summaryrefslogtreecommitdiffstats
path: root/initrd/initrd-stuff/etc/functions
diff options
context:
space:
mode:
authorDirk von Suchodoletz2006-03-23 21:26:02 +0100
committerDirk von Suchodoletz2006-03-23 21:26:02 +0100
commit1ea77b35197a40aa9b90e9092473701c217ccbbf (patch)
tree578cb062c048776bfa102b7fd17ebb77bc2a8957 /initrd/initrd-stuff/etc/functions
parentput atfpd_conf, autoindent (diff)
downloadcore-1ea77b35197a40aa9b90e9092473701c217ccbbf.tar.gz
core-1ea77b35197a40aa9b90e9092473701c217ccbbf.tar.xz
core-1ea77b35197a40aa9b90e9092473701c217ccbbf.zip
stuff for tftp file get, path for vmsessions/*.desktop ...
git-svn-id: http://svn.openslx.org/svn/openslx/ld4@117 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd/initrd-stuff/etc/functions')
-rw-r--r--initrd/initrd-stuff/etc/functions41
1 files changed, 28 insertions, 13 deletions
diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions
index ea7243b4..3e5b7a8a 100644
--- a/initrd/initrd-stuff/etc/functions
+++ b/initrd/initrd-stuff/etc/functions
@@ -2,13 +2,13 @@
# linux diskless clients (included by init, hwautocfg,
# servconfig, ... within initial ramdisk)
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 21-03-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 23-03-2006
# Felix Endres, 21-03-2006
# Blub
#
# Copyright: (c) 2006 - RZ Universitaet Freiburg
#
-# Version: 0.4.2a
+# Version: 0.4.2b
#######################################################################
# generate events with the sysfs trigger
@@ -257,7 +257,20 @@ echo "finished" > /tmp/dhcp-done
#######################################################################
# function for retrieving configuration file (machine-setup) via tftp
# from a predefined server or given source (file=tftp-server:/path via
-# kernel command line)
+# kernel command line)
+# tftpget is helper function for fileget
+tftpget () {
+# $1 is type of tftp command, $2 is config file name to get, $3 IP of
+# server to get file from
+case "$1" in
+ atftp)
+ atftp -g -r $2 $3
+ ;;
+ tftp)
+ echo "get $2" | tftp $3
+ ;;
+esac
+}
fileget () {
for tftp in /bin/atftp /bin/tftp ; do
test -x $tftp && break
@@ -265,19 +278,21 @@ done
if [ -n "$FILESRC" ] ; then
cfgfile=${FILESRC#*:}
tftpserver=${FILESRC%:*}
+ tftpget $tftp $cfgfile $tftpserver
else
- cfgfile="/tftpboot/dxs-config/$clientip.cfg"
+ cfgfile="/tftpboot/dxs-config"
+ # ensure that a / is at the end of path to config file
+ cfgfile=$cfgfile"/"
tftpserver=$serverip
+ # try to get configuration files successively; start with first part
+ # of the servers IP, add second part ...
+ set `IFS="."; echo $serverip`
+ for i in $1 $2 $3 $4 ; do
+ cfgfile=$cfgfile$i
+ tftpget $tftp $cfgfile $tftpserver
+ cfgfile=$cfgfile"."
+ done
fi
-#
-case "$tftp" in
- atftp)
- atftp -g -r $cfgfile $tftpserver
- ;;
- tftp)
- echo "get $cfgfile" | tftp $tftpserver
- ;;
-esac
echo "finished" > /tmp/file-done
}