summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSteven Shiau <steven@nchc.org.tw>2009-05-25 11:32:12 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 17:48:05 +0100
commit67fde4e3bc3d532794205f6beda6a7ebe8243834 (patch)
treedb41e85b48ee9bd0cbeb3acb1c1009b0027edbc1 /scripts
parentc5e99d4a0d54ec199c5a229c9478a50629f14aa8 (diff)
downloadlive-boot-67fde4e3bc3d532794205f6beda6a7ebe8243834.tar.gz
live-boot-67fde4e3bc3d532794205f6beda6a7ebe8243834.zip
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/live8
1 files changed, 5 insertions, 3 deletions
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
;;
*)