[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How I made a boot floppy for a Compaq Proliant 1600 (SMART2 RAID)



Hi,

I was recently commissioned to produce boot media for a Compaq Proliant
1600.  This beastie has the SMART2 RAID array and I found very little in
the archives about installing onto this equipment, so I thought I would
share what I learned about making a boot floppy for it.

I used boot-floppies 2.1.9.  Some of my problems stemmed from making
a slink/linux-2.2.13 install set on a build system that is a hybrid
of slink and unstable, and therefore wouldn't be encountered by more
sensible people.

Obviously, I enabled the SMART2 driver when I built the target kernel.

--------------------
The non-zero exit code of recode (3.4.1-11) causes rescue.sh to fail.
I wrote a tiny wrapper for recode to always return zero.

--------------------
When making the root image, we need to create device nodes for the IDA
drives and partitions.  I copied mkdev.ida (from 2.2.13 linux sources)
and modified it to create device nodes in the current working directory,
and called it from rootdisk.sh thusly:

--- boot-floppies/rootdisk.sh   Tue Mar  2 02:44:52 1999
+++ boot-floppies.markv/rootdisk.sh     Tue Oct 26 12:02:12 1999
@@ -228,6 +228,10 @@
        (cd $R/dev; /dev/MAKEDEV $i)
 done

+if [ "$arch" = i386 ]; then
+       (OPWD=$PWD; cd $R/dev; $OPWD/mkdev.ida)
+fi
+
 # Warning: New kernels need a "console" device, not a symlink.
 if [ ! -c $R/dev/tty0 ]; then
        mknod $R/dev/tty0 c 4 0


--------------------
The next bit is really ugly.  I'm making a slink disk (ld-2.0.7) but,
as rootdisk.sh uses ldd to work out what libraries the root image needs,
it finds /lib/ld-linux linked to ld-2.1.2 on my build system.  I brutalise
the list of libraries:

--- boot-floppies/rootdisk.sh   Tue Mar  2 02:44:52 1999
+++ boot-floppies.markv/rootdisk.sh     Tue Oct 26 12:02:12 1999
@@ -396,7 +396,7 @@
        LIBRARIES="$LIBRARIES $j"
         if [ -L $i ]; then
                 j=`ls -l $i |awk -v J=\`dirname $i\` -- '{print J"/"$NF}' | \
-                        sed -e "s%^$E%.%g" -e "s%^/%./%" `
+                        sed -e "s%^$E%.%g" -e "s%^/%./%" -e "s%ld-2.1.2%ld-2.0.7%" `
                 LIBRARIES="$LIBRARIES $j"
         fi
 done

Ok, yes ... I am ashamed.


--------------------
Now for the meat.  By this point, dbootstrap runs, but doesn't find
any hard disks.

I added an entry for /dev/ida/c0d0-9 into trylist[].  Though this was
good enough for my purposes, it isn't entirely satisfactory, since there
may be multiple controllers, with up to 16 logical devices each.

Second, the SMART2 driver sets errno to EBADRQC on CDROMVOLREAD, which is
not recognised by fdisk_reread() as a suitable error code for a non-CDROM
device.  I assume CDROM's don't return EBADRQC ...

--- boot-floppies/utilities/libfdisk/fdisk.c   Thu Feb  4 15:26:28 1999
+++ boot-floppies.markv/utilities/libfdisk/fdisk.c Tue Oct 26 14:56:02 1999
@@ -446,7 +446,10 @@
 
   if (minor != -1){
     partition->name= malloc(strlen(name)+4);
-    sprintf(partition->name,"%s%d", name, minor);
+    if (strncmp(name, "/dev/ida/c", 10) == 0)
+  sprintf(partition->name,"%sp%d", name, minor);
+    else
+  sprintf(partition->name,"%s%d", name, minor);
   } else {
     partition->name=strdup(name);
   }
@@ -772,6 +775,7 @@
     { "/dev/hd", 'a', 'd' },
     { "/dev/sd", 'a', 'h' },
 #if #cpu (i386)
+    { "/dev/ida/c0d", '0', '9' },
     { "/dev/ed", 'a', 'd' },
 #endif
 #if #cpu (m68k)
@@ -797,7 +801,7 @@
     struct trylist *p;
     struct cdrom_volctrl cdvol;
     int i, fd;
-    char letter, device[12], *q;
+    char letter, device[14], *q;
     unsigned size;
     
     fdisk_init();
@@ -814,8 +818,10 @@
       if ((fd = open( device, O_RDONLY )) >= 0 && !timed_out) {
    alarm( 0 );
    if (ioctl(fd, CDROMVOLREAD, &cdvol )!= 0) {
-      /* if returns EINVAL or EPERM or EIO, this is not a CD-ROM drive */
-            if ((errno==EINVAL)||(errno==EPERM)||(errno==EIO)) {
+       /* if returns EINVAL or EPERM or EIO or EBADRQC,
+          this is not a CD-ROM drive */
+            if (errno == EINVAL || errno == EPERM
+         ||errno == EIO    || errno == EBADRQC) {
     if (ioctl(fd, BLKGETSIZE, &size))
         size = 0; /* don't complain, size not really 
        used yet */


--------------------
Now bootconfig, I'm afraid, seems downright hairy when it comes to device
and partition names.  For me, it was generating a defective 'boot' line
in lilo.conf.  I bashed away at make_bootable() until I got something
I was a little happier with.  Watch out: I didn't understand the code
particularly well and could have broken it.  It worked for me in the
single case I cared about.

--- boot-floppies/utilities/dinstall/bootconfig.c Mon Feb  1 11:01:17 1999
+++ boot-floppies.markv/utilities/dinstall/bootconfig.c Thu Oct 28 17:40:04 1999
@@ -402,14 +402,33 @@
 {
   int status=0;
 #if #cpu (i386)
-  char *boot,dtype,dnum,*part;
-  dtype=*((Root->name)+5);
-  dnum=*((Root->name)+7);
-  part=(Root->name)+8;
+  char *boot, *name, dtype, dname;
+  int cnum, dnum, pnum, nchar;
 
-  fprintf(stderr,"Root=%s\n",Root->name);
+  name = Root->name;
+  if (sscanf(name, "/dev/ida/c%ud%up%u%n", &cnum, &dnum, &pnum, &nchar) >= 3) {
+    if (nchar != strlen(name)) {
+      /* FIXME: complain about partition name? */
+      return 1;
+    }
+    dtype = 'i';
+  }
+  else if (sscanf(name, "/dev/%cd%c%u%n", &dtype, &dname, &pnum, &nchar) >= 2) {
+    if (nchar != strlen(name) || dname < 'a' || dname > 'h') {
+      /* FIXME: complain about partition name? */
+      return 1;
+    }
+    cnum = 0;
+    dnum = dname - 'a';
+  }
+  else {
+    /* FIXME: complain about unrecognised device name */
+    return 1;
+  }
 
-  if(dnum!='a') {
+  fprintf(stderr, "Root=%s\n", name);
+
+  if (cnum || dnum) {
     /* The root partition is not on the first IDE or SCSI disk. */
     if (0==yesNoBox(MSG_NOT_1ST_DISK,MSG_PROBLEM)) {
       problemBox(MSG_BOOT_IMPOSSIBLE,MSG_PROBLEM);
@@ -420,18 +439,19 @@
 
 #ifdef _TESTING_
 #define HDA_EXISTS 1
-  if ( (dtype=='s') && (HDA_EXISTS) ) {
+  if ( (dtype=='s' || dtype=='i') && (HDA_EXISTS) ) {
 #else
-  if ( (dtype=='s') && (fdisk_find_disk("/dev/hda")) ) {
+  if ( (dtype=='s' || dtype=='i') && (fdisk_find_disk("/dev/hda")) ) {
 #endif
     /* The root partition is on the first SCSI disk, but hda exists. */
     if (0==yesNoBox(MSG_HDA_EXIST,MSG_PROBLEM)) {
       problemBox(MSG_BOOT_IMPOSSIBLE,MSG_PROBLEM);
       run_lilo("");
-      return 0;    }
+      return 0;
+    }
   }
 
-  if ( (part[0]>'4') || (part[1]!='\0') ){
+  if (pnum > 4) {
     /* The root partition is a logical one. Let the user choose an 
      * extended one.
      */
@@ -447,6 +467,10 @@
     }
   } else {
     boot=strdup(Root->name);
+    if (dtype == 'i') {
+      /* lop off partition number to get IDA device name for boot device */
+      *strrchr(boot, 'p') = '\0';
+    }
   }
 
   if(run_lilo(boot)!=0) {


--------------------
Though I was successful in generating boot media (and thereby installing
Debian GNU/Linux on the target system), the sponsor has changed linux
distributions and I have no further time to spend on this work.  It would
be nice to think my results might be of some use in adding IDA support
to future versions of boot-floppies.

Regards,

Mark van Walraven
Wave Internet Services


Reply to: