[PATCH] treewide: Force use of busybox wget

Fabian Bläse fabian at blaese.de
Mo Nov 11 17:31:55 CET 2019


Ui, das ist ja grausam..

Reviewed-by: Fabian Bläse <fabian at blaese.de>

Gruß
Fabian

On 11.11.19 14:24, Adrian Schmutzler wrote:
> In OpenWrt commit 055cdab2bb22 ("uclient: add ALTERNATIVES for wget")
> uclient is registered as ALTERNATIVES provider for wget. Since
> the priority for busybox as provider is lowest, this overwrites
> the link set for /usr/bin/wget, now pointing to uclient wget.
> 
> However, uclient wget does not support IPv6 link-local addresses,
> as it's not aware of the "%" to separate address from link identifier.
> 
> To prevent wget from failing when those addresses are used, this
> patch explicitly uses busybox wget.
> 
> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> ---
>  src/packages/fff/fff-hoods/Makefile                    |  2 +-
>  .../fff/fff-hoods/files/usr/lib/functions/fff/hoodfile | 10 +++++-----
>  src/packages/fff/fff-sysupgrade/Makefile               |  2 +-
>  .../fff/fff-sysupgrade/files/etc/sysupgrade.sh         |  6 +++---
>  src/packages/fff/fff-web/Makefile                      |  2 +-
>  src/packages/fff/fff-web/files/www/ssl/cgi-bin/header  |  2 +-
>  6 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/src/packages/fff/fff-hoods/Makefile b/src/packages/fff/fff-hoods/Makefile
> index 11d2523b..5eb20ca5 100644
> --- a/src/packages/fff/fff-hoods/Makefile
> +++ b/src/packages/fff/fff-hoods/Makefile
> @@ -1,7 +1,7 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=fff-hoods
> -PKG_RELEASE:=6
> +PKG_RELEASE:=7
>  
>  PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
>  
> diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
> index 9bc6a35d..b148eca6 100644
> --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
> +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile
> @@ -31,9 +31,9 @@ getWirelessHoodfile() {
>  	# wait a moment to start the interface
>  	sleep 10;
>  
> -	if wget -T15 -O "$file" "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then
> +	if /bin/busybox wget -T15 -O "$file" "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then
>  		return 0
> -	elif wget -T15 -O "$file" "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then
> +	elif /bin/busybox wget -T15 -O "$file" "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then
>  		return 0
>  	else
>  		return 1
> @@ -57,7 +57,7 @@ getEthernetHoodfile() {
>  	neighbor_addrs=$(ping6 -c2 ff02::1%"${ethmesh_dev}" | grep seq | grep DUP | cut -d " " -f4 | sed s/:$//g | sort -u)
>  
>  	for addr in $neighbor_addrs; do
> -		wget -T2 -qO "$file" "http://[${addr}%${ethmesh_dev}]:2342/keyxchangev2data" && return 0
> +		/bin/busybox wget -T2 -qO "$file" "http://[${addr}%${ethmesh_dev}]:2342/keyxchangev2data" && return 0
>  	done
>  
>  	# got no hoodfile
> @@ -73,7 +73,7 @@ getGatewayHoodfile() {
>  
>  	echo "Trying to get hoodfile from gateway..."
>  
> -	if wget -T15 -O "$file" "http://[fe80::1%br-mesh]:2342/keyxchangev2data"; then
> +	if /bin/busybox wget -T15 -O "$file" "http://[fe80::1%br-mesh]:2342/keyxchangev2data"; then
>  		return 0
>  	else
>  		return 1
> @@ -95,7 +95,7 @@ getKeyserverHoodfile() {
>  
>  	echo "Getting hoodfile from Keyserver"
>  
> -	if wget -T15 -O "$file" "http://keyserver.freifunk-franken.de/v2/?lat=$lat&long=$long"; then
> +	if /bin/busybox wget -T15 -O "$file" "http://keyserver.freifunk-franken.de/v2/?lat=$lat&long=$long"; then
>  		return 0
>  	else
>  		return 1
> diff --git a/src/packages/fff/fff-sysupgrade/Makefile b/src/packages/fff/fff-sysupgrade/Makefile
> index d03104a2..0e6c08ec 100644
> --- a/src/packages/fff/fff-sysupgrade/Makefile
> +++ b/src/packages/fff/fff-sysupgrade/Makefile
> @@ -1,7 +1,7 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=fff-sysupgrade
> -PKG_RELEASE:=9
> +PKG_RELEASE:=10
>  
>  PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
>  
> diff --git a/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh b/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh
> index 9b0881dc..b42b19aa 100755
> --- a/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh
> +++ b/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh
> @@ -34,7 +34,7 @@ case $BOARD in
>          BOARD="cpe510-520-v1" ;;
>  esac
>  
> -wget "${UPGRADE_PATH}/release.nfo"
> +/bin/busybox wget "${UPGRADE_PATH}/release.nfo"
>  if [ ! -f release.nfo ]; then
>    echo "Latest release information not found. Please try to update manually."
>    echo ""
> @@ -72,8 +72,8 @@ fi
>  FILE="fff-${VERSION}-${SOC}-${BOARD}-sysupgrade.bin"
>  echo "Downloading $FILE"
>  echo ""
> -wget "${UPGRADE_PATH}/${FILE}"
> -wget "${UPGRADE_PATH}/${FILE}.sha256"
> +/bin/busybox wget "${UPGRADE_PATH}/${FILE}"
> +/bin/busybox wget "${UPGRADE_PATH}/${FILE}.sha256"
>  
>  sum=$(sha256sum -c "${FILE}.sha256")
>  ret=$?
> diff --git a/src/packages/fff/fff-web/Makefile b/src/packages/fff/fff-web/Makefile
> index 6bdd9cd0..24bdb951 100644
> --- a/src/packages/fff/fff-web/Makefile
> +++ b/src/packages/fff/fff-web/Makefile
> @@ -1,7 +1,7 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=fff-web
> -PKG_RELEASE:=9
> +PKG_RELEASE:=10
>  
>  PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
>  
> diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header
> index b9ca1b61..84e259fd 100755
> --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header
> +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/header
> @@ -24,7 +24,7 @@ if ( [ ! -s /tmp/fwcheck ] || [ "$(cat /tmp/fwcheck)" -lt "$NOW" ] ) && [ ! "$(u
>  	rm -f /tmp/isupdate
>  	NEXTUPDATE=$(($(date +%s)+86400))
>  	echo $NEXTUPDATE > /tmp/fwcheck
> -	/usr/bin/wget "${UPGRADE_PATH}/release.nfo" -P /tmp -T 2
> +	/bin/busybox wget "${UPGRADE_PATH}/release.nfo" -P /tmp -T 2
>  	VERSION=$(cat /tmp/release.nfo|awk -F: '/VERSION:/ { print $2 }')
>  	rm -f /tmp/release.nfo
>  	if [ "$VERSION" != "$FIRMWARE_VERSION" -a -n "$VERSION" ]; then
> 

-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 833 bytes
Beschreibung: OpenPGP digital signature
URL         : <https://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20191111/dc24daf8/attachment.sig>


Mehr Informationen über die Mailingliste franken-dev