From cb47caf786f68b2c2a239bb726cf84f38b9b50b4 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 9 Sep 2009 17:02:37 +0200 Subject: [PATCH] add parameter to specify additional kernel modules to include --add-drivers for dracut add_drivers for dracut.conf --- dracut | 9 +++++++-- dracut.8 | 4 +++- dracut.conf | 4 ++-- modules.d/90kernel-modules/installkernel | 2 ++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dracut b/dracut index 1d74316..b19df1e 100755 --- a/dracut +++ b/dracut @@ -34,7 +34,9 @@ Creates initial ramdisk images for preloading modules -o, --omit [LIST] Omit a space-separated list of dracut modules. -a, --add [LIST] Add a space-separated list of dracut modules. -d, --drivers [LIST] Specify a space-separated list of kernel modules to - include in the initramfs. + exclusively include in the initramfs. + --add-drivers [LIST] Specify a space-separated list of kernel + modules to add to the initramfs. -k, --kmoddir [DIR] Specify the directory, where to look for kernel modules --fwdir [DIR] Specify additional directories, where to look for @@ -69,6 +71,7 @@ while (($# > 0)); do -o|--omit) omit_dracutmodules_l="$2"; shift;; -a|--add) add_dracutmodules_l="$2"; shift;; -d|--drivers) drivers_l="$2"; shift;; + --add-drivers) add_drivers_l="$2"; shift;; -k|--kmoddir) drivers_dir_l="$2"; shift;; --fwdir) fw_dir_l="$2"; shift;; --kernel-only) kernel_only="yes"; nokernel="no";; @@ -107,6 +110,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH [[ $omit_dracutmodules_l ]] && omit_dracutmodules=$omit_dracutmodules_l [[ $add_dracutmodules_l ]] && add_dracutmodules="$add_dracutmodules $add_dracutmodules_l" [[ $drivers_l ]] && drivers=$drivers_l +[[ $add_drivers_l ]] && add_drivers=$add_drivers_l [[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l [[ $fw_dir_l ]] && fw_dir=$fw_dir_l [[ $do_strip_l ]] && do_strip=$do_strip_l @@ -158,7 +162,8 @@ trap 'rm -rf "$initdir"' 0 # clean up after ourselves no matter how we die. chmod 755 "$initdir" export initdir hookdirs dsrc dracutmodules drivers \ - fw_dir drivers_dir debug beverbose no_kernel kernel_only + fw_dir drivers_dir debug beverbose no_kernel kernel_only \ + add_drivers if [[ $kernel_only != yes ]]; then # Create some directory structure first diff --git a/dracut.8 b/dracut.8 index 5ac33f9..b0547d9 100644 --- a/dracut.8 +++ b/dracut.8 @@ -28,7 +28,9 @@ omit a space-separated list of dracut modules. add a space-separated list of dracut modules. .TP .BR \-d ", " \-\-drivers " \fILIST\fR" -specify a space-separated list of kernel modules to include in the initramfs. +specify a space-separated list of kernel modules to exclusively include in the initramfs. +.BR \-\-add-drivers " \fILIST\fR" +specify a space-separated list of kernel modules to add to the initramfs. .TP .BR \-k ", " \-\-kmoddir " \fI{DIR}\fR specify the directory, where to look for kernel modules diff --git a/dracut.conf b/dracut.conf index f4e4daa..73d064f 100644 --- a/dracut.conf +++ b/dracut.conf @@ -6,8 +6,8 @@ # Dracut modules to omit #omit_dracutmodules="" -# Additional kernel modules to install -#drivers="" +# additional kernel modules to the default +#add_drivers="" # build initrd only to boot current hardware #hostonly="-h" diff --git a/modules.d/90kernel-modules/installkernel b/modules.d/90kernel-modules/installkernel index 92e3301..461e5ef 100755 --- a/modules.d/90kernel-modules/installkernel +++ b/modules.d/90kernel-modules/installkernel @@ -18,4 +18,6 @@ else instmods $drivers fi +[[ $add_drivers ]] && instmods $add_drivers + instmods scsi_wait_scan -- 2.7.4