From: Dave Young Date: Mon, 24 Sep 2012 02:16:26 +0000 (+0800) Subject: use by-uuid firstly in get_persistent_dev X-Git-Tag: 024~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f3f97774970e4f83af82ac58d4aab47a4d2ca1c7;p=thirdparty%2Fdracut.git use by-uuid firstly in get_persistent_dev For devices with filesystem, udev /dev/disk/by-uuid/* links are always reliable. So improve the get_persistent_dev() by using by-uuid/* firstly, and fallback to use by-id/* Signed-off-by: Dave Young --- diff --git a/dracut-functions.sh b/dracut-functions.sh index e6200c265..cdadacdf0 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -245,7 +245,7 @@ get_persistent_dev() { _dev=$(udevadm info --query=name --name="$1" 2>/dev/null) [ -z "$_dev" ] && return - for i in /dev/disk/by-id/*; do + for i in /dev/disk/by-uuid/* /dev/disk/by-id/*; do _tmp=$(udevadm info --query=name --name="$i" 2>/dev/null) if [ "$_tmp" = "$_dev" ]; then echo $i