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 |
1448 |
formatted = [] |
formatted = [] |
1449 |
notformatted = [] |
notformatted = [] |
1450 |
for entry in self.entries: |
for entry in self.entries: |
1451 |
|
if (entry.mountpoint != '/boot'): |
1452 |
|
continue |
1453 |
|
if (not entry.fsystem.isFormattable() or not entry.getFormat() |
1454 |
|
or entry.isMounted()): |
1455 |
|
notformatted.append(entry) |
1456 |
|
continue |
1457 |
|
try: |
1458 |
|
self.formatEntry(entry, chroot) |
1459 |
|
formatted.append(entry) |
1460 |
|
except SystemError: |
1461 |
|
if self.messageWindow: |
1462 |
|
self.messageWindow(_("Error"), |
1463 |
|
_("An error occurred trying to " |
1464 |
|
"format %s. This problem is " |
1465 |
|
"serious, and the install cannot " |
1466 |
|
"continue.\n\n" |
1467 |
|
"Press <Enter> to reboot your system.") |
1468 |
|
% (entry.device.getDevice(),)) |
1469 |
|
sys.exit(0) |
1470 |
|
|
1471 |
|
for entry in self.entries: |
1472 |
|
if (entry.mountpoint == '/boot'): |
1473 |
|
continue |
1474 |
if (not entry.fsystem.isFormattable() or not entry.getFormat() |
if (not entry.fsystem.isFormattable() or not entry.getFormat() |
1475 |
or entry.isMounted()): |
or entry.isMounted()): |
1476 |
notformatted.append(entry) |
notformatted.append(entry) |
1936 |
device) |
device) |
1937 |
entry = entry + " spare-disk %d\n" % (i,) |
entry = entry + " spare-disk %d\n" % (i,) |
1938 |
i = i + 1 |
i = i + 1 |
1939 |
if self.numDisks == 1: |
if self.numDisks == 1: |
1940 |
entry = entry + " device dev/null\n" |
entry = entry + " device dev/null\n" |
1941 |
entry = entry + " failed-disk 1\n" |
entry = entry + " failed-disk 1\n" |
1942 |
return entry |
return entry |
1953 |
PartitionDevice(device).setupDevice(chroot, |
PartitionDevice(device).setupDevice(chroot, |
1954 |
devPrefix=devPrefix) |
devPrefix=devPrefix) |
1955 |
|
|
1956 |
args = ["/usr/sbin/mdadm", "--create", "/dev/%s" %(self.device,), |
args = ["/usr/sbin/mdadm", "--create", "/dev/%s" %(self.device,), |
1957 |
"--run", "--chunk=%s" %(self.chunksize,), |
"--run", "--chunk=%s" %(self.chunksize,), |
1958 |
"--level=%s" %(self.level,), |
"--level=%s" %(self.level,), |
1959 |
] |
] |
1960 |
|
|
1961 |
if self.spares > 0: |
if self.spares > 0: |
1962 |
args.append("--spare-devices=%s" %(self.spares,),) |
args.append("--spare-devices=%s" %(self.spares,),) |
1963 |
|
|
1964 |
if self.numDisks == 1: |
if self.numDisks == 1 and self.level == 1: |
1965 |
args.append("--raid-devices=2") |
args.append("--raid-devices=2") |
1966 |
else: |
else: |
1967 |
args.append("--raid-devices=%s" %(self.numDisks,),) |
args.append("--raid-devices=%s" %(self.numDisks,),) |
1968 |
|
|
1969 |
args.extend(map(devify, self.members)) |
args.extend(map(devify, self.members)) |
1970 |
|
|
1971 |
if self.numDisks == 1: |
if self.numDisks == 1 and self.level == 1: |
1972 |
args.append("missing") |
args.append("missing") |
1973 |
|
|
1974 |
log("going to run: %s" %(args,)) |
log("going to run: %s" %(args,)) |