Commit Graph
68 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
lotherkandClaude Sonnet 5.5 efa96ca4f7 One package list: packages.list (kinds set/repo/fetch, @ARCH), read by tools/pkglist.sh; userland.sh detects cross or native and builds all of it; nothing is built in a VM any more
Removed: packages.{amd64,aarch64,binary*}.list, tools/packages.vm.list,
tools/vm-pkgbuild.sh, tools/vm-pkgcollect.sh, tools/vmbuild/, make binaries.
A package that fails no longer stops the others; they are named at the end.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-13 17:50:29 +00:00
lotherkandClaude Sonnet 5.5 945b993f96 AGENTS.md under mobile/: 1797 -> 617 lines, checked against the tree (patches 0001-0026, no void sysroot, make src); the old texts in docs/reference
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-13 14:26:16 +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 cc4c76c10f Makronix/Linux: df by the normal build; NetBSD's statvfs over statfs and mountinfo
libmxlinux carries NetBSD's statvfs(2) family -- statvfs, fstatvfs,
statvfs1, fstatvfs1, getvfsstat, getmntinfo -- for a Linux kernel: the
numbers from statfs(2), the names NetBSD keeps in its mount structure
(f_fstypename, f_mntonname, f_mntfromname) from /proc/self/mountinfo,
matched exactly by statx(2)'s STATX_MNT_ID.  Linux ST_* flags become
MNT_*; MNT_LOCAL unless the type is a network file system, MNT_ROOTFS
for "/", MNT_IGNORE for mounts without blocks (proc, sysfs, cgroup ...),
which NetBSD's df would otherwise list.

Headers, reached over: <sys/statvfs.h> in front of glibc's (NetBSD's
struct; its functions are renamed __statvfs90 ..., so they never meet
glibc's), <sys/fstypes.h> with NetBSD's fsid_t renamed in place (it is
not glibc's struct), a <machine/ansi.h> that needs nothing on glibc, and
a <sys/mount.h> that keeps glibc's underneath (#include_next) and adds
fstypes, statvfs and MNAMELEN (mount.h:63) as NetBSD's does.

Measured under qemu-aarch64: df -h lists the host's mounts with the
numbers GNU df gives for /, /boot, /boot/efi, /run; -i, -l, -k work.
(/dev and /tmp show the root's numbers there because qemu's -L redirects
those paths into the sysroot's own directories.)  28 of 34 programs of
src/bin build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:53:53 +00:00
lotherkandClaude Opus 5.5 86ae867ea6 Makronix/Linux: ksh, ed, dd, pax by the normal build; libcrypt, librmt
27 of the 34 programs of src/bin build now.  New libraries by the same
normal build: lib/libcrypt (NetBSD's crypt: DES, MD5, blowfish, sha1,
argon2 -- glibc 2.44 has no libcrypt) and lib/librmt.

libmxlinux, NetBSD's own sources: md5c, sha1, sha2 (with <md5.h>,
<sha1.h>, <sha2.h> and their <sys/...> names, as sys/sys/Makefile:57-61
installs them), explicit_memset, strsuftoll, fparseln.  fts.c and
fparseln.c take their own portable branch (HAVE_NBTOOL_CONFIG_H with an
empty config in portable/, which only they see).  Ours: fgetln over
getline, fchroot (fchdir + chroot(".")), sysctl's hw.* subtree from
sysconf/uname (ncpu, pagesize, physmem64/usermem64 -- argon2 sizes itself
by it).  mxlinux.h: CLK_TCK as NetBSD's __sysconf(39), O_DIRECT,
O_SHLOCK/O_EXLOCK/O_ALT_IO/O_NOSIGPIPE as 0 (no Linux counterpart; ksh's
history opens without its lock), _PASSWORD_*, des_*, pwcache_*db,
UID_MAX/GID_MAX, _PATH_DEFTAPE /dev/nst0.  <rmt.h> is read without
NetBSD's ssp layer; glibc fortifies read(2) itself.

mx_termios.h no longer includes <sys/ioctl.h>: forced into every compile
it exposed TIOCSTI to ksh's emacs.c:1309, which compiles only where that
is hidden (it names an undefined TTY), as on NetBSD.

Measured under qemu-aarch64 -L build/mxsysroot-hotdogb: crypt(3) gives
abJnggxhB/yWI for DES, the openssl MD5 hash, and openwall's $2a$05$
U*U vector; pax writes ustar that GNU tar extracts to the same tree and
extracts GNU tar's archive with modes, mtimes and symlinks; ksh
arithmetic and arrays, ed s///+w, dd copy/skip work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:50:56 +00:00
lotherkandClaude Opus 5.5 b18945f578 Makronix/Linux: NetBSD's /bin/sh, libedit and libterminfo by the normal build
make src DIR=lib/libterminfo, lib/libedit, share/terminfo, bin/sh: the
"includes" pass first as in build.sh (curses.h, term.h), terminfo.cdb
compiled by the tooldir's nbtic, libraries into /lib (USE_SHLIBDIR).

libmxlinux, NetBSD's own sources reached over: cdb(3) (cdbr, cdbw,
mi_vector_hash) for terminfo.cdb.  Headers: <sys/endian.h> (glibc's
<endian.h> plus NetBSD's encoders/decoders, endian.h:190-230 -- NetBSD's
whole header would turn ntohl into a macro under glibc's prototypes),
<sys/bitops.h>, <sys/cdbr.h>/<cdbr.h> (sys/sys/Makefile:54),
<cdbw.h>, <sys/stdint.h>, and a <sys/sysctl.h> with NetBSD's MIB numbers
(the real one pulls in sys/proc.h and UVM).  Ours at the kernel boundary:
sysctl(3) answering the user.* subtree as NetBSD's libc does
(sysctl.c:106) from confstr/sysconf -- sh asks user.cs_path;
fcntl F_MAXFD/F_CLOSEM (as 10/11 they are F_SETSIG/F_GETSIG to Linux, so
they get unknown values and never reach the kernel), funopen/funopen2
over fopencookie, setproctitle via PR_SET_NAME, issetugid from AT_SECURE.
mxlinux.h: BSD/BSD4_3/BSD4_4 (sys/param.h:49-51; sh includes <sys/wait.h>
only #ifdef BSD), __va_list, <string.h> as NetBSD's <strings.h> has it,
<stddef.h>, dup3; mx_termios.h: TCSASOFT 0 (any other value makes Linux's
tcsetattr fail).

src/lib/libedit/config.h: HAVE_STRUCT_DIRENT_D_NAMLEN only without
__GLIBC__ -- libedit's own portable branch, its autoconf answer for glibc.

Measured: sh runs under qemu-aarch64 -L build/mxsysroot-hotdogb
(functions, arithmetic, command substitution, kill -l, trap ... INFO with
kill -INFO); the port tests of cat chmod cp echo ln ls mkdir mv rm rmdir
test kill pass with this sh as their interpreter; expr's "lang" case
reports that the sysroot has no glibc locales (sh's own setlocale
message, var.c:1948).  23 of 34 programs of src/bin build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:41:27 +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 9545a5af93 mobile: kernel messages in green on the phone's console, as on NetBSD
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>
2026-11-11 22:28:05 +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 522be41c17 mobile: NEXT.md 9d -- Bluetooth retry more frequent since 7.0.14, unbind hangs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:15:02 +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 081646b002 mobile: userland: libmxlinux, and SIGINFO is SIGPWR system-wide
userland/lib/mxlinux: what NetBSD's headers and libc have and glibc lacks,
in one place instead of per port.  NetBSD's own sources where they run on
glibc unchanged (getopt, signalname/signalnumber/signalnext,
humanize_number, dehumanize_number, getbsize), ours where Linux's view is
needed (sys_signame from sigabbrev_np, fgetwln, LC_C_LOCALE);
include/mxlinux.h with the NetBSD header line each item stands in for.

The frame forces nbtool_config.h and mxlinux.h into every port and links
libmxlinux.a ahead of libc, so every program gets NetBSD's getopt (glibc's
permutes argv: env -i A=1 failed).  SIGINFO is SIGPWR on Makronix,
system-wide (Konrad, 2026-11-11), named INFO in sys_signame: kill -INFO
makes sleep print NetBSD's "Between 2 and 3 seconds left".

The ports shrink to what is theirs: 23 are two lines again; stty keeps its
termios names, sleep -lm, fold _XOPEN_SOURCE, dirname MAN=.  Clean rebuild
28/28, no warning; tests 28/28 under qemu and on the phone
(build/logs/userland-{qemu,phone}-mxlinux-2026-11-11.log).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:35:19 +00:00
lotherkandClaude Opus 5.5 9bb6c8b867 mobile: userland: the C1 ports -- 27 programs of src/ on the phone
basename comm dirname echo env fold head hostname kill ln logname nice nohup
paste printenv pwd rev rmdir sleep stty sync tee test tty uniq wc yes, ported
by four opencode agents (deepseek-v4.1-flash) along docs/PORTING-USERLAND.md,
checked and rebuilt here with the toolchain of src/.  src/ is unchanged;
what glibc lacks is carried per port and documented with the compiler error
it fixes (kill: sys_signame from sigabbrev_np; stty: NetBSD's termios names
and baud-rate codes; test: timespeccmp; sleep: timespecadd/sub, LC_C_LOCALE,
SIGINFO as SIGPWR; rev: fgetwln) -- libmxlinux material once shared.

Each test.sh carries NetBSD's own src/tests cases where they exist plus the
man page's; 28/28 suites (with cat) pass under qemu and on the phone
(7.0.14-makronix-unstable; build/logs/userland-{qemu,phone}-all-2026-11-11.log).
"[" is not installed yet (Makefile.host undefines LINKS).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:12:15 +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 c267640875 mobile: userland: cat(1) from src/bin/cat, the first port
src/bin/cat unchanged, built by the frame for aarch64 Linux.  NetBSD's
t_cat.sh cases (align, nonexistent, se_output) with their data plus two of
the man page pass 5/5 under qemu and on the phone (7.0.14-makronix-unstable,
/tmp/userland-test/cat); it needs only libc.so.6 at versions the phone's
glibc 2.41 has.  Not in the image yet (A7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:07:08 +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 dd7c192079 mobile: plan for Makronix on a Linux kernel (NetBSD userland, rc, pkgsrc)
docs/NETBSD-USERLAND.md cuts Konrad's goal of 2026-11-11 ("use as much as
possible from our makronix/netbsd source on top of the linux kernel") into
items for parallel agents: the frame (sysroot, toolchain, libnbcompat for
aarch64, mobile/userland/), libmxlinux for the BSD interfaces Linux lacks,
the programs in tiers by a scan of their sources, NetBSD rc instead of
runit, Void removed piece by piece, pkgsrc cross Linux->Linux to /usr/pkg.
It rests on what is measured: build.sh already builds ~70 NetBSD programs
for this Linux host through src/tools/compat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:06: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 a3b0f8e4c3 mobile: hotdogb: the 7.0.0 fork state is removed from the phone
/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>
2026-11-11 14:40:25 +00:00
lotherkandClaude Opus 5.5 5cebb35e89 mobile: hotdogb: slot b holds 7.0.14-makronix-unstable too
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>
2026-11-11 14:35:43 +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 4b460cd255 mobile: NEXT.md: 7.4-rc1 hangs before the console on hotdogb; on hold until the fork tags 7.4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:15:38 +00:00
lotherkandClaude Opus 5.5 fee212bbe8 mobile: kernel/patches-7.4, the series on the 7.4-rc1 base (does not boot yet)
Rebased from kernel/patches onto refs/linux/7.4-rc1: 0005, 0009, 0018 and
parts of 0001 are upstream in 7.4 and dropped, 0001 and 0004 adapted, the
rest applies.  Builds; on hotdogb it dies before the first console line,
also with the 7.0 DTB and with a smaller Image (README).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:27:00 +00:00
lotherkandClaude Opus 5.5 6ed20da3f4 refs/linux/7.4-rc1: the SM8150 fork's 7.4 branch as a shallow reference
The next kernel base for mobile/ (Konrad: "7.4 is okay"; the fork has no
7.2): sm8150/7.4-rc1-wip at 38ceee3d0, Linux 7.4.0-rc1.  kernel/PIN stays
at 7.0.0 until 7.4 is measured on the phone (mobile/docs/NEXT.md §9b).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:35:50 +00:00
lotherkandClaude Opus 5.5 a6be527b40 mobile: NEXT.md: the plan for Linux 7.4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 08:42:10 +00:00
lotherkandClaude Opus 5.5 c20e8d219e mobile: hotdogb fallback slot b holds the state of fed05a6c8
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>
2026-11-10 08:21:27 +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 fc38c85bec mobile: NEXT.md: the kernel tree from refs/linux is the same source, but not the same release name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 06:41:57 +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 6a71779264 mobile: docs/NEXT.md: detailed instructions for continuing (WLAN race, persistent /data with /etc overlay, BT, slot b)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 07:19:29 +00:00
lotherkandClaude Opus 5.5 1c1f2ab04e mobile: HANDOFF: persistent data across updates, Android's system/data split as the model
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 07:16:27 +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 45125223af mobile: hotdogb stable WLAN address; display test tools
- 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>
2026-11-08 19:34:34 +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 7cb8370e98 mobile: hotdogb "switched off" explained: power key, and a hang when the modem stops under ath10k
- 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>
2026-11-08 17:25:37 +00:00
lotherkandClaude Opus 5.5 9803d925be mobile: hotdogb clears the bootloader's blend stages; the white display measured, still open
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>
2026-11-08 15:58:08 +00:00
lotherkandClaude Opus 5.5 4ea31d69c1 mobile: hotdogb modem, WLAN, charger and fuel gauge
- 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>
2026-11-08 15:17:42 +00:00
lotherkandClaude Opus 5.5 68c3b65b20 mobile: hotdogb Bluetooth, firmware from the phone's own partitions
- 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>
2026-11-08 14:21:21 +00:00