Creating the Driver Disk for VT8251 SATA Controller in Fedora Core 5 x86_64

Introduction

Many persons have requested me for the driver disk of VT8251 SATA Controller for other architectures other than x86_64 in Fedora® Core 5. But since I don't have access to all of them & have very little time to spare, I am giving the steps that I took in creating the driver disk.

I don't think that the steps I followed was absolutely right or better. However, it worked for me. Few persons have not been able to use the driver disk to detect the SATA HDD, while others reported success. I have no idea why the driver disk didn't work for some. So, please get ready to experiment if you prefer to try the steps given here.

The steps given below is for kernel-2.6.15-1.2054_FC5 of Fedora Core 5, x86_64. These steps should also work on a recent Red Hat®/Fedora distribution. Please, make the necessary substitutions for your own distribution.

The Steps

  1. For testing the modules directly after kernel compile, you should connect a regular IDE HDD to the PC containing the VT8251 SATA controller & install the appropriate GNU/Linux® distribution on it. The steps below were executed on this setup.
  2. Now, download the appropriate Kernel Source, For FC5, I downloaded kernel-2.6.15-1.2054_FC5.src.rpm from http://rpm.pbone.net/
  3. In the # prompt type the following:
    # rpm -Uvh kernel-2.6.15-1.2054_FC5.src.rpm
    # rpmbuild --bp --target=$(uname -m) /usr/src/redhat/SPECS/kernel-2.6.spec
    # cd /usr/src/redhat/BUILD/kernel-2.6.15/
    # cp -R linux-2.6.15.x86_64/ /usr/src/
    # cd /usr/src/
    # ln -s linux-2.6.15.x86_64 linux-2.6
    
  4. Next, download the patched ahci.c and sata_via.c source from Rajahuroman's webpage
  5. Overwrite the two original sources with these two files:
    # cp ahci.c sata_via.c /usr/src/linux-2.6/drivers/scsi/
    
  6. Now, we have to make the modules with these new files. First configure the kernel:
    # cd /usr/src/linux-2.6/
    # make menuconfig             (or make xconfig|gconfig|config)
    
  7. The defaults should be ok for us. Just change the following:
  8. In this kernel, ahci, sata_via are by default selected as to be compiled as modules. For other kernel version, check & make sure they are selected as modules. Moreover, for other architecture, make sure to select SMP or non-SMP type. Save & exit the kernel configuration.
  9. Edit the Makefile and delete pre form the EXTRAVERSION = pre line to make it null.
  10. Next, compile the modules:
    # make modules
    
  11. Check the modules to see that it reports the correct kernel version & SMP/non SMP in vermagic: string.
    # modinfo drivers/scsi/ahci.ko
    # modinfo drivers/scsi/sata_via.ko
    
    Make sure the kernel version is 2.6.15-1.2054_FC5
  12. Now, we need to make the driver disk. First download the driver disk file from my web-page & extract it to an empty directory, say /opt/vt8251/
  13. The driver disk contains the following files:
    modinfo
    modules.cgz
    modules.dep
    pcitable
    rhdd-6.1

    Of these, we will need to recreate the modules.cgz file only. If you are curious how I created the other files, you can check out Petr Sulla's webpage.
  14. For creating the modules.cgz file, first we need to create a directory with the same name as the kernel version.
    # cd /opt/vt8251/
    # mkdir 2.6.15-1.2054_FC5
    
  15. Now, copy the driver files (and the driver dependency files - though not strictly required) to this directory, strip them & create the modules.cgz file:
    # cp /usr/src/linux-2.6/drivers/scsi/ahci.ko 2.6.15-1.2054_FC5/
    # cp /usr/src/linux-2.6/drivers/scsi/sat_via.ko 2.6.15-1.2054_FC5/
    # cp /usr/src/linux-2.6/drivers/scsi/libata.ko 2.6.15-1.2054_FC5/
    # cp /usr/src/linux-2.6/drivers/scsi/scsi_mod.ko 2.6.15-1.2054_FC5/
    # strip --strip-unneeded 2.6.15-1.2054_FC5/*.ko
    # find 2.6.15-1.2054_FC5 | cpio -ov -H CRC | gzip -9 > modules.cgz
    
  16. You can now copy the files modinfo, modules.cgz, modules.dep, pcitable, rhdd-6.1 to a fully formatted DOS floppy. This is your new VT8251 SATA driver disk.
  17. You need to also copy the ahci.ko, sata_via.ko files from the 2.6.15-1.2054_FC5 directory to the floppy (not part of the actual driver disk) for later 'rescue' stage as described in my installation steps. You may create a directory in the floppy to hold these two files - I copied these files to a directory called x86_64