public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: Quirin Gylstorff <Quirin.Gylstorff@siemens.com>,
	isar-users@googlegroups.com, cedric.hombourger@siemens.com,
	felix.moessbauer@siemens.com
Subject: Re: [PATCH v4 02/10] rootfs: Allow to overwrite the initramfs generation cmds
Date: Wed, 22 Oct 2025 17:44:53 +0200	[thread overview]
Message-ID: <7e1dcb33-0ca7-448a-930f-3cf3604cc467@siemens.com> (raw)
In-Reply-To: <20251022150737.3639891-3-Quirin.Gylstorff@siemens.com>

On 22.10.25 17:06, 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 | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
> index 4d73bfec..b7310e0c 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)}"
>  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,12 +583,13 @@ 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
>                  # debian (mkinitramfs)
> -                cp ${ROOTFSDIR}/initrd.img ${DEPLOYDIR}/${INITRD_DEPLOY_FILE}
> +                sudo cp ${ROOTFSDIR}/initrd.img ${DEPLOYDIR}/${INITRD_DEPLOY_FILE}
> +                sudo chown $(id -u):$(id -g) ${DEPLOYDIR}/${INITRD_DEPLOY_FILE}

Do we need more sudo? bwrap?

And why do we need this here now?

Jan

>              else
>                  # ubuntu (dracut)
>                  cp ${ROOTFSDIR}/boot/initrd.img ${DEPLOYDIR}/${INITRD_DEPLOY_FILE}

-- 
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/7e1dcb33-0ca7-448a-930f-3cf3604cc467%40siemens.com.

  reply	other threads:[~2025-10-22 15:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 15:06 [PATCH v4 00/10] Add support for dracut 'Quirin Gylstorff' via isar-users
2025-10-22 15:06 ` [PATCH v4 01/10] add dracut to custom kernel builds 'Quirin Gylstorff' via isar-users
2025-10-22 15:06 ` [PATCH v4 02/10] rootfs: Allow to overwrite the initramfs generation cmds 'Quirin Gylstorff' via isar-users
2025-10-22 15:44   ` 'Jan Kiszka' via isar-users [this message]
2025-10-22 15:53     ` 'cedric.hombourger@siemens.com' via isar-users
2025-10-22 15:56       ` 'Jan Kiszka' via isar-users
2025-10-23  8:00         ` 'Quirin Gylstorff' via isar-users
2025-10-22 15:06 ` [PATCH v4 03/10] rootfs Add dracut to initramfs generator 'Quirin Gylstorff' via isar-users
2025-10-22 15:06 ` [PATCH v4 04/10] initramfs: allow to set the generator command 'Quirin Gylstorff' via isar-users
2025-10-22 15:06 ` [PATCH v4 05/10] Add class to generate custom dracut initramfs 'Quirin Gylstorff' via isar-users
2025-10-22 15:06 ` [PATCH v4 06/10] rootfs: add flag to use dracut if it is not part of the package list 'Quirin Gylstorff' via isar-users
2025-10-22 15:06 ` [PATCH v4 07/10] Add example dracut initramfs 'Quirin Gylstorff' via isar-users
2025-10-22 15:06 ` [PATCH v4 08/10] Add dracut module helper 'Quirin Gylstorff' via isar-users
2025-10-22 15:06 ` [PATCH v4 09/10] Use lighttpd as a example how to add a dracut module 'Quirin Gylstorff' via isar-users
2025-10-22 16:08   ` 'Jan Kiszka' via isar-users
2025-10-23  8:19     ` 'Quirin Gylstorff' via isar-users
2025-10-22 15:07 ` [PATCH v4 10/10] user_manual: Add dracut for initramfs generation 'Quirin Gylstorff' via isar-users
2025-10-22 15:58 ` [PATCH v4 00/10] Add support for dracut 'Jan Kiszka' 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=7e1dcb33-0ca7-448a-930f-3cf3604cc467@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=Quirin.Gylstorff@siemens.com \
    --cc=cedric.hombourger@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