Robertof / nixos-docker-sd-image-builder

Build custom SD images of NixOS for your Raspberry Pi (or any other supported AArch64 device) in 5-20 minutes.
MIT License
214 stars 35 forks source link

Not booting on 8GB RPi4 #20

Closed ajlennon closed 3 years ago

ajlennon commented 3 years ago

Hi,

Love the docker container idea. I switched the package branch to master and changed over to the ./rpi4 config

But when I write to SD card and boot I just get the boot colour screen

image

I tried flashing both with etcher and dd..

Any advice? Thanks,

Alex

Robertof commented 3 years ago

Hey! Huge apologies for the delay in getting back to you -- this has been an incredibly busy period!

Did you manage to sort this out? This is weird, I'd expect the image to work on the Pi 4 with 8 gigs of RAM. Did you try the latest official unstable build from NixOS' hydra? If you could do that and ascertain that it works, we can see what we need to tweak to sort it out!

ajlennon commented 3 years ago

Hi there! No I tried all sorts of different permutations. I did in the end get a different image booting but when I tried to do the rebuilding it no longer booted. I spend ages looking at different conversations on the inter-webs but nothing worked.

I have the board here though. I'll go back and try the latest unstable build as you suggest and let you know!

luizirber commented 3 years ago

This comment fixed the boot problem for me: add 8250.nr_uarts=1 to the cmdline/boot params.

Robertof commented 3 years ago

Excellent, thank you so much! I suppose adding it here will make the image work?

https://github.com/Robertof/nixos-docker-sd-image-builder/blob/03359cbe7114901abe4f935fc1e633d9c8746b8f/config/rpi4/default.nix#L25

luizirber commented 3 years ago

Excellent, thank you so much! I suppose adding it here will make the image work?

In the end I changed a bit more to get the current nixpkgs master branch to compile:

  boot.kernelParams = [
    "console=tty1"
    "console=ttyAMA0,115200"
    "8250.nr_uarts=1"
  ];

  boot.initrd.availableKernelModules = [
    # Allows early (earlier) modesetting for the Raspberry Pi
    "vc4" "bcm2835_dma" "i2c_bcm2835"
  ];

I removed cma=64M (because it is also mentioned in that github issue as a problem), and fixed avaliableKernelModules because the base aarch64 image sets some modules which are not available (which is the reason why the rpi4 image is not building in hydra: https://github.com/NixOS/nixpkgs/issues/111683)

sciamp commented 3 years ago

Excellent, thank you so much! I suppose adding it here will make the image work?

In the end I changed a bit more to get the current nixpkgs master branch to compile:

  boot.kernelParams = [
    "console=tty1"
    "console=ttyAMA0,115200"
    "8250.nr_uarts=1"
  ];

  boot.initrd.availableKernelModules = [
    # Allows early (earlier) modesetting for the Raspberry Pi
    "vc4" "bcm2835_dma" "i2c_bcm2835"
  ];

I removed cma=64M (because it is also mentioned in that github issue as a problem), and fixed avaliableKernelModules because the base aarch64 image sets some modules which are not available (which is the reason why the rpi4 image is not building in hydra: NixOS/nixpkgs#111683)

removing cma=64M and adding 8250.nr_uarts=1 did the trick for my rpi4 (8GB)

thanks @luizirber !

and also many thanks to @Robertof for making this project 🙏🏻

Robertof commented 3 years ago

Thanks for the valuable feedback everyone! I'll proceed to upstream your suggested changes in the RPI 4 configuration, then close the PR. Feel free to reopen at any time if this issue reoccurs after I push the changes!