Fix ability format root device without specify fs.

Check ability format device if fs was not specifed.
Example: /dev/sda2 format in btrfs, but current system hasn't
mkfs.btrfs. Then change fs to default filesystem.
Modify partition id changing. After change id wait while device will
recreate by udev.
master
Mike Hiretsky 13 years ago
parent 7e50063029
commit 0d88b7d55c

@ -979,7 +979,15 @@ class PartitionDistributive(Distributive):
pipe.stdin.write("t\n%s\nw\ny\n"%systemid)
pipe.stdin.close()
pipe.wait()
return True
print "change id (%s) for %s"%(str(systemid),dev)
for waittime in (0.1,0.2,0.5,1,2,4):
if path.exists(dev):
return True
else:
print "Waiting %s..."%waittime
sleep(waittime)
raise DistributiveError(
_("Can not found partition %s after change system id")%dev)
def formatSwapPartition(self, dev):
"""Format swap partition"""

@ -646,7 +646,9 @@ class convertDictOpt:
availableFS = self.getAllAvailableFileSystemOpt()
# if fs not specified and current fs not supported
if not optFileSystem:
if not (format and format in set(supportedFS)-excludeFS):
if not (format and format in \
set(availableFS)&set(supportedFS)-excludeFS) \
and optMountPoint == '/':
optFileSystem = "default"
else:
dictUpdateProperty["fileSystem"] = format

Loading…
Cancel
Save