Commits

Moises Henriquez committed 2ae5b86

bootloader.py prefer UUID, but do not insist if not available

Comments (0)

Files changed (1)

vinstall/backend/bootloader.py

             LOG.error("Unable to find partition object for %s"% system.root)
             return
 
+        if not os_host.uuid or os_host.uuid == "None":
+            os_rootpath = os_host.path()
+        else:
+            os_rootpath = "/dev/disk/by-uuid/%s"% os_host.uuid
+        #XX:  ^^ Prefer UUID when available
+
         self.buffer.append("# -- %s on %s --" % (system.label,
             system.root))
 	
 	    self.buffer.append("%s label = %s"% (tab, system.label))
 	    if system.initrd:
 		self.buffer.append("%s initrd = %s"% ( tab, system.initrd))
-	self.buffer.append("%s root = /dev/disk/by-uuid/%s" % (tab, os_host.uuid))
-        #XX: ^^ This should always point to a partition.  If it does not, we have
-        #XX: more serious problems than trying to figure out this line.
+	self.buffer.append("%s root = %s" % (tab, os_rootpath))
+        #XX: ^^ This will be a path by UUID where available.  Device path when not.
         if system.appendline:
 	    self.buffer.append('%s append = "%s"'% (tab, system.appendline))
         self.buffer.append("%s read-only" % tab)