summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff/etc/functions
diff options
context:
space:
mode:
authorDirk von Suchodoletz2007-07-01 23:06:14 +0200
committerDirk von Suchodoletz2007-07-01 23:06:14 +0200
commitcf117bf9d68c01e0e9425a50469229caf20bfa6f (patch)
tree1e87e6f4285f9fcfb2835f50e65200377d449ed2 /initramfs/initrd-stuff/etc/functions
parent* verbose-mode is now activated automatically if you request the listing (diff)
downloadcore-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/initrd-stuff/etc/functions')
-rw-r--r--initramfs/initrd-stuff/etc/functions16
1 files changed, 6 insertions, 10 deletions
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 && \