#!/bin/sh -e
# used for initramfs
export PATH
. /lib/debian-installer/init-debug
debugshell "just booted"

mount /proc
if [ -x /sbin/udevd ]; then
	/lib/debian-installer/init-udev-devices
else
	echo "udev is missing. Giving up!" >&2
	sleep 5000
	exit
fi
init='busybox init'
for i in $(cat /proc/cmdline); do
	case $i in
		init=*)
			init=${i#init=}
			;;
		noshell)
			sed -i '/^tty2\|^tty3/s/^tty/\#tty/' /etc/inittab
			;;
	esac
done
debugshell "before init"
exec $init
