Hi, Attached are three patches that I made to get Fedora-devel to install on a bios sata raid-0 system (Sil 3112 on Abit AN7). It uses Heinz Mauelshagen's dmraid for detecting the disks. The first patch is against Anaconda. It removes the raid disks from the isys disklist and replaces them with the mapper device. The patch requires the full (not enable-mini) dmraid binary in the stage 2 image. I tested the patched Anaconda in install, upgrade and rescue mode (text and gui) and had no problems on my system. The second patch is against mkinitrd. It adds /sbin/dmraid.static to the initrd if necessary and updates the initscript. The /sbin/dmraid.static binary is not yet a part of the current dmraid rpm, so you need to provide your own. The third patch is against rc.sysinit so that dmraid.static is run at boot. Again, you need the full dmraid binary under /sbin/dmraid.static (not enable-mini) because the rc.sysinit script uses the testmode first before enabling the mapper devices. I now have a Fedora-devel system booting from my two raid-0 disks. Unfortunately, there is no bootloader for /dev/mapper devices. There is a patch against lilo to make it work on devmapper devices here (http://www.saout.de/misc/) and Eric Agsjö has a patch to make it work with raid-1 devices here (https://www.redhat.com/archives/ataraid-list/2004-October/msg00007.html). I am still using lilo under FC1 (using the medley.o module) and that works for me. I hope someone finds these patches useful; it would be very nice if FC4 would install on and boot from these bios ide raid devices without too much hacking. Kind regards, Mark Wormgoor -- *************************************************************** * |\ /| | /| / Mark Wormgoor * * | \ / | | / | / mailto:mark@xxxxxxxxxxxx * * | \/ |ark |/ |/ormgoor http://www.wormgoor.com/mark/ * ***************************************************************
diff -ruN mnt/usr/lib/anaconda/dmraid.py new/usr/lib/anaconda/dmraid.py --- mnt/usr/lib/anaconda/dmraid.py 1970-01-01 01:00:00.000000000 +0100 +++ new/usr/lib/anaconda/dmraid.py 2004-10-11 13:53:18.000000000 +0200 @@ -0,0 +1,80 @@ +# dmraid.py - dmraid probing +# +# Mark Wormgoor <mark@xxxxxxxxxxxx> +# +# Copyright 2004 Mark Wormgoor +# +# This software may be freely redistributed under the terms of the GNU +# general public license. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +import iutil +import os +import re + +from constants import * + +output = "/tmp/dmraidout" + +dmraidDevicePresent = 0 + +def has_dmraid(): + global dmraidDevicePresent + + if not (os.access("/usr/sbin/dmraid", os.X_OK) or + os.access("/sbin/dmraid", os.X_OK)): + return + + rc = iutil.execWithRedirect("dmraid", + ["dmraid", "-ay"], + stdout = output, + stderr = output, + searchPath = 1) + if rc: + dmraidDevicePresent = 0 + else: + dmraidDevicePresent = 1 + + return dmraidDevicePresent +# now check to see if dmraid is available +has_dmraid() + + +def disklist(): + global dmraidDevicePresent + if dmraidDevicePresent == 0: + return [] + + disks = [] + args = ["dmraid", "-vay"] + dmraidscanout = iutil.execWithCapture(args[0], args, searchPath = 1, + stderr = "/dev/tty6") + for line in dmraidscanout.split("\n"): + try: + found = re.match("INFO: added /dev/(\S+) to RAID set \"(\S+)\"", line) + disks.append (found.group(1)) + except: + pass + + return disks + +def setlist(): + global dmraidDevicePresent + if dmraidDevicePresent == 0: + return [] + + sets = [] + args = ["dmraid", "-vay"] + dmraidscanout = iutil.execWithCapture(args[0], args, searchPath = 1, + stderr = "/dev/tty6") + for line in dmraidscanout.split("\n"): + try: + found = re.match("INFO: added /dev/(\S+) to RAID set \"(\S+)\"", line) + sets.append (found.group(2)) + except: + pass + + return sets diff -ruN mnt/usr/lib/anaconda/isys.py new/usr/lib/anaconda/isys.py --- mnt/usr/lib/anaconda/isys.py 1970-01-01 01:00:00.000000000 +0100 +++ new/usr/lib/anaconda/isys.py 2004-10-10 21:06:58.000000000 +0200 @@ -20,6 +20,7 @@ import os import os.path import posix +import dmraid import sys import kudzu @@ -288,6 +289,20 @@ dict = driveDict("disk") + # first, figure out the dmraid devices + if dmraid.has_dmraid(): + disks = dmraid.disklist() + if len(disks) > 0: + for disk in disks: + try: + del dict[disk] + except: + pass + sets = dmraid.setlist() + if len (sets) > 0: + for set in sets: + dict["mapper/" + set] = "DMRAID" + # this is kind of ugly, but it's much easier to do this from python for (dev, descr) in dict.items(): # the only raid devs like this are ide, so only worry about them @@ -391,14 +406,28 @@ def makeDevInode(name, fn=None): if fn: - _isys.mkdevinode(name, fn) - return fn + if name[:7] == "mapper/": + try: + os.makedirs(os.path.dirname(fn)) + except: + pass + os.symlink("/dev/" + name, fn) + else: + _isys.mkdevinode(name, fn) + return fn path = '/dev/%s' % (name,) try: os.stat(path) except OSError: path = '/tmp/%s' % (name,) - _isys.mkdevinode(name, path) + if name[:7] == "mapper/": + try: + os.makedirs(os.path.dirname(path)) + except: + pass + os.symlink("/dev/" + name, path) + else: + _isys.mkdevinode(name, path) return path def makedev(major, minor): @@ -674,9 +703,12 @@ os.unlink("/tmp/cdrom") def driveIsRemovable(device): + # DMRaid is always non-removable # assume ide if starts with 'hd', and we don't have to create # device beforehand since it just reads /proc/ide - if device[:2] == "hd": + if device[:7] == "mapper/": + rc = 0 + elif device[:2] == "hd": rc = (_isys.isIdeRemovable("/dev/"+device) == 1) else: makeDevInode(device, "/tmp/disk") diff -ruN mnt/usr/lib/anaconda/mknod-stub new/usr/lib/anaconda/mknod-stub --- mnt/usr/lib/anaconda/mknod-stub 1970-01-01 01:00:00.000000000 +0100 +++ new/usr/lib/anaconda/mknod-stub 2004-10-10 21:06:58.000000000 +0200 @@ -25,8 +25,9 @@ # inode while (drive.find('/') != -1): if (drive.startswith("cciss") or drive.startswith("ida") or - drive.startswith("rd") or drive.startswith("ataraid") - or drive.startswith("iseries") or drive.startswith("i2o")): + drive.startswith("rd") or drive.startswith("ataraid") or + drive.startswith("mapper") or drive.startswith("iseries") or + drive.startswith("i2o")): break drive = drive[drive.find('/') + 1:] isys.makeDevInode(drive, path) diff -ruN mnt/usr/lib/anaconda/partedUtils.py new/usr/lib/anaconda/partedUtils.py --- mnt/usr/lib/anaconda/partedUtils.py 1970-01-01 01:00:00.000000000 +0100 +++ new/usr/lib/anaconda/partedUtils.py 2004-10-10 21:06:58.000000000 +0200 @@ -117,6 +117,9 @@ or partition.geom.dev.type == parted.DEVICE_CPQARRAY): return "%sp%d" % (partition.geom.dev.path[5:], partition.num) + elif partition.geom.dev.path[5:12] == "mapper/": + return "%s_p%d" % (partition.geom.dev.path[5:], + partition.num) return "%s%d" % (partition.geom.dev.path[5:], partition.num) diff -ruN mnt/usr/lib/anaconda/raid.py new/usr/lib/anaconda/raid.py --- mnt/usr/lib/anaconda/raid.py 1970-01-01 01:00:00.000000000 +0100 +++ new/usr/lib/anaconda/raid.py 2004-10-10 21:06:58.000000000 +0200 @@ -38,6 +38,9 @@ raidDevices = {} for d in drives: + # Assume dmraid is not part of a md raidset + if d[:7] == "mapper/": + continue parts = [] isys.makeDevInode(d, "/tmp/" + d) try:
--- mkinitrd 2004-10-01 00:11:59.000000000 +0200 +++ mkinitrd.new 2004-10-13 19:10:55.000000000 +0200 @@ -726,6 +726,17 @@ fi fi +if [ -x /sbin/dmraid.static -a -x /sbin/dmsetup -a -e /dev/mapper/control ]; then + dmout=$(/sbin/dmsetup ls 2>/dev/null) + if [ "$dmout" != "No devices found" -a "$dmout" != "" ]; then + inst /sbin/dmraid.static $MNTIMAGE/sbin/dmraid + echo "echo Making device-mapper control node" >> $RCFILE + echo "mkdmnod" >> $RCFILE + echo "echo Running dmraid to activate raid" >> $RCFILE + echo "/sbin/dmraid -ay" >> $RCFILE + fi +fi + echo "echo Creating root device" >> $RCFILE echo "mkrootdev /dev/root" >> $RCFILE rootdev=/dev/root
493a494,506 > # DMRAID initialization > if [ -x /sbin/dmraid.static ]; then > if ! LC_ALL=C fgrep -q "device-mapper" /proc/devices 2>/dev/null ; then > modprobe dm-mod >/dev/null 2>&1 > fi > echo "mkdmnod" | /sbin/nash --quiet >/dev/null 2>&1 > [ -n "$SELINUX" ] && restorecon /dev/mapper/control >/dev/null 2>&1 > if [ -c /dev/mapper/control -a -x /sbin/dmraid.static ]; then > if /sbin/dmraid.static -tay > /dev/null 2>&1 ; then > action $"Setting up DMRAID:" /sbin/dmraid.static -ay > fi > fi > fi