uzbek-plus/b5b/emu/mkvariants.sh
q 105bef466a Project Aurora: mainline ARM64 Linux on JZ08AU (MSM8916) LTE modem
Sanitized research log, build/reproducibility docs, DTS, kernel configs,
patches, initramfs sources, bootchain migration plans and test logs.
B5 direct boot PASS; B6 modem lifecycle in progress.
No dumps, NV/EFS, vendor firmware or device identifiers included.
2026-09-30 17:23:18 +03:00

18 lines
1.7 KiB
Bash
Executable file

#!/bin/bash
# Offline fault-injection copies of the candidate (in /tmp). Candidate itself untouched.
set -e
C=/home/q/doc/modem/jz08-aurora/b5b/cache-extlinux-mm1.img; D=/tmp/b5b-var; rm -rf $D; mkdir -p $D
v(){ cp $C $D/$1.img; chmod u+w $D/$1.img; }
v F1-no-conf; debugfs -w -R "rm /extlinux/extlinux.conf" $D/F1-no-conf.img
v F2-no-kernel; debugfs -w -R "rm /Image.gz-dtb" $D/F2-no-kernel.img
v F3-no-initrd; debugfs -w -R "rm /initramfs.cpio.gz" $D/F3-no-initrd.img
v F4-no-dtb; debugfs -w -R "rm /aurora-mm1.dtb" $D/F4-no-dtb.img
put(){ debugfs -w -R "rm $2" $D/$1.img; debugfs -w -R "write $3 $2" $D/$1.img; }
printf "this is not an extlinux config\n" > $D/bad.conf; v F5-garbage-conf; put F5-garbage-conf /extlinux/extlinux.conf $D/bad.conf
printf "default mm1\nlabel mm1\n\tlinux /Image.gz-dtb\n\tinitrd /initramfs.cpio.gz\n" > $D/nofdt.conf; v F6-no-fdt-line; put F6-no-fdt-line /extlinux/extlinux.conf $D/nofdt.conf
sed "s/\$/\r/" ../extlinux.conf > $D/crlf.conf; v F7-crlf-conf; put F7-crlf-conf /extlinux/extlinux.conf $D/crlf.conf
printf "default mm1\nlabel mm1\n\tlinux /Image.gz-dtb\n\tfdt /aurora-mm1.dtb\n\tinitrd /initramfs.cpio.gz\n\tappend x" > $D/nonl.conf; v F8-no-final-newline; put F8-no-final-newline /extlinux/extlinux.conf $D/nonl.conf
{ printf "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03"; head -c 8000000 /dev/zero | tr "\0" "\377"; } > $D/badk; v F9-corrupt-gzip-kernel; put F9-corrupt-gzip-kernel /Image.gz-dtb $D/badk
head -c 134217728 /dev/zero > $D/F10-zeroed-cache.img
cp $C $D/F11-bad-superblock.img; chmod u+w $D/F11-bad-superblock.img; printf "\x00\x00" | dd of=$D/F11-bad-superblock.img bs=1 seek=1080 conv=notrunc status=none
ls $D/*.img