#
# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# 
# T2 SDE: scripts/Build-Pkg
# Copyright (C) 2004 - 2008 The T2 SDE Project
# Copyright (C) 1998 - 2003 ROCK Linux Project
# 
# More information can be found in the files COPYING and README.
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- T2-COPYRIGHT-NOTE-END ---

# Set umask to safe level, and enable core dumps.
#
umask 022
ulimit -c 2097151
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH

# Setup /dev for boot without initrd.
#
if [ ! -e /dev/console ]; then
	echo "No /dev/console, boot without initrd? Initializig /dev."
	mount -n /dev
	mount -n /proc
	mount -n /sys
	ln -s /proc/self/fd /dev/fd

	mknod /dev/null c 1 3
	mknod /dev/zero c 1 5

	udevd &
	udevtrigger
	udevsettle
	kill %1

	[ -e /dev/console ] || mknod /dev/console c 5 1
	[ -e /dev/tty ] || mknod /dev/tty c 5 0
fi

# Execute the program.
#
eval exec "$4" > /dev/console 2>&1 < /dev/console
