#!/bin/bash # R2/T4 cache candidate: exact recipe of b6p/mkfs-cache-b6p.sh (9fea693a); only the initrd = T4 initramfs (B6P + telnetd on NCM), # its file name, the extlinux label, the fs label and UUIDs differ. Runs on 480s (mke2fs 1.47.2). Offline only; writes nothing to the board. set -e cd ~/doc/modem/jz08-aurora/r2/t4 OUT=${1:-cache-extlinux-t4.img}; B5=../../b5b/components (cd ../../b6p && sha256sum -c cache-components.sha256 | grep -v initramfs) echo "db47835b9286617c306cf78960cac592940c795fe91f45f072fa8622165869a6 out/initramfs-t4.cpio.gz" | sha256sum -c ST=$(mktemp -d); mkdir -p $ST/extlinux cp $B5/Image.gz-dtb $B5/aurora-mm1.dtb $ST/; cp out/initramfs-t4.cpio.gz $ST/ printf "default t4\nlabel t4\n\tlinux /Image.gz-dtb\n\tfdt /aurora-mm1.dtb\n\tinitrd /initramfs-t4.cpio.gz\n\tappend %s\n" "$(cat $B5/cmdline.txt)" > $ST/extlinux/extlinux.conf cp $ST/extlinux/extlinux.conf extlinux-t4.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-t4 -U 4a5a3038-b6f0-4000-8000-0000000074f0 \ -E root_owner=0:0,hash_seed=4a5a3038-b6f0-4000-8000-0000000074f1 -d $ST $OUT 32768 rm -rf $ST for f in / /lost+found /extlinux /extlinux/extlinux.conf /Image.gz-dtb /aurora-mm1.dtb /initramfs-t4.cpio.gz; do for t in atime ctime mtime; do echo "sif $f $t @1790726400"; done; done > /tmp/t4-sif.$$ /sbin/debugfs -w -f /tmp/t4-sif.$$ $OUT >/dev/null 2>&1; rm -f /tmp/t4-sif.$$ stat -c "%n %s" $OUT; sha256sum $OUT