dualboot: move the things to the corresponding class
we can get rid of dualboot.bbclass moving things to different layers. Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
This commit is contained in:
parent
272edd8af7
commit
b52339d591
|
|
@ -84,7 +84,7 @@ DEY_SELINUX_POLICY ?= "1"
|
|||
|
||||
# U-Boot scripts to include in 'linux' partition
|
||||
# (use the '+=' operator, since other layers may append scripts to this list)
|
||||
BOOT_SCRIPTS += "boot.scr:boot.scr"
|
||||
BOOT_SCRIPTS += "boot.scr:boot.scr ${@oe.utils.vartrue('DUALBOOT_ENABLED', 'altboot.scr:altboot.scr', '', d)}"
|
||||
|
||||
# This can be used to enable U-Boot update through swupdate
|
||||
SWUPDATE_UBOOTIMG ?= "false"
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
# Adds DualBoot configuration
|
||||
#
|
||||
# To use it add the following line to conf/local.conf:
|
||||
#
|
||||
# INHERIT += "dualboot"
|
||||
#
|
||||
|
||||
DUALBOOT_ENABLED ?= "true"
|
||||
|
||||
# U-Boot altboot script
|
||||
BOOT_SCRIPTS += "altboot.scr:altboot.scr"
|
||||
|
||||
# Dual boot partition names for eMMC or MTD
|
||||
BOOT_DEV_NAME_A ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p1', 'linux_a', d)}"
|
||||
BOOT_DEV_NAME_B ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p2', 'linux_b', d)}"
|
||||
ROOTFS_DEV_NAME_A ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p3', 'rootfs_a', d)}"
|
||||
ROOTFS_DEV_NAME_B ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p4', 'rootfs_b', d)}"
|
||||
|
||||
fill_description_dualboot () {
|
||||
sed -i -e "s,##BOOTIMG_NAME##,${IMG_NAME}-${MACHINE}${BOOTFS_EXT},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##BOOT_DEV_A##,${BOOT_DEV_NAME_A},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##BOOT_DEV_B##,${BOOT_DEV_NAME_B},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##ROOTIMG_NAME##,${IMG_NAME}-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##ROOTFS_DEV_A##,${ROOTFS_DEV_NAME_A},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##ROOTFS_DEV_B##,${ROOTFS_DEV_NAME_B},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description-dualboot"
|
||||
# Overwrite the sw-description with the dualboot version
|
||||
mv ${WORKDIR}/sw-description-dualboot ${WORKDIR}/sw-description
|
||||
}
|
||||
|
|
@ -55,6 +55,12 @@ def get_baseimg_pn(d):
|
|||
# Call regular substitution or dualboot substitution
|
||||
do_unpack[postfuncs] += "${@oe.utils.vartrue('DUALBOOT_ENABLED', 'fill_description_dualboot', 'fill_description', d)}"
|
||||
|
||||
# Dual boot partition names for eMMC or MTD
|
||||
BOOT_DEV_NAME_A ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p1', 'linux_a', d)}"
|
||||
BOOT_DEV_NAME_B ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p2', 'linux_b', d)}"
|
||||
ROOTFS_DEV_NAME_A ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p3', 'rootfs_a', d)}"
|
||||
ROOTFS_DEV_NAME_B ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p4', 'rootfs_b', d)}"
|
||||
|
||||
fill_description() {
|
||||
if [ "${SWUPDATE_UBOOTIMG}" = "true" ]; then
|
||||
cp ${WORKDIR}/sw-description-uboot ${WORKDIR}/sw-description
|
||||
|
|
@ -74,3 +80,15 @@ fill_description() {
|
|||
sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description"
|
||||
sed -i -e "s,##DESCRIPTION##,${DESCRIPTION},g" "${WORKDIR}/sw-description"
|
||||
}
|
||||
|
||||
fill_description_dualboot () {
|
||||
sed -i -e "s,##BOOTIMG_NAME##,${IMG_NAME}-${MACHINE}${BOOTFS_EXT},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##BOOT_DEV_A##,${BOOT_DEV_NAME_A},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##BOOT_DEV_B##,${BOOT_DEV_NAME_B},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##ROOTIMG_NAME##,${IMG_NAME}-${MACHINE}${ROOTFS_EXT},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##ROOTFS_DEV_A##,${ROOTFS_DEV_NAME_A},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##ROOTFS_DEV_B##,${ROOTFS_DEV_NAME_B},g" "${WORKDIR}/sw-description-dualboot"
|
||||
sed -i -e "s,##SW_VERSION##,${SOFTWARE_VERSION},g" "${WORKDIR}/sw-description-dualboot"
|
||||
# Overwrite the sw-description with the dualboot version
|
||||
mv ${WORKDIR}/sw-description-dualboot ${WORKDIR}/sw-description
|
||||
}
|
||||
Loading…
Reference in New Issue