]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(btrfs): do not require module via cmdline when --no-kernel
authorMichal Koutný <mkoutny@suse.com>
Mon, 19 Jun 2023 14:40:49 +0000 (16:40 +0200)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Tue, 20 Jun 2023 14:52:02 +0000 (07:52 -0700)
initrd built without modules would fail when it attempts to load a
kernel module. (Use case scenario: kernel with built-in module.)

synthesize an the cmdline only when modules are truly installed.

modules.d/90btrfs/module-setup.sh

index 3a047053e7a28f03dbf61dbaf393dea5ed1047e0..5d881332053daa19b388565333a4b778653607ff 100755 (executable)
@@ -32,6 +32,7 @@ cmdline() {
 # called by dracut
 installkernel() {
     instmods btrfs
+    printf "%s\n" "$(cmdline)" > "${initdir}/etc/cmdline.d/00-btrfs.conf"
 }
 
 # called by dracut
@@ -56,6 +57,4 @@ install() {
 
     inst_multiple -o btrfsck btrfs-zero-log
     inst "$(command -v btrfs)" /sbin/btrfs
-
-    printf "%s\n" "$(cmdline)" > "${initdir}/etc/cmdline.d/00-btrfs.conf"
 }