When creating an initrd using mkinitrd (CentOS 5.5), the kernel modules it adds to the initrd get modified in the process. For example, the initrd's /lib/sata_via.ko is not binary identical to /lib/modules/2.6.18-194.32.1.el5/kernel/drivers/ata/sata_via.ko.

I am just curious as to what happens when mkinitrd includes a kernel module - does it link in dependencies, or what is it that makes the module change?


You have a /lib/sata_vio.ko in your initrd? Is (or was) one of your file systems (e.g. / = "root") on a SATA drive that would need that driver? Does an entry for it appear in /etc/modules or /etc/mkinitrd/modules?

On my Ubuntu system, the module is in the same location inside the initrd image, e.g. <extracted initrd>/lib/modules/<uname -r>/drivers/ata/sata_vio.ko.

What does file say? What does strings | grep '\<ver' say? Maybe it's from a different driver or a different kernel version?

Obviously you could use ls -l or du to get an idea if /lib/sata_vio.ko is larger, and run nm -D against both files to see if there is any difference in symbols (e.g. using diff).

The whole process should be documented in man mkinitrd, in particular, it should say what scripts your system runs, perhaps something in /usr/share/initrd-tools/scripts or /etc/mkinitrd/scripts?

  • 1
    This is part of a cloning script for about 100 workstations of various hardware and age, so I included all SATA drivers in the initrd. The size is different (and I obviously the md5sum as well). This goes for most of the modules. It is not causing a problem or anything, I am asking mainly to learn (but don't have the time to do a deep dive into the mkinitrd script at this time). – Lars Feb 9 '11 at 1:03

The initrd (or initramfs) is the contents of a small RAM-based filesysystem that the bootloader makes available for the kernel to load on boot. It contains minimal tools to load modules, modules that are needed to access required hardware (e.g., your hard disk and filesystem). The minimal init (first process) contained in there then switches over to the real /. The initrd image is a gzip(1)ed cpio(1) archive of the required files, no linking or other operation is done to them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.