6

I need to make a driver disk for anaconda. This disk would contain an updated module for the network card of a somewhat recent laptop and the goal is to get a network install of CentOS 6.2 working. I am using cobbler so even the kickstart file itself is on the network. I don't mind if the installation is not completely unattended and I don't mind sticking a USB stick with the driver disk image during the install and manually selecting the correct item, but I do want to keep everything else on the network (kernel image, initrd, kickstart file, RPM repositories).

I already got the updated driver built, and I even have a "kmod" RPM built with the help of /usr/lib/rpm/redhat/kmodtool. Unfortunately I have found absolutely no documentation on what a driver disk looks like.

http://www.phil.muni.cz/~letty/linuxfaq/pracovni/driver-disk-howto is the only link I could find, and it describes the struggle of someone who did the same thing I did - downloaded driver disks and tried to explore them. Unfortunately the format in CentOS 6 seems to have changed and the best I could do is to get anaconda to tell me that: "Driver disk is invalid for this release of CentOS.". The log itself says "cannot find /tmp/drivers/rpms/x86_64/repodata" and until now I have not seen a driver disk with "repodata" on it.

Currently diving into the anaconda source code but I hope someone can point me in the right direction.

chutz
  • 7,569
  • 1
  • 28
  • 57

3 Answers3

9

I may have found my answer in the anaconda source after all.

To generate a CentOS 6 compatible driver disk, you can create a squashfs image (other filesystems might also work, but squashfs is by far the easiest to create) with the following layout:

  • rhdd3 - a file with a simple one-line comment to describe the disk
  • .rundepmod - the presence of this file tells the installer that it should run depmod in order to pick up the modules
  • rpms/x86_64 - an optional yum repository containing the kmod RPMs
  • lib/modules/2.6.32-220.el6.x86_64/... - the actual kernel modules go here; if the driver disk contains an updated driver of an upstream driver, then the directory structure here should match the upstream kernel module location. The version of the kernel should of course match the version of the installer.

And since a picture is worth a thousand words, here is the sample driver disk we use to kickstart recent laptops that need an updated atl1c.ko driver:

$ unsquashfs -ls driver-disk.dd 
Parallel unsquashfs: Using 2 processors
8 inodes (26 blocks) to write

squashfs-root
squashfs-root/.rundepmod
squashfs-root/lib
squashfs-root/lib/modules
squashfs-root/lib/modules/2.6.32-220.el6.x86_64
squashfs-root/lib/modules/2.6.32-220.el6.x86_64/kernel
squashfs-root/lib/modules/2.6.32-220.el6.x86_64/kernel/drivers
squashfs-root/lib/modules/2.6.32-220.el6.x86_64/kernel/drivers/net
squashfs-root/lib/modules/2.6.32-220.el6.x86_64/kernel/drivers/net/atl1c
squashfs-root/lib/modules/2.6.32-220.el6.x86_64/kernel/drivers/net/atl1c/atl1c.ko
squashfs-root/lib/modules/2.6.32-220.el6.x86_64/updates
squashfs-root/rhdd3
squashfs-root/rpms
squashfs-root/rpms/x86_64
squashfs-root/rpms/x86_64/kmod-compat-wireless-3.3_2_n-2.el6.x86_64.rpm
squashfs-root/rpms/x86_64/repodata
squashfs-root/rpms/x86_64/repodata/filelists.xml.gz
squashfs-root/rpms/x86_64/repodata/other.xml.gz
squashfs-root/rpms/x86_64/repodata/primary.xml.gz
squashfs-root/rpms/x86_64/repodata/repomd.xml
chutz
  • 7,569
  • 1
  • 28
  • 57
  • Also note in the driver disk that "There is a special requirement for the RPMs used to update drivers. Anaconda picks up only RPMs which provide "kernel-modules = "." So, for example, if you are building the e1000e RPM from Intel so you can deploy it with the system then you will need to edit the .spec and add "Provides: kernel-modules = 3.10.0-1160.el7.x86_64" or whatever your equivalent might be. – KJ7LNW Jun 10 '21 at 00:31
0

From the anaconda driverdisc.txt:

The new DriverDisc format uses simple layout which can be created on top of
any anaconda's supported filesystem (vfat, squashfs, ext2 and ext3).

/
|rhdd3   - DD marker, contains the DD's description string
/rpms
|  /i386 - contains RPMs for this arch and acts as Yum repo
|  /i586
|  /x86_64
|  /ppc
|  /...  - any other architecture the DD provides drivers for

This part is critical if you are doing something like inst.dd=http://10.0.0.80/e1000e.rpm :

There is a special requirement for the RPMs used to update drivers. Anaconda picks up only RPMs which provide "kernel-modules = <running kernel version>".

So you will need to edit the .spec and, at the top, add "Provides: kernel-modules = 3.10.0-1160.el7.x86_64" or whatever your equivalent install version might be.

Also note that inst.sshd is great for troubleshooting netboot installs. See /tmp/packaging.log:

# ssh <installer-host-ip>
[anaconda root@localhost ~]# less /tmp/packaging.log

This will complete the installation, but future kernel upgrades may not get the driver update. You can add a hook in /etc/kernel/postinst.d/ to copy your driver to newer kernel versions when the kernel is updated (assuming the ABI is compatible).

KJ7LNW
  • 131
  • 3
0

I found this when searching for instructions on how to create a driver disk for Centos 7.4. In my case I needed a RAID driver for installation on a HP Microserver where the only internal disks are part of the RAID.

I started with on old device driver disk (actually a USB key), which had the following folders (among some other files):

/rpms/x86_64/
/rpms/x86_64/repodata/

The following process seemed to work for me:

  1. Remove the contents of the /rpms/x86_64/ folder on the USB key
  2. Download the correct/latest driver as a RPM file
  3. Move this RPM to a folder on its own
  4. Ensure the createrepo package is installed
  5. Run the following command, where your_folder is where the RPM is found:

    createrepo your_folder/

  6. Check that this has created a repodata folder in your_folder

  7. Copy the contents of your_folder to /rpms/x86_64 on the USB key

While this doesn't directly address the OP, it may be helpful for someone else who came across this page when trying to work out how to create a device driver disk for CentOS installs.

Charlie Joynt
  • 219
  • 1
  • 4
  • 11