-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Aarch64 SD images missing pi-zero-2.dtb file require to boot. #216886
Comments
Could you try the new_kernel variant of the SD image? It should have the DTB which was added in 5.18. The Hydra images use the mainline kernel, and |
Thanks @zhaofengli! Tried the new_kernel variant... still panics because of a typo. The file expected by uboot is
The file provided by the image has
Copying the file:
Allows it to boot 👍 and wlan0 shows up (unlike with the RPi3 workaround above)... sweet! |
Looks like I can get things to run, though the Pi Zero 2 needs help to keep from dying when running I've made a couple of tweaks:
Still need to figure out permanent configuration, but at least with these I can rebuild without killing the Pi. |
The expected dtb file name is `bcm2837-rpi-zero-2-w.dtb` on Raspberry Pi Zero 2 W; the current code is missing the `-w` from the file name which results in u-boot failing to load. see NixOS#216886
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/raspberry-pi-compute-module-3-compatibility/16210/11 |
Looks like the problem is stale references in the uboot bins
This is based on the last new kernel sd image on hydra from Mar 20, 2023. |
Looks like the problem was fixed in uboot 17 days ago... So we'd need a uboot update in nixos and a working hydra build |
The PR with a newer version of uboot has been merged to I created a small module that copies the right uboot file, creates a swap partition and allows to add options to the firmware configuration. Here's the gist. Eventually my config looks like this: { config, lib, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix>
./sd-image.nix
];
system.stateVersion = "23.11";
# Pi Zero 2 struggles to work without swap
sdImage.swap.enable = true;
sdImage.extraFirmwareConfig = {
# Give up VRAM for more Free System Memory
# - Disable camera which automatically reserves 128MB VRAM
start_x = 0;
# - Reduce allocation of VRAM to 16MB minimum for non-rotated (32MB for rotated)
gpu_mem = 16;
};
# bzip2 compression takes loads of time with emulation, skip it. Enable this if you're low on space.
sdImage.compressImage = false;
networking = {
interfaces."wlan0".useDHCP = true;
wireless = {
enable = true;
interfaces = [ "wlan0" ];
networks = {
"<ssid>" = {
psk = "<ssid-key>";
};
};
};
};
# Enable OpenSSH out of the box.
services.sshd.enable = true;
# NTP time sync.
services.timesyncd.enable = true;
} |
@plmercereau many thanks, I used your config and added it to my fork of nixpkgs here: https://github.com/NixOS/nixpkgs/compare/release-23.05...alex-nt:nixpkgs:feature-23.05-rpi?expand=1 Using boot = {
kernelPackages = pkgs.linuxPackages_rpi3;
} I loose wifi (wlan0 fails to init). I've been using a fork of nixpkgs since 2022-12 till now on RPI02w, latest kernel always provided usable results compared with the rpi provided one. I wonder what I keep messing up. |
For wifi I observed everytime I got a message in |
my wifi works fine with the above configuration (connecting to a router with DHCP enabled), but sometimes IPv6 somehow takes precedence over IPv4, for instance: [nixos@nixos:~]$ ping www.github.com
PING www.github.com (140.82.121.4) 56(84) bytes of data.
64 bytes from lb-140-82-121-4-fra.github.com (140.82.121.4): icmp_seq=1 ttl=49 time=38.9 ms
64 bytes from lb-140-82-121-4-fra.github.com (140.82.121.4): icmp_seq=2 ttl=49 time=31.6 ms
64 bytes from lb-140-82-121-4-fra.github.com (140.82.121.4): icmp_seq=3 ttl=49 time=28.8 ms
^C
--- www.github.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 28.768/33.080/38.882/4.261 ms
[nixos@nixos:~]$ ping www.google.com
PING www.google.com(ams16s32-in-x04.1e100.net (2a00:1450:400e:80c::2004)) 56 data bytes
^C
--- www.google.com ping statistics ---
9 packets transmitted, 0 received, 100% packet loss, time 8170ms
[nixos@nixos:~]$ ping -4 www.google.com
PING (142.250.179.164) 56(84) bytes of data.
64 bytes from ams15s41-in-f4.1e100.net (142.250.179.164): icmp_seq=1 ttl=56 time=28.3 ms
64 bytes from ams15s41-in-f4.1e100.net (142.250.179.164): icmp_seq=2 ttl=56 time=27.6 ms
64 bytes from ams15s41-in-f4.1e100.net (142.250.179.164): icmp_seq=3 ttl=56 time=23.2 ms
^C
--- ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 23.231/26.375/28.291/2.240 ms I don't know if it is related to your problem though. I will try your suggestion @deftdawg |
With the following? boot = {
kernelPackages = pkgs.linuxPackages_rpi3;
} Guys, you are giving me hope here, I might burn a few hours tomorrow and check to see what happens. All in all I am still very happy with your config @plmercereau. I have everything working (even i2c, but I didn't get to test spi yet, last time I failed to get spi working). Thanks yet again! |
I am to understand that the core issue |
@deftdawg |
Hello folks,
|
awesome! looking forward to it. I tried a bit but couldn't manage to get anything working since I've moved to fully using flakes. Many thanks. I'm not sure where |
Hello,
hardware.enableRedistributableFirmware = lib.mkForce false;
hardware.firmware = [pkgs.raspberrypiWirelessFirmware];
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixos-on-raspberry-pi-zero-w/38018/1 |
Been a minute since I had a chance to play with this, but the hydra images @ https://hydra.nixos.org/job/nixos/release-23.11/nixos.sd_image_new_kernel_no_zfs.aarch64-linux now boot on my Pi Zero 2W without needing to copy dtb files, though I'm missing or forgetting a step as plugging an OTG adapter isn't working with my keyboard. One thing to note the no_zfs work, however the other build https://hydra.nixos.org/job/nixos/release-23.11/nixos.sd_image.aarch64-linux, which I presume use zfs, don't work on my pi. Going to close this since it seems the original defect is now solved. 🍻 |
[Apologies in advance if this is not the correct place to report this issue; there is basically no current documentation that I could find on how to boot and run nix on Raspberry Pi Zero 2]
Attempting to boot the Aarch64 SD card images built by Hydra on a Raspberry Pi Zero 2 fails because uboot cannot find
gd19f48w8fwcbvb3g0pmfrlyj74zcnb0-linux-5.15.94-dtbs/broadcom/bcm2837-rpi-zero-2.dtb
Based on this line in
master
:nixpkgs/pkgs/os-specific/linux/kernel/linux-rpi.nix
Line 78 in 270de46
It appears the file and a few others should be included, but for whatever reason (maybe this linux-rpi is not used or Hydra building off an different branch?) the file is not present in the image.
Here are the files actually present on the flashed SD card:
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expect it to boot to a nixOS shell
Workaround
It is possible to workaround the issue by mounting the micro SD on a operable Linux system by copying the RPi-3-b dtb file to the expected Pi Zero 2 file name:
Then unmount the SD and boot with your RPi Zero 2
Notify maintainers
Notify the 2 folks listed as having touched the RPi Zero 2 dtb line in
linux-rpi.nix
@leo60228
@zhaofengli
The text was updated successfully, but these errors were encountered: