From 976d79db9c03a6d3b6c474ea8967525ea29edfaf Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Thu, 23 Feb 2017 15:14:32 +0100 Subject: [PATCH] swupdate: define variables for flash paths and volume names Software update recipes ('core-image-base-swu' and 'dey-image-qt-swu') are able to set default or customized values for: * In the CC6, the proper path for: * linux partition (default to '/dev/mmcblk0p1') * rootfs partition (default to '/dev/mmcblk0p3' if no encrypted, always '/dev/mapper/cryptroot' otherwise) * In the CC6UL, the proper volume name for * linux partition (default to 'linux') * rootfs partition (default to 'rootfs') https://jira.digi.com/browse/DEL-3666 https://jira.digi.com/browse/DEL-3686 Signed-off-by: Tatiana Leon --- .../recipes-digi/swu-images/core-image-base-swu.bb | 12 +++++++++++- .../recipes-digi/swu-images/dey-image-qt-swu.bb | 12 +++++++++++- .../swu-images/files/ccimx6/sw-description | 4 ++-- .../swu-images/files/ccimx6ul/sw-description | 4 ++-- 4 files changed, 26 insertions(+), 6 deletions(-) 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 index fbfb9f967..e877639bf 100644 --- 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 @@ -1,4 +1,4 @@ -# Copyright (C) 2016 Digi International. +# Copyright (C) 2016, 2017 Digi International Inc. SUMMARY = "Generate update package for SWUpdate" SECTION = "base" LICENSE = "GPL-2.0" @@ -19,6 +19,14 @@ BOOTFS_EXT_ccimx6ul ?= ".boot.ubifs" ROOTFS_EXT ?= ".ext4" ROOTFS_EXT_ccimx6ul ?= ".ubifs" +BOOT_DEV_NAME ?= "/dev/mmcblk0p1" +BOOT_DEV_NAME_ccimx6ul ?= "linux" +ROOTFS_DEV_NAME ?= "/dev/mmcblk0p3" +ROOTFS_DEV_NAME_ccimx6ul ?= "rootfs" +ROOTFS_ENC_DEV = "/dev/mapper/cryptroot" +ROOTFS_ENC_DEV_ccimx6ul = "${ROOTFS_DEV_NAME}" +ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" + python () { img_fstypes = d.getVar('BOOTFS_EXT', True) + " " + d.getVar('ROOTFS_EXT', True) d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", "core-image-base", img_fstypes) @@ -28,6 +36,8 @@ 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,##BOOT_DEV##,${BOOT_DEV_NAME},g" "${WORKDIR}/sw-description" sed -i -e "s,##ROOTIMG_NAME##,core-image-base-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description" + sed -i -e "s,##ROOTFS_DEV##,${ROOTFS_DEV_NAME_FINAL},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 index 7932c1949..6bf4a1c11 100644 --- 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 @@ -1,4 +1,4 @@ -# Copyright (C) 2016 Digi International. +# Copyright (C) 2016, 2017 Digi International Inc. SUMMARY = "Generate update package for SWUpdate" SECTION = "base" LICENSE = "GPL-2.0" @@ -19,6 +19,14 @@ BOOTFS_EXT_ccimx6ul ?= ".boot.ubifs" ROOTFS_EXT ?= ".ext4" ROOTFS_EXT_ccimx6ul ?= ".ubifs" +BOOT_DEV_NAME ?= "/dev/mmcblk0p1" +BOOT_DEV_NAME_ccimx6ul ?= "linux" +ROOTFS_DEV_NAME ?= "/dev/mmcblk0p3" +ROOTFS_DEV_NAME_ccimx6ul ?= "rootfs" +ROOTFS_ENC_DEV = "/dev/mapper/cryptroot" +ROOTFS_ENC_DEV_ccimx6ul = "${ROOTFS_DEV_NAME}" +ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_INITRAMFS_IMAGE', True), '${ROOTFS_ENC_DEV}', '${ROOTFS_DEV_NAME}')}" + 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) @@ -28,6 +36,8 @@ 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,##BOOT_DEV##,${BOOT_DEV_NAME},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,##ROOTFS_DEV##,${ROOTFS_DEV_NAME_FINAL},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 index 5bc0ea016..4f4884b62 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description +++ b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6/sw-description @@ -5,13 +5,13 @@ software = images: ( { filename = "##BOOTIMG_NAME##"; - device = "/dev/mmcblk0p1"; + device = "##BOOT_DEV##"; type = "raw"; sha256 = "@##BOOTIMG_NAME##"; }, { filename = "##ROOTIMG_NAME##"; - device = "/dev/mmcblk0p3"; + device = "##ROOTFS_DEV##"; type = "raw"; sha256 = "@##ROOTIMG_NAME##"; } 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 index fc1efe15c..c0754e389 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description +++ b/meta-digi-dey/recipes-digi/swu-images/files/ccimx6ul/sw-description @@ -5,13 +5,13 @@ software = images: ( { filename = "##BOOTIMG_NAME##"; - volume = "linux"; + volume = "##BOOT_DEV##"; type = "ubivol" sha256 = "@##BOOTIMG_NAME##"; }, { filename = "##ROOTIMG_NAME##"; - volume = "rootfs"; + volume = "##ROOTFS_DEV##"; type = "ubivol" sha256 = "@##ROOTIMG_NAME##"; }