Wednesday, September 7, 2011

Making Custom Initrd or Modifying Initrd

Use existing initrd.img from /boot or create one

Using

Mkinitrd myinitrd.img <uname –r>

  1. Extract the above initrd file using

gzip -dc initrd.img | cpio -idv

  1. the initrd is whole filesystem

clip_image002

  1. init file is the script that runs and finally mounts real filesystem
  2. Put your statement here.

Eg. Echo “welcome alok”

6.then again pack it using

find . | cpio -H newc -o > ../initramfs.cpio

7.compress

Cd ..

Gzip -9 initramfs.cpio

Cp to /boot

And make necessary changes in grub.conf

Note :No limit as such in size of initramfs,

Put fsarchiver in that.

Nash is simlar to busybox containing scripts in it

No comments:

Post a Comment

Featured Post

XDP - Getting Started with XDP (Linux)