--- fsset.py | 3 ++- loader2/loader.c | 2 +- partRequests.py | 4 +++- raid.py | 20 +++++++++++++++----- scripts/mk-images | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/fsset.py b/fsset.py index c0c2df6..f39e7fb 100644 --- a/fsset.py +++ b/fsset.py @@ -2453,7 +2453,8 @@ class RAIDDevice(Device): 1: "raid1", 4: "raid5", 5: "raid5", - 6: "raid6" } + 6: "raid6", + 10: "raid10" } # If we can't find the device for some reason, revert to old behavior. try: diff --git a/loader2/loader.c b/loader2/loader.c index 0e7b88a..c9de64d 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -1697,7 +1697,7 @@ int main(int argc, char ** argv) { else if (FL_UPDATES(flags)) loadUpdates(&loaderData); - mlLoadModuleSet("md:raid0:raid1:raid5:raid6:raid456:dm-raid45:fat:msdos:jbd2:crc16:ext4dev:jbd:ext3:lock_nolock:gfs2:reiserfs:jfs:xfs:dm-mod:dm-zero:dm-mirror:dm-snapshot:dm-multipath:dm-round-robin:dm-emc:dm-crypt:dm-mem-cache:dm-region_hash:dm-message:aes_generic:sha256", modLoaded, modDeps, modInfo); + mlLoadModuleSet("md:raid0:raid1:raid10:raid5:raid6:raid456:dm-raid45:fat:msdos:jbd2:crc16:ext4dev:jbd:ext3:lock_nolock:gfs2:reiserfs:jfs:xfs:dm-mod:dm-zero:dm-mirror:dm-snapshot:dm-multipath:dm-round-robin:dm-emc:dm-crypt:dm-mem-cache:dm-region_hash:dm-message:aes_generic:sha256", modLoaded, modDeps, modInfo); usbInitializeMouse(modLoaded, modDeps, modInfo); diff --git a/partRequests.py b/partRequests.py index 5c1b934..bf7a4eb 100644 --- a/partRequests.py +++ b/partRequests.py @@ -651,7 +651,7 @@ class RaidRequestSpec(RequestSpec): for member in self.raidmembers: request = partitions.getRequestByID(member) raidmems.append(request.getDevice(partitions)) - self.dev = fsset.RAIDDevice(int(self.raidlevel[-1:]), + self.dev = fsset.RAIDDevice(int(self.raidlevel[4:]), raidmems, minor = self.raidminor, spares = self.raidspares, existing = self.preexist, @@ -698,6 +698,8 @@ class RaidRequestSpec(RequestSpec): return (nummembers-1) * smallest elif raid.isRaid6(self.raidlevel): return (nummembers-2) * smallest + elif raid.isRaid10(self.raidlevel): + return (nummembers/2) * smallest else: raise ValueError, "Invalid raidlevel in RaidRequest.getActualSize" diff --git a/raid.py b/raid.py index cbe78a0..28829ed 100644 --- a/raid.py +++ b/raid.py @@ -25,10 +25,12 @@ def getRaidLevels(): for l in f.readlines(): if not l.startswith("Personalities"): continue - for tok in l.split(): - for lev in ("RAID0", "RAID1", "RAID5", "RAID6"): - if tok.upper().find(lev) != -1: - avail.append(lev) + + lst = l.split() + + for lev in ["RAID0", "RAID1", "RAID5", "RAID6", "RAID10"]: + if "[" + lev + "]" in lst or "[" + lev.lower() + "]" in lst: + avail.append(lev) f.close() @@ -148,6 +150,12 @@ def stopAllRaid(mdList): for dev, devices, level, numActive in mdList: isys.raidstop(dev) +def isRaid10(raidlevel): + """Return whether raidlevel is a valid descriptor of RAID10.""" + if raidlevel in ("RAID10", "10", 10): + return True + return False + def isRaid6(raidlevel): """Return whether raidlevel is a valid descriptor of RAID6.""" if raidlevel in ("RAID6", "6", 6): @@ -182,6 +190,8 @@ def get_raid_min_members(raidlevel): return 3 elif isRaid6(raidlevel): return 4 + elif isRaid10(raidlevel): + return 2 else: raise ValueError, "invalid raidlevel in get_raid_min_members" @@ -189,7 +199,7 @@ def get_raid_max_spares(raidlevel, nummembers): """Return the maximum number of raid spares for raidlevel.""" if isRaid0(raidlevel): return 0 - elif isRaid1(raidlevel) or isRaid5(raidlevel) or isRaid6(raidlevel): + elif isRaid1(raidlevel) or isRaid5(raidlevel) or isRaid6(raidlevel) or isRaid10(raidlevel): return max(0, nummembers - get_raid_min_members(raidlevel)) else: raise ValueError, "invalid raidlevel in get_raid_max_spares" diff --git a/scripts/mk-images b/scripts/mk-images index e6665e0..c5a9afc 100755 --- a/scripts/mk-images +++ b/scripts/mk-images @@ -44,7 +44,7 @@ IDEMODS="ide-cd ide-cs" SCSIMODS="sr_mod sg st sd_mod scsi_mod iscsi_tcp iscsi_ibft" FSMODS="fat msdos vfat ext3 ext4dev reiserfs jfs xfs gfs2 lock_nolock" LVMMODS="dm-mod dm-zero dm-snapshot dm-mirror dm-multipath dm-round-robin dm-emc dm-crypt" -RAIDMODS="md raid0 raid1 raid5 raid6 raid456 dm-raid45 dm-mem-cache dm-region_hash dm-message" +RAIDMODS="md raid0 raid1 raid10 raid5 raid6 raid456 dm-raid45 dm-mem-cache dm-region_hash dm-message" SECSTAGE="$RAIDMODS $LVMMODS $FSMODS $IDEMODS $SCSIMODS" BTERMMODS="vga16fb" CRYPTOMODS="sha256 aes_generic" -- 1.6.0.6 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list