diff options
author | Mike Fulbright <msf@redhat.com> | 2001-06-25 21:47:43 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2001-06-25 21:47:43 +0000 |
commit | 38cace3bab4387bddaaaaa0afd810f19c63795eb (patch) | |
tree | 6bf564a71dc08b0a34f22c0cefedf0fca62913a5 /partitioning.py | |
parent | a93ec8dcafbe97ef7a97241148fe97bc462ce828 (diff) | |
download | anaconda-38cace3bab4387bddaaaaa0afd810f19c63795eb.tar.gz anaconda-38cace3bab4387bddaaaaa0afd810f19c63795eb.tar.xz anaconda-38cace3bab4387bddaaaaa0afd810f19c63795eb.zip |
added all previous autopartitioning cases for installclasses
Diffstat (limited to 'partitioning.py')
-rw-r--r-- | partitioning.py | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/partitioning.py b/partitioning.py index 72c2d7c2f..89a72882a 100644 --- a/partitioning.py +++ b/partitioning.py @@ -291,15 +291,18 @@ def doMountPointLinuxFSChecks(newrequest): if not newrequest.mountpoint: return None - if newrequest.fstype.isLinuxNativeFS(): + if newrequest.fstype == None: + return None + + if newrequest.fstype.isMountable(): if newrequest.mountpoint in mustbeonroot: return _("This mount point is invalid. This directory must " "be on the / filesystem.") - - else: + + if not newrequest.fstype.isLinuxNativeFS(): if newrequest.mountpoint in mustbeonlinuxfs: return _("This mount point must be on a linux filesystem.") - + return None def doPartitionSizeCheck(newrequest): @@ -839,3 +842,39 @@ def partitionMethodSetup(id, dispatch): for device in protected: request = id.partrequests.getRequestByDeviceName(device) request.type = REQUEST_PROTECTED + + +# shorthand mainly for installclasses +# +# make a list of tuples of the form: +# (mntpt, fstype, minsize, maxsize, grow, format) +# +# mntpt = None for non-mountable, otherwise is mount point +# fstype = None to use default, otherwise a string +# minsize = smallest size +# maxsize = max size, or None means no max +# grow = 0 or 1, should partition be grown +# format = 0 or 1, whether to format +# +def autoCreatePartitionRequests(autoreq): + requests = [] + for (mntpt, fstype, minsize, maxsize, grow, format) in autoreq: + if fstype: + ptype = fsset.fileSystemTypeGet(fstype) + else: + ptype = fsset.fileSystemTypeGetDefault() + + newrequest = PartitionSpec(ptype, + mountpoint = mntpt, + size = minsize, + maxSize = maxsize, + grow = grow, + requesttype = REQUEST_NEW, + format = format) + + requests.append(newrequest) + + for r in requests: + print r + + return requests |