From 92ab04b1915cfd64695009ff0c7a51d5aa924043 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Wed, 8 Sep 2010 11:20:56 +0400 Subject: [PATCH] Added 'vfat' to support file system. Added excludeFS logic. For '/' wrongfs is 'vfat'. --- pym/cl_install.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/pym/cl_install.py b/pym/cl_install.py index 1d95275..6e25510 100644 --- a/pym/cl_install.py +++ b/pym/cl_install.py @@ -281,6 +281,15 @@ class convertDictOpt: "incompatible":[]}}, "incompatible":[], "makefs":"/sbin/mkfs.reiserfs"}, + "vfat":{"options":["uni_xlate","posix","nonumtail", + "utf8","shortname"], + "pair":{"shortname":{"options": + re.compile("lower|win95|winnt|mixed"), + "incompatible":[]}, + "utf8":{"options": + re.compile("0|1|no|false|true|yes"), + "incompatible":["uni_xlate"]}}, + "makefs":"/usr/sbin/mkfs.vfat"}, "xfs":{"options":["allocsize", "attr2", "noattr2", "barrier", "dmapi", "grpid", "bsdgroups", "nogrpid", "sysvgroups", @@ -538,10 +547,14 @@ class convertDictOpt: optMountPoint = "/" dictUpdateProperty["mountPoint"] = optMountPoint supportedFS = self.getAllSupportFileSystemOpt() + if optMountPoint == "/": + excludeFS = set(["vfat"]) + else: + excludeFS = set([]) availableFS = self.getAllAvailableFileSystemOpt() # if fs not specified and current fs not supported if not optFileSystem: - if not (format and format in supportedFS): + if not (format and format in set(supportedFS)-excludeFS): optFileSystem = "default" else: dictUpdateProperty["fileSystem"] = format @@ -555,11 +568,20 @@ class convertDictOpt: if not optFileSystem in availableFS: raise InstallError(_("File system '%s' is not available")\ %optFileSystem) - dictOptions.update(self.getDefaultOptFileSystem(optFileSystem)) + if optFileSystem in excludeFS: + raise InstallError( + _("File system for '%s' should not be '%s'") + %(optMountPoint, optFileSystem)) + if not "fileSystem" in dictOptions or optFileSystem == "default": + dictOptions.update(self.getDefaultOptFileSystem(optFileSystem)) if optFileSystem == "noformat": if not format: raise InstallError(\ _("Partition %s is not formatted")%dev) + elif format in excludeFS: + raise InstallError(\ + _("File system for '%s' should not be '%s'") + %(optMountPoint, format)) if not options: options = ["noatime"] dictOptions["fileSystem"] = format