#------------------------------
# /etc/rc/setup 
#------------------------------


# cleanup fs

rm -f /var/run/* /var/lock/* 
> /var/run/utmp


# first boot ?

[ -f /etc/first_boot ] && first_boot=yes 

echo
echo "Setup is inspecting your computer :-)"
echo

if [ "`which dialog`" ] && [ "${first_boot}" = yes ]; then
	banner
	/etc/rc/dialog/model_select
else
	setup -a custom
fi

if [ "$first_boot" ] ; then
	#. /etc/rc/check-version
        echo
	echo -e " ** First boot detected : \
$BRIGHT$CYAN Welcome to muLinux! $NORMAL **"
	echo
	echo "In order to avoid this time consuming procedure in the future,"
        echo "save this configuration with 'setup -s <name>'!"
	echo "If you use 'lock' as profile name, this profile will be select"
	echo "automatically at boot time."
	echo
	echo -n "Do you want perform this action now? (y/[n]) "
	read ans

	if [ "$ans" = y ]; then
		echo "Excellent!"
		setup -s 
	else
		umount /startup 2>/dev/null && \
			echo "Extract the floppy, if you want."
	fi
		sleep 2

fi

# umount startup floppy (if any)

umount /startup 2>/dev/null

init q

# End
