diff --git a/meta-digi-arm/conf/machine/include/ccmp1.inc b/meta-digi-arm/conf/machine/include/ccmp1.inc index 207961fb4..16e572123 100644 --- a/meta-digi-arm/conf/machine/include/ccmp1.inc +++ b/meta-digi-arm/conf/machine/include/ccmp1.inc @@ -26,9 +26,6 @@ ROOTFS_DEV_NAME_FINAL = "${@oe.utils.ifelse(d.getVar('TRUSTFENCE_ENCRYPT_ROOTFS' UBOOT_DEV_NAME ?= "/dev/mtd" -# Add dualboot support -DUALBOOT_ENABLED ?= "true" - # Extra udev rules MACHINE_EXTRA_RRECOMMENDS += "udev-extraconf" diff --git a/meta-digi-arm/conf/machine/include/digi-defaults.inc b/meta-digi-arm/conf/machine/include/digi-defaults.inc index e0bcd1352..8f2f9bb2c 100644 --- a/meta-digi-arm/conf/machine/include/digi-defaults.inc +++ b/meta-digi-arm/conf/machine/include/digi-defaults.inc @@ -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 ${@oe.utils.vartrue('DUALBOOT_ENABLED', 'altboot.scr:altboot.scr', '', d)}" +BOOT_SCRIPTS += "boot.scr:boot.scr altboot.scr:altboot.scr" # This can be used to enable U-Boot update through swupdate SWUPDATE_UBOOTIMG ?= "false" diff --git a/meta-digi-arm/recipes-bsp/u-boot/digi-u-boot.inc b/meta-digi-arm/recipes-bsp/u-boot/digi-u-boot.inc index 748728579..68936b6a8 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/digi-u-boot.inc +++ b/meta-digi-arm/recipes-bsp/u-boot/digi-u-boot.inc @@ -21,11 +21,11 @@ UBOOT_GIT_URI ?= "${@oe.utils.conditional('DIGI_INTERNAL_GIT', '1' , '${UBOOT_UR SRC_URI = " \ ${UBOOT_GIT_URI};branch=${SRCBRANCH} \ + file://altboot.txt \ file://boot.txt \ file://install_linux_fw_sd.txt \ file://install_linux_fw_usb.txt \ ${@oe.utils.conditional('UBOOT_HAS_FASTBOOT', 'true', 'file://install_linux_fw_uuu.sh', '', d)} \ - ${@oe.utils.vartrue('DUALBOOT_ENABLED', 'file://altboot.txt', '', d)} \ " BOOTLOADER_IMAGE_RECIPE ?= "u-boot" @@ -186,9 +186,7 @@ do_deploy:append() { mkimage -T script -n bootscript -C none -d ${TMP_BOOTSCR} ${DEPLOYDIR}/boot.scr # Alternate boot script for dualboot - if [ "${DUALBOOT_ENABLED}" = "true" ]; then - mkimage -T script -n "Alternate bootscript" -C none -d ${WORKDIR}/altboot.txt ${DEPLOYDIR}/altboot.scr - fi + mkimage -T script -n "Alternate bootscript" -C none -d ${WORKDIR}/altboot.txt ${DEPLOYDIR}/altboot.scr # Sign the scripts if [ "${TRUSTFENCE_SIGN}" = "1" ]; then @@ -201,12 +199,10 @@ do_deploy:append() { trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/boot.scr" "${TMP_SIGNED_BOOTSCR}" mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/boot.scr" - if [ "${DUALBOOT_ENABLED}" = "true" ]; then - # Sign boot script - TMP_SIGNED_BOOTSCR="$(mktemp ${WORKDIR}/altboot-signed.XXXXXX)" - trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/altboot.scr" "${TMP_SIGNED_BOOTSCR}" - mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/altboot.scr" - fi + # Sign altboot script + TMP_SIGNED_BOOTSCR="$(mktemp ${WORKDIR}/altboot-signed.XXXXXX)" + trustfence-sign-artifact.sh -p "${DIGI_FAMILY}" -b "${DEPLOYDIR}/altboot.scr" "${TMP_SIGNED_BOOTSCR}" + mv "${TMP_SIGNED_BOOTSCR}" "${DEPLOYDIR}/altboot.scr" fi rm -f ${TMP_BOOTSCR} } diff --git a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb index 02d1bebc3..f556efb2e 100644 --- a/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb +++ b/meta-digi-dey/recipes-core/packagegroups/packagegroup-dey-core.bb @@ -36,7 +36,7 @@ RDEPENDS:${PN} = "\ connectcore-demo-example \ cloudconnector \ cryptodev-module \ - ${@oe.utils.vartrue('DUALBOOT_ENABLED', 'dualboot', 'recovery-utils', d)} \ + dualboot \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'firmwared', '',d)} \ ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', bb.utils.contains("MACHINE_FEATURES", "rtc", "${VIRTUAL-RUNTIME_base-utils-hwclock}", "", d), d)} \ @@ -52,6 +52,7 @@ RDEPENDS:${PN} = "\ networkmanager-nmcli \ os-release \ ${@bb.utils.contains('MACHINE_FEATURES', 'pci', 'pciutils', '',d)} \ + recovery-utils \ sysinfo \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'system-monitor', '',d)} \ usbutils \ diff --git a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb index 83f23bc4c..8c4cb15a1 100644 --- a/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb +++ b/meta-digi-dey/recipes-digi/cloudconnector/cloudconnector_git.bb @@ -34,10 +34,6 @@ do_install() { install -m 0644 ${WORKDIR}/cloud-connector.service ${D}${systemd_unitdir}/system/ fi - if ${@oe.utils.vartrue('DUALBOOT_ENABLED', 'true', 'false', d)}; then - sed -i "/firmware_download_path = \/mnt\/update/c\firmware_download_path = \/home\/root" ${D}${sysconfdir}/cc.conf - fi - install -d ${D}${sysconfdir}/init.d/ install -m 755 ${WORKDIR}/cloud-connector-init ${D}${sysconfdir}/cloud-connector ln -sf /etc/cloud-connector ${D}${sysconfdir}/init.d/cloud-connector @@ -51,6 +47,13 @@ do_install:append:ccmp1() { sed -i "/client_cert_path = \"\/etc\/ssl\/certs\/drm_cert.pem\"/c\client_cert_path = \"\/mnt\/data\/drm_cert.pem\"" ${D}${sysconfdir}/cc.conf } +pkg_postinst_ontarget:${PN}() { + # If dualboot is enabled, change the CloudConnector download path on the first boot + if [ "$(fw_printenv -n dualboot 2>/dev/null)" = "yes" ]; then + sed -i "/firmware_download_path = \/mnt\/update/c\firmware_download_path = \/home\/root" /etc/cc.conf + fi +} + INITSCRIPT_NAME = "cloud-connector" SYSTEMD_SERVICE:${PN} = "cloud-connector.service" diff --git a/meta-digi-dey/recipes-digi/swu-images/files/sw-description b/meta-digi-dey/recipes-digi/swu-images/files/sw-description index d2ee699f1..ddd469d42 100644 --- a/meta-digi-dey/recipes-digi/swu-images/files/sw-description +++ b/meta-digi-dey/recipes-digi/swu-images/files/sw-description @@ -4,7 +4,57 @@ software = description = "##DESCRIPTION##"; mmc = { - platform: { + primary: { + images: ( + { + filename = "##BOOTIMG_NAME##"; + device = "##BOOT_DEV_A##"; + type = "raw"; + sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; + installed-directly = true; + }, + { + filename = "##ROOTIMG_NAME##"; + device = "##ROOTFS_DEV_A##"; + type = "raw"; + sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; + compressed = "zlib"; + installed-directly = true; + } + ); + uboot: ( + { + name = "upgrade_available"; + value = "1"; + } + ); + } + secondary: { + images: ( + { + filename = "##BOOTIMG_NAME##"; + device = "##BOOT_DEV_B##"; + type = "raw"; + sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; + installed-directly = true; + }, + { + filename = "##ROOTIMG_NAME##"; + device = "##ROOTFS_DEV_B##"; + type = "raw"; + sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; + compressed = "zlib"; + installed-directly = true; + } + ); + uboot: ( + { + name = "upgrade_available"; + value = "1"; + } + ); + } + single: { images: ( { filename = "##BOOTIMG_NAME##"; @@ -22,10 +72,61 @@ software = installed-directly = true; } ); - }; - }; + } + platform = { + ref = "#./single"; + } + } mtd = { - platform: { + primary: { + images: ( + { + filename = "##BOOTIMG_NAME##"; + volume = "##BOOT_DEV_A##"; + type = "ubivol"; + sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; + installed-directly = true; + }, + { + filename = "##ROOTIMG_NAME##"; + volume = "##ROOTFS_DEV_A##"; + type = "ubivol"; + sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; + installed-directly = true; + } + ); + uboot: ( + { + name = "upgrade_available"; + value = "1"; + } + ); + } + secondary: { + images: ( + { + filename = "##BOOTIMG_NAME##"; + volume = "##BOOT_DEV_B##"; + type = "ubivol"; + sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; + installed-directly = true; + }, + { + filename = "##ROOTIMG_NAME##"; + volume = "##ROOTFS_DEV_B##"; + type = "ubivol"; + sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; + installed-directly = true; + } + ); + uboot: ( + { + name = "upgrade_available"; + value = "1"; + } + ); + } + single: { images: ( { filename = "##BOOTIMG_NAME##"; @@ -42,6 +143,9 @@ software = installed-directly = true; } ); - }; + } + platform = { + ref = "#./single"; + } }; } diff --git a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-dualboot b/meta-digi-dey/recipes-digi/swu-images/files/sw-description-dualboot deleted file mode 100644 index 52a93b25c..000000000 --- a/meta-digi-dey/recipes-digi/swu-images/files/sw-description-dualboot +++ /dev/null @@ -1,107 +0,0 @@ -software = -{ - version = "##SW_VERSION##"; - - mmc = { - primary: { - images: ( - { - filename = "##BOOTIMG_NAME##"; - device = "##BOOT_DEV_A##"; - type = "raw"; - sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; - installed-directly = true; - }, - { - filename = "##ROOTIMG_NAME##"; - device = "##ROOTFS_DEV_A##"; - type = "raw"; - sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; - compressed = "zlib"; - installed-directly = true; - } - ); - uboot: ( - { - name = "upgrade_available"; - value = "1"; - } - ); - } - secondary: { - images: ( - { - filename = "##BOOTIMG_NAME##"; - device = "##BOOT_DEV_B##"; - type = "raw"; - sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; - installed-directly = true; - }, - { - filename = "##ROOTIMG_NAME##"; - device = "##ROOTFS_DEV_B##"; - type = "raw"; - sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; - compressed = "zlib"; - installed-directly = true; - } - ); - uboot: ( - { - name = "upgrade_available"; - value = "1"; - } - ); - } - }; - mtd = { - primary: { - images: ( - { - filename = "##BOOTIMG_NAME##"; - volume = "##BOOT_DEV_A##"; - type = "ubivol"; - sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; - installed-directly = true; - }, - { - filename = "##ROOTIMG_NAME##"; - volume = "##ROOTFS_DEV_A##"; - type = "ubivol"; - sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; - installed-directly = true; - } - ); - uboot: ( - { - name = "upgrade_available"; - value = "1"; - } - ); - } - secondary: { - images: ( - { - filename = "##BOOTIMG_NAME##"; - volume = "##BOOT_DEV_B##"; - type = "ubivol"; - sha256 = "$swupdate_get_sha256(##BOOTIMG_NAME##)"; - installed-directly = true; - }, - { - filename = "##ROOTIMG_NAME##"; - volume = "##ROOTFS_DEV_B##"; - type = "ubivol"; - sha256 = "$swupdate_get_sha256(##ROOTIMG_NAME##)"; - installed-directly = true; - } - ); - uboot: ( - { - name = "upgrade_available"; - value = "1"; - } - ); - } - }; -} diff --git a/meta-digi-dey/recipes-digi/swu-images/swu.inc b/meta-digi-dey/recipes-digi/swu-images/swu.inc index 6d9282c8b..c9aa55d89 100644 --- a/meta-digi-dey/recipes-digi/swu-images/swu.inc +++ b/meta-digi-dey/recipes-digi/swu-images/swu.inc @@ -10,7 +10,6 @@ SRC_URI = " \ file://sw-description-uboot \ file://swupdate_uboot_nand.sh \ file://swupdate_uboot_mmc.sh \ - ${@oe.utils.vartrue('DUALBOOT_ENABLED', 'file://sw-description-dualboot', '', d)} \ " inherit swupdate @@ -52,8 +51,6 @@ def get_baseimg_pn(d): file_name = d.getVar('PN', True) return file_name[:file_name.find("-swu")] -# 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)}" @@ -61,6 +58,8 @@ BOOT_DEV_NAME_B ?= "${@bb.utils.contains('STORAGE_MEDIA', 'mmc', '/dev/mmcblk0p2 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)}" +do_unpack[postfuncs] += "fill_description" + fill_description() { if [ "${SWUPDATE_UBOOTIMG}" = "true" ]; then cp ${WORKDIR}/sw-description-uboot ${WORKDIR}/sw-description @@ -79,16 +78,10 @@ fill_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" 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 -} \ No newline at end of file + # Dualboot description + sed -i -e "s,##BOOT_DEV_A##,${BOOT_DEV_NAME_A},g" "${WORKDIR}/sw-description" + sed -i -e "s,##BOOT_DEV_B##,${BOOT_DEV_NAME_B},g" "${WORKDIR}/sw-description" + sed -i -e "s,##ROOTFS_DEV_A##,${ROOTFS_DEV_NAME_A},g" "${WORKDIR}/sw-description" + sed -i -e "s,##ROOTFS_DEV_B##,${ROOTFS_DEV_NAME_B},g" "${WORKDIR}/sw-description" +}