From 87662318845121009549b599234ed32b7af7aaf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20J=C3=B6rns?= Date: Wed, 22 Jan 2025 10:36:27 +0100 Subject: [PATCH 1/2] bundle.bbclass: run do_bundle task under pseudo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the upcoming artifacts support, we have the need to either use a real 'fakeroot' or to run in a pseudo-enabled task to support e.g. the tar conversion mode. Since OE does not provide a fakeroot recipe and running a task pseudo-enabled is a built-in bitbake feature, we simply use it. The only issue with that so far was that casync bundle conversion unconditionally called 'fakeroot' from within RAUC and that this conflicts with the pseudo-enabled task. This was resolved now in https://github.com/rauc/rauc/pull/1603 by making the 'fakeroot' call conditional (on not running under pseudo). This also allows us to drop the usage of 'pseudo' as a fakeroot replacement for casync, which simplifies the 'rauc convert' call. Signed-off-by: Enrico Jörns --- classes-recipe/bundle.bbclass | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/classes-recipe/bundle.bbclass b/classes-recipe/bundle.bbclass index c009972..1db5a27 100644 --- a/classes-recipe/bundle.bbclass +++ b/classes-recipe/bundle.bbclass @@ -406,7 +406,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 @@ -428,13 +428,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} \ From 2487a4c5104b5ff3c61e3bda7b73af67430df817 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Wed, 7 Aug 2024 14:23:06 +0200 Subject: [PATCH 2/2] bundle.bbclass: support manifest generation for artifacts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is useful only in combination with the upcoming support for artifacts, but shouldn't hurt the standard case for now. Signed-off-by: Jan Luebbe Signed-off-by: Enrico Jörns --- classes-recipe/bundle.bbclass | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/classes-recipe/bundle.bbclass b/classes-recipe/bundle.bbclass index 1db5a27..6901c82 100644 --- a/classes-recipe/bundle.bbclass +++ b/classes-recipe/bundle.bbclass @@ -40,6 +40,12 @@ # RAUC_SLOT_rootfs ?= "core-image-minimal" # RAUC_SLOT_rootfs[rename] ?= "rootfs.ext4" # +# To generate an artifact image, use / as the image name: +# 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. @@ -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 @@ -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')) manifest.write("\n") bundle_imgpath = "%s/%s" % (bundle_path, imgname)