Added ntfs and ntfs-3g description.

Added forbiddance of using vfat and ntfs for root and root directoies.
Added get ntfs-3g from fstab for ntfs filesystem.
netsetup
Mike Hiretsky 14 years ago
parent 28973727cb
commit 9bdc6f5c97

@ -587,6 +587,8 @@ class PartitionDistributive(Distributive):
'reiserfs':'/sbin/mkfs.reiserfs -f %s',
'xfs':'/sbin/mkfs.xfs -f %s',
'vfat':'/usr/sbin/mkfs.vfat -F 32 %s',
'ntfs-3g':'/usr/sbin/mkfs.ntfs -FQ %s',
'ntfs':'/usr/sbin/mkfs.ntfs -FQ %s',
'swap':'/sbin/mkswap %s'
}
@ -723,7 +725,7 @@ class PartitionDistributive(Distributive):
"""Format partition"""
if not format in self.formatUtilities:
raise DistributiveError(
_("Specified '%s' format inn't supported")%format)
_("Specified '%s' format is not supported")%format)
if dev in map(lambda y: y.split(" ")[0],
filter(lambda x: x.startswith("/"),
open("/proc/swaps"))):

@ -203,6 +203,11 @@ class fillVars(object, glob_attr):
map(lambda x: filter(lambda x: x ,
x.replace('\t',' ').split(' ')),
mountOptionsList))
# get dev which has ntfs filesystem
mountFormatList = \
filter(lambda x: x[0] in disk_hash.keys() and \
x[1] in ("ntfs","ntfs-3g"),
map(lambda y: (y[0],y[2]), mountOptionsList))
# split options and discard rw opt
mountOptionsList = \
filter(lambda x: x[0] in disk_hash.keys(),
@ -210,11 +215,14 @@ class fillVars(object, glob_attr):
y[3].split(','))),
mountOptionsList))
dictOptionList = {}
dictOptionList.update(mountOptionsList)
dictOptionList = dict(mountOptionsList)
dictFormatList = dict(mountFormatList)
for dev in disk_hash.keys():
if dev in dictOptionList:
disk_hash[dev]['options'] = ",".join(dictOptionList[dev])
if dev in dictFormatList and "format" in disk_hash[dev] and \
disk_hash[dev]['format'] in ("ntfs","ntfs-3g"):
disk_hash[dev]['format'] = dictFormatList[dev]
return disk_hash
def get_os_disk_dev(self):

@ -294,6 +294,62 @@ class convertDictOpt:
"incompatible":["uni_xlate"]}},
"incompatible":[],
"makefs":"/usr/sbin/mkfs.vfat"},
"ntfs":{"options":["uni_xlate","posix","nls",
"utf8","iocharset",
"uid","gid","umask"],
"pair":{"utf8":{"options":
re.compile("0|1|no|false|true|yes"),
"incompatible":["uni_xlate"]},
"iocharset":{"options":re.compile(".+"),
"incompatible":["nls"]},
"uni_xlate":{"options":
re.compile("0|1|2"),
"incompatible":[]},
"posix":{"options":
re.compile("0|1"),
"incompatible":[]},
"uid":{"options":re.compile(".+"),
"incompatible":[]},
"gid":{"options":re.compile(".+"),
"incompatible":[]},
"umask":{"options":re.compile(".+"),
"incompatible":[]},
},
"incompatible":[],
"makefs":"/usr/sbin/mkfs.ntfs"},
"ntfs-3g":{"options":["uid","gid","umask","fmask",
"dmask","usermapping",
"default_permissions",
"inherit","locale",
"force","remove_hiberfile",
"show_sys_files","allow_other",
"max_read","silent","no_def_opts",
"streams_interface","user_xattr",
"efs_raw","debug","no_detach"],
"pair":{"uid":{"options":re.compile(".+"),
"incompatible":[]},
"gid":{"options":re.compile(".+"),
"incompatible":[]},
"umask":{"options":re.compile(".+"),
"incompatible":[]},
"fmask":{"options":re.compile(".+"),
"incompatible":[]},
"dmask":{"options":re.compile(".+"),
"incompatible":[]},
"usermapping":{"options":re.compile(".+"),
"incompatible":[]},
"default_permissions":{
"options":re.compile(".+"),
"incompatible":[]},
"locale":{"options":re.compile(".+"),
"incompatible":[]},
"max_read":{"options":re.compile(".+"),
"incompatible":[]},
"streams_interface":{
"options":re.compile(".+"),
"incompatible":[]}},
"incompatible":[],
"makefs":"/usr/sbin/mkfs.ntfs"},
"xfs":{"options":["allocsize", "attr2", "noattr2",
"barrier", "dmapi", "grpid",
"bsdgroups", "nogrpid", "sysvgroups",
@ -563,10 +619,11 @@ class convertDictOpt:
optMountPoint = "/"
dictUpdateProperty["mountPoint"] = optMountPoint
supportedFS = self.getAllSupportFileSystemOpt()
if optMountPoint == "/":
reRootDirectories = re.compile("^/[^/]*/?$",re.S)
if reRootDirectories.match(path.normpath(optMountPoint)):
# check install type (flash or hdd)
if self._getDeviceType(dev) != "flash":
excludeFS = set(["vfat"])
excludeFS = set(["vfat","ntfs","ntfs-3g"])
else:
excludeFS = set(supportedFS) - \
set(["vfat","noformat","default"])
@ -591,7 +648,8 @@ class convertDictOpt:
%optFileSystem)
if optFileSystem in excludeFS:
mp = optMountPoint
if mp == '/' and self._getDeviceType(dev) == "flash":
if reRootDirectories.match(path.normpath(mp)) \
and self._getDeviceType(dev) == "flash":
mp = "flash"
raise InstallError(
_("File system for '%s' should not be '%s'")
@ -606,7 +664,8 @@ class convertDictOpt:
_("Partition %s is not formatted")%dev)
elif format in excludeFS:
mp = optMountPoint
if mp == '/' and self._getDeviceType(dev) == "flash":
if reRootDirectories.match(path.normpath(mp)) \
and self._getDeviceType(dev) == "flash":
mp = "flash"
raise InstallError(\
_("File system for '%s' should not be '%s'")

Loading…
Cancel
Save