Repository navigation
Start the FIBER over USB without rpiboot - #2
Merged
Merged
Conversation
…he write path Found by testing with the real Raspberry Pi OS image and with awkward settings. - The image download froze when its connection went silent (seen at 1.8 MB), for up to an hour, and Cancel could not interrupt it. Each read now has a time limit. A connection that is silent, closed early or refused for a moment is replaced by a new one that asks for the rest of the file (Range), a few times, and Cancel acts at once. The checksum is still that of the whole file. - A Wi-Fi name, Wi-Fi password or SSH key comment with DEL, a C1 control character, U+2028, U+2029, U+FEFF, U+FFFE or U+FFFF made user-data or network-config unreadable to the FIBER (PyYAML in cloud-init, libyaml in netplan), or changed the value. They are written as escapes now. - An .xz file that unpacked to something that is no disk image stayed in the cache. It is checked before it gets its name. - Tests: the download against a local server that stalls, cuts off, knows no ranges or refuses; the image cache; the settings written into a small disk image and read back; the write with the patch at every edge and images of any length; what verify reports; a link as the target. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
What Raspberry Pi's rpiboot does is now part of the app, in Rust on the nusb crate (crates/fiber-setup-core/src/rpiboot.rs): the boot code goes to the boot ROM, then the boot code gets the files it asks for, from the gadget's folder and from bootfiles.bin. The steps, their order and their time limits are rpiboot's. - Gone from the bundle: rpiboot, on macOS the libusb built for it, on Windows rpiboot.exe with Cygwin's two DLLs. The app is the only program in it; the gadget (boot.img, bootfiles.bin, config.txt) is data. - npm run usbboot only downloads the gadget's files at the pinned usbboot commit and checks their SHA-256 (scripts/fetch-usbboot.mjs). No C compiler, no Cygwin, no libusb headers; the deb no longer depends on libusb. - Release: sign-macos signs one program instead of three, sign-windows no longer signs rpiboot.exe. The USB driver package for Windows stays: the boot ROM has no driver there. - Windows: the board is chosen by its port, as on the other systems, so several boards in USB mode are no longer refused. - A board that just appeared may be without permission (Linux) or without its driver (Windows) for a moment: that is waited out, and said if it stays so. - fiber-setup-cli boot starts a FIBER over USB and stops when its eMMC is a disk; nothing is written. - rpiboot.rs is derived from rpiboot and under its license, Apache-2.0 (LICENSES/Apache-2.0.txt); the rest stays MIT. Run against a simulated board only (the boot ROM, the boot code and its requests); not yet with a real FIBER. Co-Authored-By: Claude Fable 5.2 <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 app now starts a FIBER over USB by itself, the way Raspberry Pi's rpiboot does, so the bundled rpiboot, its libusb and Cygwin's DLLs are gone.
Draft: it has run against a simulated board only. It must start a real FIBER on Linux, macOS and Windows before it is merged.
Two commits
Rangerequest;.xzthat was no disk image left its unpacked copy in the cache.crates/fiber-setup-core/src/rpiboot.rstalks to the boot ROM through thenusbcrate: the boot code first, then the files the boot code asks for. Steps, order and time limits are rpiboot's.What changes for the build and the release
boot.img,bootfiles.bin,config.txt) is data.npm run usbbootonly downloads those files at the pinned usbboot commit and checks each SHA-256. No C compiler, no Cygwin, no libusb.sign-macossigns one program instead of three.sign-windowsno longer signsrpiboot.exe.fiber-setup-cli bootstarts a FIBER over USB and stops when its eMMC is a disk. Nothing is written.Checked
Not checked yet
sign-macosandsign-windowsrun only for a release tag.To try it on a FIBER
Jumper on BOOT, power, USB-B cable, then:
It should end with the eMMC's path and size, and writes nothing.
Licence
rpiboot.rsis derived from rpiboot, which is Apache-2.0, so that one file is marked Apache-2.0 and the licence text is inLICENSES/Apache-2.0.txt. The rest stays MIT.🤖 Generated with Claude Code