From 2b47a2efe91ab8be480925c04388200a3666812c Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Wed, 19 Apr 2023 09:25:34 +0200 Subject: [PATCH] fix(btrfs): add missing cmdline function Otherwise `dracut --print-cmdline` does not print the command line option added by the btrfs module. --- modules.d/90btrfs/module-setup.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh index 279ff1459..3a047053e 100755 --- a/modules.d/90btrfs/module-setup.sh +++ b/modules.d/90btrfs/module-setup.sh @@ -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" } -- 2.47.3