diff options
author | Dirk von Suchodoletz | 2007-07-01 23:06:14 +0200 |
---|---|---|
committer | Dirk von Suchodoletz | 2007-07-01 23:06:14 +0200 |
commit | cf117bf9d68c01e0e9425a50469229caf20bfa6f (patch) | |
tree | 1e87e6f4285f9fcfb2835f50e65200377d449ed2 /initramfs | |
parent | * verbose-mode is now activated automatically if you request the listing (diff) | |
download | core-cf117bf9d68c01e0e9425a50469229caf20bfa6f.tar.gz core-cf117bf9d68c01e0e9425a50469229caf20bfa6f.tar.xz core-cf117bf9d68c01e0e9425a50469229caf20bfa6f.zip |
Further cleanups for ConfTGZ transport (to be more flexible for future
versions - ftp/http with wget).
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1212 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rw-r--r-- | initramfs/distro-specs/debian/functions-default | 19 | ||||
-rw-r--r-- | initramfs/initrd-stuff/etc/functions | 16 |
2 files changed, 17 insertions, 18 deletions
diff --git a/initramfs/distro-specs/debian/functions-default b/initramfs/distro-specs/debian/functions-default index a84fece6..e5454861 100644 --- a/initramfs/distro-specs/debian/functions-default +++ b/initramfs/distro-specs/debian/functions-default @@ -1,14 +1,17 @@ -# configuration script for general Debian to configure linux diskless clients -# (executed within initialramfs after genconfig) +# Copyright (c) 2003 - 2006 - RZ Uni Freiburg +# Copyright (c) 2007 - OpenSLX GmbH # -# this file is distributed under the GPLv2, see ~/openslx/COPYING +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING # -# Dirk von Suchodoletz <dvs@OpenSLX.com>, 22-12-2006 -# Felix Endres, 30-04-2006 +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org # -# (c) 2006 - RZ Universitaet Freiburg -# (c) 2006 - OpenSLX GmbH - +# General information about OpenSLX can be found at http://openslx.org +# +# Configuration script for general Debian distributions to setup linux +# stateless clients (included within initial ramfs) + # empty functions are defined at the beginning of /etc/functions # distro specific stuff to initialize diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index 7b00c092..313bc61e 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -308,15 +308,9 @@ echo "dhcp finished at $(sysup)" > /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) -# tftpget is helper function for fileget -tftpgetunpack () { +unpack () { # $1 is config file name to get, $2 IP of server to get file from -echo -e "tftp\t69/tcp\ntftp\t69/udp" > /etc/services -local dst=/tmp/$(basename $1) -# tftp get part -# distinguish between busybox tftp and standalone (in.tftp) client -tftp -g -r $1 -l $dst $2 2>/dev/null -# unpack part +local dst=$1 if [ -s $dst ] ; then # fixme: handle different types of packaging (gzip/bzip2)?? if ! tar -xpzf $dst 2> /tmp/ConfTGZ-tar-error ; then @@ -338,7 +332,8 @@ if [ -n "$filesrc" ] ; then local srvproto=$(uri_token $filesrc prot) local cfgfile="/$(uri_token $filesrc path)" local tftpserver=$(checkip $(uri_token $filesrc server)) - tftpgetunpack $tftp $cfgfile $tftpserver + tftp -g -r $cfgfile -l /tmp/$(basename $cfgfile) $tftpserver 2>/dev/null \ + && unpack /tmp/$(basename $cfgfile) else # predefined value for openslx environment; it is expected that this # directory is just below the tftpboot/tftproot (path to which the @@ -352,7 +347,8 @@ and as last\n# distro/default" >> /tmp/confviafile mac=$(echo $macaddr|sed "s/:/-/g") for cfgfile in $cfgdir/$SYSTEM_NAME/01-$mac.tgz \ $cfgdir/$SYSTEM_NAME/default.tgz ; do - tftpgetunpack $cfgfile $tftpserver && break + tftp -g -r $cfgfile -l /tmp/$(basename $cfgfile) $tftpserver 2>/dev/null \ + && { unpack /tmp/$(basename $cfgfile) && break; } done fi test -f /initramfs/machine-setup && \ |