patches for Compaq smart array controllers (cciss driver)

Bruce Edge bedge at troikanetworks.com
Tue Jul 2 18:11:20 CEST 2002


These are really ugly hacks, but I had to get it working ASAP.
There are 3 changes, 2 are fai changes, and 1 is a grub workaround.


In device2grub, new device name pattern is needed:

0 melloglin  ~ #> diff -c /usr/lib/fai/sbin/device2grub /export/fai/root/sbin/device2grub
*** /usr/lib/fai/sbin/device2grub       Thu May 16 05:44:08 2002
--- /export/fai/root/sbin/device2grub   Tue Jul  2 08:51:33 2002
***************
*** 17,23 ****
    $map{$olddevice} = $grubdevice;
  }

! $device=~ m#^(/dev/[sh]d\D)(\d*)$# || die "Can't match device: $device\n";
  my ($disk,$partition) = ($1,$2);

  if ($map{$disk}) {
--- 17,25 ----
    $map{$olddevice} = $grubdevice;
  }

! $device=~ m#^(/dev/[sh]d\D)(\d*)$# ||
!       $device=~ m#^(/dev/cciss/c\dd\d)$# ||
!       die "Can't match device: $device\n";
  my ($disk,$partition) = ($1,$2);

  if ($map{$disk}) {


And, in scripts/BOOT, Ihad to add a hack to get grub to work,
I'm sure there's a better way of doing this one. Ths is done before grub_install is run.

    # Hack for cciss arrays
    grep cciss /proc/partitions && \
        mkdir -p $target/boot/grub && \
        cat > $target/boot/grub/device.map <<-EOF
        (fd0)   /dev/fd0
        (hd0)   /dev/cciss/c0d0
        EOF


Lastly, in setup_harddisks, I had to comment out the duplicate mount point check, as it was always failing:

0 melloglin  ~ #> diff -c /usr/lib/fai/sbin/setup_harddisks /export/fai/root/sbin/setup_harddisks
*** /usr/lib/fai/sbin/setup_harddisks   Mon Jul  1 14:13:21 2002
--- /export/fai/root/sbin/setup_harddisks       Mon Jul  1 14:51:11 2002
***************
*** 423,430 ****
                    }
                    ($options =~ /\bboot\b/i) && die "ERROR: line $a, only primary partitions can be bootable.\n";
                }
!                       ($DiskMountpoints{$disk} =~ /\b$mountpoint\b/)
!                   && die "ERROR in config file line $a, Mountpoint redefined: $mountpoint\n$line\n";
                $DiskMountpoints{$disk} .= " $mountpoint";
                # size
                ($size =~ /^preserve\d+$|^\d+\-?\d*$|^-\d+$/i)
--- 423,430 ----
                    }
                    ($options =~ /\bboot\b/i) && die "ERROR: line $a, only primary partitions can be bootable.\n";
                }
! #                     ($DiskMountpoints{$disk} =~ /\b$mountpoint\b/)
! #                 && die "ERROR in config file line $a, Mountpoint redefined: $mountpoint\n$line\n";
                $DiskMountpoints{$disk} .= " $mountpoint";
                # size
                ($size =~ /^preserve\d+$|^\d+\-?\d*$|^-\d+$/i)



-Bruce.



More information about the linux-fai mailing list