#!/bin/sh
# Vector Linux Setup Configuration
# This script is supposed to be executed in a chrooted environment
# to configure the Vector Linux virgin
# Called by setup-install like this:
#    setup-stage1 vector-virgin <ROOT_DEVICE> <KEYMAP>
#
# We are going to do a quick setup thus this baby can boot properly 
# - initialisation
# - liloconf
#
# (c) Eko M. Budi, 2004
# (c) Vector Linux, 2004
# Released under GNU GPL
#

export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/opt/bin"

#####################################################
# Arguments from second stage
ROOT_DEVICE=$2
KEYMAP=$3

# Ok, now get the functions
vdir=$(dirname $0)
. $vdir/vasm-functions

if [ "$1" != "vector-virgin" ]; then
    msgbox "This script is supposed to be for installation only" "WARNING"
    sleep 2
fi

infobox "Checking and initializing the new installed system"

# Mount procfs
if ! mount | grep -e '^proc'; then
    MOUNT_PROC=1
    mkdir -p /proc   &> /dev/null
    mount -t proc none /proc &> /dev/null
fi

# Reset the library first
ldconfig
sleep 2

infobox "The system looks good. Now let's setup LILO" "VECTOR LINUX INSTALL"
sleep 3

while [ 0 ] ; do
    $vdir/vliloconf / $ROOT_DEVICE && clean_exit 0
    yesnobox "LILO is not properly setup.\nDo you want to try again ?" "WARNING" || clean_exit $?
done

