add persistent_policy configuration option
authorHarald Hoyer <harald@redhat.com>
Tue, 20 Aug 2013 08:28:14 +0000 (10:28 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 20 Aug 2013 08:28:14 +0000 (10:28 +0200)
dracut-functions.sh
dracut.conf.5.asc
dracut.sh

index e115989..1d70bd0 100755 (executable)
@@ -305,7 +305,7 @@ get_persistent_dev() {
 
     for i in \
         /dev/mapper/* \
-        /dev/disk/$persistent_policy/* \
+        /dev/disk/${persistent_policy:-by-uuid}/* \
         /dev/disk/by-uuid/* \
         /dev/disk/by-label/* \
         /dev/disk/by-partuuid/* \
index 22bbafd..a32516c 100644 (file)
@@ -71,6 +71,11 @@ Configuration files must have the extension .conf; other extensions are ignored.
     Host-Only mode: Install only what is needed for booting the local host
     instead of a generic host and generate host-specific configuration.
 
+*persistent_policy=*"__<policy>__"::
+    Use _<policy>_ to address disks and partitions.
+    _<policy>_ can be any directory name found in /dev/disk.
+    E.g. "by-uuid", "by-label"
+
 *tmpdir=*"__<temporary directory>__"::
     Specify temporary directory to use.
 
index 5ac66b0..3ae3874 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -416,7 +416,7 @@ while :; do
         -N|--no-hostonly|--no-host-only)
                        hostonly_l="no" ;;
         --persistent-policy)
-                       persistent_policy="$2"; shift;;
+                       persistent_policy_l="$2"; shift;;
         --fstab)       use_fstab_l="yes" ;;
         -h|--help)     long_usage; exit 1 ;;
         -i|--include)  push include_src "$2"
@@ -656,6 +656,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
 [[ $prefix_l ]] && prefix=$prefix_l
 [[ $prefix = "/" ]] && unset prefix
 [[ $hostonly_l ]] && hostonly=$hostonly_l
+[[ $persistent_policy_l ]] && persistent_policy=$persistent_policy_l
 [[ $use_fstab_l ]] && use_fstab=$use_fstab_l
 [[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
 [[ $lvmconf_l ]] && lvmconf=$lvmconf_l