NixOS on ARM/PINE A64-LTS: Difference between revisions

imported>Samueldr
m Links to the PR required for sunxi-tools.
imported>Samueldr
m Reviews compatibility notes section
Line 55: Line 55:
== Compatibility notes ==
== Compatibility notes ==


* Using the upstream kernel at 4.15, neither ethernet seems to have troubles. The interface is detected but seems to not work right.
{| class="table arm-compatibility"
* HDMI support is untested.
|-
! Device
! Notes
|-
! Ethernet
| As of mainline kernel 4.15, ethernet seems to have troubles. The interface is detected but seems to not work right.
|-
! HDMI
| As of mainline kernel 4.19, HDMI output does not seem to work (with tested hardware).
|}
 
=== Downstream kernel ===
 
Using a kernel based on the downstream patches, it is possible to get both Ethernet and HDMI working.
 
* [https://github.com/CallMeFoxie/linux/tree/v4.14-pine64 CallMeFoxie/linux@v4.14-pine64]
* [https://forum.pine64.org/showthread.php?tid=4931 Pine64 Forum post by CallMeFoxie]
 
{{note|Keep in mind that using non-upstream forks of the kernel always incurs some risk as far as security goes.}}
 
Follows an example derivation and overlay to build the known working fork.
 
<syntaxhighlight lang="nix">
# linux-pine64.nix
{ fetchFromGitHub, buildLinux, ... } @ args:
buildLinux (args // rec {
  version = "4.14.23";
  modDirVersion = "4.14.23";
  extraMeta.branch = "4.14";
  src = fetchFromGitHub {
    owner = "CallMeFoxie";
    repo = "linux";
    rev = "f0899693d21e15ce32df4d4702f236dfe3e0eba7";
    sha256 = "043q7v7c5w84dnbgsmz117q712ljqrgay5707pz4vnvxl53czk4h";
  };
  extraMeta.platforms = [ "aarch64-linux" ];
  structuredExtraConfig = {
    # Options for HDMI.
    # Fixes this:
    #  sun4i-drm display-engine: master bind failed: -517
    SUN8I_DE2_CCU = "y";
  };
} // (args.argsOverride or {}))
</syntaxhighlight>
 
<syntaxhighlight lang="nix">
# overlay.nix
self: super:
 
let
  inherit (super) callPackage kernelPatches;
in
{
  linux_pine64_4_14 = callPackage ./linux-pine64.nix {
    kernelPatches = [
      kernelPatches.bridge_stp_helper
      kernelPatches.modinst_arg_list_too_long
    ];
  };
  linuxPackages_pine64_4_14 = self.linuxPackagesFor self.linux_pine64_4_14;
}
</syntaxhighlight>


== SPI NOR flash ==
== SPI NOR flash ==