Files
BRNSystemsandClaude Opus 5.5 e8cc206d23 Toolkit: split and reassemble flash images from a dump
split.sh carves a dump into partitions using a layout file, build-image.sh
reassembles them (reproduces the stock dump byte-for-byte), repack-fs.sh
rebuilds squashfs/jffs2 partitions, extract-src.sh unpacks the stock
APP/rootfs from the user's own dump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:01:43 +01:00

14 lines
596 B
Bash
Executable File

#!/bin/sh
# (Re)create src/app and src/rootfs = the stock APP / ROOTFS squashfs from YOUR dump
# (parts/stock, made by ./split.sh). They are inputs to the variants, never committed.
set -e
HERE="$(cd "$(dirname "$0")" && pwd)"
[ -f "$HERE/parts/stock/app.bin" ] || { echo "no parts/stock: run ./split.sh <your_dump.bin> first"; exit 1; }
for p in app rootfs; do
if [ ! -d "$HERE/src/$p" ] || [ "$1" = -f ]; then
rm -rf "$HERE/src/$p"
unsquashfs -q -d "$HERE/src/$p" "$HERE/parts/stock/$p.bin" >/dev/null
echo "[extract-src] src/$p from parts/stock/$p.bin"
fi
done