add --fwdir parameter to dracut
authorHarald Hoyer <harald@eeepc.(none)>
Tue, 21 Jul 2009 15:49:17 +0000 (17:49 +0200)
committerHarald Hoyer <harald@eeepc.(none)>
Tue, 21 Jul 2009 16:11:43 +0000 (18:11 +0200)
        --fwdir [DIR]
              specify additional directory, where to look for firmwares

dracut
dracut-functions
dracut.8

diff --git a/dracut b/dracut
index ac40bf9..a41b466 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -23,6 +23,8 @@ Creates initial ramdisk images for preloading modules
   -d, --drivers [LIST]  Specify a space-separated list of kernel modules to
                          include in the initramfs.
   -k, --kmoddir [DIR]   Specify the directory, where to look for kernel modules
+  --fwdir [DIR]         Specify additional directory, where to look for 
+                        firmwares
   -h, --help            This message
   --debug               Output debug information of the build process
   -v, --verbose         Verbose output during the build process
@@ -50,6 +52,7 @@ while (($# > 0)); do
        -a|--add) add_dracutmodules_l="$2"; shift;;
        -d|--drivers) drivers_l="$2"; shift;;
        -k|--kmoddir) drivers_dir_l="$2"; shift;;
+       --fwdir) fw_dir_l="$2"; shift;;
        -h|--help) usage; exit 1 ;;
        --debug) debug="yes";;
        -v|--verbose) beverbose="yes";;
@@ -81,7 +84,8 @@ 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
-[[ $drivers_dir_l ]] && drivers_dir=$drivers_l
+[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
+[[ $fw_dir_l ]] && fw_dir=$fw_dir_l
 [[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
 
 [[ $allowlocal && -f "$(dirname $0)/dracut-functions" ]] && dsrc="$(dirname $0)" || dsrc=$dracutbasedir
@@ -118,7 +122,8 @@ trap 'rm -rf "$initdir"' 0 # clean up after ourselves no matter how we die.
 # Need to be able to have non-root users read stuff (rpcbind etc)
 chmod 755 "$initdir"
 
-export initdir hookdirs dsrc dracutmodules drivers drivers_dir debug beverbose
+export initdir hookdirs dsrc dracutmodules drivers \
+    fw_dir drivers_dir debug beverbose
 
 # Create some directory structure first
 for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/run; do 
index 0aa3025..ea5dcd7 100755 (executable)
@@ -310,10 +310,12 @@ instmods() {
                    inst_simple "$modpath"
                done
                for fw in $(modinfo -F firmware $mod 2>/dev/null); do
-                   if [[ -f /lib/firmware/$fw ]]; then
+                   if [[ -n "$fw_dir" && -f $fw_dir/$fw ]]; then
+                       inst_simple "$fw_dir/$fw"
+                   elif [[ -f /lib/firmware/$fw ]]; then
                        inst_simple "/lib/firmware/$fw"
                    else
-                       dwarning "Possible missing firmware /lib/firmware/${fw} for module ${mod}.ko"
+                       dwarning "Possible missing firmware ${fw} for module ${mod}.ko"
                    fi
                done
                ;;
index 4d62cfe..23bea5e 100644 (file)
--- a/dracut.8
+++ b/dracut.8
@@ -33,6 +33,9 @@ specify a space-separated list of kernel modules to include in the initramfs.
 .BR \-k ", " \-\-kmoddir " \fI[DIR]\fR   
 specify the directory, where to look for kernel modules
 .TP
+.BR " \-\-fwdir " \fI[DIR]\fR   
+specify additional directory, where to look for firmwares
+.TP
 .BR \-h ", " \-\-help
 display help text and exit. 
 .TP