Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
XCOMM $XConsortium: Imakefile /main/4 1996/04/21 19:28:22 drk $
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
-DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP)
AllTarget(dtconfig rc.dt)
CppScriptTarget(dtconfig,dtconfig.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(rc.dt,rc.dt.src,$(LOCAL_CPP_DEFINES),)

View File

@@ -0,0 +1,265 @@
XCOMM!/bin/ksh
XCOMM $XConsortium: dtconfig.src /main/5 1996/04/23 12:05:26 drk $
XCOMM * *
XCOMM * (c) Copyright 1993, 1994 Hewlett-Packard Company *
XCOMM * (c) Copyright 1993, 1994 International Business Machines Corp. *
XCOMM * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
XCOMM * (c) Copyright 1993, 1994 Novell, Inc. *
XCOMM *
#define HASH #
DTPATH=CDE_INSTALLATION_TOP/bin/dtlogin
XDMCONF=/usr/lpp/X11/lib/X11/xdm/xdmconf
#ifdef _POWER
GETTY=/usr/sbin/getty
#else
GETTY=/etc/getty
#endif
#ifdef _POWER
#define MKITAB /usr/sbin/mkitab
#define RMITAB /usr/sbin/rmitab
#define LSITAB /usr/sbin/lsitab
#define RCDT "dt:`cat /etc/.init.state`:wait:/etc/rc.dt"
#define RCDT2 "dt:2:wait:/etc/rc.dt"
#else
#define MKITAB /etc/mkitab
#define RMITAB /etc/rmitab
#define LSITAB /etc/lsitab
#define RCDT "dt:`cat /etc/.init.state`:wait:/usr/dt/bin/rc.dt"
#define RCDT2 "dt:2:wait:/usr/dt/bin/rc.dt"
#endif
XCOMM
XCOMM Message text
XCOMM
msg1='can only be run by the super user. \n'
msg2='The CDE environment is now set as the default user interface. This \
interface will appear on login for all users of the system. \
To see this change take effect you must shutdown and restart your system.\n'
msg3='The Command line is now set as the default user interface. This\
interface will appear on login for all users of the system.\
To see this change take effect you must shutdown and restart your system.\n'
msg4='The CDE environment is Already set as the default User Interface.\n'
msg5='The Command line is already set as the default User Interface.\n'
msg6='usage: %s \
-e (enable auto-start of dtlogin) \
-d (disable auto-start of dtlogin) \
-kill (kill dtlogin) \
-reset (reset dtlogin - reread configuration files)\n'
msg7='Too many arguments \n'
msg8='Needs one argument \n'
msg9='Could not disable xdm, Please refer to xdm man pages to\
disable xdm and try again.\n'
msg10='Dtlogin is not running \n'
GetLoginServerPid()
{
HASH GetLoginServerPid() prints login server pid if found, else nothing
grep=/usr/bin/grep
ps=/usr/bin/ps
cut=/usr/bin/cut
awk=/usr/bin/awk
$ps -u 0 -el | $grep dtlogin | $awk '{print $4 " " $5}' |
while read -r pid ppid; do
if [ "$($ps -p $ppid | $grep dtlogin)" = "" ]; then
print "$pid"
break
fi
done
}
SignalDt()
{
HASH SignalDt() - kill or reset login server
HASH $1 - operation (kill|reset)
pid=`GetLoginServerPid`
if [ "$pid" != "" ]; then
if [ "$1" = "kill" ]; then
/bin/kill $pid #kill login server
else
/bin/kill -HUP $pid #reset login server
fi
Exit 0
else
Exit 1 200 "no login server is running\n"
fi
}
Message()
{
HASH Message() - display message from dtconfig.cat
HASH $1 - message id
HASH $2 - fallback message text
HASH $3 - message insert 1
HASH $4 - message insert 2
dspmsg -s 10 dtconfig.cat $1 "$2" "$3" "$4"
}
Exit()
{
HASH Exit() - display optional message and exit
HASH $1 - exit code
HASH $2 - message id (optional)
HASH $3 - fallback message text
HASH $4 - message insert 1
HASH $5 - message insert 2
if [ "$2" != "" ]; then
Message $2 "$3" "$4" "$5"
fi
exit $1
}
DisableXdm()
{
HASH DisableXdm() - disable inittab start of xdm if necessary
HASH
HASH Check for xdm inittab entry
HASH
egrep "^xdm" /etc/inittab > /dev/null 2>&1
rc=$?
HASH
HASH Check for the existence of xdm Subsystem.
HASH
lssrc -s xdm > /dev/null 2>&1
rc1=$?
HASH
HASH if either or both of the tests are true unconfigure xdm
HASH Note that a return code of 0 is true
HASH
if [ "$rc" = "0" ] || [ "$rc1" = "0" ]; then
if [ ! -f $XDMCONF ]; then
Exit 1 9 "$msg9"
fi
$XDMCONF -d
fi
}
ConfigureDt()
{
HASH ConfigureDt() - enable or disable inittab start of dtlogin
HASH $1 - operation (enable|disable)
HASH
HASH Disable xdm if necessary
HASH
DisableXdm
HASH
HASH Check for the existence of COSE Subsystem and create if
HASH it's not there are we are enabling dtlogin
HASH
/bin/lssrc -s dtsrc > /dev/null 2>&1
if [ "$?" -ne 0 -a "$1" = "enable" ]; then
/bin/mkssys -s dtsrc -p $DTPATH -u 0 > /dev/null 2>&1
fi
HASH
HASH See if 'dt' is in inittab
HASH
LSITAB dt > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
curstate="disabled"
else
curstate="enabled"
fi
if [ "$1" = "enable" ]; then
if [ "$curstate" = "enabled" ]; then
HASH
HASH Already enabled
HASH
Exit 0 4 "$msg4"
fi
HASH
HASH Enable it
HASH
if [ -s /etc/.init.state ]; then
MKITAB RCDT
else
HASH
HASH if /etc/.init.state does NOT exist, hard code a 2 in the inittab entry
HASH
MKITAB RCDT2
fi
Message 2 "$msg2"
HASH
HASH move the "cons" record to the end of inittab file,
HASH and, after the "dt" record to let desktop come up
HASH before console login.
HASH
consitab=`LSITAB cons`
if [ ! -z "$consitab" ]; then
RMITAB cons
MKITAB -i dt "$consitab"
fi
Exit 0
else # $1 = "disable"
if [ "$curstate" = "disabled" ]; then
HASH
HASH Already disabled
HASH
Exit 0 5 "$msg5"
fi
HASH
HASH remove the "dt" inittab entry for disabling "dt"
HASH Note: The "dtsrc" subsystem would remain intact.
HASH It gets removed only when the super user deletes it
HASH explicitly by the rmssys command.
HASH
RMITAB "dt"
Message 3 "$msg3"
Exit 0
fi
}
XCOMM
XCOMM Check if the user is a super user.
XCOMM
if [ "root" != `/usr/bin/whoami` ]; then
echo "`basename $0`: \c"
Exit 1 1 "$msg1"
fi
XCOMM
XCOMM Check param count
XCOMM
if [ $# -ne 1 ]; then
Exit 1 6 "$msg6" "`basename $0` -e|-d|-kill|-reset"
fi
XCOMM
XCOMM Check options and run command
XCOMM
case $1 in
-e) ConfigureDt enable;;
-d) ConfigureDt disable;;
-kill) SignalDt kill;;
-reset) SignalDt reset;;
*) Exit 1 6 "$msg6" "`basename $0` -e|-d|-kill|-reset"
esac

View File

@@ -0,0 +1,94 @@
XCOMM! /bin/ksh
XCOMM $XConsortium: rc.dt.src /main/5 1996/04/23 12:05:38 drk $
XCOMM * *
XCOMM * (c) Copyright 1996 Digital Equipment Corporation.
XCOMM * (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
XCOMM * (c) Copyright 1993,1994,1996 International Business Machines Corp.
XCOMM * (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
XCOMM * (c) Copyright 1993,1994,1996 Novell, Inc.
XCOMM * (c) Copyright 1996 FUJITSU LIMITED.
XCOMM * (c) Copyright 1996 Hitachi.
#define HASH #
XCOMM COMPONENT_NAME: DESKTOP rc.dt
XCOMM
XCOMM FUNCTIONS:
XCOMM
XCOMM ORIGINS: 27
XCOMM
XCOMM (C) COPYRIGHT International Business Machines Corp. 1994, 1995
XCOMM All Rights Reserved
XCOMM Licensed Materials - Property of IBM
XCOMM
XCOMM US Government Users Restricted Rights - Use, duplication or
XCOMM disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
XCOMM
XCOMM ###################################################################
XCOMM rc.dt -
XCOMM starts the AIX Windows Desktop Login
XCOMM waits for the X Server to start
XCOMM ###################################################################
if [ "$1" != "boot" -a -f /.bootsequence ]
then
XCOMM
XCOMM clean things up from graphical boot
XCOMM
/usr/bin/rm -f /.bootsequence
if [ -f /.bootsequence ]; then
echo "\n\nError: Unable to remove /.bootsequence.\n\n"
fi
/usr/bin/ps -ef | /usr/bin/grep "dtlogin" | /usr/bin/grep -v grep >/dev/null
if [ "$?" -eq 0 ] ; then
exit 0
fi
fi
XCOMM
XCOMM Start the dtsrc subsystem
XCOMM
if [ "$1" = "boot" ]; then
/usr/dt/bin/dtlogin -daemon
else
/usr/bin/startsrc -s dtsrc 2>/dev/null 1>/dev/null
fi
XCOMM
XCOMM Check for error on starting the dtsrc subsystem
XCOMM
rc=$?
if [ "$rc" != "0" ]; then
echo "\n\nERROR: The AIX Windows Desktop is not correctly configured\n"
exit 1
fi
echo "Starting AIX Windows Desktop....\c"
XCOMM
XCOMM Sleep for <= 10 secs for the X server to come up.
XCOMM
i=10
while [ "$i" != 0 ]
do
HASH
HASH checking if the X server is up and running.
HASH
XPID=`ps -ef | awk '$8~/^.*\/X$/{print $3}'`
if [ -n "$XPID" ]; then
ps -ef | grep $XPID | grep "dtlogin" | grep -v grep 1>/dev/null
rc=$?
else
rc=1
fi
if [ "$rc" -eq "0" ]; then
break
fi
sleep 1
echo ".\c"
i=`expr $i - 1` # decrement count
done
sleep 1