-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
uboot: 2017.11 -> 2018.03, cross fixes, Rock64 support #36232
Conversation
Nice! I will take a closer look tomorrow. The U-Boot v2018.03 release is due on 12.03.2018 so I think we can skip straight to it when that's released. |
pkgs/misc/uboot/default.nix
Outdated
url = https://github.com/dezgeg/u-boot/commit/pythonpath-2017-11.patch; | ||
sha256 = "162b2lglp307pzxsf9m7nnmzwxqd7xkwp5j85bm6bg1a38ngpl9v"; | ||
}) | ||
./pythonpath-2018-01.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I uploaded these to:
https://github.com/dezgeg/u-boot/commit/pythonpath-2018-03.patch
https://github.com/dezgeg/u-boot/commit/extlinux-path-length-2018-03.patch
so we can keep using fetchpatch.
34d6566
to
242405e
Compare
@dezgeg I rebased it to use your patches. |
pkgs/misc/uboot/default.nix
Outdated
makeFlags = [ "DTC=dtc" ] ++ extraMakeFlags; | ||
makeFlags = [ | ||
"DTC=dtc" | ||
"ARCH=${if hostPlatform.platform.kernelArch == "arm64" then "arm" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, setting $ARCH
shouldn't be required with U-Boot? It's auto-set by CONFIG_SYS_ARCH
from the defconfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it seems to build fine without it.
I decided to |
1a52271
to
7b50251
Compare
Hmm, not sure that's worth it, I except the list will quickly get out of date as people forget to add to the list of variables to remove. Maybe we can remove |
I implemented what you suggested, but I added a little hack that basically transforms |
If I remember correctly, it works the other way around; i.e. without that PR Hydra would typically attempt to build less packages (it would complain about e.g. |
Yes, that was the case before, because On second thought, there's really no need for this hack because, until this issue is fixed, I can just set |
Great, thanks! v2018.03 is now out, you can squash in https://github.com/dezgeg/nixpkgs/commit/0c0cb5730d987f16b5fefd31b0d472446c1d0acb.patch to the first commit. It drops a patch that I sent in upstream before the release (in a different file though, so it still looks like it would apply). Also @bendlas pointed out some additional changes in pythonpath-2018-03.patch so the hash has changed. Also https://github.com/NixOS/nixpkgs/commit/fe3acfa41abeb81fac56e5bbfc6d9e0fd20cd65c.patch seems to be now needed for the tools to build, you can squash or pick it up as a separate change, whatever you prefer. On my side I will try to test this on my boards this friday. |
The bootloader is currently non-functional because it lacks the ARM Trusted Firmware image (bl31.elf).
ARM trusted firmware is required as part of the boot process on some ARMv8-A boards. Currently, only the RK3328 is supported in nixpkgs. This makes the Rock64 u-boot image bootable.
This fixes problems with cross compiled kernels failing to boot.
This stops the kernel from crashing immediately after boot.
These derivations have not seen any updates since they were created in 2010, and some of their sources have disappeared. There are upstream configs for these boards, so these are now used, and they build correctly. I have no way of testing them, and I don't if anyone even uses either board with Nix anymore.
I can't get the tools to cross compile using
I looked into the problem with |
I tested 2018.03 on my Raspberry Pi 2 and ODROID-XU4 and haven't seen any problems. |
Ah, so the sandbox has
Ok, sounds fine. |
I have tested so far on RPi 1, RPi 3 (in both 32 & 64-bit modes), Wandboard Quad, Beaglebone Black, pcDuino 3 Nano and QEMU for both ARM & AArch64. I will test a couple of more boards soon but all is fine here as well. |
BTW @lopsided98 if you happen to have a spare SD card and cycles, would you mind testing if https://www.cs.helsinki.fi/u/tmtynkky/sd-image-armv7l-with-linux-rpi.img boots for you on RPi 2? It's an image built with |
Applied to master. |
I tested your SD card image, and it hangs after u-boot starts the kernel. Here is the boot log:
|
Primarily, this PR updates U-Boot to the latest version, and fixes cross compilation. It also adds support for building U-Boot for the Rock64.
I had to rebase one of the patches from @dezgeg's repository to work with 2018.01, so I included it in this PR. I also added a patch to increase the maximum length of filenames read from an extlinux.conf file, which makes it possible to boot using a cross compiled kernel (which is normally too long because of the target suffix). Personally, I like keeping patches in the nixpkgs tree, but they could be moved to @dezgeg's repo.
The Rock64 is not yet supported in mainline U-Boot, but a community member has provided a patched version of 2018.01. To make a bootable U-Boot image for the Rock64, an ARM Trusted Firmware image is required. I created a new package for this firmware, which is structured similarly to the U-Boot package. Currently it only has a package for the RK3328 (the SOC in the Rock64). I am close to getting to the Rock64 to boot without any binary blobs, but U-Boot's TPL (which initializes the DRAM) causes the kernel to hang/crash soon after booting. Therefore, I am currently using a binary TPL provided by Rockchip.
Lastly, I switched to using mainline U-Boot for the Sheevaplug and Guruplug. These were added in 2010 and have received no maintenance since. Today, mainline U-Boot has a config for both of these boards, which build successfully. I have no way to test them, but they didn't even build before so this is better than it was.
I have tested that all the packages can be cross-compiled, and I tested native builds for the ODROID-XU3/4, Raspberry Pi 2 and 3, and Rock64. I have only tested booting with the Rock64, but I have an ODROID-XU4, Raspberry Pi 2 and Raspberry Pi 3 that I will be able to test in a few weeks (I don't have physical access to them right now, and I don't want to risk a boot failure).
Please let me know if you have any suggestions or things you want me to change.
cc @dezgeg
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)