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>
This commit is contained in:
2026-11-23 22:01:43 +01:00
co-authored by Claude Opus 5.5
parent 497c0758cc
commit e8cc206d23
5 changed files with 80 additions and 0 deletions

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
#!/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