From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: Christoph Steiger <christoph.steiger@siemens.com>,
isar-users@googlegroups.com
Cc: felix.moessbauer@siemens.com
Subject: Re: [PATCH 1/1] rootfs: rework no-generate-initrd rootfs feature
Date: Wed, 20 Aug 2025 18:30:00 +0200 [thread overview]
Message-ID: <64f20675-4fee-4a0f-bffa-729f11845bc4@siemens.com> (raw)
In-Reply-To: <2837432a-831b-495e-ada6-81cc5e4144d4@siemens.com>
On 20.08.25 18:25, Jan Kiszka wrote:
> On 20.08.25 16:10, Christoph Steiger wrote:
>> Instead of using a negative feature replace it with a positive one:
>> generate-initrd. It can be confusing for the user why a initrd is
>> generated even though no additional rootfs features are enabled.
>>
>> To keep default behavior the same add generate-initrd to the default
>> rootfs features, unless INITRD_IMAGE is provided.
>>
>> Signed-off-by: Christoph Steiger <christoph.steiger@siemens.com>
>> ---
>> RECIPE-API-CHANGELOG.md | 14 ++++++++++++++
>> meta/classes/image.bbclass | 2 --
>> meta/classes/rootfs.bbclass | 8 ++++----
>> .../sbuild-chroot/sbuild-chroot.inc | 2 +-
>> 4 files changed, 19 insertions(+), 7 deletions(-)
>>
>> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
>> index 8468717d..ef18a0ac 100644
>> --- a/RECIPE-API-CHANGELOG.md
>> +++ b/RECIPE-API-CHANGELOG.md
>> @@ -727,3 +727,17 @@ Changes in next
>>
>> This was never documented and never had practical relevance. `oci-archive` is
>> the useful OCI image format that can be imported, e.g., by podman.
>> +
>> +### Rework `no-generate-initrd` rootfs feature
>> +
>> +This negative feature is being replaced with a positive one:
>> +`generate-initrd`. The default behavior remains unchanged, as `generate-initrd`
>> +is now a default rootfs feature. Disabling initrd creation can be done in the
>> +following way:
>> +```
>> +ROOTFS_FEATURE:remove = "generate-initrd"
>> +```
>> +instead of
>> +```
>> +ROOTFS_FEATURE += "no-generate-initrd"
>> +```
>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>> index bd1b8552..f4b07816 100644
>> --- a/meta/classes/image.bbclass
>> +++ b/meta/classes/image.bbclass
>> @@ -67,8 +67,6 @@ inherit essential
>>
>> ROOTFSDIR = "${IMAGE_ROOTFS}"
>> ROOTFS_FEATURES += "clean-package-cache clean-pycache generate-manifest export-dpkg-status clean-log-files clean-debconf-cache"
>> -# when using a custom initrd, do not generate one as part of the image rootfs
>> -ROOTFS_FEATURES += "${@ '' if d.getVar('INITRD_IMAGE') == '' else 'no-generate-initrd'}"
>> ROOTFS_PACKAGES += "${IMAGE_PREINSTALL} ${@isar_multiarch_packages('IMAGE_INSTALL', d)}"
>> ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
>> ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}"
>> diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
>> index 7b7859b9..f5513277 100644
>> --- a/meta/classes/rootfs.bbclass
>> +++ b/meta/classes/rootfs.bbclass
>> @@ -14,8 +14,8 @@ ROOTFS_BASE_DISTRO ?= "${BASE_DISTRO}"
>> # 'generate-manifest' - generate a package manifest of the rootfs into ${ROOTFS_MANIFEST_DEPLOY_DIR}
>> # 'export-dpkg-status' - exports /var/lib/dpkg/status file to ${ROOTFS_DPKGSTATUS_DEPLOY_DIR}
>> # 'clean-log-files' - delete log files that are not owned by packages
>> -# 'no-generate-initrd' - do not generate debian default initrd
>> -ROOTFS_FEATURES ?= ""
>> +# 'generate-initrd' - generate debian default initrd
>> +ROOTFS_FEATURES ?= "${@ 'generate-initrd' if d.getVar('INITRD_IMAGE') == '' else ''}"
>
> INITRD_IMAGE is initialized to an empty string in image.bbclass.
> However, if rootfs.bbclass should be used in some recipe without
> inhering image as well, getVar will deliver None, and comparing that to
> a string will cause an ugly error. Probably better to do (d.getVar() or '').
>
...or just move the initialization of INITRD_IMAGE over - I just
realized that image inherits rootfs, so that will not break something else.
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/64f20675-4fee-4a0f-bffa-729f11845bc4%40siemens.com.
prev parent reply other threads:[~2025-08-20 16:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 14:10 'Christoph Steiger' via isar-users
2025-08-20 16:25 ` 'Jan Kiszka' via isar-users
2025-08-20 16:30 ` 'Jan Kiszka' via isar-users [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=64f20675-4fee-4a0f-bffa-729f11845bc4@siemens.com \
--to=isar-users@googlegroups.com \
--cc=christoph.steiger@siemens.com \
--cc=felix.moessbauer@siemens.com \
--cc=jan.kiszka@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox