#!/bin/bash # B9C cache candidate: exact recipe of b8/b8f/cache/mkfs-cache-b8f.sh (857c9c30); differs only in kernel file (B9C Image.gz-dtb: b9c kernel # + B9B DTB), fdt (B9B DTB), initrd (B9C initramfs), append (B9C cmdline = B8F + console=tty0 before the UART console + fbcon=font:6x8 # consoleblank=0), file names, extlinux label, fs label and UUIDs. 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/b9/b9c/cache OUT=${1:-cache-extlinux-b9c.img}; F=../out echo "0fef41b262917c8ae308fa222da0017e2b3cb3ec5da1ca8ba18d0318476761a3 $F/cmdline.txt" | sha256sum -c echo "632a7be801978dfaddeae633d5293b3abe385f2281cc5053772e6637897a7e5a $F/Image.gz-dtb" | sha256sum -c echo "7ca9cc794a3b85d3b7240f6311ad03bee9e1a4a59aae2ed9438318e853f7c3dc $F/aurora-b9c.dtb" | sha256sum -c echo "ac518e27e2957ad5e4515969b9a3808024e11ef8d1a79433a899a67dbc644558 $F/initramfs-b9c.cpio.gz" | sha256sum -c ST=$(mktemp -d); mkdir -p $ST/extlinux cp $F/Image.gz-dtb $F/aurora-b9c.dtb $F/initramfs-b9c.cpio.gz $ST/ printf "default b9c\nlabel b9c\n\tlinux /Image.gz-dtb\n\tfdt /aurora-b9c.dtb\n\tinitrd /initramfs-b9c.cpio.gz\n\tappend %s\n" "$(cat $F/cmdline.txt)" > $ST/extlinux/extlinux.conf cp $ST/extlinux/extlinux.conf extlinux-b9c.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-b9c -U 4a5a3038-b6f0-4000-8000-00000000b9c0 \ -E root_owner=0:0,hash_seed=4a5a3038-b6f0-4000-8000-00000000b9c1 -d $ST $OUT 32768 rm -rf $ST for f in / /lost+found /extlinux /extlinux/extlinux.conf /Image.gz-dtb /aurora-b9c.dtb /initramfs-b9c.cpio.gz; do for t in atime ctime mtime; do echo "sif $f $t @1790726400"; done; done > /tmp/b9c-sif.$$ /sbin/debugfs -w -f /tmp/b9c-sif.$$ $OUT >/dev/null 2>&1; rm -f /tmp/b9c-sif.$$ /sbin/e2fsck -fn $OUT >/dev/null 2>&1 && echo "e2fsck -fn clean" stat -c "%n %s" $OUT; sha256sum $OUT