uzbek-plus/b9/b9c/build-b9c.sh
q 4a7224c41f B9: built-in display (ST7735S SPI) in Linux and persistent B9C cache
- B9A: read-only audit of stock LK/DT: the panel is an ST7735S 128x128 on SPI (BLSP1 QUP4,
  16 MHz, mode 3, D/C GPIO116, RESET GPIO118), backlight = PM8916 MPP4 current sink 40 mA.
- B9B: upstream panel-mipi-dbi with the stock init sequence as firmware; MPP4 sink via pinctrl
  + gpio-backlight; first light with correct colours/orientation/offsets.
- B9C: fbcon (6x8, 21x16) on tty1 + getty, UART console kept, aurora-display service;
  cache B9C b9ce13c9 written and verified, cold boots with LTE + Wi-Fi + display.
- B9L (RAM only): lk2nd second stage with an msm8916 SPI panel port shows a picture before Linux.
- Sanitizer: whitelist for b8/ and b9/.
2026-10-03 01:45:02 +03:00

36 lines
2.9 KiB
Bash

#!/bin/sh
# B9C image: persistent display (fbcon tty1 + backlight) on top of B8F.
# kernel = out-b9c (b9b + FRAMEBUFFER_CONSOLE + FONTS/FONT_6x8 only; linux/aurora-b9c.config)
# DTB = B9B DTB unchanged (7ca9cc79)
# initramfs = exact B8F initramfs + overlay: /init (B8F + hostname/display/getty), aurora-display, panel firmware
# cmdline = B8F cmdline + console=tty0 (placed BEFORE console=ttyMSM0 so /dev/console stays the UART) + fbcon=font:6x8 consoleblank=0
# Outputs: RAM image (fastboot boot pretest) + parts for the cache candidate. out/ contains the B8F initramfs (Wi-Fi PSK): never publish.
set -e; cd "$(dirname "$0")"; O=out; KB=/home/q/aurora-kbuild/out-b9c; F8=../../b8/b8f/out; B9B=../b9b/out
GEN=../../linux/out/usr/gen_init_cpio; TS=1790726400; FW='jz08au,aurora-st7735s.bin'
mkdir -p $O
echo "abb3bd6757e77eae90b3c9eb9d8b3f09e7a906256a53c80033853eb82b8e3f2f $F8/initramfs-b8f.cpio.gz" | sha256sum -c
echo "7ca9cc794a3b85d3b7240f6311ad03bee9e1a4a59aae2ed9438318e853f7c3dc $B9B/aurora-b9b.dtb" | sha256sum -c
echo "58697d4db45a9af85ec09e03a4212955ae3c7eed7d9f6bda82071da1b44329b4 $B9B/$FW" | sha256sum -c
for s in FRAMEBUFFER_CONSOLE=y FONT_6x8=y DRM_PANEL_MIPI_DBI=y DRM_FBDEV_EMULATION=y VT_CONSOLE=y 'LOCALVERSION="-aurora-b9c"'; do grep -q "^CONFIG_$s\$" $KB/.config || { echo "STOP: CONFIG_$s"; exit 1; }; done
grep -q '^CONFIG_FONT_8x16=y' $KB/.config && { echo "STOP: extra fonts"; exit 1; }
diff -u ../../b8/b8f/rootfs/init rootfs/init > $O/init.diff || true
[ $(grep -c '^+[^+]' $O/init.diff) = 5 ] || { echo "STOP: init diff is not the expected 5 added lines"; exit 1; }
[ $(grep -c '^-[^-]' $O/init.diff) = 0 ] || { echo "STOP: init diff removes lines"; exit 1; }
cp $KB/arch/arm64/boot/Image.gz $O/Image.gz; cp $KB/.config $O/config-b9c; cp $B9B/aurora-b9b.dtb $O/aurora-b9c.dtb; cp "$B9B/$FW" "$O/$FW"
cat $O/Image.gz $O/aurora-b9c.dtb > $O/Image.gz-dtb
cat > $O/overlay-b9c.list <<L
file /init rootfs/init 0755 0 0
file /usr/sbin/aurora-display rootfs/usr/sbin/aurora-display 0755 0 0
file /etc/init.d/aurora-display rootfs/etc/init.d/aurora-display 0755 0 0
dir /lib/firmware 0755 0 0
file /lib/firmware/$FW $O/$FW 0644 0 0
L
$GEN -t $TS $O/overlay-b9c.list > $O/overlay-b9c.cpio
gzip -9 -n -c $O/overlay-b9c.cpio > $O/overlay-b9c.cpio.gz
cat $F8/initramfs-b8f.cpio.gz $O/overlay-b9c.cpio.gz > $O/initramfs-b9c.cpio.gz
cp cmdline.txt $O/cmdline.txt
python3 ../../b6p/mkbootimg.py $O/Image.gz-dtb $O/initramfs-b9c.cpio.gz $O/cmdline.txt $O/aurora-b9c.img
SZ=$(python3 -c "import struct;print(struct.unpack_from('<Q',open('$KB/arch/arm64/boot/Image','rb').read(24),16)[0])")
printf 'kernel image_size 0x%x, RAM-boot end 0x%x (< 0x81e00000 DTB)\n' $SZ $((0x80000000 + SZ)); [ $((0x80000000 + SZ)) -lt $((0x81e00000)) ]
S=$(stat -c %s $O/initramfs-b9c.cpio.gz); echo "initrd $S B"
(cd $O && sha256sum Image.gz aurora-b9c.dtb Image.gz-dtb config-b9c "$FW" cmdline.txt overlay-b9c.cpio.gz initramfs-b9c.cpio.gz aurora-b9c.img > SHA256SUMS; cat SHA256SUMS); ls -l $O/aurora-b9c.img