#!/bin/bash # B7C cache candidate: exact recipe of r2/t4/mkfs-cache-t4.sh (9d3bc890); only the initrd = B7C initramfs (T4 + time bootstrap overlay), # 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/b7/b7c/cache OUT=${1:-cache-extlinux-b7c.img}; B5=../../../b5b/components (cd ../../../b6p && sha256sum -c cache-components.sha256 | grep -v initramfs) echo "f219b04d539faf34cd096eaacf6bcf048c3639fa57c076d40a2812bd3ff74699 ../out/initramfs-b7c.cpio.gz" | sha256sum -c ST=$(mktemp -d); mkdir -p $ST/extlinux cp $B5/Image.gz-dtb $B5/aurora-mm1.dtb $ST/; cp ../out/initramfs-b7c.cpio.gz $ST/ printf "default b7c\nlabel b7c\n\tlinux /Image.gz-dtb\n\tfdt /aurora-mm1.dtb\n\tinitrd /initramfs-b7c.cpio.gz\n\tappend %s\n" "$(cat $B5/cmdline.txt)" > $ST/extlinux/extlinux.conf cp $ST/extlinux/extlinux.conf extlinux-b7c.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-b7c -U 4a5a3038-b6f0-4000-8000-00000000b7c0 \ -E root_owner=0:0,hash_seed=4a5a3038-b6f0-4000-8000-00000000b7c1 -d $ST $OUT 32768 rm -rf $ST for f in / /lost+found /extlinux /extlinux/extlinux.conf /Image.gz-dtb /aurora-mm1.dtb /initramfs-b7c.cpio.gz; do for t in atime ctime mtime; do echo "sif $f $t @1790726400"; done; done > /tmp/b7c-sif.$$ /sbin/debugfs -w -f /tmp/b7c-sif.$$ $OUT >/dev/null 2>&1; rm -f /tmp/b7c-sif.$$ stat -c "%n %s" $OUT; sha256sum $OUT