1. What is initrd. IMG?
Initrd. IMG is an important file during Linux Startup. If you compile a part of the function into a load-able module during kernel compilation. If the driver of some devices in the system is compiled as a load mode, if initrd =/path_to_initrd.img is not specified during startup, the system may fail to start, or a device (such as a NIC or other device) cannot be used after the device is started ).
If initrd. IMG or specified initrd. if the IMG does not contain the correct driver module, the system will be suspended at startup and the error "kernel panic: VFS: Unable to mount root FS on" will be reported.
2. disassembling initrd. img
We are glad that initrd. IMG can be split. Perhaps this is where the designer is. Initrd. IMG is not like the ramdisk cramfs file with the. IMG extension. It is a ramdisk file compressed with gzip-9. Therefore, if the # Mount initrd. img/temppath-o loop cannot be mounted, you will be reported to specify a file type. Therefore, we need to decompress and mount it before disassembling it.
3. Customize your own initrd. img
The reason why I modified initrd. IMG is still the dell precision 470 I used and the Linux cluster I used to build with oscar4.1 (in progress, not yet completed ). The systemimager3.2.2-1 BOEL-kernel-2.4.25 for the network boot client used in the oscar4.1 package and initrd. IMG does not support dell precision 470 adaptec39320b hostraid control card. In addition, during kernel re-compilation after RedHat 9.0 is installed, the generated imgfile may not be available due to mkinitrd or 9.0 kernel version. Here, I will talk about how to update the hardware driver module in initrd. IMG based on my actual problems.
The module is related to the kernel version. replacing it with other modules that support your hardware but different kernel versions is usually not successful, so it is best to download the source of the required kernel version from kernel.org.ProgramPackage. Unzip the source program, and decompress it to the/usr/src directory, and then download to the adaptec.com website to the driver program that supports 39320b hostraid for the linux-2.4 version, and decompress and replace the driver in the 2.4.25 kernel source programSource code. Then re-compile the kernel (this article does not detail the specific method, there are a lot of relevant information on the Internet, maybe I will write an article if I have time ), when you use make menuconfig, it is best to directly choose with the original Kernel & initrd. IMG config file. If no error occurs, run make modules_install to generate the required module (usually in the directory/lib/modules/kernel-version ). Then I replaced the old initrd with the new/lib/modules/kernel-version/lib/directory and its file. the modules directory in IMG (of course, you have to disassemble it first. For the method, see section 2nd ).
Note: cpio-I <initrd-kernel_version.img can also be used.
ReferenceArticle:
From disassembling to customizing your own initrd. img
An Application of module injection-initrd