apple/t2: factor out kernel definition for improved readability

This commit is contained in:
Cassie Cheung 2024-07-06 12:23:26 +08:00 committed by mergify[bot]
parent 6e253f12b1
commit f75ab8b22c

View file

@ -2,6 +2,9 @@
, ... } @ args: , ... } @ args:
let let
version = "6.9.4";
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0);
patchRepo = fetchFromGitHub { patchRepo = fetchFromGitHub {
owner = "t2linux"; owner = "t2linux";
repo = "linux-t2-patches"; repo = "linux-t2-patches";
@ -9,8 +12,10 @@ let
hash = "sha256-mwT4cuIBrz3tz8+fAxVKmnRtkPRp3lWmNbocuXCsm44="; hash = "sha256-mwT4cuIBrz3tz8+fAxVKmnRtkPRp3lWmNbocuXCsm44=";
}; };
version = "6.9.4"; kernel = fetchzip {
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0); url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
hash = "sha256-8jC5DpPi6poig1gmJPIIZ2HMwQQt1kTK4PcvyYm+Hsg=";
};
in in
buildLinux (args // { buildLinux (args // {
inherit version; inherit version;
@ -20,10 +25,7 @@ buildLinux (args // {
modDirVersion = with lib; "${concatStringsSep "." (take 3 (splitVersion "${version}.0"))}"; modDirVersion = with lib; "${concatStringsSep "." (take 3 (splitVersion "${version}.0"))}";
src = runCommand "patched-source" {} '' src = runCommand "patched-source" {} ''
cp -r ${fetchzip { cp -r ${kernel} $out
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
hash = "sha256-8jC5DpPi6poig1gmJPIIZ2HMwQQt1kTK4PcvyYm+Hsg=";
}} $out
chmod -R u+w $out chmod -R u+w $out
cd $out cd $out
while read -r patch; do while read -r patch; do