Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 21, 2025. It is now read-only.

arcayr/orangepizero3-nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kernel source and uboot configuration for linux 6.1.31 for the orange pi zero 3.

disclaimers

  • the nix expressions are probably pretty bad. they work, but i have no doubt they aren't idiomatic.
  • this requires ifd.

layout

└───packages
    └───aarch64-linux
        ├───firmwareOrangePiZero3: package 'uwe5622-firmware-6.1.31-sun50iw9'
        ├───linuxOrangePiZero3: package 'linux-6.1.31-sun50iw9'
        └───ubootOrangePiZero3: package 'uboot-orangepi_zero3_defconfig-2021.07-sunxi'

sources

usage

for your own orange pi zero 3: here's a snapshot of my own configuration, which should be a good starting point. some of the options are probably redundant, but i'd rather be safe than sorry.

{
  imports = [
    "${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
  ];

  nixpkgs.hostPlatform = "aarch64-linux";

  # dodge "module <x> not found" error for socs.
  hardware.enableRedistributableFirmware = false;
  nixpkgs.overlays = [
      (final: super: {
      makeModulesClosure = x:
          super.makeModulesClosure (x // { allowMissing = true; });
      })
  ];

  # u-boot, no grub, no efi.
  boot.loader.grub.enable = false;
  boot.loader.generic-extlinux-compatible.enable = true;
  boot.loader.efi.canTouchEfiVariables = false;

  # slim supported filesystems.
  boot.supportedFilesystems = pkgs.lib.mkForce ["vfat" "ext4"];
  boot.initrd.supportedFilesystems = pkgs.lib.mkForce ["vfat" "ext4"];

  # your shiny custom kernel.
  boot.kernelPackages = pkgs.orangePiZero3; # however you get the package here is up to you - overlay or directly from the flake.

  # opi needs the uboot image written to a specific part of the firmware.
  sdImage.postBuildCommands = ''dd if=${inputs.opiz3-nix.packages.aarch64-linux.ubootOrangePiZero3}/u-boot-sunxi-with-spl.bin of=$img bs=8 seek=1024 conv=notrunc'';

  # this gets burned straight onto an sd. no point in zstd.
  sdImage.compressImage = false;
}

then you can build the sd image with nix build .#<configuration name>.config.system.build.sdImage.

for the defconfig use pkgs/linux/sun50iw9_defconfig. the vendor-provided one is short a bunch of things.

contributing

if you have a forgejo instance, or access to one, you can fork and submit patches. i personally recommend codeberg if you aren't hosting your own.

license

everything outside of src/ is agpl licensed except the defconfig.

pkgs/linux/sun50iw9_defconfig is the same license as the linux kernel.

directories in src/ contain their own licenses, as they are verbatim copies of the upstream sources.

About

kernel source and uboot configuration for linux 6.1.31 for the orange pi zero 3.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages