From c134e0c3d4896d87397ffa7348175aa221c74e79 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 1 Aug 2007 15:44:23 +0000 Subject: ... add option/proto for file=... to use some local source for ConfTGZ, see r1296, r1297 too. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1298 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/initrd-stuff/etc/functions | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'initramfs/initrd-stuff/etc/functions') diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index 34b1cd27..ab28765d 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -329,8 +329,6 @@ echo "dhcp finished at $(sysup)" > /tmp/dhcp-done unpack () { # $1 is config file name to get, $2 IP of server to get file from local dst=$1 -echo "unpacking $dst" >>/tmp/fileblub -ls -al $dst >>/tmp/fileblub if [ -s $dst ] ; then # fixme: handle different types of packaging (gzip/bzip2)?? if ! tar -xpzf $dst 2> /tmp/ConfTGZ-tar-error ; then @@ -346,16 +344,26 @@ fi } fileget () { # get type of tftp available, alternatively use wget for ftp or http +# if local device file is specified - mount and unmount after copying local cfgfile -echo "$fileprot $filepath $filepath" > /tmp/fileblub [ "x$fileprot" = "x" ] && fileprot=tftp if [ "x$filepath" != "x" ] ; then cfgfile=${filepath} [ "x$fileserv" = "x" ] && fileserv=$(checkip ${serverip}) case "$fileprot" in ftp|http) - wget $fileprot://$fileserv/$cfgfile -O /tmp/$(basename $cfgfile) \ - 2>/dev/null && { unpack /tmp/$(basename $cfgfile) && break; } + wget $fileprot://$fileserv/$cfgfile -O /tmp/$(basename $cfgfile) \ + 2>/dev/null && { unpack /tmp/$(basename $cfgfile) && break; } + ;; + file) + local ldev=$fileserv + echo "Waiting for /dev/$ldev ...." + waitfor /dev/$ldev 10000 + mkdir /tmp/$ldev + echo -e "ext2\nreiserfs\nvfat\nxfs" >/etc/filesystems + mount /dev/$ldev /tmp/$ldev || error "$init_errlfg" + unpack $cfgfile + umount /dev/$ldev ;; *) tftp -g -r $cfgfile -l /tmp/$(basename $cfgfile) $fileserv \ -- cgit v1.2.3-55-g7522