added some postscripts to get ready for supporting postbootscripts

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4778 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2009-12-15 14:25:36 +00:00
parent 2438bdf779
commit ca4deae18b
3 changed files with 93 additions and 4 deletions

View File

@ -219,10 +219,10 @@ if [ $argnum -gt 2 ]; then
fi
#ADDSITEYUM is set by post.rh and post.rh.iscsi for full installtion
if [[ "$ADDSITEYUM" = "1" ]]; then
TMP=`sed "/postscripts-start-here/ a addsiteyum" /tmp/mypostscript`
echo "$TMP" > /tmp/mypostscript
fi
#if [[ "$ADDSITEYUM" = "1" ]]; then
# TMP=`sed "/postscripts-start-here/ a addsiteyum" /tmp/mypostscript`
# echo "$TMP" > /tmp/mypostscript
#fi
#MYCONT=`cat /tmp/mypostscript`
#echo "$MYCONT"
@ -246,6 +246,8 @@ run_ps () {
" > /tmp/mypostscript
echo "$TMP" >> /tmp/mypostscript
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ s/\(.*\)/run_ps \1/;s/run_ps\s*#/#/;s/run_ps\s*$//" /tmp/mypostscript`
echo "$TMP" > /tmp/mypostscript
if [ $argnum -eq 0 ]; then
#notify the server that we are done with netbooting

View File

@ -0,0 +1,48 @@
#!/bin/sh
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
#################################################################
#
# xCAT script for running postboot scripts for full install case.
#################################################################
if [ ! `uname` == Linux ]; then
MYDIR=`dirname $0`
#exec $MYDIR/xcatdsklspost.aix
exit
fi
let SLI=$RANDOM%10
sleep $SLI
if grep 'rw /rw tmpfs ' /proc/mounts >& /dev/null; then
touch /var/lock/subsys/xcatmounts
echo '#!/bin/bash' > /etc/rc6.d/K10xcatmounts
echo umount -l /ro >> /etc/rc6.d/K10xcatmounts
echo umount -l /rw >> /etc/rc6.d/K10xcatmounts
chmod 755 /etc/rc6.d/K10xcatmounts
ln -sf /etc/rc6.d/K10xcatmounts /etc/rc0.d/K10xcatmounts
fi
cd /xcatpost;
PATH=/xcatpost:$PATH
export PATH
chmod +x /xcatpost/*;
if [ -x /usr/bin/openssl ]; then
XCATSERVER="$SIP:3001"
export XCATSERVER
USEOPENSSLFORXCAT=1 #Though this is the only method going forward, flag to allow backward compatibility with 2.2 generated netboot images
export USEOPENSSLFORXCAT
fi
DHCP_TMP=`sed 's/\(DHCPINTERFACES=\)\(.*\)$/\1"\2"/' /tmp/mypostscript.post`
echo "$DHCP_TMP" > /tmp/mypostscript
echo "updateflag.awk \$MASTER 3002 \"installstatus booted\"" >> /tmp/mypostscript.post
chmod +x /tmp/mypostscript.post
if [ -x /tmp/mypostscript.post ];then
/tmp/mypostscript.post
fi

View File

@ -0,0 +1,39 @@
#!/bin/sh
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
# chkconfig: 345 84 59
# description: service node postboot script hack
# processname: xcatpostinit
### BEGIN INIT INFO
# Provides: xcatpostinit
# Default-Start: 3 4 5
# Default-stop: 0 1 2 6
# Required-Start:
# Required-Stop:
# Short-Description: xCATpost
# Description: xCAT post boot script
### END INIT INFO
# Source function library.
if [ -x /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
fi
case $1 in
restart)
$0 stop
$0 start
;;
status)
echo -n "xcatpostinit1 runs only at boot, runs additional post scripts"
;;
stop)
echo -n "nothing to stop "
;;
start)
# run /opt/xcat/xcatinstallpost
if [ -r /opt/xcat/xcatinstallpost ]; then
/opt/xcat/xcatinstallpost
fi
;;
esac