--- /dev/null
+#!/bin/bash
+
+# copyright 2013 Holger Levsen <holger@layer-acht.org>
+# GPL2 licenced
+
+set -x
+export
+echo
+
+if [ "$3" = "" ] ; then
+ echo "$0 must be called with exactly three arguments: hostname mac networkdevice"
+ echo "eg: $0 gw1301 01-00-25-90-2c-03-8a eth1"
+ exit 1
+fi
+
+TARGET_HOST=$1
+TARGET_MAC=$2
+TARGET_DEV=$3
+TMPOUTPUT=$(mktemp)
+
+$(dirname $0)/pxe_riserver_setup.sh $TARGET_HOST $TARGET_MAC $TARGET_DEV install ; \
+ipmitool -H ${TARGET_HOST}-ipmi -f /etc/jenkins/$TARGET_HOST.ipmi -U ADMIN chassis power reset ; \
+sleep 90 ; \
+$(dirname $0)/pxe_riserver_setup.sh $TARGET_HOST $TARGET_MAC $TARGET_DEV localboot
+
+#ipmitool -H ${TARGET_HOST}-ipmi -f /etc/jenkins/$TARGET_HOST.ipmi -U ADMIN -I lanplus sol activate < /dev/zero | tee $TMPOUTPUT &
+
+set +x
+#
+# check for 15min whether ssh comes back
+#
+echo "Checking for sshd running on $TARGET_HOST..."
+for i in $(seq 1 90) ; do
+ sleep 10
+ if $(ping -c 1 $TARGET_HOST >/dev/null) ; then
+ echo -n "ping $TARGET_HOST ok..."
+ # check ssh
+ if $(nc -z $TARGET_HOST 22 ) ; then
+ echo "ok, sshd is running at $(date +%H:%M:%S)"
+ break
+ else
+ echo "but sshd is not running at $(date +%H:%M:%S)"
+ fi
+ fi
+done
+if ! $(nc -z $TARGET_HOST 22 ) ; then
+ figlet "Failure:"
+ echo "$TARGET_HOST still not running sshd, please investigate."
+ exit 1
+fi
+echo
+
+rm $TMPOUTPUT
+
LABEL sysinfo
MENU LABEL sysinfo
KERNEL fai/vmlinuz-install
-APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=sysinfo FAI_FLAGS=verbose,sshd,createvt,reboot console=tty0 console=ttyS1,115200
+APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=sysinfo FAI_FLAGS=verbose,createvt,reboot console=tty0 console=ttyS1,115200
LABEL install
MENU LABEL install
KERNEL fai/vmlinuz-install
-APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=install FAI_FLAGS=verbose,sshd,createvt,reboot console=tty0 console=ttyS1,115200 hostname=$TARGET_HOST
+APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=install FAI_FLAGS=verbose,createvt,reboot console=tty0 console=ttyS1,115200 hostname=$TARGET_HOST
EOF
cat $TMPFILE