#!/bin/sh # $Id: linuxrc,v 1.3 2005/03/07 20:38:31 thomasez Exp $ # # floppyfw initfile # VERSION=FLOPPYFW_VERSION # /bin/busybox echo "Booting floppyfw" PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" TERM=linux export PATH TERM umask 022 /bin/busybox mount -n -t tmpfs tmpfs /nyroot cd /nyroot # Blatantly borrowed from Rob Fowler # (from a mail on the busybox mailing list) # copy over most of the filesystem # /lost+found|/nyroot|/proc|/dev) /bin/busybox echo "Copying to new filesystem." for ii in /* do case $ii in /lost+found|/nyroot|/proc|/dev) ;; *) /bin/busybox cp -dpR $ii /nyroot/. /bin/busybox echo -n $ii" " esac done /bin/busybox echo "Done." # /bin/busybox mount -n -t proc /proc /nyroot/proc /bin/busybox mkdir initrd # /bin/busybox mount -n -t devfs devfs dev /bin/busybox mkdir dev /bin/busybox mount -t devfs none dev /bin/busybox echo -n "Pivoting.. " /bin/busybox pivot_root . initrd /bin/busybox echo "Done," cd / # /bin/busybox umount /initrd /bin/busybox echo "Mounting: proc" /bin/busybox mkdir proc /bin/busybox mount -t proc /proc /proc /bin/busybox --install -s # # Testing wether we are using a serial console. # It'd better use the serial= option but I'm not sure how to grab # that info (yet) and COMMAND_LINE=`cat /proc/cmdline` ( echo $COMMAND_LINE | grep console ) && { CONSOLE=`echo $COMMAND_LINE | sed -e 's/$/ /' -e 's/.*console=\([^ ]*\) .*/\1/' -e 's/,/ /g'` } if [ "$CONSOLE" != "" ] then set -- $CONSOLE # Need a speed. if [ $# -eq 1 ] then set -- $1 9600 fi mv /etc/inittab.serial /etc/inittab # DEV=`echo $1 | sed -e 's/\/dev\///'` DEV=`echo $1 | sed -e 's/ttyS/tts\//'` echo "$DEV::respawn:/sbin/getty -L $DEV $2 vt100" >> /etc/inittab else if [ "$CONNECT_TYPE" != "PPP" ] then echo "tts/0::respawn:/sbin/getty -L /dev/tts/0 19200 vt100" >> /etc/inittab fi rm /etc/inittab.serial fi /bin/busybox echo "Running init," exec chroot . /sbin/init dev/console 2>&1 echo "Pokker, dette skal ingen kunne lese"