Subject: port-macppc/30465: NetBSD/macppc install kernel does not support RAIDframe devices
To: None <port-macppc-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Ian Spray <macppc@minimal.cx>
List: netbsd-bugs
Date: 06/08/2005 12:30:00
>Number:         30465
>Category:       port-macppc
>Synopsis:       Install kernel does not support RAIDframe devices
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 08 12:30:00 +0000 2005
>Originator:     Ian Spray
>Release:        NetBSD 3.0_BETA (2005-06-02 checkout)
>Organization:
>Environment:
System: NetBSD blue.minimal.cx 3.0_BETA NetBSD 3.0_BETA (BLUE) #3: Fri Jun 3 19:33:53 UTC 2005 root@blue.minimal.cx:/usr/src/sys/arch/macppc/compile/BLUE macppc
Architecture: powerpc
Machine: macppc
>Description:
There is no way to create a RAIDframe disk mirror without first installing NetBSD, creating the RAID component on the second device, moving the data from the first, rebooting and creating the second device.
Adding RAIDframe support to the install kernel would allow the system to be installed directly onto a RAID system, with no kernel rebuilds as long as GENERIC supports RAIDframe.
>How-To-Repeat:
Boot to the install shell, and try to mount an existing RAID partition, eg: mount /dev/raid0a /mnt
>Fix:
Patch the src/distrib/macppc/floppies/ramdisk/Makefile and src/distrib/macppc/floppies/ramdisk/list to create RAIDframe device nodes and add sbin/raidctl and libc to the installation ramdisk.
Also add RAIDframe directives to the sys/arch/macppc/conf/INSTALL kernel file, as shown below.  After these changes there is still 197KB free space remaining in the ramdisk.
This setup has been tested on a G3 B&W 350, and has been booted into the install kernel, raidctl -v -s raid0 correctly reported my mirror setup, fsck -y /dev/raid0a ran without any issues, and a 200MB dd from /dev/zero to a file on /dev/raid0g performed as expected in terms of speed.

# cvs diff -u
cvs server: Diffing .
Index: Makefile
===================================================================
RCS file: /cvsroot/src/distrib/macppc/floppies/ramdisk/Makefile,v
retrieving revision 1.31
diff -u -r1.31 Makefile
--- Makefile    18 Jan 2005 12:38:45 -0000      1.31
+++ Makefile    8 Jun 2005 10:56:14 -0000
@@ -15,7 +15,7 @@
 LISTS=         ${.CURDIR}/list ${DISTRIBDIR}/common/list.sysinst
 MTREECONF=     ${DISTRIBDIR}/common/mtree.common
 IMAGEENDIAN=   be
-MAKEDEVTARGETS=        floppy
+MAKEDEVTARGETS=        floppy raid0 raid1 raid2 raid3 raid4 raid5 raid6 raid7
 IMAGEDEPENDS=  ${CRUNCHBIN} \
                dot.profile termcap.src \
                ${DESTDIR}/usr/mdec/ofwboot ${DESTDIR}/usr/mdec/bootxx \

Index: list
===================================================================
RCS file: /cvsroot/src/distrib/macppc/floppies/ramdisk/list,v
retrieving revision 1.25
diff -u -r1.25 list
--- list        18 Jan 2005 12:38:45 -0000      1.25
+++ list        8 Jun 2005 10:56:14 -0000
@@ -45,6 +45,7 @@
 PROG   sbin/shutdown
 PROG   sbin/swapctl
 PROG   sbin/umount
+PROG   sbin/raidctl

 PROG   usr/bin/ftp
 PROG   usr/bin/gzip    usr/bin/gzcat   usr/bin/gunzip
@@ -69,7 +70,7 @@
 SPECIAL        route           srcdir  distrib/utils/x_route
 SPECIAL        umount          srcdir  distrib/utils/x_umount

-LIBS   libhack.o -ledit -lutil -lcurses -ltermcap -lrmt -ll -lm -lz
+LIBS   libhack.o -ledit -lutil -lcurses -ltermcap -lrmt -ll -lm -lz -lc

 COPY   ${DESTDIR}/usr/mdec/bootxx      usr/mdec/bootxx
 COPY   ${DESTDIR}/usr/mdec/mbr         usr/mdec/mbr

Index: INSTALL
===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/conf/INSTALL,v
retrieving revision 1.87.4.1
diff -u -r1.87.4.1 INSTALL
--- INSTALL     1 Jun 2005 17:19:44 -0000       1.87.4.1
+++ INSTALL     8 Jun 2005 10:57:10 -0000
@@ -188,5 +188,8 @@
 pseudo-device  loop                    # network loopback
 pseudo-device  pty             2       # pseudo-terminals (Sysinst needs two)

+pseudo-device  raid            8
+options                RAID_AUTOCONFIG
+
 pseudo-device  rnd                     # /dev/random and in-kernel generator
 pseudo-device  wsmux                   # mouse and keyboard multiplexor