]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
use by-uuid firstly in get_persistent_dev
authorDave Young <dyoung@redhat.com>
Mon, 24 Sep 2012 02:16:26 +0000 (10:16 +0800)
committerHarald Hoyer <harald@redhat.com>
Mon, 24 Sep 2012 11:12:26 +0000 (13:12 +0200)
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 <dyoung@redhat.com>
dracut-functions.sh

index e6200c265189173f70b70afa0fd107fb9ebba575..cdadacdf008d575b04a2a351a8bf18e3392fb4b4 100755 (executable)
@@ -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