From 16dc0fed221032b6826e34686560ea7600ed52c9 Mon Sep 17 00:00:00 2001 From: "Mario Izquierdo (mariodebian)" Date: Sat, 3 Oct 2009 13:43:42 +0200 Subject: call user scripts in /etc/tcos/pxelinux.d/*.hook files --- Makefile | 3 +++ conf/tcos-generation-functions.sh | 7 +++++++ tcos/example.dual.server.conf | 28 ++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 tcos/example.dual.server.conf diff --git a/Makefile b/Makefile index 0eafa3d..2bf2bf2 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,7 @@ install: install -d $(DESTDIR)/$(X11_CONF) install -d $(DESTDIR)$(TCOS_CONF)/hacking + install -d $(DESTDIR)$(TCOS_CONF)/pxelinux.d install -d $(DESTDIR)/usr/sbin install -d $(DESTDIR)$(TFTP_DIR)/pxelinux.cfg install -d $(DESTDIR)$(TFTP_DIR)/conf/ @@ -80,6 +81,8 @@ install: install -m 644 tcos/default.tpl $(DESTDIR)$(TCOS_CONF)/pxelinux.cfg.tpl + install -m 644 tcos/tcos/example.dual.server.conf $DESTDIR/$(TCOS_CONF)/pxelinux.d/example.dual.server.hook + install -m 644 tcos/help.msg $(DESTDIR)$(TFTP_DIR)/ install -m 644 tcos/help2.msg $(DESTDIR)$(TFTP_DIR)/ install -m 644 tcos/tcos.msg $(DESTDIR)$(TFTP_DIR)/ diff --git a/conf/tcos-generation-functions.sh b/conf/tcos-generation-functions.sh index 4d5c72c..9e16624 100644 --- a/conf/tcos-generation-functions.sh +++ b/conf/tcos-generation-functions.sh @@ -288,5 +288,12 @@ function parse_pxelinuxcfg(){ -e "s/__TFTP_MSG_HELP2__/${TFTP_MSG_HELP2}/g" \ -e "s/__TFTP_MSG__/${TFTP_MSG}/g" ${DESTFILE} _verbose "(t-g-f) MENU_FILE=$(cat ${DESTFILE})" + + if [ -d /etc/tcos/pxelinux.d ]; then + for f in /etc/tcos/pxelinux.d/*.hook ; do + exec $f || true + done + fi + } diff --git a/tcos/example.dual.server.conf b/tcos/example.dual.server.conf new file mode 100644 index 0000000..746032a --- /dev/null +++ b/tcos/example.dual.server.conf @@ -0,0 +1,28 @@ +#!/bin/sh +# +# This example generate needed default pxelinux.cfg/XXXXXXXX +# to force boot for alternate server +# * 10.0.0.1 is master server 10.0.0.101 => 10.0.0.130 +# * 10.0.0.2 is slave 10.0.0.131 => 10.0.0.161 +# +# +# Place files in /etc/tcos/pxelinux.d/filename.hook + + + +#CONF=/var/lib/tcos/tftp/pxelinux.cfg/ +# +#IPBASE=10.0.0 +# +#FROM=131 +#TO=161 +# +#for _ip in $(seq $FROM $TO); do +# +# IP=${IPBASE}.${_ip} +# HEXIP=$(gethostip $IP| awk '{print $NF}') +# cat $CONF/default | sed -e 's/splash/splash server=10.0.0.2/g' > $CONF/$HEXIP +# +#done + +exit 0 -- cgit v1.2.3