Open gungun974 opened 2 months ago
Hello! Sorry for the delayed reply, I'm glad someone else is interested in this project!
I'm not sure about the other errors you are having, maybe I can help resolve those later, however I have encountered the squashfs error before!
The issue you are running into is that NixOS requires a copy of its store to boot (of course), but it tries to read it from a file on the netbooted image by default, where it is not included.
When netbooting, NixOS uses a rw-store (usually in RAM) for things like nix-shell
and other runtime nix store changes, and a ro-store (usually a disk image or network directory) for everything in the initial configuration.
The default configuration for netbooting stores the ro-store image as a nix-store.squashfs
contained inside the Image
file, however the Image
file + other bootloader items must fit into ~1GB of RAM (for compatibility + maybe other reasons) while running on the Pi.
Usually the kernel etc. would fit into ~1GB, however if a too many things are in the nix store image, sometimes it does not fit and crashes weirdly, therefore I don't enable it by default.
See my other repo where I mount the ro-store over network instead. (you can use NFSFolder to generate an SD image that contains the full /nix/store
)
However, If you want to run without a network share it is possible, but keep in mind the 1GB limit! You might have funky errors from U-Boot if you go over.
Try building the netbootRamdisk
target after (if you haven't already) including nixos/modules/installer/netboot/netboot.nix
in your modules. That should include the nix-store.squashfs
file.
Anyway here's some places you might want to look over for guidance:
Where the ro-store is defined
where the squashfs is defined
building an Image
that includes the squashfs
Please send me any more info you have, I'd love to help out.
Hoi !
Sorry to bother you, but I'm trying to boot NixOS without any SD card on my Raspberry Pi 4.
I tried to search on the Internet for some information, but nobody has written anything about booting a Raspberry Pi with Nix using PXE. However, I found this repo.
I tried to replicate your setup using dnsmasq as described in your dotfiles repo, but I encountered some issues with the boot process of my Pi. Note: I don't use dnsmasq as DHCP; I use my firewall opnsense for that.
A lot of times, my Raspberry Pi just waits for the FTPD server, and sometimes it just instantly boots. Sometimes, during U-Boot, the Pi never finds the Pixiecore config...
In some rare cases, the Pi boots the first stage of NixOS but fails to continue and crashes because the squashfs is missing, making the Nix store unavailable.
I don't understand why I'm getting these results. Do you think there's something I forgot to configure in my DHCP? Do you think it's a network issue?
I'm trying to debug this, but all of these boot processes with ARM are unknown to me.
Here are the latest logs from my dnsmasq:
Here is a picture of the boot error with the squashfs:
My TFTP server is at 192.168.1.52, as shown in my logs.
Anyway, even if I haven't succeeded yet, your work has been a great help, so thank you.