Red Hat Enterprise Linux and CentOS 7 Driver Disk

Recently I had the need to install CentOS 7 on an old machine to be used as a simple firewall. The problem I faced was that the RAID controller (IBM ServeRAID 5) of that old server was not suported anymore by Red Hat Enterprise Linux (RHEL) and by that, by CentOS kernels. The driver is part of the kernel version of CentOS 7 but Red Hat disable it for support reasons. There is an external repository, ELRepo, that packages external drivers and drivers Red Hat disables. I have used ELRepo before in order to install a 100 MBit network interface driver (Red Hat disable too many old 100 MBit NIC drivers).

RHEL and CentOS kernels and those from many other enterprise targeted distributions are API and ABI compatible for the entire lifespan of them, so building a driver for a kernel release can be reused for all kernel updates. ELRepo packages are built that way, in contrast with akmod method that need compiler tools in order to rebuild the driver module everytime the kernel is updated.

The easiest way to build a new kernel module package is to download the SRPM of a kernel module package that is somewhat related to the one you are building, for example same device type like a NIC or a SCSI controller. Use that SRPM as the base for your package. I extracted the ips.h, ips.c and a few other needed files and built my package.

What took me more time than to build the package was to create a Driver Disk (DD) that the CentOS installer could recognize. A driver disk is needed because as I was packaging a SCSI controller driver that manage the disk I will install to, the installer need to load the driver at startup. This isn’t a problem when you are building a driver for other kind of devices, those could be installed after the installer finishes. There is little documentation on the layout of a driver disk, took me time and a lot of search to build one.

First you need your driver package RPM, let call ours kmod-ips-<version>.<arch>.rpm, and build a removable drive with the following layout

.
├── rhdd3
└── rpms
    └── <arch>
        ├── kmod-ips-7.12.05-1.el7.centos.<arch>.rpm
        └── repodata
            ├── …
            └── repomd.xml

Where <arch> could be i686 (only for CentOS 7, RHEL 7 doesn’t provide 32 bit support) or x86_64. The repodata directory is the yum repository metadata created for the <arch> directory. You can generate it from that directory using tools like createrepo or createrepo_c. rhdd3 is just a file with the text Driver Update Disk version 3 as contents.

The driver RPM must provide kernel-modules in order to tell the installer the minimum support kernel version for the module:

kernel-modules >= 3.10.0-327.el7.<arch>

ELRepo SRPMs are able to add it, so if you use them as base the RPM already contains it.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值