nakato / nixos-sbc

Nix Flake to make managing Single Board Computers easy and repeatable.
MIT License
26 stars 7 forks source link

u-boot fails. Maybe initrd is too big #26

Closed tbaumann closed 2 months ago

tbaumann commented 2 months ago

I haven't investigated that much. I think it's trying to tell me that the initrd is too big for the offset.

It's the first time I tried on actual hardware (rpi4) image

tbaumann commented 2 months ago

Just as I'm writing this I realize that it might be a rp3. But the image should be the same :D

nakato commented 2 months ago

The image here only supports the Raspberry Pi 4B. I don't build u-boot for the 3 currently, or configure the RPi firmware for the 3. I'll need to eventually, I have a RPi3 attached to a printer here.

The line scanning bus xhci_pci for devices... Device NOT ready, seems odd, as the PCIe should be ready, but I dunno. The fact that mmc is actually at address 7e340000 makes me pretty confident to say it's a 4, as I'm pretty sure the 3 has it at 0x7e202000

I think it's trying to tell me that the initrd is too big for the offset.

That's the kernel image being too large, happens every so often using the offsets from nixpkgs u-boot.

❯ nix build 'nixpkgs#legacyPackages.aarch64-linux.linuxPackages_latest.kernel'
❯ nix eval 'nixpkgs#legacyPackages.aarch64-linux.linuxPackages_latest.kernel' --apply builtins.toPath
"/nix/store/4a9j5mnb3fmrd7lfjidhfnvx9km7xxd8-linux-6.9.9"
❯ls -lha /nix/store/4a9j5mnb3fmrd7lfjidhfnvx9km7xxd8-linux-6.9.9/Image 
.r--r--r-- root root 72 MB Thu Jan  1 10:00:01 1970  /nix/store/4a9j5mnb3fmrd7lfjidhfnvx9km7xxd8-linux-6.9.9/Image

nixpkgs updated the memory offsets, their max is now 84.5MB, old limit was 68MB. I think rather than copy their new offset I'm going to take it up to 128MB.

nakato commented 2 months ago

Should be fixed with 710bc7a1e78bea07c4444020f8ec1b260c2bc0fe

If you don't want to re-build the image:

nix build 'github:nakato/nixos-sbc#packages.aarch64-linux.raspberryPiFirmware'
dd if=result of=/dev/${RASPBERRY_PI_SD_CARD}1 bs=4M oflag=sync status=progress

Feel free to re-open if issue remains.