diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 50aa9c3fa..a70f9542a 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -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 diff --git a/xCAT/postscripts/xcatinstallpost b/xCAT/postscripts/xcatinstallpost new file mode 100644 index 000000000..11140cd94 --- /dev/null +++ b/xCAT/postscripts/xcatinstallpost @@ -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 diff --git a/xCAT/postscripts/xcatpostinit1 b/xCAT/postscripts/xcatpostinit1 new file mode 100644 index 000000000..ad298fc28 --- /dev/null +++ b/xCAT/postscripts/xcatpostinit1 @@ -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