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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 10 additions & 2 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 @@ -134,7 +140,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 @@ -291,6 +297,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'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this require to run do_bundle as fakeroot task, too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, but that needs some more testing. This can't break existing use-cases though.

manifest.write("\n")

bundle_imgpath = "%s/%s" % (bundle_path, imgname)
Expand Down Expand Up @@ -405,7 +413,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 Down