#!/bin/bash set -e set -x VER=$(uname -r) NAME=$(basename $0) rm -fr root mkdir root cp -a $0 root/ pushd root mkdir -p dev bin etc/udhcpc etc/init.d lib/modules mknod dev/console c 5 1 mknod dev/tty2 c 4 2 mknod dev/tty3 c 4 3 mknod dev/tty4 c 4 4 wget http://www.busybox.net/downloads/binaries/latest/busybox-i686 -O bin/busybox chmod +x bin/busybox ln -s bin/busybox init ln -s busybox bin/sh wget -q http://git.busybox.net/busybox/plain/examples/udhcp/simple.script -O etc/udhcpc/default.script chmod +x etc/udhcpc/default.script cat > etc/init.d/rcS </proc/sys/kernel/hotplug find /sys -name 'modalias' -type f -exec sort -u {} \; | sort | uniq | grep -v ^acpi | xargs -n 1 /sbin/modprobe echo root::0:0:root:/root:/bin/sh > /etc/passwd ifconfig lo up ifconfig eth0 up udhcpc -i eth0 -R -b -s /etc/udhcpc/default.script hostname ${NAME} EOF chmod +x etc/init.d/rcS cat > etc/inittab < initrd.cpio.gz