summaryrefslogtreecommitdiffstats
path: root/kickstart.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-09-23 15:04:10 +0000
committerJeremy Katz <katzj@redhat.com>2003-09-23 15:04:10 +0000
commitcad19656b2a25aa69fa0db0539b46353ed425693 (patch)
tree2de0b60e6cb10cd9427b7d2eb3b389fa0d1cc76a /kickstart.py
parent37350e3ab0231434f62c4a91e20b1c29c796cf7b (diff)
downloadanaconda-cad19656b2a25aa69fa0db0539b46353ed425693.tar.gz
anaconda-cad19656b2a25aa69fa0db0539b46353ed425693.tar.xz
anaconda-cad19656b2a25aa69fa0db0539b46353ed425693.zip
allow setting pesize in kickstart (#104033)
Diffstat (limited to 'kickstart.py')
-rw-r--r--kickstart.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/kickstart.py b/kickstart.py
index 9563b5cc9..2ec5d92d2 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -25,6 +25,7 @@ import raid
import string
import partRequests
import urllib2
+import lvm
from rhpl.translate import _
from rhpl.log import log
@@ -872,10 +873,12 @@ class KickstartBase(BaseInstallClass):
def defineVolumeGroup(self, id, args):
- (args, extra) = isys.getopt(args, '', ['noformat','useexisting'])
+ (args, extra) = isys.getopt(args, '', ['noformat','useexisting',
+ 'pesize='])
preexist = 0
format = 1
+ pesize = 4096
vgname = extra[0]
@@ -884,6 +887,8 @@ class KickstartBase(BaseInstallClass):
if str == '--noformat' or str == '--useexisting':
preexist = 1
format = 0
+ elif str == "--pesize":
+ pesize = int(arg)
pvs = []
# get the unique ids of each of the physical volumes
@@ -895,6 +900,9 @@ class KickstartBase(BaseInstallClass):
if len(pvs) == 0 and not preexist:
raise ValueError, "Volume group defined without any physical volumes"
+ if pesize not in lvm.getPossiblePhysicalExtents(floor=1024):
+ raise ValueError, "Volume group specified invalid pesize: %d" %(pesize,)
+
# get a sort of hackish id
uniqueID = self.ksID
self.ksVGMapping[extra[0]] = uniqueID
@@ -903,7 +911,8 @@ class KickstartBase(BaseInstallClass):
request = partRequests.VolumeGroupRequestSpec(vgname = vgname,
physvols = pvs,
preexist = preexist,
- format = format)
+ format = format,
+ pesize = pesize)
request.uniqueID = uniqueID
self.addPartRequest(id.partitions, request)