Commit Graph
12 Commits
Author SHA1 Message Date
lotherkandClaude Sonnet 5.5 73c9de51a6 licence: the CNCL line in every file Makronix wrote (tools, docs, www, mobile, top level)
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>
2026-11-14 11:50:26 +00:00
lotherkandClaude Opus 5.5 5097ac6d11 mobile: /system/current and /system/previous, no version in a name
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>
2026-11-11 14:47:11 +00:00
lotherkandClaude Opus 5.5 9656b80615 mobile: update-root measured; SYSTEM_VERSION instead of VERSION, the tree streamed as a tar; hci_qca retry fix
- make update-root VERSION=... passed VERSION into the kernel's make (a
  command-line variable reaches every sub-make; VERSION is the first line
  of the kernel Makefile): the kernel was built as release
  "2026-11-10a.0.0-..." and stopped in fs/pstore/ram.c:809
  (build/logs/update-root-2026-11-10.log) -- the same error that
  0a9f83bd3 took for a race on 2026-11-09.  Now SYSTEM_VERSION.
- tools/update-root.sh ran tar -C on the tree, which is a tar file
  (tools/mkroottar.sh): "This does not look like a tar archive".  It is
  streamed as it is now.
- kernel/patches/0020: hci_qca hung for good in tty_wait_until_sent when
  a failed WCN3998 setup reopened the UART; it drops the pending output.
- tools/checks/bt-wlan.sh counts the kernel's own Bluetooth retries.

Measured (hotdogb, 2026-11-10): make update-root SYSTEM_VERSION=2026-11-10a
REBOOT=--reboot, then 2026-11-10b: the phone runs the new system
(/etc/makronix-version), the old ones stay under /system as the way back;
a marker in /root and one in /etc, the ssh host key (SHA256:/uBN1++...),
/var/lib/makronix/rtc-offset and the WLAN profile survive, WLAN back at
192.168.1.127 (build/logs/update-root-{before,after}-2026-11-10.log).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 06:25:33 +00:00
lotherk 544ad0b4a8 mobile: system and data apart on userdata (task B)
/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.
2026-11-09 23:12:26 +00:00
lotherkandClaude Opus 5.5 d29094e24f mobile: our initramfs replaces pmOS's in the boot image
- 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>
2026-11-08 13:45:42 +00:00
lotherkandClaude Opus 5.5 c520f2ea26 mobile: hotdogb DTS in the kernel series, OTG, BTF, wall clock, warnings fixed
- 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>
2026-11-08 13:24:46 +00:00
lotherkandClaude Opus 5.5 b9c0affdb8 mobile: hotdogb stable state: msm built in, display warnings fixed, self-flashing, serial console
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>
2026-11-08 09:52:05 +00:00
lotherkandClaude Opus 5.5 2e1943a743 mobile: BOOT.md: the host has IPv4 only from the initramfs DHCP; IPv6 link-local as the way in
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 07:58:16 +00:00
lotherkandClaude Opus 5.5 5233d8297a mobile: mark the booted A/B slot successful from Linux
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>
2026-11-07 21:12:16 +00:00
lotherkandClaude Opus 5.5 c236a3da5b mobile: hotdogb display race fixed: stop bootloader autorefresh before the IOMMU attach
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>
2026-11-07 20:03:56 +00:00
lotherkandClaude Opus 5.5 0cf14ec379 mobile: root image on userdata, Void (runit) boots on hotdogb
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>
2026-11-07 11:30:02 +00:00
lotherkandClaude Sonnet 5.5 7d7243cb63 mobile: Makronix Mobile Edition, phase 1 (kernel, boot image, flash; hotdogb)
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>
2026-11-07 09:58:49 +00:00