NixOS on ARM/ASUS Tinker Board: Difference between revisions

From NixOS Wiki
imported>Samueldr
m Clarifies who to contact in the intro paragraph.
 
(4 intermediate revisions by 2 users not shown)
Line 19: Line 19:
<!-- Mosly copied from NixOS on Orange PC page -->
<!-- Mosly copied from NixOS on Orange PC page -->
== Status ==
== Status ==
{{outdated|Section refers to old user-provided images. Should be reviewed with cross-compilation, or native compilation through userspace emulation.}}


'''@dezgeg''''s porting efforts to ARMv7 works on the TinkerBoard, with some modification for u-boot and DTB paths. Support for this board is a work in progress. Please contact me ([[User:tomberek|@tomberek]]) for comments/thoughts/feedback/etc.
'''@dezgeg''''s porting efforts to ARMv7 works on the TinkerBoard, with some modification for u-boot and DTB paths. Support for this board is a work in progress. Please contact me ([[User:tomberek|@tomberek]]) for comments/thoughts/feedback/etc.
Line 35: Line 37:
</syntaxhighlight>
</syntaxhighlight>


It turns out that getting into U-Boot using the TinkerOS image, halting the boot process, replacing SD cards with the NixOS image fails, but the error message suggests the extlinux merely has a different name for the DTB than NixOS has packaged. Simply copy from the nixos dtb file `/boot/nixos/<hash>-dtbs/rk3288-tinker.dtb` to `rockchip-tinker_rk3288.dtb` (possibly `rockchip-miniarm_rk3288.dtb`, TODO: examine U-Boot output to see what DTB it tries to read).
It turns out that getting into U-Boot using the TinkerOS image, halting the boot process, replacing SD cards with the NixOS image fails, but the error message suggests the extlinux merely has a different name for the DTB than NixOS has packaged. Simply copy from the nixos dtb file `/boot/nixos/<hash>-dtbs/rk3288-tinker.dtb` to `rockchip-tinker_rk3288.dtb`.


Then, install using the [[NixOS_on_ARM#NixOS_installation_.26_configuration|installation and configuration steps]].
Then, install using the [[NixOS_on_ARM#NixOS_installation_.26_configuration|installation and configuration steps]].
Line 61: Line 63:
* [[NixOS_on_ARM]]
* [[NixOS_on_ARM]]
* [https://www.asus.com/us/Single-Board-Computer/Tinker-Board/ Official ASUS website]
* [https://www.asus.com/us/Single-Board-Computer/Tinker-Board/ Official ASUS website]
* Some more details [https://tomberek.info/posts/Nix/2018-03-27-Nix-on-Tinker-Board.html on tomberek's post about the Tinker Board]

Latest revision as of 03:05, 5 April 2024

NixOS on TinkerBoard
Manufacturer ASUS
Architecture ARMv7
Bootloader Upstream u-boot
Maintainer tomberek

Status

@dezgeg's porting efforts to ARMv7 works on the TinkerBoard, with some modification for u-boot and DTB paths. Support for this board is a work in progress. Please contact me (@tomberek) for comments/thoughts/feedback/etc.

Board-specific installation notes

First follow the generic installation steps to get the installer image on an SD card.

The Tinker Board seems to look for U-Boot at a specific offset rather than in a file. So copy the initial 4MB from the TinkerOS image and then copy it to the NixOS image while skipping the MBR/partition table in the first 512 bytes. It turns out the bootstrap section of the MBR is also needed, so copy that as well.

These commands may use either the /dev/sdX or the file images and later copied to SD cards - this was discovered iteratively, thus was performed on the sd cards directly. Use with caution. (Assumes /dev/sdc is TinkerOS and /dev/sdb is NixOS images or devices respectively).

dd if=/dev/sdc of=tinker_sector bs=512k count=8 status=progress # grab tinker initial sectors
dd if=tinker_sector of=/dev/sdb bs=512 skip=1 seek=1 count=8191 # copy the img and env blobs
dd of=/dev/sdb if=tinker_sector bs=428 count=1 # bootstrap code from begining of MBR

It turns out that getting into U-Boot using the TinkerOS image, halting the boot process, replacing SD cards with the NixOS image fails, but the error message suggests the extlinux merely has a different name for the DTB than NixOS has packaged. Simply copy from the nixos dtb file `/boot/nixos/<hash>-dtbs/rk3288-tinker.dtb` to `rockchip-tinker_rk3288.dtb`.

Then, install using the installation and configuration steps.

Serial console

Your configuration.nix will need to modify the default boot.kernelParams configuration to use the serial console.

/etc/nixos/configuration.nix
boot.kernelParams = [
    "console=ttymxc0,115200n8" # HDMI?
    "console=tty0"             # Primary Console?
    "console=ttyS1,115200n8"   # Serial port?
    "console=ttyS2,115200n8"   # Serial port pins 8+10
 ];

TODO

  • Build U-boot from upstream
  • upload images/blobs
  • host binary cache

Resources