From a8542697f1e1f56fe965572f4251854824c5fa7a Mon Sep 17 00:00:00 2001 From: Florian Agbuya Date: Mon, 13 Nov 2023 13:50:16 +0800 Subject: [PATCH] use the linux xilinx fork for the kernel Signed-off-by: Florian Agbuya --- flake.nix | 1 - linux_zynq.nix | 42 ++++++------------------------------------ zynq_image.nix | 18 +++++++++++++++++- 3 files changed, 23 insertions(+), 38 deletions(-) diff --git a/flake.nix b/flake.nix index 8b343d6..a833f63 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,6 @@ extraModules = [ ./zynq_image.nix ]; - platform = system: platforms.armv7l-hf-multiplatform; system = "x86_64-linux"; crossSystem.system = "armv7l-linux"; inherit (not-os.inputs) nixpkgs; diff --git a/linux_zynq.nix b/linux_zynq.nix index 7d4be9e..66ec23c 100644 --- a/linux_zynq.nix +++ b/linux_zynq.nix @@ -1,10 +1,9 @@ -{ stdenv, fetchFromGitHub, perl, buildLinux, ... } @ args: +{ stdenv, lib, fetchFromGitHub, buildLinux, ... } @ args: let - modDirVersion = "6.1.58"; - # tag = "1.20161020-1"; + modDirVersion = "6.1.0-xilinx"; in -stdenv.lib.overrideDerivation (import "${pkgs.path}/pkgs/os-specific/linux/kernel/generic.nix" (args // rec { +lib.overrideDerivation (buildLinux (args // { version = "${modDirVersion}"; inherit modDirVersion; @@ -12,38 +11,9 @@ stdenv.lib.overrideDerivation (import "${pkgs.path}/pkgs/os-specific/linux/kerne owner = "Xilinx"; repo = "linux-xlnx"; rev = "c8b3583bc86352009c6ac61e2ced0e12118f8ebb"; - hash = ""; + sha256 = "09vfh2p7iszzjqp25fnwpzy52h07v4n161salsia0jyr2g5kxrfr"; }; - # features.iwlwifi = true; - # features.needsCifsUtils = true; - # features.canDisableNetfilterConntrackHelpers = true; - # features.netfilterRPFilter = true; + defconfig = "xilinx_zynq_defconfig"; -})) (oldAttrs: { - postConfigure = '' - # The v7 defconfig has this set to '-v7' which screws up our modDirVersion. - sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/' - ''; - - # postFixup = '' - # # Make copies of the DTBs so that U-Boot finds them, as it is looking for the upstream names. - # # This is ugly as heck. - # copyDTB() { - # if [ -f "$out/dtbs/$1" ]; then - # cp -v "$out/dtbs/$1" "$out/dtbs/$2" - # fi - # } - - # # I am not sure if all of these are correct... - # copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb - # copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb - # copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb - # copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb - # copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb - # copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb - # copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb - # copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb - # copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb - # ''; -}) +} // (args.argsOverride or {}))) (oldAttrs: {}) diff --git a/zynq_image.nix b/zynq_image.nix index c6c29b4..42f822b 100644 --- a/zynq_image.nix +++ b/zynq_image.nix @@ -5,9 +5,21 @@ let # dont use overlays for the qemu, it causes a lot of wasted time on recompiles x86pkgs = import pkgs.path { system = "x86_64-linux"; }; - customKernel = pkgs.linux.override { + # armv7l cross-compile and boot fixes + customKernel = pkgs.linux_zynq.override { extraConfig = '' OVERLAY_FS y + DRM_XLNX_HDCP n + DRM_XLNX_DPTX n + DRM_XLNX_HDMITX n + VIDEO_XILINX_HDCP2X_RX n + VIDEO_XILINX_DPRXSS n + DRM_XLNX n + USB_XHCI_PLATFORM n + USB_XHCI_HCD n + SENSORS_TPS544 n + XLNX_TSMUX n + USB_BRCMSTB n ''; }; customKernelPackages = pkgs.linuxPackagesFor customKernel; @@ -66,6 +78,10 @@ in { ''; environment.etc."pam.d/other".text = ""; + nixpkgs.config.packageOverrides = pkgs: { + linux_zynq = pkgs.callPackage ./linux_zynq.nix {}; + }; + nixpkgs.overlays = [ (self: super: { # armv7l cross-compile fixes