Repository navigation
rpi-loader 0.4.0
Added
-
rpi-loader completions [shell], writing a shell completion script
to stdout — bash unless another is named, with zsh, fish, elvish and
powershell also available. Each release also carries a ready-made
rpi-loader-<version>.bash, for installing it without building the CLI
first.Generated from the same
Commandclap builds for--help, so it
describes the CLI that is actually compiled. That is why it is a
subcommand rather than a build script: a build script cannot see the
Clitype without moving it into a library, and a checked-in script
goes stale the first time a flag is renamed.Printed rather than written to a path this picks, because where a
completion belongs differs by shell, distribution and whether the user
can write outside their home. The subcommand's--helpgives the two
usual destinations.The bash script completes
--deviceto the serial ports actually
attached, by askingrpi-loader listwhen Tab is pressed. clap knows
only that the flag takes a string, which its generator turns into
filename completion over the whole machine; which ports exist is a
runtime fact that no generated script can hold. A small wrapper around
clap's own function does it, so everything else completes exactly as
generated, and it is bash-only — the other shells get clap's script
untouched.The bash script also carries a workaround for a clap_complete bug that
makes every subcommand's completion silently empty when the binary's
name contains a hyphen — which this one does. Its generator writes each
case label twice and mangles the name differently each time: the
dispatcher setscmd="rpi__loader__subcmd__boot"while the arm holding
that subcommand's options is spelledrpi__subcmd__loader__subcmd__boot,
so no arm is ever reachable and nothing past the first word completes.
tests/completions.rschecks the invariant rather than the instance —
every label the dispatcher can set must exist as an arm — so a future
desync fails a test whether or not it is this one.Deliberately not clap_complete's dynamic engine, which would do this
for every argument at once: it is behind two unstable feature flags
(clap_complete/unstable-dynamicandclap/unstable-ext), which in a
crate installed withcargo installmeans someone else's install
breaking on a dependency bump — and the script it registers embeds the
absolute path of the binary that generated it, so it could not be the
file shipped with a release. -
Pi 1 / Pi Zero (BCM2835) support.
src/boot6.sis the ARMv6
counterpart to the existing relocating boot stub: the same copy to
0x00200000and jump, without the core-id check (MPIDRis an ARMv7
register, and this chip has one core) and with the two barriers as the
CP15 operations ARMv6 has instead ofdsb/isb— the same substitution
execnow makes.make build-bcm2835producesfirmware/target/ kernel.img, on thearmv6-none-eabitarget, and is the one recipe here
that needs nightly: that target is tier 3, so-Z build-stdhas to
compilecorefor it.The chip is now a feature of this package (
bcm2837by default,
forwarding torpi-hal's) rather than a hardcoded entry on therpi-hal
dependency line. It has to be:rpi-halprefersbcm2837over
bcm2835when both are enabled, so a Pi Zero build that could not turn
bcm2837off would have silently compiled the Pi 3's peripheral base
into a Pi Zero image. Existing invocations are unaffected — a plain
build is still the Pi 2/3 one, and--features bcm2711still the Pi 4
one.The
rpi-halfloor moves to 0.6.0, which is where thebcm2835
feature arrived.
Images
Copy the image matching your board to the SD card's boot
partition, renamed to the filename in its own name:
kernel7.img (32-bit), kernel8.img (64-bit) or kernel.img
(ARMv6). The firmware loads one of those names and no others,
chosen by the CPU it finds, and a board handed the wrong one
stops without printing anything. Use kernel8.img only with
arm_64bit=1 in config.txt.
bcm2837 covers the Pi 2 v1.2 and Pi 3; bcm2711 covers the
Pi 4; bcm2835 covers the Pi 1 and Pi Zero, and is ARMv6, so it
has no 64-bit counterpart. Verify with
sha256sum -c SHA256SUMS.
rpi-loader-<version>.bash is the bash completion for the host
CLI, for installing without building it first:
sudo cp rpi-loader-<version>.bash \
/usr/share/bash-completion/completions/rpi-loaderThe host CLI is a separate install: cargo install rpi-loader.