]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(btrfs): add missing cmdline function
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Wed, 19 Apr 2023 07:25:34 +0000 (09:25 +0200)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Tue, 20 Jun 2023 14:52:02 +0000 (07:52 -0700)
Otherwise `dracut --print-cmdline` does not print the command line option added
by the btrfs module.

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

index 279ff1459ce0d8086068a7fca9873585f208afd7..3a047053e7a28f03dbf61dbaf393dea5ed1047e0 100755 (executable)
@@ -22,6 +22,13 @@ depends() {
     return 0
 }
 
+# called by dracut
+cmdline() {
+    # Hack for slow machines
+    # see https://github.com/dracutdevs/dracut/issues/658
+    printf " rd.driver.pre=btrfs"
+}
+
 # called by dracut
 installkernel() {
     instmods btrfs
@@ -49,7 +56,6 @@ install() {
 
     inst_multiple -o btrfsck btrfs-zero-log
     inst "$(command -v btrfs)" /sbin/btrfs
-    # Hack for slow machines
-    # see https://github.com/dracutdevs/dracut/issues/658
-    echo "rd.driver.pre=btrfs" > "${initdir}"/etc/cmdline.d/00-btrfs.conf
+
+    printf "%s\n" "$(cmdline)" > "${initdir}/etc/cmdline.d/00-btrfs.conf"
 }