Erlend Midttun wrote:
* Steven Lutrov
| There was some talk some time back in this list for support of the
| Ultra ATA-100 IDE RAID (megaraid). Has there been any updates ?

The megaraid discussions I can remember seem to be related to SCSI,
not IDE.  I can not find any drivers for this card, but if you do find
some source drivers, I would not mind hearing about it.


| Steven

Erlend..

Hi Erland,

I have managed to get the megaide driver to work with Trustix.

LSI Logic's have a shim driver that has its raid intelligence as binary file megaide_lib.o and the rest of the driver is open. megaide_lib.o can be build with the open source to get driver image megaide.o. Source tree is also provided with the Make file for the same. The following instruction explains how to build the driver module for Trustix 2.2.

I have got an image already prebuilt as well as the source code at 
ftp://144.135.32.6/pub/Trustix/

Some instructions follow

Procedure To build MegaIDE driver Module
----------------------------------------
(1) Prepare Errata kernel Source Tree for the required kernel

        a. Install the required errata kernel source rpm and binary rpm

        b. cd /usr/src/kernel-source-2.4.29-4tr

        c. Run following commands
        #make clean
        #make mrproper

d. Copy apropriate config file depending on cpu (Eg. i686) and kernel type (Eg. smp) from /usr/src/linux<version>/configs directory to
/usr/src/linux</version><version>/.config


        Eg:
        # cd /usr/src/kernel-source-2.4.29-4tr
        # cp configs/kernel-2.4.29-i586.config .config

        e. Run following commands
        #make oldconfig
        #make dep

(2) copy megaide_shim_<driver -version>.tgz to linux source tree in the 
following folder

        # cp shim-source-megaide-v5.06a-generic-1.tgz 
/usr/src/kernel-source-2.4.29-4tr/drivers/scsi

(3) Untar megaide driver using the following command

        #cd /usr/src/kernel-source-2.4.29-4tr/drivers/scsi
        #tar  -zxvf shim-source-megaide-v5.06a-generic-1.tgz
        This will create a subfolder called megaide

        #ln -s /usr/include/linux/modversions.h 
/usr/src/kernel-source-2.4.29-4tr/include/linux/modversions.h
        This seems to fix problem with missing file


(4) Modify linux source tree makfile

        # cd /usr/src/kernel-source-2.4.29-4tr
        # vi Makefile

        Add following lines to end of Makfile

        megaide:
                $(MAKE) -C drivers/scsi/megaide

(5) Compile driver

        # cd /usr/src/kernel-source-2.4.29-4tr
        You may need to edit 
/usr/src/kernel-source-2.4.29-4tr/include/linux/version.h and change the 
UTS_RELEASE
        constant to reflect what version module you are building ie, SMP, BOOT 
etc

        # make megaide
        This will create driver image (megaide.o) in 
/usr/src/kernel-source-2.4.29-4tr/drivers/scsi/megaide

(6) Repeat steps 5 for "BOOT" image ...


Procedure To Create Trustix Driver Disk ---------------------------------------


(1) Obtain and copy the drvblock.img file from the Trustix CD and copy to /root/megaide/

(2) Mount the image file
        # mkdir /mnt/drv
        # cd /root/megaide/
        # mount -o loop drvblock.img /mnt/drv

(3) Copy the current modules file out
        # cp /mnt/drv/modules.cgz /root/megaide/

(4) Unpack the modules file.
        # zcat modules.cgz > modules.cpio
        # cpio -i --make-directories < modules.cpio

(5) Check that there is a directory that matches your kernel. If not, this will 
fail.  In our case, this is
    2.4.29-4trBOOT.  Copy your newly compiled module into this directory.
        # cp /usr/src/kernel-source-2.4.29-4tr/drivers/scsi/megaide/megaide.o 
/root/megaide/2.4.29-4trBOOT
        # chmod 644 /root/megaide/2.4.29-4trBOOT/megaide.o

(6) Edit /mnt/drv/pcitable and add at the end:

        0x1095 0x3112   "megaide"       "MegaIDE|SATA"
        0x1095 0x648    "megaide"       "MegaIDE|648"
        0x1095 0x649    "megaide"       "MegaIDE|649"
        0x1095 0x680    "megaide"       "MegaIDE|680"
        0x1166 0x212    "megaide"       "MegaIDE|CSB5"
        0x1166 0x213    "megaide"       "MegaIDE|CSB6"

(7) Edit the /mnt/drv/modinfo file and add at the end
        Version 0
        megaide
                scsi
                "Updated megaide driver"

(8) Edit the /mnt/drv/modules.dep file and add at the end:

megaide: sd


(9) * Re-pack the modules file # cd /root/megaide/ # find 2.4.29-4trBOOT/ > filelist # cpio -o -H crc < filelist > modules.cpio # gzip --best modules.cpio # mv modules.cpio.gz /mnt/drv/modules.cgz

        # mkdir /mnt/drv/2.4.29-4tr
        # cp /usr/src/kernel-source-2.4.29-4tr/drivers/scsi/megaide/megaide.o 
/mnt/drv/2.4.29-4tr
        # chmod 644 -R /mnt/drv/*

(10) Unmount the image
        # umount /mnt/drv

(11) Write the new file to disk
        # dd if=/root/megaide/drvblock.img of=/dev/fd0


Procedure To Install Trustix with Driver Disk ---------------------------------------------

(1) Boot of CD normally and enter "linux dd" at the kernel options prompt.

(2) Enter Driver Disk when requested and continue until end of installation. 
Final installation will fail but don't worry
    proceed to the next step as initrd image must be made.

(3) Switch to alt window Alt-F2

        # chroot /mnt/sysimage
        # mount /dev/fd0 /mnt/floppy (Use the same boot floppy)

        # cp /mnt/floppy/2.4.29-4tr/megaide.o 
/lib/modules/2.4.29-4tr/kernel/drivers/scsi/
        Copy megaide.o module manually

        # /sbin/mkinitrd -v /boot/initrd-2.4.29-4tr.img 2.4.29-4
        Create initrd image

(4) Edit /boot/grub/grub.conf file and append initrd options, see below

        title Trustix 2.2 with RAID
        root (hd0,0)
        kernel /vmlinuz-2.4.29-4 ro root=/dev/sda3
        initrd /initrd-2.4.29-4tr.img

(5) exit, exit, reboot system

_______________________________________________
tsl-discuss mailing list
[email protected]
http://lists.trustix.org/mailman/listinfo/tsl-discuss

Reply via email to