Repository navigation
usb: presets that match how the device is used - #77
Merged
Merged
Conversation
The five presets dated from before audio, the serial console helper and RustDesk's own USB needs, and none of them matched the two compositions a device actually ends up in: a fresh install (three HID functions and the virtual disk, 4 IN / 4 OUT) showed "custom", and so did a device after RustDesk had added audio. Six presets now, in the order shown: KVM (the fresh-install composition, first, no network adapter on the computer), KVM + USB network, KVM + serial console (with its helper disk), Headless server (serial console and the helper disk only, as decided: no keyboard, no network), Remote desktop (HID, disk and audio, what RustDesk enables), and Keyboard and mouse only. Each description says what the preset gives up, since the 6 IN / 7 OUT budget cannot hold everything at once. The HID-only compatibility profile (USB 1.1 descriptors) is no longer a preset but a switch in the manual section: it is a property of a composition. Turning it on drops network, disk and audio; turning one of those on leaves it again. The mouse jiggler is shown only when a mouse function is enabled. The docs get the preset table with the trade-offs, the audio row in the endpoint table, and the field, flag and selection counts the code has (seven, ten, 128); the README no longer mentions RNDIS. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Serial and disk leave 3 IN / 5 OUT; the three HID functions and audio that RustDesk enables fit on top (6 / 6). The description, the docs table and a test say so, instead of "no remote desktop". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A headless server's serial login is set up before, with the console preset (where the helper disk appears) or over the network; afterwards the server needs nothing else from the NanoKVM. Without the virtual disk no USB storage shows up in its boot order. 2 IN / 1 OUT; RustDesk still fits on top (5 / 5), and network, disk or audio can be added by hand. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The USB presets predate audio, the serial console helper (#76) and RustDesk's USB needs, and none of them matched the compositions a device actually runs: a fresh install (three HID functions and the virtual disk without media, 4 IN / 4 OUT) showed "Custom composition" with the manual section open, and so did a device after RustDesk had added audio. The "Headless" preset had no keyboard and the USB network, and "HID compatibility (USB 1.1)" was a copy of "Keyboard and mouse only" with another USB profile.
The presets now
The budget is 6 IN / 7 OUT, so everything at once (HID + network + disk + serial = 8 IN) does not fit; every preset gives something up, and its description says what.
usb.dev, emptyusb.disk0) matches KVM without any image change.usbPresets[0]is also the fallback when USB is switched back on with nothing remembered.EnsureRemoteAccessUSB(RustDesk) produces exactly Remote desktop.standard,console,controlkeep their meaning;headlesschanges composition;kvmandremoteare new;compatibilityis gone.Docs
docs/usb-composition.md: the preset table with the trade-offs, the fresh-install and RustDesk notes, the compatibility switch, an audio row in the endpoint table, and the counts the code has (seven boolean fields, ten boot flags, 128 manual selections; it said six, eight and 64).README.md: the presets, and "NCM/RNDIS" becomes NCM (RNDIS was removed in beta-4).Checked
web/tests/usb-composition.test.mjs: every preset fits and is matched; the fresh-install and the RustDesk compositions matchkvmandremote; what each preset gives up (serial does not fit onstandard, network not onconsole, headless has room for network and audio, audio fits on the full KVM presets); the compatibility switch drops network, disk and audio and is left again; the existing budget sweeps.tests/i18n-keys.test.mjs.tsc --noEmit, eslint, prettier;go testfor the endpoint budget with the new compositions.Not covered
🤖 Generated with Claude Code