#!/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 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