Bug#706596: wget tftp:// support
Package: busybox
Version: 1:1.20.0-7
Severity: wishlist
Tags: upstream
curl has a "conventional" tftp://<server>/<path> syntax to download a
file from a TFTP server. To do the same with busybox tftp, you have
to break up the URL into pieces. If busybox wget supported tftp://
when the tftp applet was also compiled in, that would avoid the need
for this kind of code in live-boot:
case "$url" in
tftp*)
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
;;
*)
log_begin_msg "Trying wget ${url} -O ${dest}/$(basename ${url})"
wget "${url}" -O "${dest}/$(basename ${url})"
;;
esac
It would simplify to
wget "${url}" -O "${dest}/$(basename ${url})"
Hm... I just noticed that I'm losing the -b 10240 (default is 512),
which increases the download of a 40MB test file from 10s to 28s.
Maybe that's a good enough reason not to bother implementing this --
adding --tftp-block-size to the wget applet would be overkill.
Reply to: