]> git.ozlabs.org Git - yaboot.git/blobdiff - ybin/yabootconfig
Add LABEL/UUID support to yabootconfig
[yaboot.git] / ybin / yabootconfig
index f343a7dad1f3ba74f9894bbac5849b6f2c14d4fc..755e79cdfff89def6385cbd5facab682859f8b3e 100755 (executable)
@@ -390,6 +390,21 @@ if [ -z "$ROOT" ] ; then
     fi
 fi
 
+## dereference label or uuid if necessary
+case "$ROOT" in
+    LABEL=*|UUID=*)
+       if ! (command -v findfs > /dev/null 2>&1) ; then
+           echo 1>&2 "$PRG: Unable to locate findfs, aborting..."
+           exit 1
+       fi
+       ROOT="$(findfs "$ROOT")"
+       if [ -z "$ROOT" -o $? != 0 ] ; then
+           echo 1>&2 "$PRG: Could not determine root partition, aborting..."
+           exit 1
+       fi
+       ;;
+esac
+
 ## make sure root device exists
 if [ ! -e "$ROOT" ] ; then
     echo 1>&2 "$PRG: $ROOT: No such file or directory"