public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: quirin.gylstorff@siemens.com, jan.kiszka@siemens.com,
	Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 2/8] dracut-module: make module-setup compatible with sysroot
Date: Tue, 15 Sep 2026 12:01:19 +0200	[thread overview]
Message-ID: <20260915100125.1991311-3-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20260915100125.1991311-1-felix.moessbauer@siemens.com>

As a preparation for cross-building dracut initrds, we need to ensure
the module setup does not call external tooling (which would have to be
emulated). Further, all tool output must be consumable under sysroot as
well (e.g. paths must be resolved in the target chroot). We fix this by
replacing calls to tooling with the corresponding dracut helpers.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 .../dracut-example-lighttpd/files/install.sh         | 12 ++++++++----
 .../dracut-module/files/module-setup.sh.tmpl         |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/meta-isar/recipes-initramfs/dracut-example-lighttpd/files/install.sh b/meta-isar/recipes-initramfs/dracut-example-lighttpd/files/install.sh
index b7295b94..66b54a43 100644
--- a/meta-isar/recipes-initramfs/dracut-example-lighttpd/files/install.sh
+++ b/meta-isar/recipes-initramfs/dracut-example-lighttpd/files/install.sh
@@ -1,5 +1,9 @@
-inst_multiple -o /usr/lib/lighttpd/*.so
-inst_multiple -o /usr/share/lighttpd/*
+# Copy optional lighttpd modules and assets from the target sysroot.
+for source in "${dracutsysrootdir}"/usr/lib/*/lighttpd/*.so \
+			  "${dracutsysrootdir}"/usr/share/lighttpd/*; do
+	[[ -e "$source" ]] || continue
+	inst_simple "$source" "${source#"$dracutsysrootdir"}"
+done
 
 inst_simple "${moddir}/lighttpd.service" "$systemdsystemunitdir/lighttpd.service"
 inst_simple "${moddir}/lighttpd.conf" /etc/lighttpd/lighttpd.conf
@@ -13,8 +17,8 @@ mkdir -p -m 0700 "$initdir/var/cache/lighttpd/uploads"
 mkdir -p -m 0700 "$initdir/var/log/lighttpd/"
 mkdir -p -m 0755 "$initdir/var/www/html"
 
-/usr/bin/install -m 0644 /usr/share/lighttpd/index.html "$initdir/var/www/html/index.html"
+inst_simple "${dracutsysrootdir}"/usr/share/lighttpd/index.html /var/www/html/index.html
 touch "$moddir"/error.log
-/usr/bin/install -m 0644 "$moddir"/error.log "$initdir/var/log/lighttpd/error.log"
+inst_simple "$moddir"/error.log /var/log/lighttpd/error.log
 chown -R www-data:www-data "$initdir/var/log/lighttpd/"
 systemctl -q --root "$initdir" enable lighttpd
diff --git a/meta/recipes-initramfs/dracut-module/files/module-setup.sh.tmpl b/meta/recipes-initramfs/dracut-module/files/module-setup.sh.tmpl
index be0f4c54..b38ae50c 100644
--- a/meta/recipes-initramfs/dracut-module/files/module-setup.sh.tmpl
+++ b/meta/recipes-initramfs/dracut-module/files/module-setup.sh.tmpl
@@ -31,7 +31,7 @@ cmdline() {
 
 install() {
     for executable in ${DRACUT_REQUIRED_BINARIES}; do
-        if exec_path=$(command -v $executable 2>/dev/null); then
+        if exec_path=$(find_binary "$executable"); then
             inst_binary "$exec_path"
         else
             echo "(ERROR): Unable to copy $executable" >&2
-- 
2.55.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/20260915100125.1991311-3-felix.moessbauer%40siemens.com.

  parent reply	other threads:[~2026-09-15 10:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 10:01 [PATCH 0/8] Add support to cross-compile a dracut initramfs 'Felix Moessbauer' via isar-users
2026-09-15 10:01 ` [PATCH 1/8] rootfs: generalize deployment of rootfs artifact 'Felix Moessbauer' via isar-users
2026-09-15 10:01 ` 'Felix Moessbauer' via isar-users [this message]
2026-09-15 10:01 ` [PATCH 3/8] initramfs: move dracut logic to initrd-dracut class 'Felix Moessbauer' via isar-users
2026-09-15 10:01 ` [PATCH 4/8] dracut: use fixed log level on generation for progress reporting 'Felix Moessbauer' via isar-users
2026-09-15 10:01 ` [PATCH 5/8] dracut: enforce build of reproducible initrd 'Felix Moessbauer' via isar-users
2026-09-15 10:01 ` [PATCH 6/8] add host-tooling chroot for generic host tooling 'Felix Moessbauer' via isar-users
2026-09-15 10:01 ` [PATCH 7/8] dracut: add support for cross initrd generation 'Felix Moessbauer' via isar-users
2026-09-15 10:01 ` [PATCH 8/8] rootfs: stub both dracut and update-initramfs on dracut 'Felix Moessbauer' 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=20260915100125.1991311-3-felix.moessbauer@siemens.com \
    --to=isar-users@googlegroups.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