Talk:NixOS on ARM/Raspberry Pi 4: Difference between revisions

From NixOS Wiki
Latest comment: 3 April by Riot in topic Enabling the SPI
imported>Kaligule
Explained some questions about the article.
 
Riot (talk | contribs)
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:


First follow the generic installation steps to get the installer image and install using the installation and configuration steps.
First follow the generic installation steps to get the installer image and install using the installation and configuration steps.
(Link to https://nixos.wiki/wiki/NixOS_on_ARM#Installation which itself links to
(Link to https://wiki.nixos.org/wiki/NixOS_on_ARM#Installation which itself links to
'''https://hydra.nixos.org/job/nixos/release-20.03/nixos.sd_image.aarch64-linux''')
'''https://hydra.nixos.org/job/nixos/release-20.03/nixos.sd_image.aarch64-linux''')
Until the generic image works, a temporary device-specific image is build on Hydra. Note that this image is not using u-boot, but rather the Raspberry Pi specific bootloader configuration.
Until the generic image works, a temporary device-specific image is build on Hydra. Note that this image is not using u-boot, but rather the Raspberry Pi specific bootloader configuration.
Line 17: Line 17:
There is also this line: "These configurations will boot (from this PR comment):"
There is also this line: "These configurations will boot (from this PR comment):"
But then no configurations do follow.
But then no configurations do follow.
== Viable Pi 4 (B) image(s) ==
(The confusion around working images is compounded by the fact that Hydra offers identically-named downloads have non-identical contents, and the underscore/hyphen nomenclature varies wildly. It took me a while to confirm that the file I'd downloaded matched the build link below.)
...
Currently, [https://hydra.nixos.org/build/149338044/ build #149338044] has worked twice on my Pi 4 (B) hardware.
My usage is command-line only (Bash on TTY + ssh/mosh headless use), and the first run was stable for about three or four weeks of daily-ish use.
...
To be quite honest, I'm not sure how I found that specific working image.
I know my path led past here, which is why I'm posting, but I know it involved a lot of negotiating with Hydra's willingness to purge long-running queries and finding a way to list successful sd_image_new_kernel.aarch64-linux builds (maybe via [https://hydra.nixos.org/search?query=nixos-sd-image-21.11pre this query?]. Following that logic has been somewhat of a mixed bag, eg today I've unsuccessfully attempted to get both [https://hydra.nixos.org/build/154444353 build #154444353] and [https://hydra.nixos.org/build/154444322 build #154444322] to run.
== Enabling the SPI ==
This section is confusing, mostly because it has factual errors and i can't get it to work.
For starters, it talks about <code>dtsoFile = ./spi0-0cd.dtso;</code>, which should probably be <code>dtboFile = ./spi0-0cs.dtbo;</code> (note the ''dtbo'' and ''cs'' part, the page mentions ''dtso'' and ''cd'') - at least that is my idea, if i look at the link's (below) target, which is <code>https://github.com/raspberrypi/firmware/blob/master/boot/overlays/spi0-0cs.dtbo</code>
Also, it is unclear on how one should ''change the <code>compatible</code> field'' in a dtbo-file - editing is only possible on their corresponding source files - while the text actually mentions ''dtbo'' here ;)
I've adapted my configuration to this but don't get any spi devices (nor does <code>spi</code> appear in dmesg). I'm also wondering wether using <code>boot.kernelPackages = pkgs.linuxPackages_rpi4;</code> is still relevant (it is mentioned in [https://github.com/NixOS/nixos-hardware/issues/565 nixos-hardware-issues/565]) while some other user claims that "using nixos-hardware wasn't necessary anymore" ([https://github.com/NixOS/nixos-hardware/issues/631#issuecomment-1584100732 nixos-hardware/issues/631] - maybe unrelated)
It would probably help, if someone knowledgeable can verify these instructions and in general clarify the confusions i mentioned.
Thanks in advance, [[User:Riot|Riot]] ([[User talk:Riot|talk]]) 21:44, 3 April 2024 (UTC)

Latest revision as of 21:44, 3 April 2024

I am a bit confused here, it seems like there is a lot of valueable information, but it hard to follow. Can someone help me clear it up, please?


About which image to use it says:

First follow the generic installation steps to get the installer image and install using the installation and configuration steps. (Link to https://wiki.nixos.org/wiki/NixOS_on_ARM#Installation which itself links to https://hydra.nixos.org/job/nixos/release-20.03/nixos.sd_image.aarch64-linux) Until the generic image works, a temporary device-specific image is build on Hydra. Note that this image is not using u-boot, but rather the Raspberry Pi specific bootloader configuration. (Link to https://hydra.nixos.org/job/nixos/trunk-combined/nixos.sd_image_raspberrypi4.aarch64-linux)

Only the later link gave me an image that would boot on my RP4(4GB)


There is also this line: "These configurations will boot (from this PR comment):" But then no configurations do follow.

Viable Pi 4 (B) image(s)

(The confusion around working images is compounded by the fact that Hydra offers identically-named downloads have non-identical contents, and the underscore/hyphen nomenclature varies wildly. It took me a while to confirm that the file I'd downloaded matched the build link below.)

...

Currently, build #149338044 has worked twice on my Pi 4 (B) hardware. My usage is command-line only (Bash on TTY + ssh/mosh headless use), and the first run was stable for about three or four weeks of daily-ish use.

...

To be quite honest, I'm not sure how I found that specific working image.

I know my path led past here, which is why I'm posting, but I know it involved a lot of negotiating with Hydra's willingness to purge long-running queries and finding a way to list successful sd_image_new_kernel.aarch64-linux builds (maybe via this query?. Following that logic has been somewhat of a mixed bag, eg today I've unsuccessfully attempted to get both build #154444353 and build #154444322 to run.

Enabling the SPI

This section is confusing, mostly because it has factual errors and i can't get it to work. For starters, it talks about dtsoFile = ./spi0-0cd.dtso;, which should probably be dtboFile = ./spi0-0cs.dtbo; (note the dtbo and cs part, the page mentions dtso and cd) - at least that is my idea, if i look at the link's (below) target, which is https://github.com/raspberrypi/firmware/blob/master/boot/overlays/spi0-0cs.dtbo

Also, it is unclear on how one should change the compatible field in a dtbo-file - editing is only possible on their corresponding source files - while the text actually mentions dtbo here ;)

I've adapted my configuration to this but don't get any spi devices (nor does spi appear in dmesg). I'm also wondering wether using boot.kernelPackages = pkgs.linuxPackages_rpi4; is still relevant (it is mentioned in nixos-hardware-issues/565) while some other user claims that "using nixos-hardware wasn't necessary anymore" (nixos-hardware/issues/631 - maybe unrelated)

It would probably help, if someone knowledgeable can verify these instructions and in general clarify the confusions i mentioned.

Thanks in advance, Riot (talk) 21:44, 3 April 2024 (UTC)Reply