Digging into an initrd File
Updated January 30, 2002
Created August 24, 2001



Please refer to rhdiskmod.html for complete information. That page will eventually replace this page.


UNPACK INSPECT REPACK


Unpacking an initrd


# Make and change to a temporary directory
mkdir /tmp/initrdtesting
cd /tmp/initrdtesting

# Grab an initrd you want to work with
cp /boot/initrd.img .

# Rename the initrd
mv initrd.img initrd.ext2.gz

# Unzip the initrd
gunzip initrd.ext2.gz

# Create a blank directory to mount the initrd to
mkdir initrd.dir

# Mount the initrd filesystem
mount initrd.ext2 initrd.dir -o loop

# Investigate your initrd
cd initrd.dir


UNPACK INSPECT REPACK


Inspecting the initrd

When initrd boots, it immediately runs /linuxrc SCSI modules are located in the /lib directory bin insmod sash dev console (5,1) null (1,3) ram (1,1) systty (4,0) tty1 (4,1) tty2 (4,2) tty3 (4,3) tty4 (4,4) etc lib ncr53c8xx.o linuxrc loopfs
Contents of linuxrc
#!/bin/sash

aliasall

echo "Loading ncr53c8xx module"
insmod /lib/ncr53c8xx.o 



UNPACK INSPECT REPACK


Repacking the initrd





Homepage: http://www.oocities.org/rlcomp_1999