linux-hardened: Fix kernel version detection

This commit is contained in:
Tim Steinbach 2020-05-12 08:37:08 -04:00
parent 511b503b0d
commit 0c9b897241
No known key found for this signature in database
GPG Key ID: 6538CB9266B06F31

View File

@ -184,11 +184,10 @@ for filename in os.listdir(NIXPKGS_KERNEL_PATH):
with import {NIXPKGS_PATH} {{}};
(callPackage {NIXPKGS_KERNEL_PATH / filename} {{}}).version
"""
kernel_version = parse_version(
run(
"nix", "eval", "--impure", "--raw", "--expr", nix_version_expr,
).stdout
)
kernel_version_json = run(
"nix-instantiate", "--eval", "--json", "--expr", nix_version_expr,
).stdout
kernel_version = parse_version(json.loads(kernel_version_json))
if kernel_version < MIN_KERNEL_VERSION:
continue
kernel_key = major_kernel_version_key(kernel_version)