From: "'Quirin Gylstorff' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com, jan.kiszka@siemens.com,
felix.moessbauer@siemens.com, cedric.hombourger@siemens.com
Subject: [RFC PATCH v2 3/5] rootfs: Allow to overwrite the initramfs generation cmds
Date: Fri, 5 Sep 2025 16:28:44 +0200 [thread overview]
Message-ID: <20250905142913.3336245-4-Quirin.Gylstorff@siemens.com> (raw)
In-Reply-To: <20250905142913.3336245-1-Quirin.Gylstorff@siemens.com>
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 | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index 7b7859b9..70758cce 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -5,7 +5,20 @@ inherit deb-dl-dir
ROOTFS_ARCH ?= "${DISTRO_ARCH}"
ROOTFS_DISTRO ?= "${DISTRO}"
+
+def initramfs_generator_cmd(d):
+ cmdline = d.getVar('ROOTFS_INITRAMFS_GENERATOR_CMDLINE') or ''
+ cmd = cmdline.split()
+ if len(cmd):
+ return cmd[0]
+ return ''
+
+def initramfs_generator_cmdline(d):
+ return "update-initramfs -u -v -k \"$kernel_version\""
+
ROOTFS_PACKAGES ?= ""
+ROOTFS_INITRAMFS_GENERATOR_CMD ?= "${@ initramfs_generator_cmd(d)}"
+ROOTFS_INITRAMFS_GENERATOR_CMDLINE ?= "${@ initramfs_generator_cmdline(d)}"
ROOTFS_BASE_DISTRO ?= "${BASE_DISTRO}"
# Features of the rootfs creation:
@@ -183,7 +196,7 @@ rootfs_disable_initrd_generation[weight] = "1"
rootfs_disable_initrd_generation() {
# fully disable initrd generation
sudo mkdir -p "${ROOTFSDIR}${ROOTFS_STUBS_DIR}"
- sudo cp -a ${ROOTFSDIR}/usr/bin/true ${ROOTFSDIR}${ROOTFS_STUBS_DIR}/update-initramfs
+ sudo cp -a ${ROOTFSDIR}/usr/bin/true ${ROOTFSDIR}${ROOTFS_STUBS_DIR}/${ROOTFS_INITRAMFS_GENERATOR_CMD}
}
ROOTFS_INSTALL_COMMAND += "rootfs_install_pkgs_update"
@@ -485,11 +498,12 @@ rootfs_generate_initramfs() {
export kernel_version=$(basename /boot/vmlinu[xz]-* | cut -d'-' -f2-); \
echo "Total number of modules: $mods_total"; \
echo "Generating initrd for kernel version: $kernel_version"; \
- update-initramfs -u -v -k "$kernel_version";'
+ ${ROOTFS_INITRAMFS_GENERATOR_CMDLINE};'
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}
else
# ubuntu (dracut)
cp ${ROOTFSDIR}/boot/initrd.img ${DEPLOYDIR}/${INITRD_DEPLOY_FILE}
--
2.50.1
--
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/20250905142913.3336245-4-Quirin.Gylstorff%40siemens.com.
next prev parent reply other threads:[~2025-09-05 14:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 14:28 [RFC PATCH v2 0/5] Add support for dracut 'Quirin Gylstorff' via isar-users
2025-09-05 14:28 ` [RFC PATCH v2 1/5] enable-fsck: remove dependency to initramfs-tools 'Quirin Gylstorff' via isar-users
2025-09-05 14:52 ` 'Jan Kiszka' via isar-users
2025-09-05 14:28 ` [RFC PATCH v2 2/5] add dracut to custom kernel builds 'Quirin Gylstorff' via isar-users
2025-09-05 14:28 ` 'Quirin Gylstorff' via isar-users [this message]
2025-09-05 15:10 ` [RFC PATCH v2 3/5] rootfs: Allow to overwrite the initramfs generation cmds 'Jan Kiszka' via isar-users
2025-09-05 14:28 ` [RFC PATCH v2 4/5] rootfs Add dracut to initramfs generator 'Quirin Gylstorff' via isar-users
2025-09-05 14:28 ` [RFC PATCH v2 5/5] initramfs: allow to set the generator command '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=20250905142913.3336245-4-Quirin.Gylstorff@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