infrastructure/scripts/extract-firmware-from-zyxel-nwa-fit.sh
Ryan Lahfa d915875a25 feat(scripts/liminix): make it easy to extract the firmware part of the Zyxel NWA FIT image
This is useful when reflashing the system from scratch in the levitation
mode.

Note that doing this will reset the UBI counter to zero, this is bad for
wear leveling.

Signed-off-by: Ryan Lahfa <ryan@dgnum.eu>
2024-12-09 01:29:45 +01:00

12 lines
318 B
Bash
Executable file

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p ubootTools
usage() {
echo "extract the firmware part to write it manually from a Zyxel NWA FIT image"
echo "$0 <zyxel_nwa_fit_image_path> <firmware_output_file>"
}
ZYXEL_NWA_FIT="$1"
FIRMWARE_OUTPUT="$2"
dumpimage -T flat_dt -p 0 $ZYXEL_NWA_FIT -o $FIRMWARE_OUTPUT