#! /bin/sh

# $Progeny: S99unconfigured,v 1.13 2002/04/09 23:01:15 branden Exp $

# work around possible bug(s) in debootstrap process
dpkg --configure --pending 2> /dev/null || true

# ensure the network interface is up
module=$(discover --format="%m\n" ethernet)
modprobe $module
ifdown eth0 2> /dev/null
ifup eth0 2> /dev/null

# Get the X server all nice and configured; if auto-detection
# worked the user should not get prompted; otherwise they have
# to be so we get a working X server to run the configlets.
for PKG in xserver-common xserver-xfree86; do
    DEBIAN_FRONTEND=noninteractive dpkg-reconfigure $PKG
done

PATH=$PATH:/usr/bin/X11
xinit /etc/xinitrc-pgi -- vt7

if [ ! -f /etc/configlets-debug ]; then
    rm -f /etc/rcS.d/S99unconfigured
    rm -rf /etc/configlets
    rm -rf /usr/share/configlets/user
    rm -f /etc/xinitrc-pgi
    rm -f /usr/bin/do-apt-cdrom
fi
