From dacfe128b68b245fe890fd1b5feec5a9096d1a7a Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Thu, 22 Dec 2016 16:06:45 +0100 Subject: [PATCH] meta-digi-dey: swupdate: add recipes for update packages These recipes allow to generate the .swu update packages to be used with SWUpdate. The packages can be generated using: bitbake dey-image-qt-swu bitbake core-image-base-swu https://jira.digi.com/browse/DEL-3272 Signed-off-by: Diaz de Grenu, Jose --- .../swu-images/core-image-base-swu.bb | 33 +++++++++++++++++++ .../swu-images/dey-image-qt-swu.bb | 33 +++++++++++++++++++ .../swu-images/files/ccimx6/sw-description | 17 ++++++++++ .../swu-images/files/ccimx6ul/sw-description | 17 ++++++++++ 4 files changed, 100 insertions(+) create mode 100644 meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb create mode 100644 meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb create mode 100644 meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description create mode 100644 meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description diff --git a/meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb b/meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb new file mode 100644 index 000000000..fbfb9f967 --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/core-image-base-swu.bb @@ -0,0 +1,33 @@ +# Copyright (C) 2016 Digi International. +SUMMARY = "Generate update package for SWUpdate" +SECTION = "base" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +SRC_URI = "file://sw-description" + +inherit swupdate + +IMAGE_DEPENDS = "core-image-base" + +SWUPDATE_IMAGES = "core-image-base" + +SOFTWARE_VERSION ?= "0.0.1" + +BOOTFS_EXT ?= ".boot.vfat" +BOOTFS_EXT_ccimx6ul ?= ".boot.ubifs" +ROOTFS_EXT ?= ".ext4" +ROOTFS_EXT_ccimx6ul ?= ".ubifs" + +python () { + img_fstypes = d.getVar('BOOTFS_EXT', True) + " " + d.getVar('ROOTFS_EXT', True) + d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", "core-image-base", img_fstypes) +} + +do_unpack[postfuncs] += "fill_description" + +fill_description() { + sed -i -e "s,##BOOTIMG_NAME##,core-image-base-${MACHINE}${BOOTFS_EXT},g" "${WORKDIR}/sw-description" + sed -i -e "s,##ROOTIMG_NAME##,core-image-base-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description" + sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description" +} diff --git a/meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb b/meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb new file mode 100644 index 000000000..7932c1949 --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/dey-image-qt-swu.bb @@ -0,0 +1,33 @@ +# Copyright (C) 2016 Digi International. +SUMMARY = "Generate update package for SWUpdate" +SECTION = "base" +LICENSE = "GPL-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" + +SRC_URI = "file://sw-description" + +inherit swupdate + +IMAGE_DEPENDS = "dey-image-qt" + +SWUPDATE_IMAGES = "dey-image-qt-${GRAPHICAL_BACKEND}" + +SOFTWARE_VERSION ?= "0.0.1" + +BOOTFS_EXT ?= ".boot.vfat" +BOOTFS_EXT_ccimx6ul ?= ".boot.ubifs" +ROOTFS_EXT ?= ".ext4" +ROOTFS_EXT_ccimx6ul ?= ".ubifs" + +python () { + img_fstypes = d.getVar('BOOTFS_EXT', True) + " " + d.getVar('ROOTFS_EXT', True) + d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", "dey-image-qt-" + d.getVar('GRAPHICAL_BACKEND', True), img_fstypes) +} + +do_unpack[postfuncs] += "fill_description" + +fill_description() { + sed -i -e "s,##BOOTIMG_NAME##,dey-image-qt-${GRAPHICAL_BACKEND}-${MACHINE}${BOOTFS_EXT},g" "${WORKDIR}/sw-description" + sed -i -e "s,##ROOTIMG_NAME##,dey-image-qt-${GRAPHICAL_BACKEND}-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description" + sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description" +} diff --git a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description new file mode 100644 index 000000000..7f23803ef --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description @@ -0,0 +1,17 @@ +software = +{ + version = "##SW_VERSION##"; + + images: ( + { + filename = "##BOOTIMG_NAME##"; + device = "/dev/mmcblk0p1"; + types = "raw"; + }, + { + filename = "##ROOTIMG_NAME##"; + device = "/dev/mmcblk0p3"; + types = "raw"; + } + ); +} diff --git a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description new file mode 100644 index 000000000..46002c6d0 --- /dev/null +++ b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description @@ -0,0 +1,17 @@ +software = +{ + version = "##SW_VERSION##"; + + images: ( + { + filename = "##BOOTIMG_NAME##"; + volume = "linux"; + type = "ubivol" + }, + { + filename = "##ROOTIMG_NAME##"; + volume = "rootfs"; + type = "ubivol" + } + ); +}