base-files: upgrade: use zcat command provided by busybox
authorChuck Fan <fanck0605@qq.com>
Tue, 9 Mar 2021 09:42:57 +0000 (17:42 +0800)
committerPaul Spooren <mail@aparcar.org>
Mon, 21 Jun 2021 00:19:54 +0000 (14:19 -1000)
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>
package/base-files/files/lib/upgrade/common.sh

index b59a40456551c80948110046f60de72131d7ccf1..b8ae2ecb7e5e95446e166a91ae0f96b04bff1ebd 100644 (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