enable kernel selection support

This commit is contained in:
Adam Stephens 2024-02-20 08:43:19 -05:00
parent b05262f882
commit 5a4384c71b
No known key found for this signature in database
4 changed files with 47 additions and 27 deletions

View file

@ -16,7 +16,7 @@ jobs:
- name: build all
run: |
OUTPUT=$(nix build --print-out-paths .#x13s/linux .#x13s/alsa-ucm-conf .#pd-mapper .#x13s/extra-firmware)
OUTPUT=$(nix build --print-out-paths .#linux_jhovold .#linux_steev .#x13s/alsa-ucm-conf .#pd-mapper .#x13s/extra-firmware)
echo $OUTPUT
echo "$OUTPUT" > build.out

View file

@ -10,7 +10,14 @@ let
x13sPackages = import ./packages/default.nix { inherit lib pkgs; };
dtbName = "sc8280xp-lenovo-thinkpad-x13s.dtb";
linuxPackages_x13s = pkgs.linuxPackagesFor x13sPackages."x13s/linux";
linuxPackages_x13s = pkgs.linuxPackagesFor (
if cfg.kernel == "jhovold" then
x13sPackages.linux_jhovold
else if cfg.kernel == "steev" then
x13sPackages.linux_steev
else
pkgs.linuxPackages_latest
);
dtb = "${linuxPackages_x13s.kernel}/dtbs/qcom/${dtbName}";
alsa-ucm-conf-env.ALSA_CONFIG_UCM2 = "${x13sPackages."x13s/alsa-ucm-conf"}/share/alsa/ucm2";
@ -23,6 +30,16 @@ in
type = lib.types.str;
description = "mac address to set on boot";
};
kernel = lib.mkOption {
type = lib.types.enum [
"jhovold"
"mainline"
"steev"
];
description = "which patched kernel to use. jhovold is the latest RC, steev is the latest patched release, and mainline is nixos latest";
default = "jhovold";
};
};
config = lib.mkIf cfg.enable {

View file

@ -14,7 +14,7 @@
"url": "https://api.github.com/repos/alsa-project/alsa-ucm-conf/tarball/v1.2.11",
"hash": "1jcn0x6bbg69p1ygxnh1zn33sd9lpbll4bnhvkzw1fjpmw7igjkz"
},
"linux": {
"linux-jhovold": {
"type": "Git",
"repository": {
"type": "GitHub",
@ -25,6 +25,18 @@
"revision": "00a0ee0018ac61ec4c93536f27916ff40cfe7a99",
"url": "https://github.com/jhovold/linux/archive/00a0ee0018ac61ec4c93536f27916ff40cfe7a99.tar.gz",
"hash": "115yra3w4a0f4aprjb8n5gpq4xc8j7h3kql18z755jii5gd49qfr"
},
"linux-steev": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "steev",
"repo": "linux"
},
"branch": "lenovo-x13s-linux-6.7.y",
"revision": "45411854bb931cb5c989e00ded127d4fc68dfa01",
"url": "https://github.com/steev/linux/archive/45411854bb931cb5c989e00ded127d4fc68dfa01.tar.gz",
"hash": "19wa6ihmjp748vj5qqzy1kqz4bhxy4k81v90kbca9y15l6waqm6q"
}
},
"version": 3

View file

@ -3,39 +3,30 @@ let
sources = import ../npins;
linux_x13s_pkg =
{ buildLinux, ... }@args:
let
version = "6.8.0-rc5";
modDirVersion = "${version}";
in
{ version, buildLinux, ... }@args:
buildLinux (
args
// {
inherit version modDirVersion;
modDirVersion = version;
src = sources.linux;
kernelPatches = (args.kernelPatches or [ ]) ++ [
# {
# # fix resets when reading EFI vars
# name = "qcom-shm-bridge-tz";
# patch = (
# pkgs.fetchurl {
# url = "https://lore.kernel.org/lkml/20240205182810.58382-1-brgl@bgdev.pl/t.mbox.gz";
# hash = "sha256-MeuDkVFSf/KqzcD92wR6U9yOJhOKmZkXsgGcOm/9l/k=";
# }
# );
# extraStructuredConfig = {
# QCOM_TZMEM_MODE_SHMBRIDGE = lib.kernel.yes;
# };
# }
];
kernelPatches = (args.kernelPatches or [ ]) ++ [ ];
extraMeta.branch = lib.versions.majorMinor version;
}
);
in
rec {
"x13s/linux" = pkgs.callPackage linux_x13s_pkg { defconfig = "johan_defconfig"; };
linux_jhovold = pkgs.callPackage linux_x13s_pkg {
src = sources.linux-jhovold;
version = "6.8.0-rc5";
defconfig = "johan_defconfig";
};
linux_steev = pkgs.callPackage linux_x13s_pkg {
src = sources.linux-steev;
version = "6.7.5";
defconfig = "laptop_defconfig";
};
"x13s/alsa-ucm-conf" = pkgs.alsa-ucm-conf.overrideAttrs (
_: {
version = sources.alsa-ucm-conf.version;