Skip to content

feat(install): udev reprobe rule recovers driverless devices at boot (#355) [HARDWARE-GATED]#372

Closed
BANANASJIM wants to merge 1 commit into
mainfrom
feat/boot-reprobe
Closed

feat(install): udev reprobe rule recovers driverless devices at boot (#355) [HARDWARE-GATED]#372
BANANASJIM wants to merge 1 commit into
mainfrom
feat/boot-reprobe

Conversation

@BANANASJIM

@BANANASJIM BANANASJIM commented Jun 5, 2026

Copy link
Copy Markdown
Owner

DRAFT — defense-in-depth safety net, NOT a confirmed fix. Do not merge yet.

Status after multi-agent review (2026-06-05)

Three independent reviewers + a real-hardware repro on the maintainer's Vader 5 concluded:

Kept open as a documented safety net for any future regression that genuinely leaves an interface driverless. Merge gate: a real-boot padctl doctor capture from an affected machine showing a supported interface driver -> (none) (truly driverless). If instead it shows usbhid bound + no hidraw, or hidraw present + daemon down, this is the wrong fix and should be closed.

Change

  • New generateReprobeRulesFromEntries62-padctl-reprobe.rules (sorts after the 61 unbind). One rule per supported device:
    ACTION=="add|bind", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_interface", ATTRS{idVendor}=="37d7", ATTRS{idProduct}=="2401", RUN+="/bin/sh -c 'test -e /sys%p/driver || echo %k > /sys/bus/usb/drivers_probe'"
    
    Uses udev %p/%k substitution (filled by udevd, matching the proven 61 rule) — no reliance on shell env export. Live-checks the driver symlink at execution time, so only a still-driverless interface is reprobed.
  • Wired into install after the 61 rule; added to /lib + /etc cleanup lists. Keeps the install-time probeAndReprobeDrivers (hybrid).

Test plan

  • Layer-0 rule-gen tests (vid/pid, add|bind, usb_interface, drivers_probe target, live %p guard on every line); falsifiability verified (removing the guard fails the tests). CI green.
  • Phase-B hardware validation (required before any merge): with the rule installed, udevadm monitor --udev + udevadm trigger --action=add on a driverless Vader interface must rebind usbhid and produce a hidraw node (udevadm test does NOT execute RUN, so it is not sufficient proof).

Refs

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 87d86082-f5ad-4ed4-8697-e783d9f8b12e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/boot-reprobe

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…355)

- Add generateReprobeRulesFromEntries -> 62-padctl-reprobe.rules: on add|bind
  of a supported VID:PID, reprobe the interface if it is still driverless
  (live `test -e /sys%p/driver` check; %p/%k substituted by udevd, matching the
  61 driver-block rule). Root-scoped via udevd; coldplug-replayed at boot.
- Wired into install after the 61 block rule; added to /lib and /etc cleanup.
- Complements the install-time probeAndReprobeDrivers (immediate case).

Defense-in-depth safety net only: on current main nothing leaves the interface
driverless at boot (the usbhid-in-block_kernel_drivers regression was fixed in
PR #362). Kept unmerged until a real-boot capture from an affected machine
confirms a genuinely driverless interface.
@BANANASJIM BANANASJIM force-pushed the feat/boot-reprobe branch from 195ace3 to 985c41c Compare June 6, 2026 03:21
@BANANASJIM

Copy link
Copy Markdown
Owner Author

Closing. Live padctl doctor output from an affected machine (#355) shows the daemon up with the Vader claimed and state=active, output_fd_alive=true — there is no driverless interface, so the boot-reprobe rule this PR adds addresses a precondition current main no longer produces (the boot-time usbhid unbind was fixed in #362). The real residual symptom is a connect/disconnect flap, tracked separately. Keeping the codebase free of a rule that could rebind usbhid under the daemon's libusb claim.

@BANANASJIM BANANASJIM closed this Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant