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.
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
;;
*)