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:
No files matched your search
Executable
+13
@@ -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
|
||||
Reference in New Issue
Block a user