# # Original File # ------------- # # Create the contents: /tmp/initrd/{bin,dev,etc,lib,sbin} # http://Linux-Boot.net/Scripts/InitRD/initrd.fs.sh.txt # # # Create the initrd.gz # --> http://Linux-Boot.net/Scripts/InitRD/initrd.gz.sh.txt # # # # 12-Sep-04 amo Create a Custom intrd.gz # 15-Mar-05 amo Moved to Scripts/InitRD from Creating/Scripts/initrd.gz.sh # # # # # # ---------------------------- # # Create the initrd filesystem # # ---------------------------- # # # initrd.fs.sh # # ======================================================== # # # Create initrd.gz # ----------------- # # 4MB ramddisk dd if=/dev/zero of=/tmp/initrd.img count=4096 bs=1024 # # Use Loop device # --------------- # losetup /dev/loop0 /tmp/initrd.img # mke2fs /dev/loop0 # mount /dev/loop0 /mnt/loop # # mke2fs -j /tmp/initrd.img # mkdir /mnt/loop mount -o loop /tmp/initrd.img /mnt/loop # cp -par /tmp/initrd/* /mnt/loop # # # Umount the ramdisk # ------------------ umount /mnt/loop # # losetup -d /dev/loop0 # # # Now Compress it # ---------------- gzip -c -9 /tmp/initrd.img > /tmp/initrd.gz # # # # free the memory # blockdev --flushbufs /dev/ram0 # blockdev --flushbufs /dev/rd/0 # if using devfs # # # # # update lilo to use it # # # # cp /tmp/initrd.gz /boot # # # # vi /etc/lilo.conf # # .... # # initrd = /boot/initrd.gz # # # End of file