Skip to content

Commit

Permalink
feat: dump thead-kernel's version
Browse files Browse the repository at this point in the history
feat: update .gitignore
  • Loading branch information
ryan4yin committed Mar 3, 2024
1 parent c5ab439 commit 0a3bc32
Show file tree
Hide file tree
Showing 3 changed files with 620 additions and 55 deletions.
20 changes: 1 addition & 19 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 24 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@
# so we can use the small channel to get updates more quickly.
# checkout more details here: https://hydra.nixos.org/jobset/nixos/release-23.05#tabs-jobs
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05-small";

# according to https://github.com/sipeed/LicheePi4A/blob/pre-view/.gitmodules
thead-kernel = {
url = "github:revyos/thead-kernel/lpi4a";
flake = false;
};
};

outputs = inputs @ {
outputs = {
self,
nixpkgs,
thead-kernel,
...
}: let
buildFeatures = {
Expand Down Expand Up @@ -56,37 +49,41 @@
};
overlay = self: super: {
linuxPackages_thead = super.linuxPackagesFor (super.callPackage ./pkgs/kernel {
src = thead-kernel;
# according to https://github.com/sipeed/LicheePi4A/blob/pre-view/.gitmodules
src = super.fetchFromGitHub {
owner = "revyos";
repo = "thead-kernel";
rev = "3eee2bf4d220e0415135b63af972efab4ef970dc"; # branch lpi4a, 2024-02-29
sha256 = "sha256-Km1cNQTV4Xp65c5fn7gC9A+dhWw25cnoFujQmCXyY7E=";
};
stdenv = super.gcc13Stdenv;
kernelPatches = with super.kernelPatches; [
bridge_stp_helper
request_key_helper
];
});

light_aon_fpga = super.callPackage ./pkgs/firmware/light_aon_fpga.nix { };
light_c906_audio = super.callPackage ./pkgs/firmware/light_c906_audio.nix { };
thead-opensbi = super.callPackage ./pkgs/opensbi { };
light_aon_fpga = super.callPackage ./pkgs/firmware/light_aon_fpga.nix {};
light_c906_audio = super.callPackage ./pkgs/firmware/light_c906_audio.nix {};
thead-opensbi = super.callPackage ./pkgs/opensbi {};
};
pkgsKernelCross = import nixpkgs {
localSystem = "x86_64-linux";
crossSystem = buildFeatures;

overlays = [ overlay ];
overlays = [overlay];
};
pkgsKernelNative = import nixpkgs {
localSystem = buildFeatures;

overlays = [ overlay ];
};
overlays = [overlay];
};
in {
# expose this flake's overlay
overlays.default = overlay;

# cross-build an sd-image
nixosConfigurations.lp4a-cross = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";

specialArgs = {
inherit nixpkgs;
pkgsKernel = pkgsKernelCross;
Expand All @@ -113,6 +110,16 @@
# the nixpkgs
pkgsKernelCross = pkgsKernelCross;
pkgsKernelNative = pkgsKernelNative;

# the custom kernel, only used for debugging.
# use `nix develop .#kernel` to enter the environment with the custom kernel build environment available.
# and then use `unpackPhase` to unpack the kernel source code and cd into it.
# then you can use `make menuconfig` to configure the kernel.
#
# problem
# - using `make menuconfig` - Unable to find the ncurses package.
# - using `make revyos_defconfig` - awk not found.
kernel = pkgsKernelCross.linuxPackages_thead.kernel.dev;
};

# use `nix develop .#fhsEnv` to enter the fhs test environment defined here.
Expand Down
Loading

0 comments on commit 0a3bc32

Please sign in to comment.