Nixpkgs: Orange Pi One - ARM install.

Created on 19 Sep 2017  路  13Comments  路  Source: NixOS/nixpkgs

Hello,

Currently, I'm trying to install Nixos on an ARM board, an Orange Pi One exactly, but I'm having trouble with the ethernet port. I'm using it headless so it's kind of complicated to know where exactly it's not working so I'm searching for eventual hints.

I'm using the sd-image-armv7l-multiplatform image available thanks to dezgeg and as far as I know it should actually work for Allwiner boards but despite multiple tries, my ethernet port seems to be unavailable. During by best attempts, it blinks during what I suppose is the boot process before shutting down a few seconds and finally staying full light on. When looking at the sd card afterward, the image seems to work as the NIXOS_SD partition is populated.

I saw somewhere @samueldr made it work on a Orange Pi PC. What was your magic word? Maybe @dezgeg has a idea?

Thank you,

Most helpful comment

Based on the description of https://github.com/torvalds/linux/commit/527d1470744d338c912f94bc1f4dba08ffdff349, I think the Ethernet will start working out-of-the-box in 4.15.

All 13 comments

Sounds like some hardware-specific problem indeed.

You could mount the partition and get logs via journalctl --directory=/mnt/var/log/journal in case they have some clues.

Yeah, nothing fancy there. Just a dramatic
dhcp: No interfaces found (more or less). It is known that ethernet is not yet available in mainline kernel but it should work thanks to uboot (from what I understood).
Still what bothers me is that OP One and PC are basically the same (besides RAM) so I'm wondering what I'm doing wrong here.

But thanks anyway!

Hi, sorry I didn't see the github notification before.

To make the ethernet interface of the orangepi pc, I'm using megous' kernel fork

Here's a derivation I added to an overlay on my orange pi pc.

{ stdenv, hostPlatform, fetchurl, perl, buildLinux, fetchFromGitHub, ... } @ args:

import <nixpkgs/pkgs/os-specific/linux/kernel/generic.nix> (args // rec {
  version = "4.13.0";
  extraMeta.branch = "4.13";

  src = fetchFromGitHub {
    owner = "megous";
    repo = "linux";
    rev = "c173fe35989ed23e9f14379550a056969ef6140c";
    sha256 = "0ak6r9yvzmg0j3yh7fnm72f1h3k57gjrxy2cs0bvhi1h7lirxqcd";
  };

  kernelPatches = args.kernelPatches;

  features.iwlwifi = true;
  features.efiBootStub = false;
  features.needsCifsUtils = true;
  features.netfilterRPFilter = true;
} // (args.argsOverride or {}))

As described in the repo's readme, it should work for orange pi one.

Ethernet support was slated for 4.13, but reverted just before it was released. I haven't had time to test upstream 4.14, to see if it finally shipped.

The linux-sunxi wiki is pretty great to find informations about those boards, if you didn't know.

A quick git log arch/arm/boot/dts/sun8i-h3-orangepi-one.dts in a kernel repo confirms that the Ethernet isn't in mainline yet.

I have the same problem with my Orange Pi Zero but there is a .dts since kernel 4.13:

https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts

Which I've confirmed is in the image.

My steps were:

  1. Download https://www.cs.helsinki.fi/u/tmtynkky/nixos-arm/installer/sd-image-armv7l-linux.img
  2. sudo bash -c "pv sd-image-armv7l-linux.img > /dev/mmcblk0"
  3. "Building u-boot from your NixOS PC" using orangepi_zero_defconfig
  4. sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8 conv=notrunc

My logs, from journalctl --directory=var/log/journal -p err:

-- Logs begin at Thu 1970-01-01 10:00:20 AEST, end at Thu 1970-01-01 10:15:34 AEST. --
Jan 01 10:00:20 nixos kernel: /cpus/cpu@0 missing clock-frequency property
Jan 01 10:00:20 nixos kernel: /cpus/cpu@1 missing clock-frequency property
Jan 01 10:00:20 nixos kernel: /cpus/cpu@2 missing clock-frequency property
Jan 01 10:00:20 nixos kernel: /cpus/cpu@3 missing clock-frequency property
Jan 01 10:00:20 nixos kernel: dmi: Firmware registration failed.
Jan 01 10:00:20 nixos systemd-modules-load[411]: Failed to find module 'snd_pcm_oss'
Jan 01 10:00:21 nixos systemd-udevd[428]: Specified group 'kvm' unknown
-- Reboot --
Jan 01 10:00:23 nixos kernel: /cpus/cpu@0 missing clock-frequency property
Jan 01 10:00:23 nixos kernel: /cpus/cpu@1 missing clock-frequency property
Jan 01 10:00:23 nixos kernel: /cpus/cpu@2 missing clock-frequency property
Jan 01 10:00:23 nixos kernel: /cpus/cpu@3 missing clock-frequency property
Jan 01 10:00:23 nixos kernel: dmi: Firmware registration failed.
Jan 01 10:00:23 nixos systemd-modules-load[436]: Failed to find module 'snd_pcm_oss'
Jan 01 10:00:23 nixos systemd-udevd[456]: Specified group 'kvm' unknown
-- Reboot --
Jan 01 10:00:24 nixos dhcpcd[586]: no valid interfaces found
-- Reboot --
Jan 01 10:00:27 nixos dhcpcd[616]: no valid interfaces found
-- Reboot --
Jan 01 10:00:54 nixos dhcpcd[586]: timed out
-- Reboot --
Jan 01 10:00:57 nixos dhcpcd[616]: timed out

The latest commit on the dts reverts changes that made the ethernet work

Your board isn't listed on megous' fork, and there doesn't seem to be any details on the sunxi wiki about mainlined ethernet. Though H2+ seems to be somewhat the same thing than H3. The fork could work, if you have the time to wait for the build. On my Orange Pi PC, I believe it's about a full day.

Hello,

Tried again this week, everything is working nicely thanks to samueldr's derivation.
In case it can help anyone, I had to install Nix on Armbian and build my own sd image with custom kernel. It doesn't take that much time if you use dezgeg's binary cache. I also had to limit binary-caches-parallel-connections to avoid crashes.

So thank you everybody ;),

Bye,

Of note, from memory, using the image from dezgeg to start will work, but you'll be without ethernet, forcing you to use either a USB ethernet or wireless USB dongle. (I used a wireless USB dongle.)

I used an Apple USB Ethernet adaptor, worked well. The image doesn't start SSH automatically so I also had to connect over UART then start sshd.

Based on the description of https://github.com/torvalds/linux/commit/527d1470744d338c912f94bc1f4dba08ffdff349, I think the Ethernet will start working out-of-the-box in 4.15.

Anyone impatient that didn't update it themselves, 4.14 from megous' fork:

{ stdenv, hostPlatform, fetchurl, perl, buildLinux, fetchFromGitHub, ... } @ args:

import <nixpkgs/pkgs/os-specific/linux/kernel/generic.nix> (args // rec {
  version = "4.14.0";
  extraMeta.branch = "4.14";

  src = fetchFromGitHub {
    owner = "megous";
    repo = "linux";
    rev = "cb31337027aaf606dc77cd423dc54197bb5ed16c";
    sha256 = "123gl8gf98h0s7y9db6ygn6gflx2bpxc1l03xd6jlnc9ay2pkrca";
  };  

  kernelPatches = args.kernelPatches;

  features.iwlwifi = true;
  features.efiBootStub = false;
  features.needsCifsUtils = true;
  features.netfilterRPFilter = true;
} // (args.argsOverride or {}))

Ethernet works, haven't tested anything else.

So it seems this can be closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

retrry picture retrry  路  3Comments

chris-martin picture chris-martin  路  3Comments

sid-kap picture sid-kap  路  3Comments

rzetterberg picture rzetterberg  路  3Comments