diff options
author | Brian Norris <computersforpeace@gmail.com> | 2023-01-12 21:32:16 -0800 |
---|---|---|
committer | Christian Marangi <ansuelsmth@gmail.com> | 2023-01-21 01:02:23 +0100 |
commit | d3c19c71f6044eff1677563365cea0f9e919b462 (patch) | |
tree | a1721b058c8b38f832454796079e7a85f52120cd /package/base-files/files/lib/upgrade/common.sh | |
parent | bf1634f318e191e7da17e34de98dbd7d5122ef8b (diff) | |
download | upstream-d3c19c71f6044eff1677563365cea0f9e919b462.tar.gz upstream-d3c19c71f6044eff1677563365cea0f9e919b462.tar.bz2 upstream-d3c19c71f6044eff1677563365cea0f9e919b462.zip |
base-files: Remove nand.sh dependency from emmc upgrade
emmc_do_upgrade() relies on identify() from the nand.sh upgrade helper.
This only works because FEATURES=emmc targets also tend to include
FEATURES=nand.
Rename identify_magic() to identify_magic_long() to match the common.sh
style and make it clear it pairs with other *_long() variants (and not,
say *_word()).
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'package/base-files/files/lib/upgrade/common.sh')
-rw-r--r-- | package/base-files/files/lib/upgrade/common.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 5af061f6a4..53b8865a57 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -127,6 +127,33 @@ get_magic_fat32() { (get_image "$@" | dd bs=1 count=5 skip=82) 2>/dev/null } +identify_magic_long() { + local magic=$1 + case "$magic" in + "55424923") + echo "ubi" + ;; + "31181006") + echo "ubifs" + ;; + "68737173") + echo "squashfs" + ;; + "d00dfeed") + echo "fit" + ;; + "4349"*) + echo "combined" + ;; + "1f8b"*) + echo "gzip" + ;; + *) + echo "unknown $magic" + ;; + esac +} + part_magic_efi() { local magic=$(get_magic_gpt "$@") [ "$magic" = "EFI PART" ] |