summaryrefslogtreecommitdiff
path: root/dracut.sh
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-01-21 11:23:19 +0000
committerHarald Hoyer <harald@redhat.com>2013-01-23 15:24:27 +0100
commitc586b033a710ed9d2bf6dd5c99505385e101163b (patch)
tree8e53ef0731879723ae68f9e611bd3b090e477428 /dracut.sh
parenta9f634f81500b2e255468ef0be342b61e7061c81 (diff)
downloaddracut-c586b033a710ed9d2bf6dd5c99505385e101163b.tar.gz
dracut-c586b033a710ed9d2bf6dd5c99505385e101163b.tar.bz2
dracut-c586b033a710ed9d2bf6dd5c99505385e101163b.zip
Extend 52f1b041 to allow devices to be specified in config files as well as cmdline.
This also changes the command line switch to be --add-device and the config directive is set to add_device. This was chosen as device= in the config file seems too generic and not quite as consistent with other directives (i.e. drivers/add_drivers) The --device command line is still supported but it should be considered deprecated in favour of --add-device.
Diffstat (limited to 'dracut.sh')
-rwxr-xr-xdracut.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/dracut.sh b/dracut.sh
index 469f4087..23ffaa4b 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -134,7 +134,7 @@ Creates initial ramdisk images for preloading modules
--mount "[DEV] [MP] [FSTYPE] [FSOPTS]"
Mount device [DEV] on mountpoint [MP] with filesystem
[FSTYPE] and options [FSOPTS] in the initramfs
- --device "[DEV]" Bring up [DEV] in initramfs
+ --add-device "[DEV]" Bring up [DEV] in initramfs
-i, --include [SOURCE] [TARGET]
Include the files in the SOURCE directory into the
Target directory in the final initramfs.
@@ -331,7 +331,8 @@ while :; do
--fscks) push fscks_l "$2"; shift;;
--add-fstab) push add_fstab_l "$2"; shift;;
--mount) push fstab_lines "$2"; shift;;
- --device) push host_devs "$2"; shift;;
+ --add-device|--device)
+ push add_device_l "$2"; shift;;
--kernel-cmdline) push kernel_cmdline_l "$2"; shift;;
--nofscks) nofscks_l="yes";;
--ro-mnt) ro_mnt_l="yes";;
@@ -734,6 +735,16 @@ for f in $add_fstab; do
done < $f
done
+if (( ${#add_device_l[@]} )); then
+ while pop add_device_l val; do
+ add_device+=" $val "
+ done
+fi
+
+for dev in $add_device; do
+ push host_devs $dev
+done
+
if [[ $hostonly ]]; then
# in hostonly mode, determine all devices, which have to be accessed
# and examine them for filesystem types