#!/bin/bash # B23 cache CANDIDATE (= B18 c. ac82811a with DTB b23 = b18 + LBC fast-charge current 720 mA; kernel b18 unchanged; derived 1:1 from b18/cache/mkfs-cache-b18.sh) (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/b23/cache OUT=${1:-cache-extlinux-b23.img}; F=../out echo "0fef41b262917c8ae308fa222da0017e2b3cb3ec5da1ca8ba18d0318476761a3 $F/cmdline.txt" | sha256sum -c echo "771ecadcd5fbf05e8962dcf2092741fac88217f62938f6ea13f9eea09da5a419 $F/Image.gz-dtb" | sha256sum -c echo "89eade0f41a7b2f4fb4acc030cf6b30889438ed77a2047c7a7728405c10c3db1 $F/aurora-b23.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-b23.dtb $F/initramfs-b12q.cpio.gz $ST/ printf "default b23\nlabel b23\n\tlinux /Image.gz-dtb\n\tfdt /aurora-b23.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-b23.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-b23 -U 4a5a3038-b6f0-4000-8000-00000b231800 \ -E root_owner=0:0,hash_seed=4a5a3038-b6f0-4000-8000-00000b231801 -d $ST $OUT 32768 rm -rf $ST for f in / /lost+found /extlinux /extlinux/extlinux.conf /Image.gz-dtb /aurora-b23.dtb /initramfs-b12q.cpio.gz; do for t in atime ctime mtime; do echo "sif $f $t @1790726400"; done; done > /tmp/b23-sif.$$ /sbin/debugfs -w -f /tmp/b23-sif.$$ $OUT >/dev/null 2>&1; rm -f /tmp/b23-sif.$$ /sbin/e2fsck -fn $OUT >/dev/null 2>&1 && echo "e2fsck -fn clean" stat -c "%n %s" $OUT; sha256sum $OUT