#!/bin/sh
#
# Copyright 2002 Dell Computer Corp
#
# based on ks.cfg script by Amro Hatim
# Initial script: 2002-08-15 Michael Brown
# Enabled first boot for Milan: 2002-09-09 Rez Kabir 

#Common header items, import function definitions
DIR=$(dirname $0)
DIR=$(cd $DIR; pwd)

. $DIR/../functions.sh

# The purpose of this script is to unify all of the simple one or two line 
#	scripts that we need to shape up the system. Stuff like 
# 	setting the root password or refreshing skeleton dirs.
#	Stuff added here should be common stuff for ESG and CPG

# ------------------------------------------------------------------------------
logecho "refresh root account with /etc/skel"
# ------------------------------------------------------------------------------

	# WARNING: If you need to muck with .bash_profile, make sure 
	#  you do it _after_ this script.	
	#
	for i in /etc/skel/* ; do
		if [ -e $i ]; then
			cp -fr $i /root
		fi
	done

# ------------------------------------------------------------------------------
logecho "set default desktop to gnome"
# ------------------------------------------------------------------------------

	if [ -e /etc/syconfig/desktop ]; then
		mv /etc/sysconfig/desktop /etc/sysconfig/desktop-bak
	fi
	echo "DISPLAYMANAGER=GNOME" > /etc/sysconfig/desktop


# ------------------------------------------------------------------------------
logecho "Add reconfig mode to allow users to add in keyboard and lang type"
# ------------------------------------------------------------------------------

       	rm -f /etc/X11/XF86Config*

        touch /etc/reconfigSys
        rm /etc/sysconfig/firstboot

# Removing clock file to make date/time application work

       if [ -f /etc/sysconfig/clock ]; then
            rm -f /etc/sysconfig/clock
       fi


# ------------------------------------------------------------------------------
logecho "Add 'off' aliases to /etc/modules.conf to silence misc warnings"
# ------------------------------------------------------------------------------

	echo "# Turn off mcdx modules"  >> /etc/modules.conf
	echo "alias block-major-20 off" >> /etc/modules.conf

