Browse Source

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.
master
Colin Guthrie 12 years ago committed by Harald Hoyer
parent
commit
c586b033a7
  1. 7
      dracut.8.asc
  2. 5
      dracut.conf.5.asc
  3. 15
      dracut.sh

7
dracut.8.asc

@ -332,8 +332,11 @@ provide a valid _/etc/fstab_. @@ -332,8 +332,11 @@ provide a valid _/etc/fstab_.
Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
options>_ in the initramfs

**--device** _<device>_ ::
Bring up _<device>_ in initramfs, _<device>_ should be the device name
**--add-device** _<device>_ ::
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
This can be useful in hostonly mode for resume support when your swap is on
LVM or an encrypted partition.
[NB --device can be used for compatibility with earlier releases]

**-i, --include** _<SOURCE>_ _<TARGET>_::
include the files in the SOURCE directory into the

5
dracut.conf.5.asc

@ -82,6 +82,11 @@ If chrooted to another root other than the real root device, use --fstab and pro @@ -82,6 +82,11 @@ If chrooted to another root other than the real root device, use --fstab and pro
*add_fstab+=*" __<filename>__ "::
Add entries of __<filename>__ to the initramfs /etc/fstab.

*add_device+=*" __<device>__ "::
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
This can be useful in hostonly mode for resume support when your swap is on
LVM an encrypted partition.

*mdadmconf=*"__{yes|no}__"::
Include local _/etc/mdadm.conf_ (default=yes)


15
dracut.sh

@ -134,7 +134,7 @@ Creates initial ramdisk images for preloading modules @@ -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 @@ -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 @@ -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

Loading…
Cancel
Save