From: Steven Shiau Date: Mon, 25 May 2009 09:32:12 +0000 (+0200) Subject: Making fetch to work with file on sub dir on tftp server. X-Git-Tag: debian/2.0.15-1~309 X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=commitdiff_plain;h=67fde4e3bc3d532794205f6beda6a7ebe8243834 Making fetch to work with file on sub dir on tftp server. This patch allows live-initramfs to fetch file from sub dir on tftp server. The original one from live-initramfs 1.157.2 only works for the file existing on the root of tftp server, e.g. fetch=tftp://192.168.101.254/filesystem.squashfs It allows the PXE client to get the file either on the root, or on the sub dir, e.g. fetch=tftp://192.168.101.254/live/filesystem.squashfs is working now. --- diff --git a/scripts/live b/scripts/live index 4a793ad..683afa2 100755 --- a/scripts/live +++ b/scripts/live @@ -773,9 +773,11 @@ do_httpmount () then case "$url" in tftp*) - ip="$(dirname $url | sed -e 's|tftp://||g')" - log_begin_msg "Trying tftp -g -b 10240 -r $(basename ${url}) -l ${dest}/$(basename ${url}) $ip" - tftp -g -b 10240 -r $(basename ${url}) -l ${dest}/$(basename ${url}) $ip + ip="$(dirname $url | sed -e 's|tftp://||g' -e 's|/.*$||g')" + rfile="$(echo $url | sed -e "s|tftp://$ip||g")" + lfile="$(basename $url)" + log_begin_msg "Trying tftp -g -b 10240 -r $rfile -l ${dest}/$lfile $ip" + tftp -g -b 10240 -r $rfile -l ${dest}/$lfile $ip ;; *)