NixOS on ARM: Difference between revisions
imported>Samueldr m Makes use of {{Nixpkg Link}} |
imported>Dezgeg m More stylistic tweaks. |
||
| Line 5: | Line 5: | ||
== Supported devices == | == Supported devices == | ||
The installation images | The installation images should work on the following devices: | ||
{| | {| | ||
| Line 37: | Line 37: | ||
| ARMv6 | | ARMv6 | ||
| 1x ARM1176 @ 700 MHz | | 1x ARM1176 @ 700 MHz | ||
| 256/512 MB | | 256 MB / 512 MB | ||
| SD/microSD | | SD/microSD | ||
|- | |- | ||
| Line 53: | Line 53: | ||
| ARMv7 | | ARMv7 | ||
| 1x/2x/4x Cortex-A9 @ 1000 MHz | | 1x/2x/4x Cortex-A9 @ 1000 MHz | ||
| 512 | | 512 MB / 1 GB / 2 GB | ||
| microSD, SATA | | microSD, SATA | ||
|} | |} | ||
| Line 63: | Line 63: | ||
The installation images come in two flavors: <code>sd-image-armv6l-linux.img</code> is built for the ARMv6 architecture and it comes with the Raspberry Pi kernel. sd-image-armv7l-linux.img is built for the ARMv7 architecture and comes with the mainline multiplatform ARMv7 kernel (multi_v7_defconfig). Make sure you download the correct image for your board! | The installation images come in two flavors: <code>sd-image-armv6l-linux.img</code> is built for the ARMv6 architecture and it comes with the Raspberry Pi kernel. sd-image-armv7l-linux.img is built for the ARMv7 architecture and comes with the mainline multiplatform ARMv7 kernel (multi_v7_defconfig). Make sure you download the correct image for your board! | ||
The .img files can be directly written to a microSD/SD card (minimal recommended size: 4 GB) using dd. | The .img files can be directly written to a microSD/SD card (minimal recommended size: 4 GB) using dd. | ||
<syntaxhighlight lang="bash">sudo dd if=sd-image-armv7l-linux.img of=/dev/ | <syntaxhighlight lang="bash">sudo dd if=sd-image-armv7l-linux.img of=/dev/sdX</syntaxhighlight> | ||
Replace <code>/dev/sdX</code> with the path to your SD card device. | |||
== Board-specific installation notes == | == Board-specific installation notes == | ||
| Line 78: | Line 78: | ||
=== pcDuino 3 Nano === | === pcDuino 3 Nano === | ||
U-Boot needs to be copied to the microSD card with dd | U-Boot needs to be copied to specific sectors on the microSD card with dd. Download U-Boot for the board (<code>uboot-Linksprite_pcDuino3_Nano_defconfig-2015.07_u-boot-sunxi-with-spl.bin</code>), and copy it to the correct location with (again, replace <code>/dev/sdX</code> with the correct path to the SD card device): | ||
<syntaxhighlight lang="bash">sudo dd if=uboot-Linksprite_pcDuino3_Nano_defconfig-2015.07_u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8</syntaxhighlight> | <syntaxhighlight lang="bash">sudo dd if=uboot-Linksprite_pcDuino3_Nano_defconfig-2015.07_u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8</syntaxhighlight> | ||
| Line 92: | Line 92: | ||
=== Wandboard === | === Wandboard === | ||
U-Boot and its SPL need to be copied to the microSD card with dd. Download U-Boot | U-Boot and its SPL need to be copied to specific sectors on the microSD card with dd. Download U-Boot & SPL for the board (<code>uboot-wandboard_defconfig-2017.03_u-boot.img</code>, <code>uboot-wandboard_defconfig-2017.03_SPL</code>), and copy them to the correct location with (again, replace /dev/sdX with the correct path to the SD card device): | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| Line 145: | Line 145: | ||
== Details about the boot process == | == Details about the boot process == | ||
On NixOS, all ARM boards use the popular U-Boot as the bootloader and U-Boot's Generic Distro Configuration Concept as the mechanism to communicate boot information (such as path to kernel zImage, initrd, DTB, command line arguments). For a quick TL;DR about the generic distro configuration support: U-Boot is scripted to scan all attached storage devices & partitions and look for a file named <code>/extlinux/extlinux.conf</code> or <code>/boot/extlinux/extlinux.conf</code> (which will be generated by NixOS, just like <code>/boot/grub/grub.cfg</code> is generated on PCs). | On NixOS, all ARM boards use the popular U-Boot as the bootloader and [https://github.com/u-boot/u-boot/blob/master/doc/README.distro U-Boot's Generic Distro Configuration Concept] as the mechanism to communicate boot information (such as path to kernel zImage, initrd, DTB, command line arguments). For a quick TL;DR about the generic distro configuration support: U-Boot is scripted to scan all attached storage devices & partitions and look for a file named <code>/extlinux/extlinux.conf</code> or <code>/boot/extlinux/extlinux.conf</code> (which will be generated by NixOS, just like <code>/boot/grub/grub.cfg</code> is generated on PCs). | ||
U-Boot also provides an interactive shell and the generation selection menu (just like GRUB). However, support for input or display devices varies greatly, depending on the board: | U-Boot also provides an interactive shell and the generation selection menu (just like GRUB). However, support for input or display devices varies greatly, depending on the board: | ||
| Line 159: | Line 159: | ||
=== Raspberry Pi (all versions) === | === Raspberry Pi (all versions) === | ||
USB keyboards and HDMI displays work perfectly. | USB keyboards and HDMI displays work perfectly. Using the 3.3v serial port via the pin headers (exact location depends on hardware version) should also work. | ||
Using the 3.3v serial port via the pin headers (exact location depends on hardware version) should also work. | |||
=== Wandboard === | === Wandboard === | ||