The EeePC Linux use a two-stage boot process: The GRUB bootloader first loads the kernel (built with the most common drivers), then extracts the initramfs archive and mounts it as an initial RAM-based root filesystem. This allows loading of additional modules, e.g. USB drivers, and other initialization steps like F9 restore and Perform Disk Scan.
The loading of the kernel and initramfs image are specified in the following lines in /boot/grub/menu.lst:
kernel /boot/vmlinuz-2.6.21.4-eeepc quiet rw vga=785 irqpoll root=/dev/sda1 initrd /boot/initramfs-eeepc.img
If an initramfs is built into the kernel or passed to it, the kernel will try to execute the init script in the initramfs. Usually /init is a shell script that will find and mount the root partition, then switch_root onto the root partiton and execute /sbin/init.
In EeePC Linux, the default initramfs image as specified in /boot/grub/menu.lst is /boot/initramfs-eeepc.img. The init script of the default initramfs does the followings:
[NB. All these operations have to be done with “root” privilege. You can either su to change to a root terminal or add sudo before every command]
mkdir /boot/temp # make temp directory to unpack the initramfs cd /boot/temp # enter temp directory gunzip < ../initramfs-eeepc.img | cpio -i # unpack the image
find | cpio -H newc -o | gzip -9 > ../initramfs-[new name]-eeepc.img
Note:
#mount SYSTEM and USER partitions mount /dev/sda1 /mnt-system mount /dev/sda2 /mnt-user #backup original initramfs image and copy new one to /boot in SYSTEM partition cd /mnt-system/boot mv initramfs-eeepc.img initramfs-eeepc.img.orig cp /mnt-user/boot/initramfs-[new name]-eeepc.img . #backup original GRUB menu.lst and copy new one to /boot/grub in SYSTEM partition cd grub mv menu.lst menu.lst.orig cp /mnt-user/boot/grub/menu.lst . #umount all partitions cd / umount -a #then wait at least 8 sec before you reboot
To support USB storage devices at bootup, the following changes need to be made to initramfs:
mknod -m 644 sdb1 b 8 17 mknod -m 644 sdc1 b 8 33
insmod -f /modules/usbcore.ko insmod -f /modules/ehci-hcd.ko insmod -f /modules/uhci-hcd.ko insmod -f /modules/libusual.ko insmod -f /modules/usb-storage.ko
[NB. Please note that the initramfs of EeePC only support ash commands and limited BusyBox commands including: [ cat cp cut dd dmesg echo env expr false grep insmod ln losetup ls mdev mkdir mknod mount mv pivot_root realpath rm rmmod sed sh sleep switch_root test true umount vi ]