[openwrt/openwrt] base-files: upgrade: use zcat command provided by busybox

LEDE Commits lede-commits at lists.infradead.org
Sun Jun 20 17:20:31 PDT 2021


aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d374e2cdb499b2a4282d84f95709b9a40d88a995

commit d374e2cdb499b2a4282d84f95709b9a40d88a995
Author: Chuck Fan <fanck0605 at qq.com>
AuthorDate: Tue Mar 9 17:42:57 2021 +0800

    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 at qq.com>
---
 package/base-files/files/lib/upgrade/common.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index b59a404565..b8ae2ecb7e 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() { # <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



More information about the lede-commits mailing list