#!/bin/sh

# dyne:III live-boot script
# by Denis Roio <jaromil@dyne.org>
# GNU GPL v3

PREREQ=""

prereqs()
{
	echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
	prereqs
	exit 0
	;;
esac

. /scripts/live-helpers
. /scripts/live-functions

# we operate on boot type local
bootconf=$(egrep '^BOOT=' /conf/initramfs.conf | tail -1)
if [ "$bootconf" != "BOOT=local" ]
then
    # Not a local boot : nothing to do
    exit 0
fi


# superseded by command line
for ARGUMENT in $(cat /proc/cmdline); do
    case "${ARGUMENT}" in
	textonly)
	    TEXTONLY=Yes
	    NOXAUTOLOGIN=yes
	    NOXAUTOCONFIG=yes
	    really_export TEXTONLY
	    really_export NOXAUTOLOGIN
	    really_export NOXAUTOCONFIG
	    echo "Text-only mode selected"
	    ;;

	xdriver=*)
	XDRIVER="${ARGUMENT#xdriver=}"
	really_export XDRIVER
	echo "XDriver manually set to ${XDRIVER}"
	;;

	access=*)
	ACCESS=${ARGUMENT}
	really_export ACCESS
	;;

	braille)
	    ACCESS="braille=ask"
	    really_export ACCESS
	    ;;

    esac
done


