Skip to content

Commit

Permalink
ostree: use kargs.d for kernel arguments
Browse files Browse the repository at this point in the history
Instead of setting kernel argument at deploy time use the kargs.d
mechanism. Currently, this mechanism is still a downstream change of
OSTree, but has been proposed upstream:
ostreedev/ostree#2217

Signed-off-by: Stefan Agner <[email protected]>
  • Loading branch information
Stefan Agner committed Oct 22, 2020
1 parent a491e47 commit ba62852
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions classes/image_types_ostree.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ IMAGE_CMD_ostree () {
ln -s ../init.d/tmpfiles.sh usr/etc/rcS.d/S20tmpfiles.sh
fi

# Use kargs.d for kernel arguments
mkdir -p usr/lib/ostree-boot/kargs.d
echo -n "${OSTREE_KERNEL_ARGS}" > usr/lib/ostree-boot/kargs.d/2000_torizon

# Preserve OSTREE_BRANCHNAME for future information
mkdir -p usr/share/sota/
echo -n "${OSTREE_BRANCHNAME}" > usr/share/sota/branchname
Expand Down
6 changes: 1 addition & 5 deletions classes/image_types_ota.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ IMAGE_CMD_ota () {
# Use OSTree hash to avoid any potential race conditions between
# multiple builds accessing the same ${OSTREE_REPO}.
ostree --repo=${OTA_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash}
kargs_list=""
for arg in ${OSTREE_KERNEL_ARGS}; do
kargs_list="${kargs_list} --karg-append=$arg"
done

# Create the same reference on the device we use in the archive OSTree
# repo in ${OSTREE_REPO}. This reference will show up when showing the
Expand All @@ -82,7 +78,7 @@ IMAGE_CMD_ota () {
# will allow to use:
# ostree admin upgrade
ostree --repo=${OTA_SYSROOT}/ostree/repo refs --create=${OSTREE_OSNAME}:${OSTREE_BRANCHNAME} ${ostree_target_hash}
ostree admin --sysroot=${OTA_SYSROOT} deploy ${kargs_list} --os=${OSTREE_OSNAME} ${OSTREE_OSNAME}:${OSTREE_BRANCHNAME}
ostree admin --sysroot=${OTA_SYSROOT} deploy --os=${OSTREE_OSNAME} ${OSTREE_OSNAME}:${OSTREE_BRANCHNAME}

cp -a ${IMAGE_ROOTFS}/var/sota ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true
# Create /var/sota if it doesn't exist yet
Expand Down

0 comments on commit ba62852

Please sign in to comment.