Difference between revisions of "NixOS on ARM/ODROID-HC4"

From NixOS Wiki
Jump to: navigation, search
m (rollback unauthorized mass edits)
Tag: Rollback
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{ARM/breadcrumb}}
+
This page has been moved to the official NixOS Wiki:
<div class="infobox">
 
{|class="table"
 
!colspan="2" class="title"|Hardkernel ODROID-HC4
 
|-
 
!Manufacturer
 
|Hardkernel
 
|-
 
!Architecture
 
|ARMv7
 
|-
 
!Bootloader
 
|U-Boot
 
|-
 
!Boot options
 
|SD (SATA?)
 
|}
 
</div>
 
  
== Status ==
+
    ⇒ '''[https://wiki.nixos.org/wiki/NixOS_on_ARM/ODROID-HC4 NixOS on ARM/ODROID-HC4]'''
  
Mostly working, but some manual steps needed to get it running.
+
''— samueldr, Lead of NixOS on ARM.''
 
 
U-boot support in NixPkgs is currently in review: [https://github.com/NixOS/nixpkgs/pull/101454 NixPkgs Pull Request #101454]
 
 
 
== Board-specific installation notes ==
 
 
 
=== Petitboot removal ===
 
 
 
Petitboot is installed on the SPI memory of the Odroid HC4 from factory. To be able to load an upstreamed version of U-Boot without having to press a hardware button at each boot, you may remove it.
 
'''Please proceed with caution, this will make Hardkernel images unbootable!'''
 
 
 
From the Petitboot, go for “Exit to shell” and enter these commands to remove Petitboot:
 
<syntaxhighlight lang="bash">
 
flash_eraseall /dev/mtd0
 
flash_eraseall /dev/mtd1
 
flash_eraseall /dev/mtd2
 
flash_eraseall /dev/mtd3
 
</syntaxhighlight>
 
 
 
This will make your SPI flash memory empty and the device will now start from SD on next boot.
 
 
 
See [https://forum.odroid.com/viewtopic.php?f=207&t=40906 this Odroid forum topic] to restore Petitboot.
 
 
 
=== NixOS installation ===
 
 
 
# First follow the [[NixOS_on_ARM#Installation|generic installation steps]] to get the '''21.05 (Latest kernel)''' installer image.
 
# Uncompress the .zst file. One may use the <code>unzstd</code> command (equivalent to <code>zstd -d</code>) on supported machines. The zstd commands can be accessed from the <code>zstd</code> package.
 
# Patch this image (.img file) with U-Boot for Odroid HC4. <syntaxhighlight lang="bash">
 
# Clone content of pull request https://github.com/NixOS/nixpkgs/pull/101454 and build
 
git clone https://github.com/arapov/nixpkgs --depth 1 -b hardkernel && cd nixpkgs
 
nix-build -I "nixpkgs=$PWD" -A pkgsCross.aarch64-multiplatform.ubootOdroidC4
 
sudo dd if=result/u-boot.bin of=PATH/TO/nixos-sd-image-21.05.XXXX.XXXXXXXX-aarch64-linux.img  conv=fsync,notrunc bs=512 seek=1
 
  </syntaxhighlight>
 
# Flash the modified SD image file (.img) to a microSD card. '''This will erase all the data on the card!'''
 
 
 
== Known Problems ==
 
 
 
=== SATA is not working ===
 
 
 
SATA is working on Armbian with mainline kernel and u-boot but not on NixOS 21.05: lspci returns nothing.
 
WIP
 
 
 
== Resources ==
 
 
 
* [https://www.hardkernel.com/shop/odroid-hc4/ Official product page]
 
* [https://github.com/considerate/nixos-odroidhc4/ NixOS configuration for the ODROID HC4 microcomputer by considerate]
 
* [https://www.armbian.com/odroid-hc4/ Armbian Odroid HC4]
 
* [https://u-boot.readthedocs.io/en/latest/board/amlogic/odroid-c4.html U-Boot for Odroid C4 documentation]
 

Latest revision as of 11:04, 6 April 2024

This page has been moved to the official NixOS Wiki:

    ⇒ NixOS on ARM/ODROID-HC4

— samueldr, Lead of NixOS on ARM.