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: [PATCH v6 04/13] rootfs: Copy the newly created initrd.img to the work directory
Date: Wed, 5 Nov 2025 10:29:19 +0100 [thread overview]
Message-ID: <20251105093710.19582-5-Quirin.Gylstorff@siemens.com> (raw)
In-Reply-To: <20251105093710.19582-1-Quirin.Gylstorff@siemens.com>
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
This allows to change the permissions of the initrd to 0644. And
all followup steps do not need sudo.
This is necessary as dracut creates the initrd with 0600 permissions.
Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
meta/classes/rootfs.bbclass | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index c683d5d2..78da8a4b 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -606,17 +606,11 @@ rootfs_generate_initramfs() {
echo "Total number of modules: $mods_total"
echo "Generating initrd for kernel version: $kernel_version"
sudo -E chroot "${ROOTFSDIR}" sh -c ' \
- ${ROOTFS_INITRAMFS_GENERATOR_CMDLINE};'
+ ${ROOTFS_INITRAMFS_GENERATOR_CMDLINE}; \
+ find /boot -name "initrd.img-$kernel_version*" -exec install --mode 0644 {} /isar-work/initrd.img \; \
+ '
done
- if [ -n "${INITRD_DEPLOY_FILE}" ]; then
- if [ -f "${ROOTFSDIR}/initrd.img" ]; then
- # debian (mkinitramfs)
- cp ${ROOTFSDIR}/initrd.img ${DEPLOYDIR}/${INITRD_DEPLOY_FILE}
- else
- # ubuntu (dracut)
- cp ${ROOTFSDIR}/boot/initrd.img ${DEPLOYDIR}/${INITRD_DEPLOY_FILE}
- fi
- fi
+ install --owner $(id -u) --group $(id -g) ${WORKDIR}/initrd.img ${DEPLOYDIR}/${INITRD_DEPLOY_FILE}
else
echo "no kernel in this rootfs, do not generate initrd"
fi
--
2.51.0
--
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/20251105093710.19582-5-Quirin.Gylstorff%40siemens.com.
next prev parent reply other threads:[~2025-11-05 9:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 9:29 [PATCH v6 00/13] Add support for dracut 'Quirin Gylstorff' via isar-users
2025-11-05 9:29 ` [PATCH v6 01/13] Add dracut to custom kernel builds 'Quirin Gylstorff' via isar-users
2025-11-05 9:29 ` [PATCH v6 02/13] rootfs: Allow to overwrite the initramfs generation cmds 'Quirin Gylstorff' via isar-users
2025-11-05 9:29 ` [PATCH v6 03/13] rootfs: Add isar-work directory to rootfs mounts 'Quirin Gylstorff' via isar-users
2025-11-05 9:29 ` 'Quirin Gylstorff' via isar-users [this message]
2025-11-05 9:29 ` [PATCH v6 05/13] rootfs: Add dracut to initramfs generator 'Quirin Gylstorff' via isar-users
2025-11-05 9:29 ` [PATCH v6 06/13] rootfs: exit immediately if INITRAMFS_GENERATOR_CMD fails 'Quirin Gylstorff' via isar-users
2025-11-05 9:29 ` [PATCH v6 07/13] initramfs: allow to set the generator command 'Quirin Gylstorff' via isar-users
2025-11-05 9:29 ` [PATCH v6 08/13] Add class to generate custom dracut initramfs 'Quirin Gylstorff' via isar-users
2025-11-05 10:16 ` 'Jan Kiszka' via isar-users
2025-11-05 9:29 ` [PATCH v6 09/13] rootfs: add flag to use dracut if it is not part of the package list 'Quirin Gylstorff' via isar-users
2025-11-05 9:29 ` [PATCH v6 10/13] Add example dracut initramfs 'Quirin Gylstorff' via isar-users
2025-11-05 9:29 ` [PATCH v6 11/13] Add dracut module helper 'Quirin Gylstorff' via isar-users
2025-11-05 10:15 ` 'Jan Kiszka' via isar-users
2025-11-05 9:29 ` [PATCH v6 12/13] Use lighttpd as a example how to add a dracut module 'Quirin Gylstorff' via isar-users
2025-11-05 9:29 ` [PATCH v6 13/13] 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=20251105093710.19582-5-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