# Onboard RAID + linux-2.6.22-gentoo-r8 + Manual Configuration

## yoless

Hi,

I am trying to get the Onboard RAID of a P5N32-E SLI Motherboard(it has a MediaShield RAID chip from NVIDIA) working without the need to use "genkernel". I looked at http://gentoo-wiki.com/HOWTO_Gentoo_Install_on_Bios_%28Onboard%29_RAID to get it working at installation and now I want to use without genkernel usage. So I looked at http://gentoo-wiki.com/HOWTO_Install_Gentoo_with_NVRAID_using_dmraid, because it has a Section about not using genkernel, and configured and compiled the kernel.

I got the two scripts ("dmraidinitrd" and "linuxrc") from the GoogleCache, checked and corrected the Links of BusyBox, DeviceMapper and DmRaid. But when i want to run "./dmraidinitrd linuxrc initrd" it complains that Busybox failed to compile: 

```
Making busybox...

Making device-mapper lib...

  Making fake install in /tmp/initrd/opt/device-mapper...

Making dmraid...

Creating initrd image...

2048+0 records in

2048+0 records out

2097152 bytes (2.1 MB) copied, 0.00991769 s, 211 MB/s

cp: cannot stat `/tmp/initrd/busybox-0.60.5/busybox': No such file or directory

Cleaning up...

Fatal error: did busybox fail to compile?

```

So I tried to compile BusyBox manually( I simply carried out all the actions in the "dmraidinitrd"-script under "make_busybox()" manually) which should create an directory named "busybox"(at least the scripts tries to copy this directory to somewhere else) after running "make DOSTATIC=true > /dev/null 2>&1 " When i run  "make DOSTATIC=true " it gives me following errors: 

```

...some Output, but nothing looking important

gcc -Wall -Wshadow -Os -march=i386 -mpreferred-stack-boundary=2 -falign-functions=1 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer -D_GNU_SOURCE  -DBB_VER='"0.60.5"' -DBB_BT='"2007.09.28-13:45+0000"' -DUSE_SYSTEM_PWD_GRP  -Ilibbb -c libbb/syscalls.c -o libbb/syscalls.o

libbb/syscalls.c:43: error: expected declaration specifiers or '...' before 'sysfs'

libbb/syscalls.c:43: error: expected declaration specifiers or '...' before 'option'

libbb/syscalls.c:43: error: expected declaration specifiers or '...' before 'fs_index'

libbb/syscalls.c:43: error: expected declaration specifiers or '...' before 'buf'

libbb/syscalls.c:43: warning: data definition has no type or storage class

libbb/syscalls.c:43: warning: type defaults to 'int' in declaration of '_syscall3'

libbb/syscalls.c:68: error: expected declaration specifiers or '...' before 'pivot_root'

libbb/syscalls.c:68: error: expected declaration specifiers or '...' before 'new_root'

libbb/syscalls.c:68: error: expected declaration specifiers or '...' before 'put_old'

libbb/syscalls.c:68: warning: data definition has no type or storage class

libbb/syscalls.c:68: warning: type defaults to 'int' in declaration of '_syscall2'

make: *** [libbb/syscalls.o] Error 1

```

So, I am asking for help to resolve this error and to create a initramfs that will work with my system/kernel.

If any further information is needed, please tell me.

Thanks in advance

yoless

----------

## Pr0xXx

Hello yoless,

i tryed the same on my system [MSI K8N Diamond Plus | nvidia raid controller]. I used the same howto and copied the script from http://gentoo-wiki.com/HOWTO_Install_Gentoo_with_NVRAID_using_dmraid/dmraidinitrd.

You could edit the lines 

```

DEVICEMAPPER_URI_PREFIX="ftp://sources.redhat.com/pub/dm/old/" and

DMRAID_URI_PREFIX="http://people.redhat.com/~heinzm/sw/dmraid/src/old/"

```

or you use the newer version dmraid-1.0.0-rc14 and device-mapper-1.02.22. I tried the newer versions of dmraid and devicemapper. 

I got the same linuxrc by using the google cache but my kernel says the following.

 *Quote:*   

> failed to execute linuxrc
> 
> Kernel Panic - not syncing: No init found. Try passing init= option to kernel.
> 
> 

 

Maybe you try it on your system.

----------

## yoless

Hi Pr0xXx!

I tryied the new versions, but I think is that busybox isn't compiling, maybe newer versions of busyboc will work. But what version should I take? Is there somewhere a compatibility break?

I got the following linuxrc (also somewhere from googlecache):

```
#!/bin/sh

# Gerte Hoogewerf <gerte at nieuwenborg.nl>

# Released under the GNU General Public License version 2

# http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/

QUIET=1

REAL_ROOT=''

PATH=/usr/sbin:/usr/bin:/sbin:/bin

BACK_UP="\033[1K\033[0G"

NORMAL="\033[0m"

WARN="\033[33;1m"

BAD="\033[31;1m"

BOLD="\033[1m"

GOOD="\033[32;1m"

USE_DEVFS_NORMAL=0

#Devfs is deprecated, but supported, not tested very well, but most likely it will work.

if [ "$$" != '1' ]

then

   echo '/linuxrc has to be run as the init process as the one'

   echo 'with a PID of 1. Try adding init="/linuxrc" to the'

   echo 'kernel command line or running "exec /linuxrc".'

   exit 1

fi

parse_opt() {

   case "$1" in

      *\=*)

         echo "$1" | cut -f2 -d=

      ;;

   esac

}

echo -e "${GOOD}>>${NORMAL}${BOLD} Mounting filesystems...${NORMAL}"

mount -o remount,rw /

mount -t proc proc /proc

mkdir /sys

mount -t sysfs sysfs /sys

[ -n "$QUIET" ] && echo '0' > /proc/sys/kernel/printk

CMDLINE=`cat /proc/cmdline`

# Scan CMDLINE for any specified real_root etc.

for x in ${CMDLINE}

do

   case "${x}" in

      real_root\=*)

         REAL_ROOT=`parse_opt "${x}"`

      ;;

      devfs)

         USE_DEVFS_NORMAL=1

      ;;

      nodevfs)

         USE_DEVFS_NORMAL=0

      ;;

      real_init\=*)

         REAL_INIT=`parse_opt "${x}"`

      ;;

      *)

      ;;

   esac

done

echo -e "${GOOD}>>${NORMAL}${BOLD} Preparing environment for dmraid...${NORMAL}"

if [ "${USE_DEVFS_NORMAL}" -eq '1' ]

then

   [ ! -e /dev/.devfsd ] && mount -t devfs devfs /dev

   devfsd /dev -np

   #HACK: dmraid doesn't scan for names used in devfs

   #this is not very flexible, but works for me

   (cd /dev; \

   ln -s scsi/host0/bus0/target0/lun0/disc sda; \

   ln -s scsi/host1/bus0/target0/lun0/disc sdb)

else

   MAJOR=$(sed -n 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices)

   MINOR=$(sed -n "s/^ *\([0-9]\+\) \+device-mapper\$/\1/p" /proc/misc)

   if test -z "$MAJOR" -o -z "$MINOR"

   then

      echo -e "${BAD}>>${NORMAL} device-mapper kernel module not loaded: can't create /dev/mapper/control."

      exit 1

   fi

   mkdir -p /dev/mapper

   test -e /dev/mapper/control && rm -f /dev/mapper/control

   echo -e "${GOOD}>>${NORMAL}${BOLD} Creating /dev/mapper/control character device with major:$MAJOR minor:$MINOR...${NORMAL}"

   mknod /dev/mapper/control c $MAJOR $MINOR

   #workaround: dmraid should not probe cdroms, but it does.

   #we'll remove al cdrom device nodes till dmraid does this check by itselve

   for y in hda hdb hdc hdd hde hdf hdg hdh sr0 sr1 sr2 sr3;

   do 

      if (grep -q "$y" /proc/sys/dev/cdrom/info)

      then

         rm -f /dev/"$y"

      fi

   done

fi

##Fixme: can this be done otherwise?

#cat /proc/mounts>/etc/mtab

#Yes, just by commenting it out :) It was a dmraid bug.

echo -e "${GOOD}>>${NORMAL}${BOLD} Calling dmraid...${NORMAL}"

#Fixme: dmraid reports results even if there is nothing to be happy about

#Should this check be done otherwise?

if (/sbin/dmraid -ay)

then

   echo -e "${GOOD}>>${NORMAL} dmraid was run successfully"

else

   echo -e "${BAD}>>${NORMAL} dmraid failed"

   #What to do now? I don't care, we'll deal with this problem later.

fi

echo -e "${GOOD}>>${NORMAL}${BOLD} Determining root device...${NORMAL}"

mkdir /newroot

while true

do

   while [ "${got_good_root}" != '1' ]

   do

      if [ "${REAL_ROOT}" = 'shell' ]

      then

         /bin/ash

         REAL_ROOT=''

         got_good_root=0

         continue

      elif [ "${REAL_ROOT}" = '' ]

      then

      # No REAL_ROOT determined/specified. Prompt user for root block device.

         echo -e "${BAD}>>${NORMAL} The root block device is unspecified or not detected"

         echo -e "${BAD}>>${NORMAL} Specify real_root=<root_blockdevice> on the kernel cmdline"

         echo '   Please specify a device to boot, or "shell" for a shell...'

         echo -n 'boot() :: '

         read REAL_ROOT

         got_good_root=0

      elif [ -b "${REAL_ROOT}" ]

      then

         got_good_root=1

      else

         echo -e "${BAD}>>${NORMAL} Block device ${REAL_ROOT} is not a valid root device..."

         REAL_ROOT=""

         got_good_root=0

      fi

   done

   echo -e "${GOOD}>>${NORMAL}${BOLD} Mounting root...${NORMAL}"

   mount -o rw ${REAL_ROOT} /newroot

   if [ "$?" = '0' ]

   then

      break

   else

      echo -e "${BAD}>> ${NORMAL}Could not mount specified ROOT, try again"

      got_good_root=0

      REAL_ROOT=''

   fi

done

mkdir -p /newroot/tmp/.initrd

cd /newroot

pivot_root . tmp/.initrd

umount /tmp/.initrd/proc > /dev/null 2>&1 || echo "*: Failed to unmount /tmp/.initrd/proc!"

umount /tmp/.initrd/sys > /dev/null 2>&1 || echo "*: Failed to unmount /tmp/.initrd/sys!"

exec <dev/console >dev/console 2>&1

echo '.'

exec chroot . /bin/sh <<- EOF

   umount /tmp/.initrd || echo "*: Failed to unmount the initrd!"

   /sbin/blockdev --flushbufs /dev/ram0 >/dev/null 2>&1

   exec /sbin/init ${REAL_INIT}

EOF

echo 'A fatal error has probably occured since /sbin/init did not'

echo 'boot correctly. Trying to open a shell...'

echo

exec /bin/bash

exec /bin/sh

exec /bin/ash

exec sh

```

----------

## minor_prophets

After the scripts creates the initrd image and echos the image size, next line is

```
cp:  cannot stat '/tmp/initrd/busybox-0.60.5/busybox' :  No such file or directory

Cleaning up...

Fatal error:  did busybox fail to compile
```

I'm following the same howto as well.  I'm using the hardened-sources and standard gentoo infrastructure server packages.  That is, the NVRAID version of the RAID on a BIOS Gentoo manual, as it goes through a self-compiled option as opposed to the genkernel.  I'm using hardened-sources and, AFAIK aside from using genkernel, this route is my only route for RAID1 on the BIOS 'controller' (as opposed to taking the highly unfavorable lvm2 route)

Giga-byte GA-7VAXP-A Ultra moboard

sil_3112 controller

2 hitachi desktar 160gb

Oh, and had this very problem with

A8V Deluxe...try that again later if I get this Giga-byte rig up.

----------

## Pr0xXx

Hello,

i tried to build the initrd with busybox 0.60.5 but got the same error as minor. With the updated script and busybox 1.2.2 i can create a initrd but when i try to boot i get the kernel panic. In the howto you can read "This has not been tested to work on kernel >=2.6.18-r3." This week i get a new pc, i will try it on that one and will test it with my new board. Maybe i try it with an older kernel.

btw. Gerte Hoogewerf's server is back online, but the scripts are the old one.

----------

## minor_prophets

 *Pr0xXx wrote:*   

> Hello,
> 
> i tried to build the initrd with busybox 0.60.5 but got the same error as minor. With the updated script and busybox 1.2.2 i can create a initrd but when i try to boot i get the kernel panic. In the howto you can read "This has not been tested to work on kernel >=2.6.18-r3." This week i get a new pc, i will try it on that one and will test it with my new board. Maybe i try it with an older kernel.
> 
> btw. Gerte Hoogewerf's server is back online, but the scripts are the old one.

 

Read my post in https://forums.gentoo.org/viewtopic-p-4384178.html#4384178

Sorry if this is cross-posting.  By the way, after finding that Hooge's site was offline last night, I began trying to find a way to to get grub to work nicely with BIOS controlled RAID1 on boot first partition.  I found a way to use hardened-sources(or whatever you lilke, I'd imagine) and get genkernel to do all the work on top of it, thereby, removing the need to download the two scripts and go the harder route.

After posting here, I moved over to my A8V and built lvm2 ~amd64 soft raid system from stage1(haven't sorted out the grub bug yet(but will).  I moved back over to the Gentoo BIOS RAID install and got further.  Maybe there are tips that will help.  I really do hope this helps a few people out there even if it is just one or two tid bits of info.

----------

## minor_prophets

Apologies.  I kind of hijacked this thread.  I am up and running with genkernel-hardened-sources!

Compiled statically RAID1 and device-mapper with all its sub-categories.

So, 2.6.20-r10, dmraid, hardened-sources genkernel worked out after I got my head around all the little corners.  Worked with a Giga-byte GA-7VAXP-A Ultra motherboard with a Sil3112 chipset, sil_sata module.  

Hope that helps someone.

Now where did I put that root password  :Rolling Eyes: 

----------

## minor_prophets

 *Pr0xXx wrote:*   

> Hello yoless,
> 
> i tryed the same on my system [MSI K8N Diamond Plus | nvidia raid controller]. I used the same howto and copied the script from http://gentoo-wiki.com/HOWTO_Install_Gentoo_with_NVRAID_using_dmraid/dmraidinitrd.
> 
> You could edit the lines 
> ...

 

Hi ProxXx,

How are you making out on this topic?

----------

