public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] initramfs: Restore default "generate-initrd" logic in initramfs.bbclass
@ 2025-12-09 11:50 Zhihang Wei
  2025-12-11 10:02 ` Zhihang Wei
  0 siblings, 1 reply; 2+ messages in thread
From: Zhihang Wei @ 2025-12-09 11:50 UTC (permalink / raw)
  To: isar-users, wzh, quirin.gylstorff, jan.kiszka, cedric.hombourger,
	christoph.steiger

After 78d42de "rootfs: rework no-generate-initrd rootfs feature", the logic
for adding "generate-initrd" feature was moved from image.bbclass to
rootfs.bbclass. This feature controls whether the initrd(initramfs) is
generated and deployed under build/tmp/deploy/images/. By default, this
feature is not added.

However, initramfs.bbclass also inherits rootfs.bbclass. As a result, builds
of initramfs recipes, such as isar-initramfs.bb, no longer generate or deploy
an initrd image. The test case test_var_image_initrd has failed.

This patch adds "generate-initrd" feature back to initramfs.bbclass, and
cleans up incorrect conflict resolving in c3c4e72.

Signed-off-by: Zhihang Wei <wzh@ilbers.de>
---
 meta/classes-recipe/image.bbclass     | 3 +++
 meta/classes-recipe/initramfs.bbclass | 1 +
 meta/classes-recipe/rootfs.bbclass    | 4 ----
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass
index 24a23808..2c8beefa 100644
--- a/meta/classes-recipe/image.bbclass
+++ b/meta/classes-recipe/image.bbclass
@@ -48,6 +48,9 @@ python() {
         d.setVar('INITRD_DEPLOY_FILE', initrd_image)
 }
 
+# Generate and deploy debian default initrd if no custom initrd needs to be built
+ROOTFS_FEATURES += "${@ 'generate-initrd' if (d.getVar('INITRD_IMAGE') == '' and d.getVar('IMAGE_INITRD') == '') else ''}"
+
 # This variable is used by wic and start_vm
 KERNEL_IMAGE ?= "${IMAGE_FULLNAME}-${KERNEL_FILE}"
 
diff --git a/meta/classes-recipe/initramfs.bbclass b/meta/classes-recipe/initramfs.bbclass
index 85b07f28..7d4ae523 100644
--- a/meta/classes-recipe/initramfs.bbclass
+++ b/meta/classes-recipe/initramfs.bbclass
@@ -27,6 +27,7 @@ DEPENDS += "${INITRAMFS_INSTALL}"
 
 ROOTFSDIR = "${INITRAMFS_ROOTFS}"
 ROOTFS_FEATURES = "generate-manifest"
+ROOTFS_FEATURES += "generate-initrd"
 ROOTFS_PACKAGES = "${INITRAMFS_GENERATOR_PKG} ${INITRAMFS_PREINSTALL} ${INITRAMFS_INSTALL}"
 
 # validate whether there are incompatible packages in the installation list
diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass
index eb5645af..cbb658dd 100644
--- a/meta/classes-recipe/rootfs.bbclass
+++ b/meta/classes-recipe/rootfs.bbclass
@@ -23,8 +23,6 @@ ROOTFS_INITRAMFS_GENERATOR_CMD = "${@ d.getVar('ROOTFS_INITRAMFS_GENERATOR_CMDLI
 ROOTFS_INITRAMFS_GENERATOR_CMDLINE = "${@ initramfs_generator_cmdline(d)}"
 ROOTFS_BASE_DISTRO ?= "${BASE_DISTRO}"
 
-IMAGE_INITRD ?= ""
-
 # Features of the rootfs creation:
 # available features are:
 # 'clean-package-cache' - delete package cache from rootfs
@@ -32,8 +30,6 @@ IMAGE_INITRD ?= ""
 # '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
 # 'populate-systemd-preset' - enable systemd units according to systemd presets
-# 'generate-initrd' - generate debian default initrd
-ROOTFS_FEATURES += "${@ 'generate-initrd' if d.getVar('IMAGE_INITRD') == '' else ''}"
 
 ROOTFS_APT_ARGS="install --yes -o Debug::pkgProblemResolver=yes"
 
-- 
2.39.5

-- 
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/20251209115009.1932908-1-wzh%40ilbers.de.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] initramfs: Restore default "generate-initrd" logic in initramfs.bbclass
  2025-12-09 11:50 [PATCH] initramfs: Restore default "generate-initrd" logic in initramfs.bbclass Zhihang Wei
@ 2025-12-11 10:02 ` Zhihang Wei
  0 siblings, 0 replies; 2+ messages in thread
From: Zhihang Wei @ 2025-12-11 10:02 UTC (permalink / raw)
  To: isar-users, quirin.gylstorff, jan.kiszka, cedric.hombourger,
	christoph.steiger

Applied to next.

Zhihang

On 12/9/25 12:50, Zhihang Wei wrote:
> After 78d42de "rootfs: rework no-generate-initrd rootfs feature", the logic
> for adding "generate-initrd" feature was moved from image.bbclass to
> rootfs.bbclass. This feature controls whether the initrd(initramfs) is
> generated and deployed under build/tmp/deploy/images/. By default, this
> feature is not added.
>
> However, initramfs.bbclass also inherits rootfs.bbclass. As a result, builds
> of initramfs recipes, such as isar-initramfs.bb, no longer generate or deploy
> an initrd image. The test case test_var_image_initrd has failed.
>
> This patch adds "generate-initrd" feature back to initramfs.bbclass, and
> cleans up incorrect conflict resolving in c3c4e72.
>
> Signed-off-by: Zhihang Wei <wzh@ilbers.de>
> ---
>   meta/classes-recipe/image.bbclass     | 3 +++
>   meta/classes-recipe/initramfs.bbclass | 1 +
>   meta/classes-recipe/rootfs.bbclass    | 4 ----
>   3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass
> index 24a23808..2c8beefa 100644
> --- a/meta/classes-recipe/image.bbclass
> +++ b/meta/classes-recipe/image.bbclass
> @@ -48,6 +48,9 @@ python() {
>           d.setVar('INITRD_DEPLOY_FILE', initrd_image)
>   }
>   
> +# Generate and deploy debian default initrd if no custom initrd needs to be built
> +ROOTFS_FEATURES += "${@ 'generate-initrd' if (d.getVar('INITRD_IMAGE') == '' and d.getVar('IMAGE_INITRD') == '') else ''}"
> +
>   # This variable is used by wic and start_vm
>   KERNEL_IMAGE ?= "${IMAGE_FULLNAME}-${KERNEL_FILE}"
>   
> diff --git a/meta/classes-recipe/initramfs.bbclass b/meta/classes-recipe/initramfs.bbclass
> index 85b07f28..7d4ae523 100644
> --- a/meta/classes-recipe/initramfs.bbclass
> +++ b/meta/classes-recipe/initramfs.bbclass
> @@ -27,6 +27,7 @@ DEPENDS += "${INITRAMFS_INSTALL}"
>   
>   ROOTFSDIR = "${INITRAMFS_ROOTFS}"
>   ROOTFS_FEATURES = "generate-manifest"
> +ROOTFS_FEATURES += "generate-initrd"
>   ROOTFS_PACKAGES = "${INITRAMFS_GENERATOR_PKG} ${INITRAMFS_PREINSTALL} ${INITRAMFS_INSTALL}"
>   
>   # validate whether there are incompatible packages in the installation list
> diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass
> index eb5645af..cbb658dd 100644
> --- a/meta/classes-recipe/rootfs.bbclass
> +++ b/meta/classes-recipe/rootfs.bbclass
> @@ -23,8 +23,6 @@ ROOTFS_INITRAMFS_GENERATOR_CMD = "${@ d.getVar('ROOTFS_INITRAMFS_GENERATOR_CMDLI
>   ROOTFS_INITRAMFS_GENERATOR_CMDLINE = "${@ initramfs_generator_cmdline(d)}"
>   ROOTFS_BASE_DISTRO ?= "${BASE_DISTRO}"
>   
> -IMAGE_INITRD ?= ""
> -
>   # Features of the rootfs creation:
>   # available features are:
>   # 'clean-package-cache' - delete package cache from rootfs
> @@ -32,8 +30,6 @@ IMAGE_INITRD ?= ""
>   # '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
>   # 'populate-systemd-preset' - enable systemd units according to systemd presets
> -# 'generate-initrd' - generate debian default initrd
> -ROOTFS_FEATURES += "${@ 'generate-initrd' if d.getVar('IMAGE_INITRD') == '' else ''}"
>   
>   ROOTFS_APT_ARGS="install --yes -o Debug::pkgProblemResolver=yes"
>   

-- 
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/bef8a9db-a8ed-4f6b-9ed1-9a1c9441592d%40ilbers.de.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-11 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-09 11:50 [PATCH] initramfs: Restore default "generate-initrd" logic in initramfs.bbclass Zhihang Wei
2025-12-11 10:02 ` Zhihang Wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox