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"
+ echo "$0 must be called with three or four arguments: hostname mac networkdevice [branch]"
+ echo "eg: $0 gw1301 01-00-25-90-2c-03-8a eth1 master"
exit 1
fi
TARGET_HOST=$1
TARGET_MAC=$2
TARGET_DEV=$3
+TARGET_BRANCH=$4
-$(dirname $0)/pxe_riserver_setup.sh $TARGET_HOST $TARGET_MAC $TARGET_DEV install ; \
+$(dirname $0)/pxe_riserver_setup.sh $TARGET_HOST $TARGET_MAC $TARGET_DEV "$TARGET_BRANCH" 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
+$(dirname $0)/pxe_riserver_setup.sh $TARGET_HOST $TARGET_MAC $TARGET_DEV "$TARGET_BRANCH" localboot
# doesnt work because ipmitool too frequently segfaults
#ipmitool -H ${TARGET_HOST}-ipmi -f /etc/jenkins/$TARGET_HOST.ipmi -U ADMIN -I lanplus sol activate < /dev/zero | tee $TMPOUTPUT &
#export
echo
-if [ "$4" = "" ] || ( [ "$4" != "install" ] && [ "$4" != "sysinfo" ] && [ "$4" != "localboot" ] ) ; then
- echo "$0 must be called with exactly four arguments: hostname mac networkdevice action"
- echo "eg: $0 gw1301 01-00-25-90-2c-03-8a eth1 install"
+if [ "$5" = "" ] || ( [ "$5" != "install" ] && [ "$5" != "sysinfo" ] && [ "$5" != "localboot" ] ) ; then
+ echo "$0 must be called with exactly five arguments: hostname mac networkdevice branch action"
+ echo "eg: $0 gw1301 01-00-25-90-2c-03-8a eth1 master install"
echo "action must be either 'install', 'sysinfo' or 'localboot'"
exit 1
fi
TARGET_HOST=$1
TARGET_MAC=$2
TARGET_DEV=$3
-TARGET_ACTION=$4
+TARGET_BRANCH=$4
+TARGET_ACTION=$5
echo "Re-configuring PXE on riserver:"
echo
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,createvt,reboot 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 hostname=$TARGET_HOST BRANCH=$TARGET_BRANCH
EOF
cat $TMPFILE