Commit Graph
33 Commits
Author SHA1 Message Date
lotherkandClaude Sonnet 5.5 7eb8ff29d1 AGENTS.md for mobile/* and ext/src, ext/src/glibc (t0235; written by a free-model subagent from the directory contents, checked against ls and mobile/AGENTS.md)
mobile/build is ignored by .gitignore (build output): no AGENTS.md there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 10:19:15 +00:00
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
lotherk 338e9577a1 Makronix/Linux: libmxlinux grows into NetBSD's libc -- db, hashes, glob, syslog
The phone's userland is NetBSD's own source built with NetBSD's build
against glibc, and more and more of src/ asks for libc symbols glibc
does not have, so libmxlinux takes them over from the same tree:
db(3) (Berkeley DB 1.85, which glibc dropped), md2/md4/rmd160 and the
*File/*End helpers the hash tools link, glob(3) (renamed __glob30, so
beside glibc's), stringlist, errc/warnc, fmtcheck, shquote, getcap,
strtonum, heapsort/merge/radixsort, base64, stresep, and the
<db.h>/<md2.h>/<ndbm.h>/<stringlist.h> frames that reach over to
src/include.

-mx_cdefs.h: __strong_alias/__weak_alias stay off inside libmxlinux
(-D_MX_LIBMXLINUX).  The libc sources it compiles alias their public
names to libc-internal ones in hashhl.c before namespace.h can withdraw
the macro, and those names do not exist outside libc -- every program
linked against the library had undefined _MD2FileChunk.  src/tools/compat
builds the same sources without them for the same reason.

-mxlinux.h: the feature set is asked for the way NetBSD's
<sys/featuretest.h> asks for it.  A program with -std=c99 alone asks for
no standard, which on NetBSD means _NETBSD_SOURCE (everything);
glibc gives ISO C only, so _DEFAULT_SOURCE and _NETBSD_SOURCE are set
before the first glibc header.

-mobile/conf/mk.conf: the NetBSD subsystems with a NetBSD kernel
underneath are off for a Linux target -- MKAUDIO, MKBLUETOOTH, MKUSB,
MKNFS, MKYP, MKHESIOD, MKSKEY, MKKERBEROS, MKPAM -- and libpthread is
glibc's (LIBDO.pthread=_external), not NetBSD's LWP threads.

-mobile/tools/mxsrc.sh: USE_FILEMON=no on the command line, because
make(1) decides on filemon before bsd.own.mk reads mk.conf and traces
with ktrace(2)/filemon(4), which Linux has neither of.

Measured: make src DIR=lib/libmxlinux -> mxsrc lib/libmxlinux exit=0,
0 errors (mobile/build/logs/mxsrc-libmxlinux-2026-11-12-b.log).
2026-11-12 12:36:19 +00:00
lotherkandClaude Opus 5.5 4c89941778 Makronix/Linux: src/bin by NetBSD's normal build, libmxlinux from NetBSD's own sources
make src DIR=<dir> (mobile/tools/mxsrc.sh) runs the tooldir's
nbmake-evbarm64 in src/<dir> with MAKECONF=mobile/conf/mk.conf and the
sysroot as DESTDIR, objects in build/tools-obj, "obj" first.

libmxlinux grows into what NetBSD's libc and libutil have and glibc
lacks, from NetBSD's own sources reached over by .PATH: vis/unvis,
strmode, setmode, pwcache, reallocarr, strtoi/strtou (BCS_ONLY), fts (its
<fts.h> in front of glibc's; renamed symbols, so the two never meet),
acl(3) (posix1e), extattr(3), and libutil's efun, parsedate,
raise_default_signal, stat_flags, strpct, snprintb.  Ours only at the
kernel boundary: extattr onto Linux xattr(7) (user. and trusted.), the
__acl_* calls (EOPNOTSUPP; _PC_ACL_* get values glibc answers EINVAL to),
chflags/undelete (EOPNOTSUPP), lchmod (a link has no mode on Linux),
lpathconf, setpassent, the timezone_t API over TZ (mx_tz.c), sys_siglist.
include/ reaches over <fts.h>, <util.h>, <vis.h>, <tzfile.h>,
<sys/acl.h>, <sys/extattr.h>.  stty's mx_termios.h moves here and serves
every program; the old port frame keeps its per-port shims behind
-DMX_PORT_FRAME until they are gone.

libnbcompat is out of the normal build again: its setmode is the host
tools' octal-only stub (src/tools/compat/getmode.c:37), so chmod u+x set
mode 0.  mk.conf: NOGCCERROR (28 warnings left in src/bin),
-Wno-system-headers (glibc's fortify headers), MKRUMP=no.

Found on the way: NetBSD's __used macro deleted a member of glibc's
regex_t (<regex.h>:410 pastes "__used") and of posix_spawnattr_t
(<spawn.h>:47); regex_t shrank from 64 to 56 bytes and expr's regexec
read garbage.  mxlinux.h now includes both headers before mx_cdefs.h.

Measured: 22 of 34 programs of src/bin build
(mobile/build/logs/mxsrc-bin6-2026-11-12.log); the 18 with a port test
pass all of them under qemu-aarch64 -L build/mxsysroot-hotdogb: cat chmod
cp echo expr hostname kill ln ls mkdir mv pwd rm rmdir sleep stty sync
test.  The old frame still builds cat, stty, test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:21:44 +00:00
lotherkandClaude Opus 5.5 d6540e5659 mobile: consmirror -- the serial console shows what the display shows
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>
2026-11-12 07:57:22 +00:00
lotherkandClaude Opus 5.5 ce9b1fef77 Makronix/Linux: libmxlinux is src/lib/libmxlinux, built by NetBSD's normal build
libmxlinux moves from mobile/userland/lib/mxlinux into src/lib/libmxlinux
with a NetBSD library Makefile (LIB=mxlinux, bsd.lib.mk, shlib_version),
so NetBSD's build makes libmxlinux.so.0 for a Linux target like any other
library of src/.  mx_cdefs.h carries the <sys/cdefs.h> additions glibc
lacks, namespace.h stands in for libc's (no __weak_alias on glibc),
mx_progname.c gives getprogname/setprogname, mxlinux.h gains _DIAGASSERT.
mobile/conf/mk.conf forces mxlinux.h into every compile and links
-lmxlinux.  The old port frame builds the same sources from there
(mobile/build/logs/userland-cat-2026-11-12.log: cat built, mxcheck ok).

The sysroot steps that were done by hand are in the tools now:
- mkmxheaders.sh installs only the kernel headers (the tooldir's gcc needs
  nothing else, and nbmtree does not exist yet);
- mkglibc.sh lays down NetBSD's hierarchy with nbmtree from
  NetBSD.dist.base + .aarch64 (1480 directories), installs glibc, and links
  the dynamic linker as /lib/ld-linux-aarch64.so.1 and /libexec/ld.elf_so,
  the interpreter bsd.prog.mk:69,286 writes into every program;
- mktargetlibs.sh installs libgcc_s.so.1 and libstdc++.so.6 into the
  sysroot's /usr/lib.

Measured: src/bin/cat built by nbmake-evbarm64 with this mk.conf (NEEDED
libmxlinux.so.0, libgcc_s.so.1, libc.so.6; interpreter /libexec/ld.elf_so)
passes userland/cat/test.sh 5/5 under qemu-aarch64 -L mxsysroot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 07:57:00 +00:00
lotherkandClaude Opus 5.5 315cf540c3 Makronix/Linux: src/ builds for Linux with NetBSD's own build and a mk.conf
The toolchain and sysroot are ours now in LFS's order (Makefile: mxheaders
-> tooldir -> sysroot (glibc) -> targetlibs -> toolchain); the Void-made
sysroot (tools/mksysroot.sh, base/void/sysroot-packages) is gone, the
frame points at build/mxsysroot-<dev>.

conf/mk.conf: what NetBSD's build needs to build src/ for a Linux target,
as MAKECONF, nothing changed in src/: the sysroot's library directories
for the -DNETBSD_TOOLS gcc (as src/tools/gcc/Makefile:162 does), and the
start files -- glibc's Scrt1/crti/crtn, gcc's crtbegin/crtend -- through
the ?= of bsd.gcc.mk and bsd.prog.mk.  With it, src/lib/libz builds
unchanged with bsd.lib.mk through the tooldir's nbmake-evbarm64:
libz.so.1 (soname as on NetBSD), NEEDED only libc.so.6 and
ld-linux-aarch64.so.1, its symbol check against NetBSD's list empty.

Open: programs (bin/cat) need NetBSD's header additions (cdefs,
setprogname): libmxlinux and libnbcompat through the same mk.conf.
make userland (the port frame) waits for libz in the sysroot: libnbcompat's
configure requires zlib.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 02:54:24 +00:00
lotherkandClaude Opus 5.5 ab3e8d8179 mobile: targetlibs against Makronix/Linux's own glibc once it is there (L4)
libgcc and libstdc++ of the tooldir's gcc 14.4 rebuilt against
build/mxsysroot-<dev> (glibc 2.44), as LFS orders it: gcc's runtime
libraries after the C library.  C++ runs under qemu on it alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 23:03:07 +00:00
lotherkandClaude Opus 5.5 b2de49bb97 Makronix/Linux: our own sysroot -- our kernel's headers and glibc 2.44
Void is dropped (Konrad, 2026-11-11): src/ first, then pkgsrc recipes, then
LFS-style from upstream for what neither has; the whole system under our
control, the phone first, a desktop variant on the Linux kernel later.
docs/NETBSD-USERLAND.md has the new goal and phase L (the base from our own
parts, replacing phase D).

L1: make mxheaders -- headers_install of our kernel tree (7.0.14) into
build/mxsysroot-<dev>, with the usr-merged links.
L2: make glibc -- ext/src/glibc/mx/Makefile, LFS's cross "Glibc" recipe,
compiled with the tooldir's gcc 14.4.0 of src/; host tools borrowed for now:
GNU make >= 4.0, python3, bison, gawk.

Measured: glibc 2.44 built and installed (mkglibc exit=0,
build/logs/glibc-2026-11-11.log; .comment GCC: (NetBSD nb4 20260926)
14.4.0); a C program linked only against it runs under qemu with
build/mxsysroot-hotdogb as its root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 23:00:38 +00:00
lotherkandClaude Opus 5.5 bf4abb6d5c mobile: userland: install a program's LINKS ("[" of test)
src/tools/Makefile.host undefines LINKS (its programs are host tools), so
mk/mx.prog.mk reads them from the program's own Makefile beforehand
(make -V '${LINKS}'), maps them onto Void's layout like HOST_BINDIR and
makes hard links after install.host, as NetBSD's install does.  /usr/bin/[
is test's inode now.  userland_stage accepts a LINKS name as a hard link of
a done port's program.  Clean rebuild 28/28, tests 28/28 under qemu
(build/logs/make-userland-links-2026-11-11.log); grep, id, pax, hexdump
... get theirs when they are ported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 21:54:26 +00:00
lotherkandClaude Opus 5.5 5187ae1a8e mobile: A7 -- the NetBSD userland goes into the phone's image
tools/lib.sh userland_stage stages build/userland/<dev>/destdir (without
METALOG) and our libstdc++.so.6.0.33 + libgcc_s.so.1 (stripped, from the
tooldir), and refuses a program whose port is not "state: done";
assemble-rootfs.sh lays it over the Void packages, before base/ and soc/.
make roottar / rootimg / update-root carry it from now on.

On the phone (/system/current since 2026-11-11): cat, sleep, kill, env, test,
wc, ln, head, tee ... are NetBSD's (gcc 14.4.0 of src/), libstdc++.so.6 is
ours, kill -INFO makes sleep answer, WLAN/battery/all 20 services up.

Bluetooth, A/B on the same phone (build/logs/ab-bt-{new,old}-2026-11-11.log):
NetBSD userland 4/5, the tree before 3/5 -- every failure is the kernel's
"QCA TLV response size mismatch" retry, with either userland; not A7.  Since
the kernel moved to 7.0.14 it fails in about 3 boots of 10 (7.0.0: 1 of 15,
bt-flush-2026-11-10.log), and bt-address's re-probe then hangs in the kernel
(qca_serdev_remove -> flush_work, D state): a kernel matter, open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:14:48 +00:00
lotherkandClaude Opus 5.5 f0f267eadf mobile: the phone's toolchain from src/ -- build.sh tools for aarch64-linux-gnu
make tooldir runs build.sh tools unchanged with -m evbarm64, the phone's
sysroot as -D, and -V MACHINE_GNU_PLATFORM=aarch64-linux-gnu (bsd.own.mk:1065
sets it with ?=): gcc 14.4.0 and binutils 2.46.0 of src/external/gpl3,
configured as NetBSD configures its own (c c++ objc fortran, no Ada), plus
nbmake, nbmtree, install for the host -- the phone no longer borrows the
desktop's tooldir nor Debian's cross compiler.

make targetlibs does what NetBSD does with its own Makefiles, and meets four
NetBSD particulars (PORTING-USERLAND.md section 8): gcc's headers are not
copied by NetBSD's gcc (Makefile.in:3308 "if false"); -DNETBSD_TOOLS needs
the -B/-L of src/tools/gcc/Makefile:162; the libstdc++ import has no "src"
in SUBDIRS and no po/; NetBSD's locale_facets_nonio.h:339 needs a locale
model glibc's "gnu" one is not -- libstdc++ uses "generic" (a finding).

The frame (mxmake.sh, mktoolchain.sh, mxcheck.sh) uses the tooldir's gcc,
binutils and make.  Measured: C and C++ run under qemu against the phone's
glibc 2.41 with libstdc++.so.6.0.33; all 28 ports rebuilt with it pass
28/28 under qemu and on the phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:12:15 +00:00
lotherkandClaude Opus 5.5 0d4901af1e mobile: the frame for porting src/ programs to the phone
NetBSD's own host-program machinery, with the phone as the host: build.sh
builds nbcat, nbsed ... for a Linux build host with src/tools/Makefile.host
and libnbcompat; tools/mxmake.sh runs the same with HOST_CC = an aarch64
compiler whose glibc is the phone's.

- tools/mksysroot.sh: the Void rootfs + base/void/sysroot-packages headers
- tools/mktoolchain.sh: Debian's aarch64 gcc, glibc only from the sysroot
  (--sysroot alone took Debian's glibc 2.42; the phone has 2.41)
- tools/mxmake.sh: the nbmake-<machine> of the phone (QEMU_LD_PREFIX lets
  configure run its tests through binfmt; INSTALL and HOST_MKDEP overrides)
- userland/Makefile: mtree hierarchy, libnbcompat for aarch64, every port
  found by its directory; make userland [PROG=x], make userland-test
- userland/mk/mx.prog.mk: two lines per port, Makefile.host unchanged
- tools/mxcheck.sh: no symbol version newer than the phone's libraries
- docs/PORTING-USERLAND.md: how to port one program, with the twelve
  pitfalls met on the first one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:07:07 +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 3b2cbc44f1 mobile: kernel on kernel.org v7.0.14, named 7.0.14-makronix-unstable
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>
2026-11-11 14:29:14 +00:00
lotherkandClaude Opus 5.5 fed05a6c80 mobile: hotdogb boot splash: the Makronix M fullscreen, gone at the login
- 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>
2026-11-10 08:19:47 +00:00
lotherkandClaude Opus 5.5 92db34f7e4 mobile: hotdogb WLAN missing in some boots solved: qrtr_smd in stage 1
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>
2026-11-10 07:47:09 +00:00
lotherkandClaude Opus 5.5 5c5872eb6f mobile: fetch-kernel.sh: reproducible commits, so the same patch series gives the same kernel release
git am stamped the time of the run as commit date: two trees from the same
pin and patches had the same source (tree d31c6d86f032) but other hashes,
and setlocalversion put the hash into the release name (g4db1692fd and
g425f6d5c4), so modules of one did not load with the kernel of the other.
Now a fixed committer and the patch's author date as commit date: two
fresh trees both at 662ea51c5ed9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 06:44:09 +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 e7bd6d9407 tree: drop xsrc, track src, X from pkgsrc
- xsrc/ deleted; X11_TYPE=modular, Xorg and the X libraries come from pkgsrc
  (packages.list), in the cross configuration and the build VM.
- overlay/ and patches/ are gone; their content is in src/ (commit 64934f16).
- Makefile: no -x/-X, no overlay target, stamp no longer syncs an overlay.
- makronix-pins.sh: src/BASE + pkgsrc; msrc-stage: no .git/xsrc, src comes
  from the NetBSD source sets.
- AGENTS/GOAL/docs updated to the new model (src tracked, refs/ read-only).
- mobile: kernel source is refs/linux/7.0.0, patches stay in
  mobile/kernel/patches; fetch-kernel clones it locally and checks the pin.
2026-11-09 23:30:07 +00:00
lotherk 0a9f83bd32 mobile: build-kernel.sh: olddefconfig alone, before the build
`make -j olddefconfig Image modules <dtb>` runs olddefconfig in parallel
with the compiles.  When the config had changed, include/generated/* was
regenerated while sources were being compiled: the build died with an
empty LINUX_VERSION_CODE and an empty KERNEL_REL in unrelated drivers

    fs/pstore/ram.c:809: error: expected expression before ','
    drivers/usb/core/hcd.c:191: note: in expansion of macro 'KERNEL_REL'

(build/logs/update-root-2026-11-09.log).  Two builds had passed before, so
it is a race, not a wrong config.  Now olddefconfig runs first and alone;
the next build of the same tree exits 0
(build/logs/kernel-retry-2026-11-09.log).
2026-11-09 23:17:26 +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 a2c6cd1347 mobile: hotdogb bt-address as a service with re-probe, rmtfs waits for tqftpserv, boot-loop tool, handoff
- bt-address runs as a runit service (no longer from udev, where its wait
  for wlan0 held up the WLAN modules); on failure it re-probes the
  controller (unbind/bind of hci_uart_qca), three attempts.
- rmtfs (which starts the modem) waits for tqftpserv.
- tools/boot-loop.sh: N reboots with a check per boot, every wait
  bounded; tools/checks/ holds the checks.
- docs/HANDOFF.md: how to work with the phone, what works, what is open
  (WLAN missing in 2-3 boots of 15 -- the modem's WLAN QMI service never
  appears -- first).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 07:14:26 +00:00
lotherkandClaude Opus 5.5 fd0e21d238 mobile: hotdogb white display solved: initialise the panel instead of taking it over
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>
2026-11-08 19:27:27 +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 4a40bfe919 mobile: netconsole over usb0, and the log of the remaining hotdogb hang
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>
2026-11-07 21:28:38 +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 c134e25c2b mobile: our initramfs (own busybox), display-init defect measured
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>
2026-11-07 12:46:37 +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 26258166df mobile: kernel as pin + patches, glibc base (Debian and Void rootfs)
kernel/PIN and kernel/patches replace the external kernel tree: make linux
fetches the pinned commit and applies the patches (source tree identical to
the one that runs on the phone). base/debian and base/void build a glibc
aarch64 root file system without root (mmdebstrap / unshare + xbps).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 11:03:38 +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