From 435ca4cc1590d4a51af49b629fba73080bc2583f Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Tue, 7 Mar 2006 19:05:28 +0000 Subject: started to add alternative configuration via file (tftp get from server), see DXS Wiki too ... git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@92 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initrd/initrd-stuff/etc/functions | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'initrd/initrd-stuff/etc/functions') diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index 349ee9da..e80fdc67 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 , 20-01-2006 +# Author(s): Dirk von Suchodoletz , 07-03-2006 # Blabla # Blub # # Copyright: (c) 2006 - RZ Universitaet Freiburg # -# Version: 0.4.1b +# Version: 0.4.2a ####################################################################### # generate events with the sysfs trigger @@ -254,6 +254,33 @@ esac 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) +fileget () { +for tftp in /bin/atftp /bin/tftp ; do + test -x $tftp && break +done +if [ -n "$FILESRC" ] ; then + cfgfile=${FILESRC#*:} + tftpserver=${FILESRC%:*} +else + cfgfile="/tftpboot/dxs-config/$clientip.cfg" + tftpserver=$serverip +fi +# +case "$tftp" in + atftp) + atftp -g -r $cfgfile $tftpserver + ;; + tftp) + echo "get $cfgfile" | tftp $tftpserver + ;; +esac +echo "finished" > /tmp/file-done +} + ####################################################################### # function for creating directories after testing of their existance # avoids to recreate directories in union mounts -- cgit v1.2.3-55-g7522