Identify the compressed kernel file:
# cd /boot # ls vmlinuz-$(uname -r) vmlinuz-2.4.18-3 |
# tftp 10.0.0.1 tftp> binary tftp> put vmlinuz-2.4.18-3 vmlinuz Sent 1030147 bytes in 2.3 seconds tftp> quit |
Next, make the root file system image for the client. The full listing of the files is in Appendix A.
These files have been taken from a working system as a minimum configuration for having powerful shell (bash), client network utilities (dhcpcd and tftp), and copying and compressing utilities (dd, gzip). Administrative commands (mknod, mount, fdisk and insmod) are also present.
In the working directory create a file named initrd.lst and put these file names on it. To check the existence of these files in your system, run the following command:
# ls -d $(<initrd.lst) > /dev/null |
You should get an error output like this:
ls: /bin/clone: No such file or directory ls: /bin/tftp: No such file or directory ls: /lib/3c59x.o: No such file or directory |
The first error is a script to be created in the working directory. The second error is the program tftp found in the directory /usr/bin instead of /bin. The third is the network interface card module (probably not yours) found in the directory /lib/modules/$(uname -r)/kernel/drivers/net.
These three files will be discussed in upcoming sections separately soon. If there are other missing files, check for lack of installation or differences in version, distribution or hardware. Adjust the list to match your system.
# dd if=/dev/zero of=initrd bs=1024 count=4096 4096+0 records in 4096+0 records out # yes | mkfs initrd mke2fs 1.27 (8-Mar-2002) initrd is not a block special device. Proceed anyway? (y,n) Filesystem label= blah blah blah... # mkdir mnt # mount -o loop initrd mnt/ # egrep -v "clone|3c59x|tftp" initrd.lst | cpio -pdm mnt 4876 blocks |
# cp -p /usr/bin/tftp mnt/bin/ |
![]() | Whenever you see a reference to 3c59x, use the name of the module suited for your case. |
# cp -p /lib/modules/$(uname -r)/kernel/drivers/net/3c59x.o mnt/lib/ |
Edit the clone script found in Appendix B, changing the variables as explained in Section 6. Make it executable and copy it to the image directory:
# chmod +x clone # cp -p clone mnt/bin/ |
Unmount, compress, and send the initrd image.
# umount mnt/ # gzip initrd # tftp 10.0.0.1 tftp> binary tftp> put initrd.gz Sent 1155530 bytes in 2.8 seconds tftp> quit |