#!/sbin/sh
#
# $Id: init,v 1.3 1998/01/11 06:43:17 root Exp root $
#
# SPARC-Linux Xterminal init.
#
# Based on "Xkernel" from Seth Robertson (seth@ctr.columbia.edu)
#

PATH=/bin:/usr/bin:/usr/X11/bin;
XSERV_BIN=/usr/X11/bin/X;
XSERV_IP= ##SERVER_IP##
XSERV_IP=${XSERV_IP:-"***SERVER IP ADDRESS NOT SET***"};
export PATH XSERV_BIN XSERV_IP;

#
# This version depends upon a font server being available.
#
FS_LOC="tcp/${XSERV_IP}:7100/all"

#
# The chooser will work, so if you want, you can modify this line
# to use "-indirect <HOST_IP>" if you want to. Please do note that
# the kernel has no hostname lookup capabilities, so you must use
# the server IP address (as elsewhere in this file).
#
XDMCMD="-query ${XSERV_IP}"

#
# The complete server line. The "-fbinfo" will show which frame-buffer the
# system thinks it should be running on.
#
XSRVCMD="${XSERV_BIN} -fbinfo -pn -fp ${FS_LOC} ${XDMCMD}";

exec >/dev/console 2>&1
echo "SPARCLinux Xkernel init is running";

#
# Mount the /proc filesystem. This is a local mount and will not write
# to the common /proc directory in the client tree on the server.
#
echo "Mounting /proc filesystem...";
mount -n /proc /proc -t proc;
[ ${?} -ne 0 ] && echo "*** Failed to mount /proc ***";

[ ! -f /usr/lib/X11/rgb.db -o ! -f /usr/lib/X11/rgb.txt ] && \
		echo "*** RGB Database info missing ***";

#
# Now start up the X-server.
#
echo "Starting X server process...";
${XSRVCMD} >/dev/console 2>&1;

#
# For debugging purposes (Yes Virginia, you can have a shell, but only if
# youve been paying attention and have read this far...). "cat /proc/meminfo"
# and "ps -alwx" are interesting to look at as the X-server process gradually
# increases in size).
#
#/bin/sh >/dev/console 2>&1 </dev/console
#
########################################
#
echo "Dropped out of bottom of init... \
		Aaaaaaargh!   (exits stage left, staggering and holding head)";
