1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-16 12:14:01 +02:00

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 <fanck0605@qq.com>
This commit is contained in:
Chuck Fan 2021-03-09 17:42:57 +08:00 committed by Paul Spooren
parent bffee5ea19
commit d374e2cdb4

View File

@ -95,7 +95,7 @@ get_image() { # <source> [ <command> ]
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