27 lines
2.2 KiB
Bash
27 lines
2.2 KiB
Bash
#!/bin/bash
|
|
# B12R cache CANDIDATE (= B12Q + kernel 7.2.7-aurora-b12 with nf_tables for the Alpine router) (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/b12/b12r/cache
|
|
OUT=${1:-cache-extlinux-b12r.img}; F=../out
|
|
echo "0fef41b262917c8ae308fa222da0017e2b3cb3ec5da1ca8ba18d0318476761a3 $F/cmdline.txt" | sha256sum -c
|
|
echo "19a53b6f4f6689fe20da8f2fc87f1f683b5b8c086537ef94ed8818ed47fd7d05 $F/Image.gz-dtb" | sha256sum -c
|
|
echo "e47762d1dcd0af6e2acb711fa47ecc13769cd6bcb81259ce50635e8b18b6514a $F/aurora-b10b3.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-b10b3.dtb $F/initramfs-b12q.cpio.gz $ST/
|
|
printf "default b12r\nlabel b12r\n\tlinux /Image.gz-dtb\n\tfdt /aurora-b10b3.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-b12r.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-b12r -U 4a5a3038-b6f0-4000-8000-0000b12b1400 \
|
|
-E root_owner=0:0,hash_seed=4a5a3038-b6f0-4000-8000-0000b12b1401 -d $ST $OUT 32768
|
|
rm -rf $ST
|
|
for f in / /lost+found /extlinux /extlinux/extlinux.conf /Image.gz-dtb /aurora-b10b3.dtb /initramfs-b12q.cpio.gz; do for t in atime ctime mtime; do echo "sif $f $t @1790726400"; done; done > /tmp/b12r-sif.$$
|
|
/sbin/debugfs -w -f /tmp/b12r-sif.$$ $OUT >/dev/null 2>&1; rm -f /tmp/b12r-sif.$$
|
|
/sbin/e2fsck -fn $OUT >/dev/null 2>&1 && echo "e2fsck -fn clean"
|
|
stat -c "%n %s" $OUT; sha256sum $OUT
|