Update of /cvsroot/wisp/wisp/users/pisi/winix/beast/beast-initrd
In directory sc8-pr-cvs1:/tmp/cvs-serv7371/beast-initrd
Added Files:
linuxrc
Log Message:
beast initrd initial checkin
--- NEW FILE: linuxrc ---
#!/busybox/busybox ash
echo -n "Searching for bones..."; echo "Found."
mount -n -t proc proc /proc
# search for the cdrom that booted us. That will be the flesh on the bones.
# basicall this must find the root file system. and mount it. all customization
# of the root finding should happen here.
echo -n "Searching for flesh..."
# note - this ide stuff is hack
set -- /dev/cdroms/cdrom* /dev/ide/host0/bus0/target0/lun0/part*
places="$@"
while test ! -z "$1" && test ! -f /flesh/flesh
do
umount /flesh 2> /dev/null
mount -o ro -t iso9660 "$1" /flesh 2> /dev/null
test -f /flesh/flesh && echo "$1 will be my flesh."
shift
done
if test ! -f /flesh/flesh; then
echo "Not found!"
echo
echo "Sorry, i can't live without flesh on my bones."
echo "I searched from $places but in vain."
sleep 1000
fi
# we have the beast media mounted on /flesh now.
# the current implementation uses romfs on /flesh/flesh
#
# root change 1 - off the ramdisk, onto the media
umount /proc
cd /flesh
pivot_root . initrd
cd /
# mount the beast
mount -n -t devfs devfs /dev
losetup /dev/loop/0 /flesh
mount -n -o ro -t romfs /dev/loop/0 /fleshroot
# root change 2 - off the media, onto beast flesh
cd /fleshroot
pivot_root . media
cd /
# run the beast.
mount -n -t devfs devfs /dev
exec chroot . /winix/linux/sysinit < dev/console > dev/console 2>&1
#this should not be rached
exit 0
|