Bug 868397 - dracut's mkinitrd broken wrt. INITRD_MODULES
Summary: dracut's mkinitrd broken wrt. INITRD_MODULES
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: 13.2 Milestone 0
Hardware: Other Other
: P5 - None : Critical (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-14 09:57 UTC by Stefan Seyfried
Modified: 2021-03-02 16:37 UTC (History)
1 user (show)

See Also:
Found By: Third Party Developer/Partner
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---
seife: SHIP_STOPPER?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Seyfried 2014-03-14 09:57:56 UTC
susi:~ # mkinitrd
Creating: target|kernel|dracut args 

Unknown arguments: /boot/initrd-3.14.0-rc5-1-default 3.14.0-rc5-1-default

Usage: /usr/bin/dracut [OPTION]... [<initramfs> [<kernel-version>]]

Version: 036-5.1

Creates initial ramdisk images for preloading modules

  -h, --help  Display all options

If a [LIST] has multiple arguments, then you have to put these in quotes.

For example:

    # dracut --add-drivers "module1 module2"  ...


Unknown arguments: /boot/initrd-3.14.0-rc6-3.gd1a7ba5-desktop 3.14.0-rc6-3.gd1a7ba5-desktop

Usage: /usr/bin/dracut [OPTION]... [<initramfs> [<kernel-version>]]

Version: 036-5.1

Creates initial ramdisk images for preloading modules

  -h, --help  Display all options

If a [LIST] has multiple arguments, then you have to put these in quotes.

For example:

    # dracut --add-drivers "module1 module2"  ...


using "bash -x":

...
+ '[' -n 'processor thermal fan' ']'
+ dracut --logfile /var/log/YaST2/mkinitrd.log --hostonly --force --add-drivers '"processor' thermal 'fan"' /boot/initrd-3.14.0-rc6-3.gd1a7ba5-desktop 3.14.0-rc6-3.gd1a7ba5-desktop

Unknown arguments: /boot/initrd-3.14.0-rc6-3.gd1a7ba5-desktop 3.14.0-rc6-3.gd1a7ba5-desktop

Usage: /usr/bin/dracut [OPTION]... [<initramfs> [<kernel-version>]]

Version: 036-5.1

Creates initial ramdisk images for preloading modules

  -h, --help  Display all options

If a [LIST] has multiple arguments, then you have to put these in quotes.

For example:

    # dracut --add-drivers "module1 module2"  ...

+ (( i++ ))

ok, broken quoting.

fix:
susi:~ # diff -u /sbin/mkinitrd.bak /sbin/mkinitrd
--- /sbin/mkinitrd.bak  2014-03-11 20:33:27.000000000 +0100
+++ /sbin/mkinitrd      2014-03-14 10:55:06.155754920 +0100
@@ -337,13 +337,13 @@
         # -> dracut bug workarounded ugly, because of complex whitespace
         # expansion magics
         if [ -n "${modules_all}" ];then
-            $dracut_cmd $dracut_args --add-drivers \"${modules_all}\" "$target" "$kernel" &>/dev/null
+            $dracut_cmd $dracut_args --add-drivers "${modules_all}" "$target" "$kernel" &>/dev/null
         else
             $dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null
         fi
     else
         if [ -n "${modules_all}" ];then
-            $dracut_cmd $dracut_args --add-drivers \"${modules_all}\" "$target" "$kernel"
+            $dracut_cmd $dracut_args --add-drivers "${modules_all}" "$target" "$kernel"
         else
             $dracut_cmd $dracut_args "$target" "$kernel"
         fi


Since it looks like this was obviously never tested before submitting to Factory, but I'm not able to parse the code at all, I'm not creating a submit request with the obvious fix, but instead am opening this report.

This is a critical bug, since after a kernel update, there will be no initrd to boot from.
Comment 1 Thomas Renninger 2014-03-14 15:17:31 UTC
I tested the stuff, but did not properly sync everything into the patch, maybe I forgot a quilt refresh or similar.
Thanks, package submitted.
Comment 3 Bernhard Wiedemann 2014-03-14 16:00:12 UTC
This is an autogenerated message for OBS integration:
This bug (868397) was mentioned in
https://build.opensuse.org/request/show/225991 Factory / dracut
Comment 4 Thomas Renninger 2014-03-20 11:25:57 UTC
*** Bug 866454 has been marked as a duplicate of this bug. ***