summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Izquierdo (mariodebian) <mariodebian@gmail.com>2009-10-03 13:43:42 +0200
committerMario Izquierdo (mariodebian) <mariodebian@gmail.com>2009-10-03 13:43:42 +0200
commit16dc0fed221032b6826e34686560ea7600ed52c9 (patch)
tree98df490d34dfce768f1f74871b024ec348ae0531
parent7a77d47f1136d0e0c96ca61320c79faab592c07a (diff)
call user scripts in /etc/tcos/pxelinux.d/*.hook files
-rw-r--r--Makefile3
-rw-r--r--conf/tcos-generation-functions.sh7
-rw-r--r--tcos/example.dual.server.conf28
3 files changed, 38 insertions, 0 deletions
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