use device UUID in etc/fstab for raw image
authorGui Chen <gui.chen@intel.com>
Tue, 31 Jul 2012 03:22:13 +0000 (11:22 +0800)
committerGui Chen <gui.chen@intel.com>
Tue, 31 Jul 2012 03:22:13 +0000 (11:22 +0800)
Signed-off-by: Gui Chen <gui.chen@intel.com>
mic/imager/raw.py
mic/utils/partitionedfs.py

index 4beaf06..19be0d1 100644 (file)
@@ -81,7 +81,7 @@ class RawImageCreator(BaseImageCreator):
                     break
 
             s += "%(device)s  %(mountpoint)s  %(fstype)s  %(fsopts)s 0 0\n" % {
-               'device': "/dev/%s%-d" % (p['disk'], p['num']),
+               'device': "UUID=%s" % p['uuid'],
                'mountpoint': p['mountpoint'],
                'fstype': p['fstype'],
                'fsopts': "defaults,noatime" if not p['fsopts'] else p['fsopts']}
index 204ba34..98a0da2 100644 (file)
@@ -645,6 +645,7 @@ class PartitionedMount(Mount):
                     self.__create_subvolumes(p, pdisk)
                 self.__mount_subvolumes(p, pdisk)
             p['mount'] = pdisk
+            p['uuid'] = pdisk.uuid
 
     def resparse(self, size = None):
         # Can't re-sparse a disk image - too hard