summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2020-04-26 13:42:54 +0000
committerLaurent Bonnans <laurent.bonnans@here.com>2020-06-02 10:11:57 +0200
commit1841b99deec9aee37156726c1a895776b0ccf96a (patch)
tree69b8dfcf2a214392277fc8756a96667527a6f898
parent24a560c4285d5d5cf1ce771abe79ce718855d9f3 (diff)
downloadmeta-updater-1841b99deec9aee37156726c1a895776b0ccf96a.tar.gz
image_types_ota: export OSTREE_BOOT_PARTITION when needed
The environment variable OSTREE_BOOT_PARTITION is only used when using GRUB. Move the export into the if statement. Also add a comment why manually adding /boot/loader{.0} directory is necessary. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--classes/image_types_ota.bbclass6
1 files changed, 5 insertions, 1 deletions
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass
index 857161a..e9f9467 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -45,13 +45,17 @@ do_image_ota[cleandirs] = "${OTA_SYSROOT}"
45do_image_ota[depends] = "${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER') == 'grub' else ''} \ 45do_image_ota[depends] = "${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER') == 'grub' else ''} \
46 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER') == 'u-boot' else ''}" 46 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER') == 'u-boot' else ''}"
47IMAGE_CMD_ota () { 47IMAGE_CMD_ota () {
48 export OSTREE_BOOT_PARTITION=${OSTREE_BOOT_PARTITION}
49 ostree admin --sysroot=${OTA_SYSROOT} init-fs ${OTA_SYSROOT} 48 ostree admin --sysroot=${OTA_SYSROOT} init-fs ${OTA_SYSROOT}
50 ostree admin --sysroot=${OTA_SYSROOT} os-init ${OSTREE_OSNAME} 49 ostree admin --sysroot=${OTA_SYSROOT} os-init ${OSTREE_OSNAME}
50
51 # Preparation required to steer ostree bootloader detection
51 mkdir -p ${OTA_SYSROOT}/boot/loader.0 52 mkdir -p ${OTA_SYSROOT}/boot/loader.0
52 ln -s loader.0 ${OTA_SYSROOT}/boot/loader 53 ln -s loader.0 ${OTA_SYSROOT}/boot/loader
53 54
54 if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then 55 if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then
56 # Used by ostree-grub-generator called by the ostree binary
57 export OSTREE_BOOT_PARTITION=${OSTREE_BOOT_PARTITION}
58
55 mkdir -p ${OTA_SYSROOT}/boot/grub2 59 mkdir -p ${OTA_SYSROOT}/boot/grub2
56 ln -s ../loader/grub.cfg ${OTA_SYSROOT}/boot/grub2/grub.cfg 60 ln -s ../loader/grub.cfg ${OTA_SYSROOT}/boot/grub2/grub.cfg
57 elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then 61 elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then