summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-09-09 23:26:15 +0000
committerErik Troan <ewt@redhat.com>1999-09-09 23:26:15 +0000
commitece6be7649e3bda60f8bb62fc8dfdb55e41a14ee (patch)
tree96d84fc8cb95a394d7ea69d86f6e9699c6e13c08
parentdfb608910aac4778e8194425a3c51eed792e0442 (diff)
downloadanaconda-ece6be7649e3bda60f8bb62fc8dfdb55e41a14ee.tar.gz
anaconda-ece6be7649e3bda60f8bb62fc8dfdb55e41a14ee.tar.xz
anaconda-ece6be7649e3bda60f8bb62fc8dfdb55e41a14ee.zip
added software raid support
unfortunately, it's not not tested
-rw-r--r--isys/devnodes.c3
-rw-r--r--iw/rootpartition.py9
-rw-r--r--todo.py32
3 files changed, 42 insertions, 2 deletions
diff --git a/isys/devnodes.c b/isys/devnodes.c
index cd6fab4bb..bb98e609c 100644
--- a/isys/devnodes.c
+++ b/isys/devnodes.c
@@ -54,6 +54,9 @@ int devMakeInode(char * devName, char * path) {
minor += 10 + (devName[4] - '0');
else if (devName[3])
minor += (devName[3] - '0');
+ } else if (devName[0] == 'm' && devName[1] == 'd') {
+ major = 9;
+ minor = atoi(devName + 2);
} else if (devName[0] == 'h' && devName[1] == 'd') {
type = S_IFBLK;
if (devName[2] == 'a')
diff --git a/iw/rootpartition.py b/iw/rootpartition.py
index 83f35a18c..5330986c9 100644
--- a/iw/rootpartition.py
+++ b/iw/rootpartition.py
@@ -46,6 +46,15 @@ class PartitionWindow (InstallWindow):
for (partition, mount, fsystem, size) in fstab:
self.todo.addMount(partition, mount, fsystem)
+ (drives, raid) = self.todo.ddruid.partitionList()
+ print "drives", drives
+ print "raid", raid
+
+ for (mount, device, other) in raid:
+ self.todo.addMount("/dev/" + device, mount, "ext2")
+
+ print "self.todo.mounts", self.todo.mounts
+
return None
def enableCallback (self, value):
diff --git a/todo.py b/todo.py
index 671286229..a9560b440 100644
--- a/todo.py
+++ b/todo.py
@@ -390,7 +390,7 @@ class ToDo:
self.liloImages = images
def getLiloImages(self):
- drives = self.ddruid.partitionList()
+ (drives, raid) = self.ddruid.partitionList()
# rearrange the fstab so it's indexed by device
mountsByDev = {}
@@ -403,7 +403,7 @@ class ToDo:
oldImages[dev] = self.liloImages[dev]
self.liloImages = {}
- for (dev, type) in drives:
+ for (dev, devName, type) in drives:
# ext2 partitions get listed if
# 1) they're /
# 2) they're not mounted
@@ -441,7 +441,35 @@ class ToDo:
def makeFilesystems(self, createSwap = 1, createFs = 1):
if (not self.setupFilesystems): return
+
+ # let's make the RAID devices first -- the fstab will then proceed
+ # naturally
+ (devices, raid) = self.ddruid.partitionList()
+ if raid:
+ rt = open("/tmp/raidtab", "w")
+ for (mntpoint, device, makeup) in raid:
+ rt.write("raiddev /dev/%s\n" % (device,))
+ rt.write("raid-level 1\n")
+ rt.write("nr-raid-disks %d\n" % (len(makeup),))
+ rt.write("chunk-size 64k\n" % (len(makeup),))
+ rt.write("persistent-superblock 1\n");
+ rt.write("#nr-spare-disks 0\n")
+ i = 0
+ for subDev in makeup:
+ rt.write(" device /dev/%s\n" % (subDev,))
+ rt.write(" raid-disk %d\n" % (i,))
+ i = i + 1
+
+ rt.write("\n")
+ rt.close()
+
+ for (mntpoint, device, makeup) in raid:
+ iutil.execWithRedirect ("/usr/sbin/mkraid",
+ [ 'mkraid', '/dev/' + device ])
+ iutil.execWithRedirect ("/usr/sbin/raidstart",
+ [ 'raidstart', '-a' ])
+
keys = self.mounts.keys ()
keys.sort()
for mntpoint in keys: