NixOS on ARM/NanoPC-T4: Difference between revisions

imported>Tmountain
No edit summary
imported>Tmountain
No edit summary
Line 36: Line 36:
== Board Specific Installation Notes ==
== Board Specific Installation Notes ==


 
=== Installation onto eMMC ===
 
The NanoPC-T4 reserves space for u-boot at the beginning of its eMMC and/or microSD. As a result, successful image installation relies upon a custom partitioning scheme.
The NanoPC-T4 reserves space for u-boot at the beginning of its eMMC and/or microSD. As a result, successful image installation relies upon a custom partitioning scheme.


Line 53: Line 52:
Command (m for help): w
Command (m for help): w


Make the filesystem and set the disk label (crucially important)
# Make the filesystem and set the disk label (crucially important)
# mkfs.ext4 /dev/mmcblk2p1
# mkfs.ext4 /dev/mmcblk2p1
# tune2fs -L NIXOS_SD /dev/mmcblk2p1
# tune2fs -L NIXOS_SD /dev/mmcblk2p1
Line 64: Line 63:
# dd if=uboot.img of=/dev/mmcblk2 seek=16384 conv=notrunc
# dd if=uboot.img of=/dev/mmcblk2 seek=16384 conv=notrunc
# dd if=trust.bin of=/dev/mmcblk2 seek=24576 conv=notrunc
# dd if=trust.bin of=/dev/mmcblk2 seek=24576 conv=notrunc
</syntaxhighlight>
==== boot and rootfs ====
The latest linux kernel is working with this board. Instead of building the image yourself you can fetch the latest sd-image from hydra and dd the created images onto the separate partitions.
You can find all the successful builds in [https://hydra.nixos.org/job/nixos/release-18.09-aarch64/nixos.sd_image.aarch64-linux hydra @ nixos:release-18.09-aarch64:nixos.sd_image.aarch64-linux]
<syntaxHighlight lang=bash>
# get the latest link directly from hydra
wget https://hydra.nixos.org/build/89033499/download/1/nixos-sd-image-18.09.2227.ea0820818a7-aarch64-linux.img -O sd.img
udisksctl loop-setup -f sd.img -r
# copy the root filesystem to the partition you created earlier
# mkdir eemc imgroot
# mount /dev/mmcblk2p1 emmc
# mount /dev/loop0p2 imgroot
# cd imgroot
# tar cf - . | (cd ../emmc && tar xvf -)
# cd .. && umount eemc imgroot
</syntaxhighlight>
</syntaxhighlight>