#!/bin/bash # B12Q cache CANDIDATE (Alpine primary root: stage0 switch_root, LFS rescue) (NOT for writing without a separate GO): exact recipe of b10/b10b3/cache-v4/mkfs-cache-b10b5.sh (c3732515); # differs only in the initrd (B9C initramfs + B12P overlay: aurora-alpine autostart, modem safety gate, e2fsck bundle), file names, # extlinux label, fs label and UUIDs. Kernel/DTB/append = B10 production unchanged. Runs on 480s (mke2fs 1.47.2). Offline only. # The image contains the AP PSK (in the initramfs) - never publish it. set -e cd ~/doc/modem/jz08-aurora/b12/b12q/cache OUT=${1:-cache-extlinux-b12q.img}; F=../out echo "0fef41b262917c8ae308fa222da0017e2b3cb3ec5da1ca8ba18d0318476761a3 $F/cmdline.txt" | sha256sum -c echo "b0ea04666c4ab979067fe9c0015bda0e9c8ac742678321e57b18e841c9c69f95 $F/Image.gz-dtb" | sha256sum -c echo "e47762d1dcd0af6e2acb711fa47ecc13769cd6bcb81259ce50635e8b18b6514a $F/aurora-b10b3.dtb" | sha256sum -c echo "9ade7cffb1f3f19e86acc8869565a88b960abba543385a2fddcebd27bd529e79 $F/initramfs-b12q.cpio.gz" | sha256sum -c ST=$(mktemp -d); mkdir -p $ST/extlinux cp $F/Image.gz-dtb $F/aurora-b10b3.dtb $F/initramfs-b12q.cpio.gz $ST/ printf "default b12q\nlabel b12q\n\tlinux /Image.gz-dtb\n\tfdt /aurora-b10b3.dtb\n\tinitrd /initramfs-b12q.cpio.gz\n\tappend %s\n" "$(cat $F/cmdline.txt)" > $ST/extlinux/extlinux.conf cp $ST/extlinux/extlinux.conf extlinux-b12q.conf chmod 0644 $ST/*.* $ST/extlinux/extlinux.conf; chmod 0755 $ST $ST/extlinux find $ST -exec touch -h -d @1790726400 {} + rm -f $OUT; truncate -s 134217728 $OUT E2FSPROGS_FAKE_TIME=1790726400 /sbin/mke2fs -F -q -t ext2 -O none,filetype,sparse_super \ -b 4096 -I 128 -N 64 -m 0 -L aurora-b12q -U 4a5a3038-b6f0-4000-8000-0000b12b1300 \ -E root_owner=0:0,hash_seed=4a5a3038-b6f0-4000-8000-0000b12b1301 -d $ST $OUT 32768 rm -rf $ST for f in / /lost+found /extlinux /extlinux/extlinux.conf /Image.gz-dtb /aurora-b10b3.dtb /initramfs-b12q.cpio.gz; do for t in atime ctime mtime; do echo "sif $f $t @1790726400"; done; done > /tmp/b12q-sif.$$ /sbin/debugfs -w -f /tmp/b12q-sif.$$ $OUT >/dev/null 2>&1; rm -f /tmp/b12q-sif.$$ /sbin/e2fsck -fn $OUT >/dev/null 2>&1 && echo "e2fsck -fn clean" stat -c "%n %s" $OUT; sha256sum $OUT