Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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?

share|improve this answer
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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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