GithubHelp home page GithubHelp logo

nix-odroid-n2's Introduction

Nixos sd image and mainline uboot for Odroid N2

Suitable for a server. Make sure you have your UART.

Kernel patches sourced from the Armbian build.

Built regularily on the nix release-20.03 branch on arm64 hardware.

What's working

  • RTC
  • Boots from SD, USB, eMMC (tested)
  • ethaddr

What's not working

  • Resetting the network adapter (ip link set eth0 down/up) requires a reboot!
  • WOL
  • Linux desktop acceleration (needs panfrost drivers?) (won't fix)

Not tried

  • Audio

How to prepare a bootable drive.

Running nix-build links products under the ./result folder. You will need to build an image and uboot and write them to a drive to boot.

  1. Build an image (on an aarch64 or x86_64 box)

nix-build release.nix -A sdImage

Then dd it to an sd card (or usb or eMMC)

DEV=/dev/mmcblkX
IMG=./result/???/sd-image-odroid-n2.img
dd if=$IMG of=$DEV conv=fsync bs=4M
sync
  1. Build a u-boot (x86_64 box only :S)

Build the firmware package fip that packs u-boot ready for use.

nix-build release.nix -A fip

Then dd it to the sd card (or usb or eMMC)

DEV=/dev/mmcblkX
UBOOT=result/u-boot.bin
dd if=$UBOOT of=$DEV conv=fsync,notrunc bs=512 seek=1
sync

On your first boot

Upon first boot, you will need to setup a /etc/nixos/configuration.nix. Generate one using nixos-generate-config.

Afterwards, refer to the same profile.nix that the sd image was built from. This profile contains the board specific kernel package and configuration.

{ config, pkgs, lib, ... }:

{
  imports = [
    /etc/nixos/hardware-configuration.nix
    /etc/nixos/nix-odroid-n2/modules/profile.nix
  ];
}

Lessons learnt

  • When a cross-compiled image is used. NixOS will be rebuilt on the device natively when doing nixos-rebuild.

  • Cross-compiling is a means to get something going if you don't have any suitable arm64 hardware. Use arm64 hardware when you can.

  • When cross-compiling turn off everything you can till you get something that boots. For example, turn off sound, wifi or filesystem drivers.

  • You can build an image on arm64 hardware using nix on Armbian. Ensure you enable enough swap space ~15GB and have a 4GB model. This build will be much quicker because you can leverage the arm64 binary cache.

  • Cross-compiling is possible and has been done time to time. It bootstrapped this project. However it is not maintained as arm64 builds work better. YMMV.

References for guidance and patches

  • Armbian
  • LibreElec
  • Hardkernel forums

nix-odroid-n2's People

Contributors

wav avatar angerman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.