Wanted to document how it was to follow the documentation etc. as a laywoman.
-
The wiki page[1] has a scary warning about memory corruption. But if you follow the issue link[2], the last comment says that PR #191538 superseded it, and from what I can gather it fixed the issue in November 2023[3].
-
The wiki says you can get U-Boot from Hydra, and also provides a command to download the files (
nix-build '<nixpkgs>' -A ubootRock64 --argstr system aarch64-linux
). It then gives manual commands to dd 2 of the files (idbloader.img
andu-boot.itb
), but I didn’t know what to do with the 3rd file (u-boot-rockchip.bin
). I also couldn’t figure out how would I put a root filesystem in it. -
The wiki also says you can get a compatible image for an SD card with nixos-aarch64-images[4]. But the linked github repo was last updated 6 months ago. Would it get the fixed version of the binary blobs?
-
Unsure what to do, I cloned the
nixos-aarch64-images
repository and ran the commands in the documentation, which gave me an image to dd. -
This created 3 partitions, the last being the mountable root fs. (It was only 2.7GiB, with 2.4GiB used, so I figured I’d have to enlarge it later; but once you boot at NixOS it enlarges itself, neat.)
-
At first I thought the image failed to boot, but this turned out to be due to a faulty HDMI cable / monitor or some incompatibility. With a different cable+monitor combo I could get a console.
-
Which promptly crashed with a kernel stack trace, starting on
drm_atomic_helper_wait_for_vblanks
(vblank_wait timed out
). -
I figured if I followed the wiki instructions to dd the
idbloader.img
andu-boot.itb
, maybe it would update the binary thingies in the magic two first partitions while still keeping the root fs functional? I have no idea what I’m doing. -
I done that anyway. the resulting system booted, and didn’t crash.
-
I realised I have no idea how to boot into memtest86 on NixOS on U-Boot, so I pulled memtester to try in userspace at least. 777 loops and no errors.
-
I tried stress(1) too to force some load on the CPUs, no crash either.
It’s still too early to be sure it’s not a coincidence, but in summary, what appears to have worked for me is:
- git-clone, build, and dd the nixos-aarch64-images then
- on top of the same SD card,
dd
the updatedidbloader.img
andu-boot.itb
from hydra, with the offsets described in the wiki.
Beginner questions I’m left with are:
-
Where’s configuration.nix / hardware.nix ?(you have to run nixos-generate-config; maybe it would make sense if this ran automatically?) - What’s up with
u-boot-rockchip.bin
? Am I supposed to dd it too, and if so where? - Is it even the case that the image built via
nixos-aarch64-images
is getting older blobs, or did I just get lucky? - how is memtest86+ formed? how girl gets U-boot options?
- NixOS on ARM/PINE64 ROCK64 - NixOS Wiki
- use unmodified (blob-free) U-Boot for the Rock64 board by royneary · Pull Request #145506 · NixOS/nixpkgs · GitHub
- u-boot: ROCK64 RAM init improvements by lorenz · Pull Request #191538 · NixOS/nixpkgs · GitHub
- GitHub - Mic92/nixos-aarch64-images: Build NixOS images for various ARM single computer boards