735 |
|
|
736 |
def labelDevice(self, entry, chroot): |
def labelDevice(self, entry, chroot): |
737 |
file = entry.device.setupDevice(chroot) |
file = entry.device.setupDevice(chroot) |
738 |
label = labelFactory.createLabel("SWAP-%s" %entry.device.getDevice(), |
devName = entry.device.getDevice() |
739 |
self.maxLabelChars) |
# we'll keep the SWAP-* naming for all devs but Compaq SMART2 |
740 |
|
# nodes (#170500) |
741 |
|
if devName[0:6] == "cciss/": |
742 |
|
swapLabel = "SW-%s" % (devName) |
743 |
|
else: |
744 |
|
swapLabel = "SWAP-%s" % (devName) |
745 |
|
label = labelFactory.createLabel("%s" %swapLabel, self.maxLabelChars) |
746 |
rc = iutil.execWithRedirect ("/usr/sbin/mkswap", |
rc = iutil.execWithRedirect ("/usr/sbin/mkswap", |
747 |
[ "mkswap", '-v1', "-L", label, file ], |
[ "mkswap", '-v1', "-L", label, file ], |
748 |
stdout = "/dev/tty5", |
stdout = "/dev/tty5", |
831 |
def __init__(self): |
def __init__(self): |
832 |
FileSystemType.__init__(self) |
FileSystemType.__init__(self) |
833 |
self.partedFileSystemType = None |
self.partedFileSystemType = None |
834 |
|
self.partedPartitionFlags = [ parted.PARTITION_BOOT ] |
835 |
self.checked = 0 |
self.checked = 0 |
836 |
self.name = "PPC PReP Boot" |
self.name = "PPC PReP Boot" |
837 |
self.maxSizeMB = 10 |
self.maxSizeMB = 10 |
1187 |
|
|
1188 |
f.close() |
f.close() |
1189 |
|
|
1190 |
# return the "boot" devicce |
# return the "boot" device |
1191 |
def getBootDev(self): |
def getBootDev(self): |
1192 |
mntDict = {} |
mntDict = {} |
1193 |
bootDev = None |
bootDev = None |
1231 |
|
|
1232 |
if bootDev.getName() == "RAIDDevice": |
if bootDev.getName() == "RAIDDevice": |
1233 |
ret['boot'] = (bootDev.device, N_("RAID Device")) |
ret['boot'] = (bootDev.device, N_("RAID Device")) |
1234 |
|
ret['mbr'] = (bl.drivelist[0], N_("Master Boot Record (MBR)")) |
1235 |
return ret |
return ret |
1236 |
|
|
1237 |
if iutil.getPPCMacGen() == "NewWorld": |
if iutil.getPPCMacGen() == "NewWorld": |
1913 |
device) |
device) |
1914 |
entry = entry + " spare-disk %d\n" % (i,) |
entry = entry + " spare-disk %d\n" % (i,) |
1915 |
i = i + 1 |
i = i + 1 |
1916 |
if self.numDisks == 1: |
if self.numDisks == 1: |
1917 |
entry = entry + " device dev/null\n" |
entry = entry + " device dev/null\n" |
1918 |
entry = entry + " failed-disk 1\n" |
entry = entry + " failed-disk 1\n" |
1919 |
return entry |
return entry |
1930 |
PartitionDevice(device).setupDevice(chroot, |
PartitionDevice(device).setupDevice(chroot, |
1931 |
devPrefix=devPrefix) |
devPrefix=devPrefix) |
1932 |
|
|
1933 |
args = ["/usr/sbin/mdadm", "--create", "/dev/%s" %(self.device,), |
args = ["/usr/sbin/mdadm", "--create", "/dev/%s" %(self.device,), |
1934 |
"--run", "--chunk=%s" %(self.chunksize,), |
"--run", "--chunk=%s" %(self.chunksize,), |
1935 |
"--level=%s" %(self.level,), |
"--level=%s" %(self.level,), |
1936 |
] |
] |
1937 |
|
|
1938 |
if self.spares > 0: |
if self.spares > 0: |
1939 |
args.append("--spare-devices=%s" %(self.spares,),) |
args.append("--spare-devices=%s" %(self.spares,),) |
1940 |
|
|
1941 |
if self.numDisks == 1: |
if self.numDisks == 1 and self.level == 1: |
1942 |
args.append("--raid-devices=2") |
args.append("--raid-devices=2") |
1943 |
else: |
else: |
1944 |
args.append("--raid-devices=%s" %(self.numDisks,),) |
args.append("--raid-devices=%s" %(self.numDisks,),) |
1945 |
|
|
1946 |
args.extend(map(devify, self.members)) |
args.extend(map(devify, self.members)) |
1947 |
|
|
1948 |
if self.numDisks == 1: |
if self.numDisks == 1 and self.level == 1: |
1949 |
args.append("missing") |
args.append("missing") |
1950 |
|
|
1951 |
log("going to run: %s" %(args,)) |
log("going to run: %s" %(args,)) |