summaryrefslogtreecommitdiffstats
path: root/classes/image_types_ota.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/image_types_ota.bbclass')
-rw-r--r--classes/image_types_ota.bbclass10
1 files changed, 6 insertions, 4 deletions
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass
index 17fe4e8..9581971 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -7,8 +7,6 @@
7# boot scripts, kernel and initramfs images 7# boot scripts, kernel and initramfs images
8# 8#
9 9
10OSTREE_BOOTLOADER ??= 'u-boot'
11
12do_image_otaimg[depends] += "e2fsprogs-native:do_populate_sysroot \ 10do_image_otaimg[depends] += "e2fsprogs-native:do_populate_sysroot \
13 ${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER', True) == 'grub' else ''} \ 11 ${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER', True) == 'grub' else ''} \
14 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot' else ''}" 12 ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot' else ''}"
@@ -78,7 +76,7 @@ IMAGE_CMD_otaimg () {
78 76
79 if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then 77 if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then
80 mkdir -p ${PHYS_SYSROOT}/boot/grub2 78 mkdir -p ${PHYS_SYSROOT}/boot/grub2
81 touch ${PHYS_SYSROOT}/boot/grub2/grub.cfg 79 ln -s ../loader/grub.cfg ${PHYS_SYSROOT}/boot/grub2/grub.cfg
82 elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then 80 elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then
83 touch ${PHYS_SYSROOT}/boot/loader/uEnv.txt 81 touch ${PHYS_SYSROOT}/boot/loader/uEnv.txt
84 else 82 else
@@ -109,7 +107,11 @@ IMAGE_CMD_otaimg () {
109 # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local) 107 # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local)
110 install -d ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local 108 install -d ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local
111 # Set package version for the first deployment 109 # Set package version for the first deployment
112 echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${ostree_target_hash}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/installed_versions 110 target_version=${ostree_target_hash}
111 if [ -n "${GARAGE_TARGET_VERSION}" ]; then
112 target_version=${GARAGE_TARGET_VERSION}
113 fi
114 echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${target_version}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/installed_versions
113 115
114 rm -rf ${HOME_TMP} 116 rm -rf ${HOME_TMP}
115 117