Initrd

From Linuxintro
Revision as of 11:24, 20 August 2014 by imported>ThorstenStaerk

The Linux boot process will first mount an initial ramdisk to mount the harddisks. This is how you modify an initrd:

mkdir tmp
cd tmp
cp /boot/initrd initrd.gz
gunzip initrd.gz
mkdir tmp2
cd tmp2
cpio -id < ../initrd 

Do the needed changes now in this folder. Then pack the initrd again:

/tmp/tmp2 # find . | cpio --create --format='newc' > ../newinitrd
40242 blocks
/tmp/tmp2 # cd ..
/tmp # gzip newinitrd  find . | cpio --create --format='newc' > ../newinitrd

Your new initrd is now called newinitrd.gz.

See also