Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/uboot-builder: enable uboot support for rpi4 #257981

Closed
wants to merge 1 commit into from

Conversation

c0deaddict
Copy link
Member

Description of changes

I've been running NixOS with this patch on my Raspberry Pi 4 for almost a year now, it works fine.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@samueldr
Copy link
Member

samueldr commented Oct 1, 2023

All options to manage the platform firmware for the Raspberry Pi have been formally deprecated a few months back.

These options, including the U-Boot management options, may not work as expected for the default expected settings.

These files:

  • # Add the firmware files
    fwdir=@firmware@/share/raspberrypi/boot/
    copyForced $fwdir/bootcode.bin $target/bootcode.bin
    copyForced $fwdir/fixup.dat $target/fixup.dat
    copyForced $fwdir/fixup_cd.dat $target/fixup_cd.dat
    copyForced $fwdir/fixup_db.dat $target/fixup_db.dat
    copyForced $fwdir/fixup_x.dat $target/fixup_x.dat
    copyForced $fwdir/start.elf $target/start.elf
    copyForced $fwdir/start_cd.elf $target/start_cd.elf
    copyForced $fwdir/start_db.elf $target/start_db.elf
    copyForced $fwdir/start_x.elf $target/start_x.elf
    # Add the uboot file
    copyForced @uboot@/u-boot.bin $target/u-boot-rpi.bin
    # Add the config.txt
    copyForced @configTxt@ $target/config.txt

Will be installed to the same location as these files:

This most likely does not do what people expect. For this to work "correctly", you have to have a setup where the platform firmware partition is mounted at /boot on the Raspberry Pi, which is not a recommended, and is not a supported configuration.

@c0deaddict
Copy link
Member Author

All options to manage the platform firmware for the Raspberry Pi have been formally deprecated a few months back.

These options, including the U-Boot management options, may not work as expected for the default expected settings.

These files:

* https://github.com/NixOS/nixpkgs/blob/78c07ab688cde97d6705d9507ccbc99a2001d970/nixos/modules/system/boot/loader/raspberrypi/uboot-builder.sh#L22-L38

Will be installed to the same location as these files:

* https://github.com/NixOS/nixpkgs/blob/78c07ab688cde97d6705d9507ccbc99a2001d970/nixos/modules/system/boot/loader/raspberrypi/uboot-builder.sh#L19-L20

This most likely does not do what people expect. For this to work "correctly", you have to have a setup where the platform firmware partition is mounted at /boot on the Raspberry Pi, which is not a recommended, and is not a supported configuration.

Aha, I have missed that deprecation warning then :) So if I understand correctly: on a Pi4 there is no need anymore to set boot.loader.raspberryPi.uboot.enable = true? NixOS will always configure uboot by default on Pi's?

@samueldr
Copy link
Member

samueldr commented Oct 3, 2023

boot.loader.raspberryPi.uboot.enable hasn't been needed and hasn't "worked" as expected on NixOS ARM images on any image generated since mid-2019.

The current expectation is to enable the boot.loader.generic-extlinux-compatible options on all U-Boot using ARM systems, which includes the Raspberry Pi.

@c0deaddict c0deaddict closed this Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants