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

RaspberryPi boot loader: fix booting Raspberry Pi 3 #21988

Merged
merged 2 commits into from Feb 12, 2017

Conversation

wizeman
Copy link
Member

@wizeman wizeman commented Jan 19, 2017

Motivation for this change

This PR makes the Raspberry Pi boot loader boot the Raspberry Pi 3 correctly (apart from not generating/overwriting /boot/config.txt, like it would be necessary for the other Raspberry Pi models).

In addition to what was already being done for the other Raspberry Pi models, this basically just copies the .DTB files of the default installed kernel to /boot, and deletes any old .DTB files that could have been lying around in that directory.

I have also fixed a bug where all /boot/old/xx-initrd files (where xx is a small number between 1 and the number of system profile generations) were getting accidentally deleted after having been created.

Note that this PR does not copy old .DTB files to /boot/old, especially because maintaining the same deduplicating scheme seems like it would greatly complicate the code (but perhaps I am mistaken). However, there's nothing in this PR that would prevent that from being done in the future.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

The Raspberry Pi 3 seems to need the .DTB file when booting the kernel,
so we must copy it to /boot when installing a new kernel.
The Raspberry Pi boot loader was deleting all xx-initrd text files
(which simply contain the path to the actual initrd files) just after
having created them. The code was actually trying to delete real,
obsolete initrd files, which are named <hash>-initrd-initrd (after path
cleaning), but the glob was catching the other files as well.
@wizeman
Copy link
Member Author

wizeman commented Jan 19, 2017

cc @dezgeg @viric

@dezgeg
Copy link
Contributor

dezgeg commented Jan 19, 2017

I don't use/maintain this code (I use the U-Boot / extlinux stuff). So all @viric. Sounds reasonable to me though.

@Mic92 Mic92 mentioned this pull request Jan 21, 2017
@dezgeg dezgeg merged commit 123cbd4 into NixOS:master Feb 12, 2017
@wizeman wizeman deleted the u/fix-raspi-3 branch February 13, 2017 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants