From 3411ad661a27643834d6394949b25583ba8c34eb Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 20 Aug 2013 10:28:14 +0200 Subject: [PATCH] add persistent_policy configuration option --- dracut-functions.sh | 2 +- dracut.conf.5.asc | 5 +++++ dracut.sh | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dracut-functions.sh b/dracut-functions.sh index e1159898..1d70bd00 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -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/* \ diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc index 22bbafde..a32516c4 100644 --- a/dracut.conf.5.asc +++ b/dracut.conf.5.asc @@ -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=*"____":: + Use __ to address disks and partitions. + __ can be any directory name found in /dev/disk. + E.g. "by-uuid", "by-label" + *tmpdir=*"____":: Specify temporary directory to use. diff --git a/dracut.sh b/dracut.sh index 5ac66b04..3ae3874c 100755 --- 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