diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-06-10 15:41:52 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-06-11 19:26:34 +0200 |
commit | e6c17aa21912da9b988b57b75e50228eb7e84115 (patch) | |
tree | ee4c6e60226836099e840f3f7ec38688205f0927 /package | |
parent | f18f08d9c8af8f67f07ea627f65cc2215cbc2c42 (diff) | |
download | upstream-e6c17aa21912da9b988b57b75e50228eb7e84115.tar.gz upstream-e6c17aa21912da9b988b57b75e50228eb7e84115.tar.bz2 upstream-e6c17aa21912da9b988b57b75e50228eb7e84115.zip |
base-files: sysupgrade: fix handling get_image unpack commands
On bcm53xx and brcm47xx, commands are passed to default_do_upgrade that
expect the image to be passed on stdin, rather than as an argument.
Fixes: 30f61a34b4cf ("base-files: always use staged sysupgrade")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Diffstat (limited to 'package')
-rw-r--r-- | package/base-files/files/lib/upgrade/common.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 5f5c9dc8a3..38056fd346 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -78,18 +78,18 @@ rootfs_type() { get_image() { # <source> [ <command> ] local from="$1" - local cat="$2" + local cmd="$2" - if [ -z "$cat" ]; then + 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) cat="zcat";; - 425a) cat="bzcat";; - *) cat="cat";; + 1f8b) cmd="zcat";; + 425a) cmd="bzcat";; + *) cmd="cat";; esac fi - $cat "$from" 2>/dev/null + cat "$from" 2>/dev/null | $cmd } get_magic_word() { |