Creating a Device Driver disc for Red Hat/CentOS installs

Contents

Note: known to work for CentOS 7; your mileage may vary)

The problem: no network driver available for a network install

As part of my testing for the new penguin system, I decided to install CentOS 7 from scratch. This was actually not a very straightforward task:

  • Booting using tftp no longer works due to the Pi-hole work I had done previously
  • I had swapped the DVD drive from the HP Pavillion system and replaced it with a CD drive
  • The CentOS 7 Minimal installation disc is 830 MB (792 MiB); too large for a CD-ROM
  • I have a network installation CD, but the CentOS kernel doesn’t have a driver for the Pavillion’s network card

Of course, the reasonable thing to do would be to simply move the DVD drive back into the Pavillion computer, but what would be the fun in that? Also, since I had both motive and opportunity to learn about RHEL/CentOS driver discs, I decided to do so.

Driver Disc layout

While the Red Hat documentation has good details about how to use a driver disc (naming it OEMDRV allows the installer to see it automatically, or one can add inst.dd to the installation boot command line,) it has nothing to say to how to create one! Red Hat assumes the driver disc has been supplied by a vendor and is available as the disc itself, or as an .iso file, or as a mountable device with the contents of the disc copied to it.

After doing some research, looking at ddiskit, and no small amount of trial and error, I determined the driver disc needs the following layout:

  ./
  ├─ rhdd3    (file; can be empty, but must exist)
  └─ rpms/
     └─ x86_64/
        └─ kmod-forcedeth-0.64-3.el7.elrepo.x86_64.rpm

Putting the above structure on to a USB flash drive works. If the filesystem on the drive has the label OEMDRV, at boot time a systemd unit runs that unpacks all the RPMs under (filesystem-root)/rpms/<ARCH>, then attempts to modprobe the kernel modules.

Alternative: specify path to RPM file on “inst.dd”

Perhaps the best way to use a stand-alone driver disc is to bypass the above structure and specify the path to the driver RPM in the inst.dd parameter:

inst.dd=hd:LABEL=MULTIBOOT:/CentOS-7.5-Install/kmod-forcedeth-0.64-3.el7.elrepo.x86_64.rpm

The above means:

Parameter Interpretation
hd: Look for a disc device
LABEL=MULTIBOOT: Look for a partition with filesystem label MULTIBOOT
/ ... Path to the RPM file

Note: I also had to add the following parameter to the boot command line to get Linux to assign an IP address:

ip=dhcp

A note on repodata

Some doucmentation I found said including a repodata directory under the <ARCH> directory would allow multiple versions of a driver to be on the device. The implication is the boot process will use the repodata information to determine the RPM appropriate to the running kernel. However, in my testing I saw the process simply “installed” all the RPMs, with the result that the driver that ended in the running file system might ot might not work.

Older note: Using “inst.dd” with no parameters

If the file system label is not OEMDRV, one can still force the boot process to look for a driver disc by adding the following to the boot command line:

inst.dd

Then in the early part of the installation boot, the following dialogue occurs:

[  OK  ] Created slice system-driver\xduplicate.slice.
         Starting Driver Update Disk UI on tty1...
DD: starting interactive mode

(Page 1 of 1) Driver disk device selection
    /DEVICE  TYPE     LABEL                UUID
 1) sde1     vfat     KNOPPIX-72           20EA-1200
 2) sr0      iso9660  CentOS\x207\x20x86_6 2017-09-05-13-35-43-00
# to select, 'r'-refresh, or 'c'-continue: 1

DD: Examining /dev/sde1

(Page 1 of 1) Select drivers to install
 1) [ ] /media.SS-1/rpms/x86_64/kmod-forcedeth-0.64-3.el7.elrepo.x86_64.rpm
# to toggle selection, or 'c'-continue: 1

(Page 1 of 1) Select drivers to install
 1) [x] /media.SS-1/rpms/x86_64/kmod-forcedeth-0.64-3.el7.elrepo.x86_64.rpm
# to toggle selection, or 'c'-continue: c

DD: extracting: kmod-forcedeth

(Page 1 of 1) Driver disk device selection
    /DEVICE  TYPE     LABEL                UUID
 1) sde1     vfat     KNOPPIX-72           20EA-1200
 2) sr0      iso9660  CentOS\x207\x20x86_6 2017-09-05-13-35-43-00
# to select, 'r'-refresh, or 'c'-continue: c
[  OK  ] Started Driver Update Disk UI