fix(batm3): eGalax touchscreen (kernel 6.6) + USB-bootable image #80

Merged
padreug merged 2 commits from fix/batm3-usb-boot-and-touchscreen into dev 2026-07-29 23:57:28 +00:00
Owner

Summary

Two batm3 hardware-enablement fixes, both validated on the physical Dell 9030 AIO. The touchscreen half is essential for any batm3 image — without it a dev-built batm3 boots on kernel 6.12 and the panel is dead. (These fixes had been developed on a local branch but never landed on dev; this PR closes that gap.)

1. eGalax touchscreen (996ed7e) — deploy/nixos/hardware/batm3.nix

The Dell 9030 AIO's eGalax SAW panel (0eef:0001) was unusable on 25.11's default 6.12 kernel: hid-multitouch grabs the controller and mis-parses its HID report, usbtouchscreen refuses to bind, and touches don't register (or land in the wrong place).

  • Pin linuxPackages_6_6 — usbtouchscreen binds this controller on 6.6 (the known-good prior install ran 6.6.68) and produces a clean single-touch ABS device. Re-test touch before bumping.
  • udev rule self-loads usbtouchscreen before the usbhid→usbtouchscreen handover, removing a boot-ordering race.
  • evdev InputClass (99-egalax.conf) so X uses evdev + the transformation matrix (not libinput).
  • egalax-calibrate gets XAUTHORITY — the actual boot-time bug: without the X auth cookie xinput died with Invalid MIT-MAGIC-COOKIE-1, so the coordinate matrix was never applied. Also swapped the fixed sleep for a retry loop on the device appearing.

2. USB-bootable image (3324975) — flake.nix + batm3.nix

Adds disk-image-batm3-usb for a dd-to-USB test image that boots on the batm3 without disturbing the internal SATA install:

  • Distinct labels nixos-usb / ESP-USB so stage-1 can't latch onto the internal drive's generic nixos/ESP.
  • usb_storage in initrd, uas blacklisted, usbcore.autosuspend=-1 — flaky USB bridges dropped off the bus under UAS/autosuspend ("device offline").
  • /boot nofail so a slow ESP-USB enumeration doesn't drop to emergency mode.
  • No growPartition on the USB image — sfdisk rewriting the partition table on first boot wedged flaky sticks (and stranded the ESP). The internal-SATA disk-image-batm3 keeps growPartition (real SSD, no bus drops).

Validated on hardware

  • Boots from USB on the batm3; root + /boot mount reliably.
  • Touch works: usbtouchscreen binds on 6.6, calibration matrix applies at boot, taps land correctly.

Relationship to #79

#79 fixes cash-in (EBDS + device paths). Both PRs together make a complete, correct batm3 image — the internal-SATA production image needs the 6.6 pin from this PR and the cash-in fixes from #79. They touch disjoint files and merge cleanly (verified: built and flashed a combined image to the batm3's internal SATA, kernel 6.6.140 + working validator).

🤖 Generated with Claude Code

## Summary Two batm3 hardware-enablement fixes, both validated on the physical Dell 9030 AIO. **The touchscreen half is essential for *any* batm3 image** — without it a `dev`-built batm3 boots on kernel 6.12 and the panel is dead. (These fixes had been developed on a local branch but never landed on `dev`; this PR closes that gap.) ### 1. eGalax touchscreen (`996ed7e`) — `deploy/nixos/hardware/batm3.nix` The Dell 9030 AIO's eGalax SAW panel (`0eef:0001`) was unusable on 25.11's default 6.12 kernel: `hid-multitouch` grabs the controller and mis-parses its HID report, `usbtouchscreen` refuses to bind, and touches don't register (or land in the wrong place). - **Pin `linuxPackages_6_6`** — `usbtouchscreen` binds this controller on 6.6 (the known-good prior install ran 6.6.68) and produces a clean single-touch ABS device. Re-test touch before bumping. - **udev rule self-loads `usbtouchscreen`** before the usbhid→usbtouchscreen handover, removing a boot-ordering race. - **evdev `InputClass`** (`99-egalax.conf`) so X uses evdev + the transformation matrix (not libinput). - **`egalax-calibrate` gets `XAUTHORITY`** — the actual boot-time bug: without the X auth cookie `xinput` died with `Invalid MIT-MAGIC-COOKIE-1`, so the coordinate matrix was never applied. Also swapped the fixed `sleep` for a retry loop on the device appearing. ### 2. USB-bootable image (`3324975`) — `flake.nix` + `batm3.nix` Adds `disk-image-batm3-usb` for a dd-to-USB test image that boots on the batm3 without disturbing the internal SATA install: - **Distinct labels** `nixos-usb` / `ESP-USB` so stage-1 can't latch onto the internal drive's generic `nixos`/`ESP`. - **`usb_storage` in initrd**, **`uas` blacklisted**, **`usbcore.autosuspend=-1`** — flaky USB bridges dropped off the bus under UAS/autosuspend ("device offline"). - **`/boot` `nofail`** so a slow ESP-USB enumeration doesn't drop to emergency mode. - **No `growPartition` on the USB image** — sfdisk rewriting the partition table on first boot wedged flaky sticks (and stranded the ESP). The internal-SATA `disk-image-batm3` keeps growPartition (real SSD, no bus drops). ## Validated on hardware - Boots from USB on the batm3; root + `/boot` mount reliably. - Touch works: `usbtouchscreen` binds on 6.6, calibration matrix applies at boot, taps land correctly. ## Relationship to #79 [#79](https://git.atitlan.io/aiolabs/bitspire/pulls/79) fixes cash-in (EBDS + device paths). **Both PRs together** make a complete, correct batm3 image — the internal-SATA production image needs the 6.6 pin from *this* PR **and** the cash-in fixes from #79. They touch disjoint files and merge cleanly (verified: built and flashed a combined image to the batm3's internal SATA, kernel 6.6.140 + working validator). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add a USB-bootable BATM3 disk-image target plus the batm3 hardware
changes that make a dd'd USB stick boot reliably on the Dell 9030 AIO.

flake.nix — new `disk-image-batm3-usb` target:
- Distinct partition labels (nixos-usb / ESP-USB) so stage-1 by-label
  resolution can't latch onto an internal SATA drive that already holds
  a generic nixos/ESP-labelled install. Post-build mlabel relabels the
  ESP FAT volume to ESP-USB (bootloader files untouched; UEFI still
  loads /EFI/BOOT/BOOTX64.EFI).
- /boot mounted nofail + short device-timeout: the firmware already
  loaded the bootloader before Linux; without nofail a slow/late ESP-USB
  enumeration drops to emergency mode with root locked — a dead end.
- NO growPartition/autoResize on the USB image: sfdisk rewriting the
  partition table on first boot is the single most bus-stressing write,
  and flaky USB bridges drop off the bus mid-rewrite (sfdisk wedges in
  uninterruptible D-state and ESP-USB vanishes with the device, so /boot
  times out too). Persistent state is a few MB and the image already
  ships ~2GB free in root. The internal-SATA disk-image-batm3 keeps
  growPartition — a real AHCI SSD won't drop the bus.
- autoUpgrade off (test image, not a managed fleet member).

batm3.nix — USB-boot reliability:
- Add usb_storage to initrd.availableKernelModules so stage-1 binds the
  stick and /dev/disk/by-label/* appears.
- Blacklist uas + usbcore.autosuspend=-1: force the slower-but-reliable
  Bulk-Only Transport path and stop the boot medium being power-suspended
  mid-I/O — both were causing "device offline error" bus drops.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Dell 9030 AIO's built-in eGalax SAW panel (0eef:0001) was unusable:
touches either didn't register or landed in the wrong place. Full fix:

- Pin linuxPackages_6_6. On 25.11's default 6.12 kernel hid-multitouch
  grabs the controller and mis-parses its HID report (axes read stuck)
  and usbtouchscreen refuses to bind. On 6.6 usbtouchscreen binds and
  produces a clean single-touch ABS device (the known-good internal-SATA
  install runs 6.6.68). Mirrors douro.nix's per-hardware kernel pin.

- udev rule now modprobes usbtouchscreen ITSELF before unbinding usbhid
  and handing over via new_id. On a USB boot systemd-udev-trigger fires
  this rule (~2s) before systemd-modules-load loads usbtouchscreen
  (~12s), so new_id previously hit a not-yet-loaded driver and the panel
  bound to nothing. Loading it inline removes the boot-ordering race.

- Add an X evdev InputClass (99-egalax.conf) so X uses evdev + the
  transformation matrix rather than libinput. Mirrors the working
  internal-SATA install.

- egalax-calibrate: add XAUTHORITY (=/home/bitspire/.Xauthority) — the
  actual boot-time bug. Without the auth cookie xinput died with
  "Invalid MIT-MAGIC-COOKIE-1 key / Unable to connect to X server", so
  the coordinate-transformation matrix was never applied and touches
  landed in the wrong place. Also replace the fixed ExecStartPre sleep
  with a 30s retry loop on the eGalax X device appearing — more robust
  to boot timing than a race against display-manager.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
padreug force-pushed fix/batm3-usb-boot-and-touchscreen from 996ed7ec67 to f52d942e57 2026-07-29 23:56:44 +00:00 Compare
padreug deleted branch fix/batm3-usb-boot-and-touchscreen 2026-07-29 23:57:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/bitspire!80
No description provided.