From: Chuck Fan Date: Tue, 9 Mar 2021 09:42:57 +0000 (+0800) Subject: base-files: upgrade: use zcat command provided by busybox X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d374e2cdb499b2a4282d84f95709b9a40d88a995;p=openwrt%2Fstaging%2Frmilecki.git base-files: upgrade: use zcat command provided by busybox Calling `switch_to_ramfs()` will not copy the gzip executable (/bin/gzip) to ramfs, but `/bin/zcat` will call `/bin/gzip` when package gzip is installed, instead of the busybox-supplied zcat. This will cause `zcat` to fail to find `gzip`, then cause the sysupgrade to fail. Adding the `busybox` prefix here will solve the problem. Signed-off-by: Chuck Fan --- diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index b59a4045655..b8ae2ecb7e5 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -95,7 +95,7 @@ get_image() { # [ ] if [ -z "$cmd" ]; then local magic="$(dd if="$from" bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')" case "$magic" in - 1f8b) cmd="zcat";; + 1f8b) cmd="busybox zcat";; *) cmd="cat";; esac fi