Skip to content

USB media manager, exFAT, battery rewrite, drives UI, Settings fixes - #24

Merged
v3nn7 merged 1 commit into
mainfrom
feat/usb-automount
Oct 30, 2026
Merged

v3nn7 merged 1 commit into
mainfrom
feat/usb-automount

Conversation

@v3nn7

@v3nn7 v3nn7 commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

What

  • USB media manager (kernel/src/media.rs): volumes on USB sticks and disks are mounted at /media/<label> (FAT32, exFAT, ext4; GPT and MBR as Windows writes them). Eject is eject <disk> to /dev/media: sync, all-or-nothing unmount (Busy while a file is open), cache flush, stop unit. A stick pulled out while mounted is detached by force without the kernel or the USB controller thread waiting on the dead device. /run/media.status lists the media.
  • exFAT: new osyx-exfat crate (read/write, format, check) and VFS adapter. FAT32 reads the volume label from the root directory. osyx-part reads MBR tables on removable disks.
  • Battery: new osyx-battery crate behind batteryd (EC protocol with time-outs and error counting, mAh/mWh, several batteries, time estimates, last good state through EC failures). /run/battery keeps its first line and gains key=value details. The vendored AML interpreter gains Index/DerefOf, Subtract/Multiply/Divide/Mod/Or/XOr/Not/SizeOf/LNot, Store into Index and package elements from locals; without them a typical firmware _BST could not run.
  • Desktop: drives button and list (label, file system, size, use, Open in Files, Eject), notifications for plug, eject and unplug, battery details on click.
  • Settings: Save, Use DHCP and Apply never fired (they waited for Response::Submitted, buttons answer Activated), and Settings ran as the desktop user although it writes system files; it now runs privileged as its header says. New "System update" section (version, check, install, status, errors) served by osyx-update, which answers requests written to /etc/osyx/update.request.

Tests

Host: osyx-exfat, osyx-part, osyx-abi, osyx-battery (mock EC, hand-assembled AML). QEMU: scripts/usb-storage-test.ps1 (FAT32 and exFAT: automount, busy refusal, eject, replug, pull-out), scripts/desktop-test.ps1 (USB steps and a Settings step), plus smp-test, win-test, usbhub-test run during development.

Not verified on real hardware

exFAT writes, the battery on a ThinkPad T495 (EC and firmware AML), eject on real sticks. The "Install update" path needs a configured release URL and was not exercised.

Removable media (kernel/src/media.rs): USB mass-storage volumes are mounted
at /media/<label> (FAT32, exFAT, ext4; GPT and MBR), ejected safely through
/dev/media (sync, all-or-nothing unmount, Busy while in use, cache flush and
stop unit) and detached by force when the stick is pulled out, without the
kernel or the USB controller thread waiting on the dead device.
/run/media.status publishes the list (osyx_abi::media).

exFAT: new osyx-exfat crate (read/write, format, check) and VFS adapter.
FAT32 reads the volume label from the root directory entry. osyx-part reads
MBR tables (removable disks only). Partitions of disks whose name ends in a
digit are <disk>p<n>.

Battery: new osyx-battery crate (EC protocol with time-outs and error
counting, unit conversion, several batteries, time estimates, last-good
state through EC failures) behind batteryd; /run/battery keeps its first
line and gains key=value details (osyx_abi::battery). The vendored AML
interpreter gains Index/DerefOf, Subtract/Multiply/Divide/Mod/Or/XOr/Not/
SizeOf/LNot, Store into Index and package elements from locals.

Desktop: drives button, list with label, file system, size and use, Open
(Files) and Eject, notifications for plug, eject and unplug; battery
details on click. Settings: the Save, DHCP and Apply buttons never fired
(they waited for Submitted, buttons answer Activated) and Settings ran as
the desktop user although it writes system files; it now runs privileged
and has a system update section served by osyx-update.

Tests: scripts/usb-storage-test.ps1, USB steps and a Settings step in
scripts/desktop-test.ps1, host tests for exfat, part, abi and battery.
@v3nn7 v3nn7 added enhancement New feature or request storage Area: filesystems update Area: system desktop Area: desktop kernel Area: kernel drivers Area: drivers labels Oct 30, 2026
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@codspeed

codspeed Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 33 untouched benchmarks


Comparing feat/usb-automount (f327cda) with main (28ff744)

Open in CodSpeed

@v3nn7
v3nn7 merged commit 0e5b51f into main Oct 30, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Area: desktop drivers Area: drivers enhancement New feature or request kernel Area: kernel storage Area: filesystems update Area: system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant