consmirror.c: the BSD notice is replaced (Makronix's own file). Files with
changes of other sessions pending are left for their commit.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
consmirror (userland/consmirror, a program of Makronix's own built through
the port frame with MX_LOCALSRC) reads the text console from /dev/vcsu1 and
/dev/vcsa1, woken by POLLPRI on every change, and writes it to the USB
serial gadget ttyGS0 as ANSI; what is typed there goes back into the
console through a uinput keyboard. Under X the virtual terminal is not
written, so nothing is mirrored, as asked. Test 3/3 PASS under qemu.
It replaces the agetty on ttyGS0 (runit service consmirror instead of
agetty-ttyGS0), and the kernel no longer writes its messages there itself:
console=ttyGS0 is gone from the cmdline, they reach the serial line through
the mirror of tty0, green as on the display.
userland_stage leaves a program whose port is not done out of the image
instead of failing (another agent may be building it); userland-test.sh
knows MX_LOCALSRC ports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kernel/patches/0026: vt.kernel_fg= colours what the kernel prints on the
console -- NetBSD's WS_KERNEL_FG (src/sys/arch/amd64/conf/GENERIC:
options WS_KERNEL_FG=WSCOL_GREEN) for the Linux vt; the console's own
colour is restored after each message.
devices/hotdogb/cmdline: console=tty0 (the panel; last, so it is
/dev/console, as the display is on NetBSD) besides ttyGS0, and
vt.kernel_fg=2. Measured from RAM: the boot messages run green on the
panel (build/cam/green-2.jpg). A fresh fetch-kernel tree with the series
is identical to the build tree (tree e066d46d1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
update-root keeps two trees, A/B like the boot slots: the new tree goes to
/system/.staging, the old previous is removed, current becomes previous and
the new one current. No SYSTEM_VERSION any more, so updating the same
Makronix version twice does not collide.
Which Makronix a tree is goes into the tree: /etc/makronix-release
("Makronix 0.99.9 Camouflage (unstable)"), written by assemble-rootfs.sh
for update-root and for a fresh image, from src/sys/conf/makronix-release
and makronix-codename; the channel (unstable for x.99.y, else stable)
comes from tools/lib.sh makronix_version, which kernel_make uses too.
Measured: make update-root twice with 0.99.9 -> current and previous, both
"Makronix 0.99.9 Camouflage (unstable)"; after a reboot the new current
runs 7.0.14-makronix-unstable with WLAN, Bluetooth, battery and every
service up (build/logs/update-root-ab-2026-11-11.log, checks/layout.sh).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/system on the phone holds only current (0.99.9, 7.0.14-makronix-unstable);
the eight old trees (2026-11-10*, previous-*) are deleted, 12G -> 1.4G.
Measured after: WLAN on deadbeef_5G (-43 dBm, gateway 14 ms with power
save, 2 ms without), Bluetooth powered and scanning, bq27411 100 % Full,
modem running, every runit service up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fallback slot is written with the image of slot a (sha256
6e9d7ee126184d0a, build/logs/flash-fallback-b-2026-11-11.log); slot a stays
active and successful. The way back now ends at /system/0.99.9; the 7.0.0
fork state (/system/2026-11-10f, build/boot_hotdogb-70.img) is kept as the
one before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The phone kernel no longer builds from the qualcomm-sm8150 fork: the base
is kernel.org stable v7.0.14 (refs/linux/7.0.14, shallow), and what hotdogb
needs from the fork is carried as kernel/patches 0001-0004 (sm8150/PMIC
DTSI nodes, the OnePlus DTS, the SMB5 charger, of/property), unchanged from
its 8e126dbc4; 0005-0025 are our series (the old 0005 is in v7.0.14 by a
stable backport).
The name comes from Makronix's versioning, the files the NetBSD side reads
(src/sys/conf/makronix-release, makronix-codename): kernel_make in
tools/lib.sh gives uname -r 7.0.14-makronix-unstable (x.99.y is -current)
and /proc/version makronix@camouflage, for the build and for every
modules_install. make update-root defaults to /system/<Makronix version>.
Measured: slot a boots 7.0.14-makronix-unstable with /system/0.99.9,
marked successful; WLAN, Bluetooth, battery and the display work
(build/logs/flash-0.99.9-2026-11-11.log). docs/NEXT.md 9c has what
7.3.4 showed (ftrace hangs it before the console; without ftrace a hard
freeze later).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Boot image 8c098f3d3af88f9b on boot_a and boot_b (hashed on the phone),
slot a active and successful; its system is /system/2026-11-10f. Written
with Konrad's OK before the move to Linux 7.4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The M tile (docs/logo/makronix-square-1080.png, rendered from the SVG)
is the kernel's boot logo: KERNEL_LOGO in device.conf, converted by
tools/build-kernel.sh to the PPM CONFIG_LOGO_LINUX_CLUT224_FILE names;
full width, centred, once (fbcon=logo-pos:center fbcon=logo-count:1).
- agetty on tty1 without --noclear: it clears the logo at the login.
- kernel/patches/0021: the logo stays after init (msm's framebuffer came
after late_initcall in some boots: no logo).
- kernel/patches/0022: the panel is switched on after msm's first frame,
not at the end of its on-sequence (half a second of noise before).
Measured with the camera on the screen: bootloader logo, dark, the M,
the login (build/cam/boot-0022b.mp4); Konrad: "perfekt".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the failing boots the modem had no QRTR service at all (qrtr-lookup:
only the phone's own rmtfs, PD mapper and tqftpserv): qrtr_smd, the
transport to the modem, was loaded by udev too late -- the same race as
the PD mapper. Loaded in stage 1 now: WLAN in 15 of 15 boots, before 3
missing of 15 (build/logs/wlan-qrtrsmd-2026-11-10.log).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/system/current holds the system, /data the state that survives an update
(docs/NEXT.md §6, Konrad: "it sucks that with an update we have to configure
everything"). base/initramfs/init mounts the partition once and sets up:
/ bind of /system/current
/home /root /var/lib binds of /data/...
/etc overlay: lower = the system's /etc, upper = /data/etc/upper
/data /system binds, so the system sees them
An image without /system/current (before 2026-11-09) is still mounted as the
whole partition -- measured on the phone: "layout: whole partition (image
without /system/current)", switch_root at 1.45 s.
Measured on the host (2026-11-09): the mount sequence works; a /etc write
lands in /data/etc/upper; remount,ro on the bind flips the whole file
system (so Void's stage 1 fsck still checks the partition) and remount,rw
undoes it; /proc/mounts names the device for /, so 03-grow-root.sh keeps
working. The partition mount cannot be moved into the new root -- the
target lies inside the source (the bind makes it so) -- so it stays at
/sysroot.real without a path after switch_root; the overlay and the binds
hold it.
Kernel: CONFIG_OVERLAY_FS=y (was m; the initramfs loads no modules).
tools/mkrootimg.sh writes /system/current/ and keeps /data out of the
image; the tree assembly is tools/assemble-rootfs.sh, shared with the new
tools/mkroottar.sh (make roottar) and tools/update-root.sh (make
update-root VERSION=...; unpack into /system/<v>, rename current, /data
untouched). update-root is written and syntax-checked, not yet measured.
Initramfs pin renewed: 6d1bd30b2a6fd815 (4950e286679ca4fa before).
Measured on the phone (hotdogb, 2026-11-09): flash-root of the new image,
first boot creates /data and copies /var/lib and /root, file system grown
to 96 GiB; after restoring the phone's /etc/NetworkManager, /etc/ssh and
/var/lib state into /data: WLAN reconnects with the saved profile
(192.168.1.127), the ssh host key is the old one, rtc-offset and the clock
survive a reboot, upper has the profile, the keys and runit's supervise
dirs.
- wlan-address (udev) and NetworkManager's conf.d: a WLAN address derived
from the serial number, kept across boots. With a random one per boot
the router's DHCP pool ran out after a day of test boots; with it the
phone got its lease at once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kernel/patches/0019: the panel driver resets the panel and sends the
stock 7T sequence by default. Taking over ABL's panel state gave a white
panel in 25 of 90 boots, the full init in 0 of 40, counted with a camera
on the screen: tools/phone-screen.sh (brightness of the screen in a
camera frame) and tools/display-loop.sh (N reboots, screen, SMMU faults,
panel state, msm/DSI interrupt rates per boot).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- elogind: a short press on the power key no longer powers the phone off
(base/void/rootfs, logind.conf.d).
- runit stage 3: ath10k is unloaded before rmtfs stops the modem; with it
loaded the system hung after "stopped remote processor modem" and the
watchdog left it in crash-dump mode (05c6:900e).
- kernel/patches/0018: qcom_scm clears the bootloader's download-mode bit.
Measured: reboot-mode bootloader with WLAN connected reaches fastboot in
12 s; make flash end to end on 7.0.0-sm8150-g6b20b1b06323, WLAN
reconnects by itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kernel/patches/0017: msm clears the blend stages ABL leaves in ctl_0
(sspp_0 on LM_0, sspp_1 on LM_1, both reading the boot framebuffer) when
it takes over. The SMMU faults on the boot framebuffer went away in two
boots of four. The white display is not explained by them nor by the
panel's compression state: devices/hotdogb/AGENTS.md has the table.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- kernel/patches 0014-0016: ath10k keeps the WCN powered from probe
(qcom,keep-powered); the modem with its firmware from the phone's
partition, WLAN, rmtfs outside the TZ region; charger and the bq27411
fuel gauge.
- firmware-partitions maps the modem partition too;
/usr/lib/firmware/qcom/sm8150/partitions links there for tqftpserv.
- wlan-board and ath10k-board: the phone's own WLAN board data from
persist, as board-2.bin under /run, before ath10k loads.
- qcom_pd_mapper in stage 1, so the modem's WLAN domain starts.
- base/void: rmtfs, tqftpserv (services), linux-firmware-network.
Measured: wlan0 up, a scan finds 12 networks, Bluetooth alongside, the
charger charges, the gauge reads 4.433 V / 100 %. Open: the display
white in some boots, and one sysrq reboot that ended switched off
(devices/hotdogb/AGENTS.md).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- kernel/patches/0013: WCN3998 on uart13 in the DTS.
- firmware-partitions (soc/sm8150/rootfs, stage 1 before udev): mounts the
partitions /etc/makronix/firmware-partitions names, of the active slot,
read-only under /run and puts them first in firmware_class.path; the
vendor's signed firmware stays on the phone and out of our images.
- bt-address (udev rule): a stable, locally administered address from the
serial number for a controller that has none.
- base/void: bluez, bluetoothd.
Measured: firmware loaded from bluetooth_a, setup complete at 3.3 s, the
same address after a reboot, a scan finds 14 devices.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- base/initramfs/init builds the gadget with NCM and ACM at once: the root's
stage 1 no longer rebinds it, so the host keeps its link and address and
netconsole runs from 1.5 s.
- The root grows itself online to its partition
(base/void/rootfs/.../03-grow-root.sh), which the pmOS initramfs did;
tools/mkrootimg.sh copies base/<base>/rootfs/ before the SoC's files.
- tools/build-busybox.sh: SOURCE_DATE_EPOCH of the pinned source, so the
initramfs is reproducible; pinned in device.conf (4950e286679ca4fa).
- Makefile: INITRAMFS defaults to ours; bootimg checks the pins after the
inputs are built.
Measured on hotdogb: switch_root at 1.27 s (pmOS: about 3.5 s), a fresh
root grown from 281468 to 25493504 blocks, 10 of 10 warm reboots, no
WARNING, make flash end to end.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- kernel/patches 0007-0012: the DTS of the baseline moves into the tree
(0007, with the PON modes), the ABL framebuffer is reserved memory (0008),
msm's fbdev marks its memory virtual (0009), the MDSS no longer resets
the Ethernet MAC (0010; the real dispcc reset leaves the panel white,
measured), u_serial closes a hung-up port once (0011, the gs_close WARN),
USB dual role with the pm8150b Type-C port (0012).
- KERNEL_DTB in device.conf: tools/build-kernel.sh builds the DTB in the
tree, mkbootimg takes it from there; the binary DTB and its pin are gone.
- kernel.config: BTF (pahole 1.32 on the host).
- rtc-offset: the wall clock across reboots on the read-only PMIC RTC;
tools/phone-time.sh sets it from the host.
Measured: kernel 7.0.0-sm8150-g3c5fa409ca54, 10 of 10 warm reboots, no
WARNING in dmesg, display good, Type-C data role device on the laptop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kernel (7.0.0-sm8150-g1299aab93171):
- msm DRM built in again: up at 0.6-0.8 s instead of 4.2 s, safe since
0003 and 0004.
- 0005: CLK_OPS_PARENT_ENABLE on the pixel RCGs (as sdm845): "rcg didn't
update its configuration" is gone.
- 0006: dsi_err_worker reported every error as status=4, a FIFO error
that was none (lane FIFOs empty) and hid the ACK error (bit 0); it now
reads status=40 ack_err=..., the panel's report on the first read after
the takeover.
- ftrace (dynamic, function_graph), Landlock.
Without a button: the DTB gets the PON's mode-bootloader/mode-recovery
(fdtput on the pinned binary until the DTS moves in; new pin), Void gets
reboot-mode(1) and a runit stage-3 hook that restarts with the mode
(base/reboot2.c, built static by mkrootimg.sh). flash.sh and
flash-root.sh reboot a running phone into fastboot themselves and wait for
ABL without ever cutting a command off or resetting the device -- two
usbresets after the userdata flash crashed it into 05c6:900e. Writing the
fallback slot no longer makes it active.
Access: dnsmasq (DHCP only) on usb0, so the host keeps 172.16.42.2 after
the initramfs; an ACM function next to NCM with the kernel console and a
login on ttyGS0; phone_addr falls back to IPv6 link-local;
tools/reboot-loop.sh for boot races. zram swap (half the RAM, zstd).
Measured: 20 of 20 warm reboots reachable; the self-flash
(build/logs/selfflash3-2026-11-08.log).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
About one boot in three crawled after msm loaded: every CPU around 50%
in hardirq, UFS timeouts, no ssh. The DSI PHY's probe suspends the MDSS,
which switches the display clocks off in hardware while the bootloader's
autorefresh still fetches from memory.
kernel/patches/0004 keeps a runtime reference on the MDSS from its probe
until the DPU has stopped the boot scanout (0003). Measured: 0 crawls in
20 warm reboots with it, against 5 in about 12 without; the same with the
userspace experiment that forbids the MDSS runtime PM (0 in 15).
Debugging aids for the next hang, all off unless their flag file exists:
irqwatch now also logs the per-CPU hardirq share (/proc/stat), which sees
chained interrupts /proc/interrupts cannot; 01-initcall-debug.sh switches
on initcall_debug before udev; 01-mdss-rpm-on.sh is the experiment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kernel.config: NETCONSOLE (dynamic) and PRINTK_CALLER; olddefconfig also
writes back the DRM helpers that became modules with msm. A stage-1
script sets up a netconsole target on usb0 before udev loads the drivers;
tools/netconsole-listen.sh receives it on the host.
Caught with it: the hang left after patch 0003 is a system spending its
CPUs in interrupts from msm's DSI probe on (25 ms hardirq, RT throttling,
UFS timeouts). Suspected: an interrupt storm through the MDSS
demultiplexer, whose mask is software-only, while DSI's interrupt is
still disabled and the bootloader's DSI error pending. irqwatch (opt-in,
/etc/makronix-irqwatch) logs the storming interrupt in the next hang.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bootloader counts a slot's retries down on every boot until the slot
is marked successful, and at 0 stops on "image destroyed" without falling
back to the other slot (measured). qcom-ab-slot (soc/sm8150/rootfs, POSIX
sh) sets the successful bit of boot_<slot> in byte 6 of its GPT
attributes, in the primary and the backup table with both CRCs, checking
both before and after -- the edit qbootctl makes (docs/reference/
qbootctl.txt). The runit service slot-successful runs it once sshd runs;
tools/mkrootimg.sh copies soc/<soc>/rootfs and rootfs-<base> into the
image.
Measured on hotdogb: after a flash (retry 7, not successful) the first
boot marks the slot at 6.4 s; fastboot then reports
slot-successful:a:yes and the retry count no longer drops.
devices/hotdogb/AGENTS.md: a rarer hang remains, 2 of 10 boots with
kernel patch 0003.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With kernel patch 0003 the bootloader's scanout is stopped before the
IOMMU attach, so modprobe.blacklist=msm goes. Measured: udev loads msm
at 4.2 s, 0 SMMU faults, console and login: on the panel, ssh up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kernel/patches/0003: dpu_kms_hw_init switches off the INTF tear check's
autorefresh (and the timing engine) the bootloader left on, before msm
attaches its IOMMU domain, as mdp4/mdp5 already do. Measured: 0 SMMU
faults and login: on the panel in 4 of 4 loads, faults in 7 of 7 before.
docs/BOOT.md: the bootloader does not fall back to slot b when slot a's
retry count runs out; set_active resets it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CONFIG_DRM_MSM=m and modprobe.blacklist=msm on the cmdline: a lost SMMU race
on the bootloader framebuffer can no longer stall the boot before sshd.
make bootimg defaults to the pinned pmOS initramfs again until ours has
booted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
msm DRM loaded by hand over ssh: the scanout the bootloader left running at
0x9c000000 faults in the SMMU when msm attaches (SIDs 0x800/0xc20); lost
race = SoC crawls, won race = login: on the panel. Same image, both
outcomes. Fix: iommu-addresses for the framebuffer region in the DTS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
base/initramfs/init (POSIX sh) and a static busybox built from pinned
upstream source (tools/build-busybox.sh), packed by tools/mkinitramfs.sh:
USB NCM + DHCP lease, root=UUID= read-only, switch_root, telnetd rescue.
Not yet booted. mkbootimg.sh appends root=UUID= and takes EXTRA_CMDLINE for
test images; the pmOS initramfs pin is retired.
Measured on hotdogb: the pinned kernel is fine -- with
initcall_blacklist=msm_drm_register it boots to Void. msm DRM with the
panel handoff garbles the panel and blocks the boot for every boot image
but the baseline one (devices/hotdogb/AGENTS.md has the table).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/mkrootimg.sh makes an ext4 image with the device's ROOT_UUID from the
base's rootfs tar, the kernel modules, fstab, a usb0 profile and the root
password (ROOT_PASSWORD, default makronix); tools/flash-root.sh writes it to
ROOT_PARTITION (userdata). mkbootimg.sh appends pmos_root_uuid=$ROOT_UUID;
the pmOS UUIDs left the cmdline. BASE defaults to void.
Measured: Void reaches "void login:" with runit, sshd and NetworkManager, with
the baseline kernel on slot a. The pinned kernel tree's build garbles the
display and does not reach the initramfs (devices/hotdogb/AGENTS.md).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One tree with the desktop: mobile/ is a subtree, userland and pkgsrc are
shared, platform differences live in soc/<soc>/soc.conf and
devices/<codename>/device.conf. tools/ is POSIX sh; tools/mkbootimg.sh
reproduces byte for byte the boot image that boots on the OnePlus 7T.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>