public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'cedric.hombourger@siemens.com' via isar-users" <isar-users@googlegroups.com>
To: "quirin.gylstorff@siemens.com" <quirin.gylstorff@siemens.com>,
	"isar-users@googlegroups.com" <isar-users@googlegroups.com>,
	"Kiszka, Jan" <jan.kiszka@siemens.com>,
	"MOESSBAUER, Felix" <felix.moessbauer@siemens.com>
Subject: Re: [PATCH v5 02/12] rootfs: Allow to overwrite the initramfs generation cmds
Date: Sat, 1 Nov 2025 06:02:18 +0000	[thread overview]
Message-ID: <c5ea8e9e9f1661083730d3f4536e3a50e3bbf541.camel@siemens.com> (raw)
In-Reply-To: <59058a2c5c547fec27f0e7af7229ddd1616b7375.camel@siemens.com>

On Fri, 2025-10-31 at 16:03 +0100, Cedric Hombourger wrote:
> On Thu, 2025-10-30 at 10:44 +0100, Quirin Gylstorff wrote:
> > From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> > 
> > This is in preparation to support additional initramfs generators
> > like dracut.
> > 
> > Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> > ---
> >  meta/classes/rootfs.bbclass | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meta/classes/rootfs.bbclass
> > b/meta/classes/rootfs.bbclass
> > index 2fef3120..98da62fb 100644
> > --- a/meta/classes/rootfs.bbclass
> > +++ b/meta/classes/rootfs.bbclass
> > @@ -5,7 +5,13 @@ inherit deb-dl-dir
> >  
> >  ROOTFS_ARCH ?= "${DISTRO_ARCH}"
> >  ROOTFS_DISTRO ?= "${DISTRO}"
> > +
> > +def initramfs_generator_cmdline(d):
> > +    return "update-initramfs -u -v -k \"$kernel_version\""
> > +
> >  ROOTFS_PACKAGES ?= ""
> > +ROOTFS_INITRAMFS_GENERATOR_CMD = "${@
> > d.getVar('ROOTFS_INITRAMFS_GENERATOR_CMDLINE').split()[0]}"
> > +ROOTFS_INITRAMFS_GENERATOR_CMDLINE = "${@
> > initramfs_generator_cmdline(d)}"
> 
> Can we make it easier to switch to dracut for a regular image (vs
> initramfs-image which is covered by your series).

My bad. It's sufficient to simply use IMAGE_PREINSTALL += "dracut"
Test case modified.

>  I used your patch
> series to check what it takes to add test cases and I had to do the
> following in citest.cy:
> 
> diff --git a/testsuite/citest.py b/testsuite/citest.py
> index a1214e9c..df0f66e0 100755
> --- a/testsuite/citest.py
> +++ b/testsuite/citest.py
> @@ -278,6 +278,25 @@ class KernelTests(CIBaseTest):
>          self.perform_build_test(targets, image_install='
> '.join(modules), lines=lines)
> 
> 
> +class InitRdTests(CIBaseTest):
> +    """
> +    Tests for initrd generation
> +    :avocado: tags=initrd,full
> +    """
> +
> +    DRACUT_CONF = [
> +        "INITRAMFS_GENERATOR_PKG = 'dracut'",
> +        "ROOTFS_INITRAMFS_GENERATOR_CMDLINE:forcevariable =
> 'dracut'"

This is now changed to:

class InitRdTests(CIBaseTest):
    """
    Tests for initrd generation
    :avocado: tags=initrd,full
    """

    DRACUT_CONF = [
        “IMAGE_PREINSTALL:append = ‘ dracut'",
        “IMAGE_INSTALL:remove = ‘enable-fsck'"
    ]

    def test_dracut_in_image(self):
        """Test switch to dracut in an image recipe."""

        targets = ['mc:qemuamd64-bookworm:isar-image-ci']
        self.init()
        self.perform_build_test(targets, lines=InitRdTests.DRACUT_CONF)

(the enable-fsck package requires initramfs-tools)

> +    ]
> +
> +    def test_dracut_in_image(self):
> +        """Test switch to dracut in an image recipe."""
> +
> +        targets = ['mc:qemuamd64-bookworm:isar-image-ci']
> +        self.init()
> +        self.perform_build_test(targets,
> lines=InitRdTests.DRACUT_CONF)
> +
> +
> 
> I am going to add more tests, including builds of your custom
> recipes.
> I would be super grateful if we could simplify the above use-case to
> support switching between initramfs-tools and dracut with a single
> variable assignment
> 
> >  ROOTFS_BASE_DISTRO ?= "${BASE_DISTRO}"
> >  
> >  # Features of the rootfs creation:
> > @@ -254,7 +260,7 @@ rootfs_disable_initrd_generation() {
> >      set -e
> >  
> >      mkdir -p "${ROOTFSDIR}${ROOTFS_STUBS_DIR}"
> > -    ln -s /usr/bin/true ${ROOTFSDIR}${ROOTFS_STUBS_DIR}/update-
> > initramfs
> > +    ln -s /usr/bin/true
> > ${ROOTFSDIR}${ROOTFS_STUBS_DIR}/${ROOTFS_INITRAMFS_GENERATOR_CMD}
> >  
> >      mkdir -p '${ROOTFSDIR}/etc/apt/apt.conf.d'
> >      echo 'DPkg::Path
> > ${ROOTFS_STUBS_DIR}:/usr/sbin:/usr/bin:/sbin:/bin;' \
> > @@ -577,7 +583,7 @@ rootfs_generate_initramfs() {
> >              echo "Total number of modules: $mods_total"
> >              echo "Generating initrd for kernel version:
> > $kernel_version"
> >              sudo -E chroot "${ROOTFSDIR}" sh -c ' \
> > -                update-initramfs -u -v -k "$kernel_version"'
> > +                ${ROOTFS_INITRAMFS_GENERATOR_CMDLINE};'
> >          done
> >          if [ -n "${INITRD_DEPLOY_FILE}" ]; then
> >              if [ -f "${ROOTFSDIR}/initrd.img" ]; then
> 

-- 
Cedric Hombourger
Siemens AG
www.siemens.com

-- 
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/c5ea8e9e9f1661083730d3f4536e3a50e3bbf541.camel%40siemens.com.

  reply	other threads:[~2025-11-01  6:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30  9:44 [PATCH v5 00/12] Add support for dracut 'Quirin Gylstorff' via isar-users
2025-10-30  9:44 ` [PATCH v5 01/12] Add dracut to custom kernel builds 'Quirin Gylstorff' via isar-users
2025-10-30  9:44 ` [PATCH v5 02/12] rootfs: Allow to overwrite the initramfs generation cmds 'Quirin Gylstorff' via isar-users
2025-10-31 15:03   ` 'cedric.hombourger@siemens.com' via isar-users
2025-11-01  6:02     ` 'cedric.hombourger@siemens.com' via isar-users [this message]
2025-10-30  9:44 ` [PATCH v5 03/12] rootfs: Add isar-work directory to rootfs mounts 'Quirin Gylstorff' via isar-users
2025-10-30  9:44 ` [PATCH v5 04/12] rootfs: Copy the newly created initrd.img to the work directory 'Quirin Gylstorff' via isar-users
2025-10-30 12:04   ` 'Quirin Gylstorff' via isar-users
2025-11-01  8:26   ` 'cedric.hombourger@siemens.com' via isar-users
2025-10-30  9:44 ` [PATCH v5 05/12] rootfs: Add dracut to initramfs generator 'Quirin Gylstorff' via isar-users
2025-10-30  9:44 ` [PATCH v5 06/12] initramfs: allow to set the generator command 'Quirin Gylstorff' via isar-users
2025-10-30  9:44 ` [PATCH v5 07/12] Add class to generate custom dracut initramfs 'Quirin Gylstorff' via isar-users
2025-10-30  9:44 ` [PATCH v5 08/12] rootfs: add flag to use dracut if it is not part of the package list 'Quirin Gylstorff' via isar-users
2025-10-30  9:44 ` [PATCH v5 09/12] Add example dracut initramfs 'Quirin Gylstorff' via isar-users
2025-10-30  9:44 ` [PATCH v5 10/12] Add dracut module helper 'Quirin Gylstorff' via isar-users
2025-10-30 11:26   ` 'Jan Kiszka' via isar-users
2025-10-30 11:53     ` 'Quirin Gylstorff' via isar-users
2025-10-30  9:44 ` [PATCH v5 11/12] Use lighttpd as a example how to add a dracut module 'Quirin Gylstorff' via isar-users
2025-10-30  9:44 ` [PATCH v5 12/12] user_manual: Add dracut for initramfs generation 'Quirin Gylstorff' via isar-users

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=c5ea8e9e9f1661083730d3f4536e3a50e3bbf541.camel@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=cedric.hombourger@siemens.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --cc=quirin.gylstorff@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