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.bbclass12
1 files changed, 11 insertions, 1 deletions
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass
index 56c7794..a8a19b5 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -66,13 +66,23 @@ IMAGE_CMD_ota () {
66 66
67 ostree_target_hash=$(cat ${WORKDIR}/ostree_manifest) 67 ostree_target_hash=$(cat ${WORKDIR}/ostree_manifest)
68 68
69 # Use OSTree hash to avoid any potential race conditions between
70 # multiple builds accessing the same ${OSTREE_REPO}.
69 ostree --repo=${OTA_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash} 71 ostree --repo=${OTA_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash}
70 kargs_list="" 72 kargs_list=""
71 for arg in ${OSTREE_KERNEL_ARGS}; do 73 for arg in ${OSTREE_KERNEL_ARGS}; do
72 kargs_list="${kargs_list} --karg-append=$arg" 74 kargs_list="${kargs_list} --karg-append=$arg"
73 done 75 done
74 76
75 ostree admin --sysroot=${OTA_SYSROOT} deploy ${kargs_list} --os=${OSTREE_OSNAME} ${ostree_target_hash} 77 # Create the same reference on the device we use in the archive OSTree
78 # repo in ${OSTREE_REPO}. This reference will show up when showing the
79 # deployment on the device:
80 # ostree admin status
81 # If a remote with the name ${OSTREE_OSNAME} is configured, this also
82 # will allow to use:
83 # ostree admin upgrade
84 ostree --repo=${OTA_SYSROOT}/ostree/repo refs --create=${OSTREE_OSNAME}:${OSTREE_BRANCHNAME} ${ostree_target_hash}
85 ostree admin --sysroot=${OTA_SYSROOT} deploy ${kargs_list} --os=${OSTREE_OSNAME} ${OSTREE_OSNAME}:${OSTREE_BRANCHNAME}
76 86
77 cp -a ${IMAGE_ROOTFS}/var/sota ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true 87 cp -a ${IMAGE_ROOTFS}/var/sota ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true
78 # Create /var/sota if it doesn't exist yet 88 # Create /var/sota if it doesn't exist yet