public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Quirin Gylstorff' via isar-users" <isar-users@googlegroups.com>
To: Jan Kiszka <jan.kiszka@siemens.com>,
	"Hombourger,
	Cedric (FT FDS CES LX)" <cedric.hombourger@siemens.com>,
	"isar-users@googlegroups.com" <isar-users@googlegroups.com>,
	"Moessbauer,
	Felix (FT RPD CED OES-DE)" <felix.moessbauer@siemens.com>
Subject: Re: [PATCH v4 02/10] rootfs: Allow to overwrite the initramfs generation cmds
Date: Thu, 23 Oct 2025 10:00:02 +0200	[thread overview]
Message-ID: <6d4fb362-cdb5-41cc-b17c-b328103bb999@siemens.com> (raw)
In-Reply-To: <48b69bab-3f65-4df2-b885-7e8a7b224fe2@siemens.com>



On 10/22/25 17:56, Jan Kiszka wrote:
> On 22.10.25 17:53, Hombourger, Cedric (FT FDS CES LX) wrote:
>> On Wed, 2025-10-22 at 17:44 +0200, Jan Kiszka wrote:
>>> 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?
>>
>> dracut creates the initrd.img with 0600 perms so bwrap wouldn't help
>> here :(
>>
>> we may need to check if we can convince dracut to use 0644
>>
> 
> I was suspecting something like that but not reading it anywhere.
> 
> Besides micro-optimizations (chown first, then there is no need for sudo
> cp), this should probably be done in dracut context, not for all
> initramfs generators.
> 
> And, yes, checking with dracut if they consider this a feature or rather
> a bug would be good as well.

I will look into it.

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

-- 
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/6d4fb362-cdb5-41cc-b17c-b328103bb999%40siemens.com.

  reply	other threads:[~2025-10-23  8:00 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
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 [this message]
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=6d4fb362-cdb5-41cc-b17c-b328103bb999@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