From 88bbedb26e24ec313d7809592e91f351b0f346d5 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Sun, 26 Apr 2020 13:42:54 +0000 Subject: 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 --- classes/image_types_ota.bbclass | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 2cc8913..e9f9467 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -45,14 +45,17 @@ do_image_ota[cleandirs] = "${OTA_SYSROOT}" do_image_ota[depends] = "${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER') == 'grub' else ''} \ ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER') == 'u-boot' else ''}" IMAGE_CMD_ota () { - export OSTREE_BOOT_PARTITION=${OSTREE_BOOT_PARTITION} - ostree admin --sysroot=${OTA_SYSROOT} init-fs ${OTA_SYSROOT} ostree admin --sysroot=${OTA_SYSROOT} os-init ${OSTREE_OSNAME} + + # Preparation required to steer ostree bootloader detection mkdir -p ${OTA_SYSROOT}/boot/loader.0 ln -s loader.0 ${OTA_SYSROOT}/boot/loader if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then + # Used by ostree-grub-generator called by the ostree binary + export OSTREE_BOOT_PARTITION=${OSTREE_BOOT_PARTITION} + mkdir -p ${OTA_SYSROOT}/boot/grub2 ln -s ../loader/grub.cfg ${OTA_SYSROOT}/boot/grub2/grub.cfg elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then -- cgit v1.2.3-54-g00ecf