dracut/0035-Introduce-force-drivers-parameter-and-force_drivers-.patch

113 lines
4.2 KiB
Diff
Raw Normal View History

From 35997a262493d31af8cd06a93612cf341df3f0cb Mon Sep 17 00:00:00 2001
From: Thomas Renninger <trenn@suse.de>
Date: Tue, 27 May 2014 14:59:39 +0200
Subject: [PATCH] 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>
---
dracut.8.asc | 13 +++++++++++++
dracut.sh | 21 +++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/dracut.8.asc b/dracut.8.asc
index 14ce26b..5ff0e82 100644
--- a/dracut.8.asc
+++ b/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.
diff --git a/dracut.sh b/dracut.sh
index adf26ad..9898cdf 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -81,6 +81,10 @@ Creates initial ramdisk images for preloading modules
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;;
Accepting request 235703 from home:trenn:branches:Base:System - Update to latest git HEAD: commit 0fa5dbedc5b222435f51f7460a81232ee120c4e1 Tue May 20 13:23 Modified dracut_v37_to_HEAD.patch Modified mdraid-setup.patch Modified dracut-install-persistent-rule.patch - Add /etc/dracut.d.conf/01-dist modifications to file instead of writing to it via rpm build section Add 0033-dracut_hostonly_hostonly_cmdline_default.patch Add 0034-suse.conf.example_extend.patch - Cleanup mkinitrd-suse.sh: * Remove hostonly and hostonly-cmdline -> this is done via 01-dist config file now - Always add network module based on modules_setup.sh check() function and not via 01-dist config file Add 0035-always_add_network.patch - Add find to debug binaries - Useful and harmless Add 0036-add_extra_debug_binaries.patch - Fix adding of network modules for s390 (bnc#879302) Add 0037-fix_s390_network_modules_install.patch - Omit resume module on s390(x) - There is no suspend on s390 Add 0039-s390_no_resume_module.patch - Do not wait for swap - This causes trouble with Rudi's autobuild images: Add 0038-remove_waiting_for_swap_dev.patch - Fcoe and ibft fixes (bnc#879038): Add 0041-only_enable_network_if_explicitly_requested.patch Add 0042-ibft_autoconfig_param.patch Add 0043-fcoe_strip_quotes.patch - Print message when starting to update bootloader Add 0044-Add_update_bootloader_msg.patch - ToDo: Pass hostonly variable earlier so that is always avail in check() OBS-URL: https://build.opensuse.org/request/show/235703 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=151
2014-05-28 16:30:59 +00:00
@@ -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 "
Accepting request 235703 from home:trenn:branches:Base:System - Update to latest git HEAD: commit 0fa5dbedc5b222435f51f7460a81232ee120c4e1 Tue May 20 13:23 Modified dracut_v37_to_HEAD.patch Modified mdraid-setup.patch Modified dracut-install-persistent-rule.patch - Add /etc/dracut.d.conf/01-dist modifications to file instead of writing to it via rpm build section Add 0033-dracut_hostonly_hostonly_cmdline_default.patch Add 0034-suse.conf.example_extend.patch - Cleanup mkinitrd-suse.sh: * Remove hostonly and hostonly-cmdline -> this is done via 01-dist config file now - Always add network module based on modules_setup.sh check() function and not via 01-dist config file Add 0035-always_add_network.patch - Add find to debug binaries - Useful and harmless Add 0036-add_extra_debug_binaries.patch - Fix adding of network modules for s390 (bnc#879302) Add 0037-fix_s390_network_modules_install.patch - Omit resume module on s390(x) - There is no suspend on s390 Add 0039-s390_no_resume_module.patch - Do not wait for swap - This causes trouble with Rudi's autobuild images: Add 0038-remove_waiting_for_swap_dev.patch - Fcoe and ibft fixes (bnc#879038): Add 0041-only_enable_network_if_explicitly_requested.patch Add 0042-ibft_autoconfig_param.patch Add 0043-fcoe_strip_quotes.patch - Print message when starting to update bootloader Add 0044-Add_update_bootloader_msg.patch - ToDo: Pass hostonly variable earlier so that is always avail in check() OBS-URL: https://build.opensuse.org/request/show/235703 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=151
2014-05-28 16:30:59 +00:00
@@ -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%|}"
Accepting request 235703 from home:trenn:branches:Base:System - Update to latest git HEAD: commit 0fa5dbedc5b222435f51f7460a81232ee120c4e1 Tue May 20 13:23 Modified dracut_v37_to_HEAD.patch Modified mdraid-setup.patch Modified dracut-install-persistent-rule.patch - Add /etc/dracut.d.conf/01-dist modifications to file instead of writing to it via rpm build section Add 0033-dracut_hostonly_hostonly_cmdline_default.patch Add 0034-suse.conf.example_extend.patch - Cleanup mkinitrd-suse.sh: * Remove hostonly and hostonly-cmdline -> this is done via 01-dist config file now - Always add network module based on modules_setup.sh check() function and not via 01-dist config file Add 0035-always_add_network.patch - Add find to debug binaries - Useful and harmless Add 0036-add_extra_debug_binaries.patch - Fix adding of network modules for s390 (bnc#879302) Add 0037-fix_s390_network_modules_install.patch - Omit resume module on s390(x) - There is no suspend on s390 Add 0039-s390_no_resume_module.patch - Do not wait for swap - This causes trouble with Rudi's autobuild images: Add 0038-remove_waiting_for_swap_dev.patch - Fcoe and ibft fixes (bnc#879038): Add 0041-only_enable_network_if_explicitly_requested.patch Add 0042-ibft_autoconfig_param.patch Add 0043-fcoe_strip_quotes.patch - Print message when starting to update bootloader Add 0044-Add_update_bootloader_msg.patch - ToDo: Pass hostonly variable earlier so that is always avail in check() OBS-URL: https://build.opensuse.org/request/show/235703 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=151
2014-05-28 16:30:59 +00:00
@@ -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
--
1.8.4.5