uzbek-plus/b6p/mkfs-cache-b6p.sh

21 lines
1.4 KiB
Bash
Executable file

#!/bin/bash
# B6P cache candidate: same recipe as b5b/mkfs-candidate.sh (409bbb11 reproduced), components = golden Image.gz-dtb + DTB + cmdline, initrd = B6P initramfs.
# Runs on 480s (mke2fs 1.47.2). Offline only; writes nothing to the board.
set -e
cd ~/doc/modem/jz08-aurora/b6p
OUT=${1:-cache-extlinux-b6p.img}; B5=../b5b/components
sha256sum -c cache-components.sha256
ST=$(mktemp -d); mkdir -p $ST/extlinux
cp $B5/Image.gz-dtb $B5/aurora-mm1.dtb $ST/; cp out/initramfs-b6p.cpio.gz $ST/
printf "default b6p\nlabel b6p\n\tlinux /Image.gz-dtb\n\tfdt /aurora-mm1.dtb\n\tinitrd /initramfs-b6p.cpio.gz\n\tappend %s\n" "$(cat $B5/cmdline.txt)" > $ST/extlinux/extlinux.conf
cp $ST/extlinux/extlinux.conf extlinux-b6p.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-b6p -U 4a5a3038-b6f0-4000-8000-00000000b6f0 \
-E root_owner=0:0,hash_seed=4a5a3038-b6f0-4000-8000-00000000b6f1 -d $ST $OUT 32768
rm -rf $ST
for f in / /lost+found /extlinux /extlinux/extlinux.conf /Image.gz-dtb /aurora-mm1.dtb /initramfs-b6p.cpio.gz; do for t in atime ctime mtime; do echo "sif $f $t @1790726400"; done; done > /tmp/b6p-sif.$$
/sbin/debugfs -w -f /tmp/b6p-sif.$$ $OUT >/dev/null 2>&1; rm -f /tmp/b6p-sif.$$
stat -c "%n %s" $OUT; sha256sum $OUT