|
|
|
@ -998,6 +998,8 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
|
|
return map(self.defaultPerformFormat(),
|
|
|
|
|
zip(source,mount,fs,value))
|
|
|
|
|
|
|
|
|
|
fixNtfs = lambda self,x:{'ntfs-3g':'ntfs'}.get(x,x)
|
|
|
|
|
|
|
|
|
|
def check(self,value):
|
|
|
|
|
"""Check perform format
|
|
|
|
|
|
|
|
|
@ -1016,9 +1018,11 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
|
|
unavailFS = set(self.Select('os_format_type',
|
|
|
|
|
where='os_format_use',
|
|
|
|
|
eq="off"))
|
|
|
|
|
fixNtfs = self.fixNtfs
|
|
|
|
|
for dev,mp,fs,isformat in info:
|
|
|
|
|
# should format if change fs or partition is root, but non flash
|
|
|
|
|
partitionMustFormat = diskFormat.get(dev,fs) != fs or \
|
|
|
|
|
partitionMustFormat = \
|
|
|
|
|
fixNtfs(diskFormat.get(dev,fs)) != fixNtfs(fs) or \
|
|
|
|
|
(mp == '/' and \
|
|
|
|
|
self.Get('os_install_root_type') != 'flash')
|
|
|
|
|
# if entry has mount point AND
|
|
|
|
@ -1060,10 +1064,11 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
|
|
(self.Get('os_disk_format'))))
|
|
|
|
|
def wrap(info):
|
|
|
|
|
source,dest,fs,isformat = info
|
|
|
|
|
fixNtfs = self.fixNtfs
|
|
|
|
|
if not isformat and source.startswith('/dev/'):
|
|
|
|
|
if dest == '/':
|
|
|
|
|
return "on"
|
|
|
|
|
if dest and diskFormat.get(source,fs) != fs:
|
|
|
|
|
if dest and fixNtfs(diskFormat.get(source,fs)) != fixNtfs(fs):
|
|
|
|
|
return "on"
|
|
|
|
|
return isformat or ("off" if source.startswith('/dev/') else "")
|
|
|
|
|
return wrap
|
|
|
|
@ -1591,7 +1596,7 @@ class VariableOsInstallFstabMountConf(ReadonlyVariable,DeviceHelper):
|
|
|
|
|
devicesForFstab = filter(lambda x:x[1] != "/", devicesForFstab)
|
|
|
|
|
|
|
|
|
|
# rootLine one string, but it correct work if devicesForFstab is empty
|
|
|
|
|
rootLine = "\n".join(map(lambda x: "%s\t%s\t%s\t%s\t0 2" %
|
|
|
|
|
rootLine = "\n".join(map(lambda x: "%s\t%s\t%s\t%s\t0 1" %
|
|
|
|
|
(self._commentFstab(x[0],x[1],x[4]),x[1],x[2],x[3]),
|
|
|
|
|
devicesForFstab[:1]))
|
|
|
|
|
otherLines = "\n".join(map(lambda x: "%s\t%s\t%s\t%s\t0 0" %
|
|
|
|
|