Use dbus-uuidgen if uuidgen is not available
authorHugo Villeneuve <hugo@hugovil.com>
Sun, 9 Jun 2013 14:43:48 +0000 (10:43 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Mon, 10 Jun 2013 02:29:20 +0000 (22:29 -0400)
stage0/create-version

index eb4b012..a5df707 100755 (executable)
@@ -9,17 +9,23 @@ create_hvlinux_version()
     if [ ! -f ${CFG_DIR}/${HV_VER_FILE} ]; then
         echo "Create new hvlinux-version file"
 
-        if [ ! -x /usr/bin/uuidgen ]; then
-            echo "Error, missing /usr/bin/uuidgen program"
-            exit 1
-        fi
+       UUIDGEN=/usr/bin/uuidgen
+
+        if [ ! -x ${UUIDGEN} ]; then
+           UUIDGEN=/usr/bin/dbus-uuidgen
+
+            if [ ! -x ${UUIDGEN} ]; then
+                echo "Error, missing /usr/bin/uuidgen program"
+                exit 1
+            fi
+       fi
 
         cat > ${CFG_DIR}/${HV_VER_FILE} <<EOF
 # Do not edit this file.
 # This file is autogenerated by the HVLinux build system
 EOF
 
-        echo "HVUUID=$(uuidgen)" >> ${CFG_DIR}/${HV_VER_FILE}
+        echo "HVUUID=$(${UUIDGEN})" >> ${CFG_DIR}/${HV_VER_FILE}
         echo "HVDATE=\"$(date)\"" >> ${CFG_DIR}/${HV_VER_FILE}
     fi