Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundle.bbclass: support manifest generation for artifacts #337

Merged
merged 2 commits into from
Jan 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions classes-recipe/bundle.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
# RAUC_SLOT_rootfs ?= "core-image-minimal"
# RAUC_SLOT_rootfs[rename] ?= "rootfs.ext4"
#
# To generate an artifact image, use <repo>/<artifact> as the image name:
ejoerns marked this conversation as resolved.
Show resolved Hide resolved
# RAUC_BUNDLE_SLOTS += "containers/test"
# RAUC_SLOT_containers/test ?= "container-test-image"
# RAUC_SLOT_containers/test[fstype] = "tar.gz"
# RAUC_SLOT_containers/test[convert] = "tar-extract;composefs"
#
# To prepend an offset to a bootloader image, set the following parameter in bytes.
# Optionally you can use units allowed by 'dd' e.g. 'K','kB','MB'.
# If the offset is negative, bytes will not be added, but removed.
Expand Down Expand Up @@ -135,7 +141,7 @@ RAUC_CASYNC_BUNDLE ??= "0"
RAUC_BUNDLE_FORMAT ??= ""
RAUC_BUNDLE_FORMAT[doc] = "Specifies the bundle format to be used (plain/verity)."

RAUC_VARFLAGS_SLOTS = "name type fstype file hooks adaptive rename offset depends"
RAUC_VARFLAGS_SLOTS = "name type fstype file hooks adaptive rename offset depends convert"
RAUC_VARFLAGS_HOOKS = "file hooks"

# Create dependency list from images
Expand Down Expand Up @@ -292,6 +298,8 @@ def write_manifest(d):
manifest.write("hooks=%s\n" % slotflags.get('hooks'))
if 'adaptive' in slotflags:
manifest.write("adaptive=%s\n" % slotflags.get('adaptive'))
if 'convert' in slotflags:
manifest.write("convert=%s\n" % slotflags.get('convert'))
jluebbe marked this conversation as resolved.
Show resolved Hide resolved
manifest.write("\n")

bundle_imgpath = "%s/%s" % (bundle_path, imgname)
Expand Down Expand Up @@ -406,7 +414,7 @@ CASYNC_BUNDLE_LINK_NAME ??= "${CASYNC_BUNDLE_BASENAME}-${MACHINE}"
CASYNC_BUNDLE_EXTENSION ??= "${BUNDLE_EXTENSION}"
CASYNC_BUNDLE_EXTENSION[doc] = "Specifies desired custom filename extension of generated RAUC casync bundle."

do_bundle() {
fakeroot do_bundle() {
if [ -z "${RAUC_KEY_FILE}" ]; then
bbfatal "'RAUC_KEY_FILE' not set. Please set to a valid key file location."
fi
Expand All @@ -428,13 +436,7 @@ do_bundle() {
bbfatal "'RAUC_KEYRING_FILE' not set. Please set a valid keyring file location."
fi

# There is no package providing a binary named "fakeroot" but instead a
# replacement named "pseudo". But casync requires fakeroot to be
# installed, thus make a symlink.
if ! [ -x "$(command -v fakeroot)" ]; then
ln -sf ${STAGING_BINDIR_NATIVE}/pseudo ${STAGING_BINDIR_NATIVE}/fakeroot
fi
PSEUDO_PREFIX=${STAGING_DIR_NATIVE}/${prefix_native} PSEUDO_DISABLED=0 ${STAGING_BINDIR_NATIVE}/rauc convert \
${STAGING_BINDIR_NATIVE}/rauc convert \
--debug \
--trust-environment \
--cert=${RAUC_CERT_FILE} \
Expand Down