Skip to content
This repository was archived by the owner on Oct 15, 2026. It is now read-only.

rpi-loader 0.4.0

Choose a tag to compare

@github-actions github-actions released this 21 Sep 00:01
· 10 commits to main since this release
59ccc16

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 Command clap 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
    Cli type 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 --help gives the two
    usual destinations.

    The bash script completes --device to the serial ports actually
    attached
    , by asking rpi-loader list when 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 sets cmd="rpi__loader__subcmd__boot" while the arm holding
    that subcommand's options is spelled rpi__subcmd__loader__subcmd__boot,
    so no arm is ever reachable and nothing past the first word completes.
    tests/completions.rs checks 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-dynamic and clap/unstable-ext), which in a
    crate installed with cargo install means 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.s is the ARMv6
    counterpart to the existing relocating boot stub: the same copy to
    0x00200000 and jump, without the core-id check (MPIDR is an ARMv7
    register, and this chip has one core) and with the two barriers as the
    CP15 operations ARMv6 has instead of dsb/isb — the same substitution
    exec now makes. make build-bcm2835 produces firmware/target/ kernel.img, on the armv6-none-eabi target, and is the one recipe here
    that needs nightly: that target is tier 3, so -Z build-std has to
    compile core for it.

    The chip is now a feature of this package (bcm2837 by default,
    forwarding to rpi-hal's) rather than a hardcoded entry on the rpi-hal
    dependency line. It has to be: rpi-hal prefers bcm2837 over
    bcm2835 when both are enabled, so a Pi Zero build that could not turn
    bcm2837 off 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 bcm2711 still the Pi 4
    one.

    The rpi-hal floor moves to 0.6.0, which is where the bcm2835
    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-loader

The host CLI is a separate install: cargo install rpi-loader.