dracut/0035-Introduce-force-drivers-parameter-and-force_drivers-.patch
Hannes Reinecke 3f26422f3a Accepting request 236221 from home:hreinecke:branches:Base:System
- Rename patches to match git repository:
  * old: 0013-Correct-paths-for-openSUSE.patch
    new: 0011-Correct-paths-for-openSUSE.patch
  * old: 0014-Check-for-plymouth-lib-directories.patch
    new: 0012-Check-for-plymouth-lib-directories.patch
  * old: dracut_do_not_update_booloader_if_no_kernel_is_found.patch
    new: 0013-mkinitrd-suse-do-not-update-bootloader-if-no-kernel-.patch
  * old: suse_grub_manpage.patch
    new: 0014-Update-dracut-manpage-for-GRUB-Legacy-and-GRUB2.patch
  * old: replace_dhclient_with_wickedd_dhcp_supplicants.patch
    new: 0015-40network-replace-dhclient-with-wickedd-dhcp-supplic.patch
  * old: 0015-add-new-s390x-specific-rule-files.patch
    new: 0016-Add-new-s390x-specific-rule-files.patch
  * old: change_write_ifcfg_to_suse.patch
    new: 0017-45ifcfg-use-distro-specific-scripts.patch
  * old: dracut-fix-whitespace-add-drivers_call.patch
    new: 0018-mkinitrd-suse-Fix-whitespaces-when-adding-drivers.patch
  * old: wait_for_network_race_condition_fix.patch
    new: 0019-40network-Fix-race-condition-when-wait-for-networks.patch
  * old: dracut-warpclock_module.patch
    new: 0020-00warpclock-Set-correct-timezone.patch
  * old: s390-dcssblk.patch
    new: 0021-95dcssblk-Add-new-module-for-DCSS-block-devices.patch
  * old: dracut-install-persistent-rule.patch
    new: 0022-95udev-rules-add-persistent-network-rule.patch
  * old: dracut-really-always-add-autofs4.patch
    new: 0023-systemd-always-tries-to-load-autofs4.patch
  * old: mdraid-setup.patch
    new: 0024-Fixup-mdraid-setup.patch
  * old: 0015-95udev-rules-Add-59-scsi-sg_utils.rules.patch

OBS-URL: https://build.opensuse.org/request/show/236221
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=156
2014-06-04 12:38:30 +00:00

102 lines
4.0 KiB
Diff
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

dracut: Introduce --force-drivers parameter and force_drivers=+ config option
Which will not only add listed drivers, but also enforce that they are tried
to be loaded at early boot time.
This is needed if drivers which are not autoloaded (e.g. loop and a lot others)
shall get loaded via initramfs.
Signed-off-by: Thomas Renninger <trenn@suse.de>
Index: dracut-037/dracut.sh
===================================================================
--- dracut-037.orig/dracut.sh
+++ dracut-037/dracut.sh
@@ -81,6 +81,10 @@ Creates initial ramdisk images for prelo
exclusively include in the initramfs.
--add-drivers [LIST] Specify a space-separated list of kernel
modules to add to the initramfs.
+ --force-drivers [LIST] Specify a space-separated list of kernel
+ modules to add to the initramfs and make sure they
+ are tried to be loaded via modprobe same as passing
+ rd.driver.pre=DRIVER kernel parameter.
--omit-drivers [LIST] Specify a space-separated list of kernel
modules not to add to the initramfs.
--filesystems [LIST] Specify a space-separated list of kernel filesystem
@@ -299,6 +303,7 @@ rearrange_params()
--long add: \
--long force-add: \
--long add-drivers: \
+ --long force-drivers: \
--long omit-drivers: \
--long modules: \
--long omit: \
@@ -463,6 +468,7 @@ while :; do
-a|--add) push add_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
--force-add) push force_add_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
--add-drivers) push add_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
+ --force-drivers) push force_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
--omit-drivers) push omit_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
-m|--modules) push dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
-o|--omit) push omit_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
@@ -887,6 +893,13 @@ if (( ${#add_drivers_l[@]} )); then
fi
add_drivers=${add_drivers/-/_}
+if (( ${#force_drivers_l[@]} )); then
+ while pop force_drivers_l val; do
+ force_drivers+=" $val "
+ done
+fi
+force_drivers=${force_drivers/-/_}
+
if (( ${#omit_drivers_l[@]} )); then
while pop omit_drivers_l val; do
omit_drivers+=" $val "
@@ -903,6 +916,7 @@ fi
omit_drivers_corrected=""
for d in $omit_drivers; do
[[ " $drivers $add_drivers " == *\ $d\ * ]] && continue
+ [[ " $drivers $force_drivers " == *\ $d\ * ]] && continue
omit_drivers_corrected+="$d|"
done
omit_drivers="${omit_drivers_corrected%|}"
@@ -1295,6 +1309,13 @@ if [[ $no_kernel != yes ]]; then
if [[ $add_drivers ]]; then
hostonly='' instmods -c $add_drivers
fi
+ if [[ $force_drivers ]]; then
+ hostonly='' instmods -c $force_drivers
+ rm -f $initdir/etc/cmdline.d/20-force_driver.conf
+ for mod in $force_drivers; do
+ echo "rd.driver.pre=$mod" >>$initdir/etc/cmdline.d/20-force_drivers.conf
+ done
+ fi
if [[ $filesystems ]]; then
hostonly='' instmods -c $filesystems
fi
Index: dracut-037/dracut.8.asc
===================================================================
--- dracut-037.orig/dracut.8.asc
+++ dracut-037/dracut.8.asc
@@ -136,6 +136,19 @@ example:
----
===============================
+**--force-drivers** _<list of kernel modules>_::
+ See add-drivers above. But in this case it is ensured that the drivers
+ are tried to be loaded early via modprobe.
++
+[NOTE]
+===============================
+If [LIST] has multiple arguments, then you have to put these in quotes. For
+example:
+----
+# dracut --force-drivers "kmodule1 kmodule2" ...
+----
+===============================
+
**--omit-drivers** _<list of kernel modules>_::
specify a space-separated list of kernel modules not to add to the
initramfs.