summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2023-10-10 10:12:41 +0200
committerJörg Thalheim <Mic92@users.noreply.github.com>2023-10-10 14:49:51 +0200
commit865a2cf8c1b5038d7beee47a2f39d4e20bbe433c (patch)
treedc33ed1ae4c1632a7187c0dd7ccd31219f779a11
parentb7fbd1ffd4a82a46f853a78aef907e8b16570228 (diff)
downloadnixpkgs-865a2cf8c1b5038d7beee47a2f39d4e20bbe433c.tar
nixpkgs-865a2cf8c1b5038d7beee47a2f39d4e20bbe433c.tar.gz
nixpkgs-865a2cf8c1b5038d7beee47a2f39d4e20bbe433c.tar.bz2
nixpkgs-865a2cf8c1b5038d7beee47a2f39d4e20bbe433c.tar.lz
nixpkgs-865a2cf8c1b5038d7beee47a2f39d4e20bbe433c.tar.xz
nixpkgs-865a2cf8c1b5038d7beee47a2f39d4e20bbe433c.tar.zst
nixpkgs-865a2cf8c1b5038d7beee47a2f39d4e20bbe433c.zip
Revert "nixos/systemd-boot: skip EFI update to 252"
This reverts commit 80665d606ab66a82fc969a24a8d0143914683806.

Parsing the package version broke our systemd-boot builder test.

i.e. it won't be able to parse systemd-boot efi binaries coming from
ubuntu

We no longer use the faulty systemd-boot version so this code should no
longer be needed.
-rw-r--r--[-rwxr-xr-x]nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py15
-rw-r--r--nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix6
2 files changed, 6 insertions, 15 deletions
diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
index f883c12e3a1..78b43c57e90 100755..100644
--- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
+++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
@@ -13,7 +13,6 @@ import sys
 import warnings
 from typing import NamedTuple
 
-from packaging import version
 
 libc = ctypes.CDLL("libc.so.6")
 
@@ -260,18 +259,12 @@ def install_bootloader(args: argparse.Namespace) -> None:
         if available_match is None:
             raise Exception("could not determine systemd-boot version")
 
-        installed_version = version.parse(installed_match.group(1))
-        available_version = version.parse(available_match.group(1))
+        installed_version = installed_match.group(1)
+        available_version = available_match.group(1)
 
-        # systemd 252 has a regression that leaves some machines unbootable, so we skip that update.
-        # The fix is in 252.2
-        # See https://github.com/systemd/systemd/issues/25363 and https://github.com/NixOS/nixpkgs/pull/201558#issuecomment-1348603263
         if installed_version < available_version:
-            if version.parse('252') <= available_version < version.parse('252.2'):
-                print("skipping systemd-boot update to %s because of known regression" % available_version)
-            else:
-                print("updating systemd-boot from %s to %s" % (installed_version, available_version))
-                subprocess.check_call(["@systemd@/bin/bootctl", "--esp-path=@efiSysMountPoint@"] + bootctl_flags + ["update"])
+            print("updating systemd-boot from %s to %s" % (installed_version, available_version))
+            subprocess.check_call(["@systemd@/bin/bootctl", "--esp-path=@efiSysMountPoint@", "update"])
 
     os.makedirs("@efiSysMountPoint@/efi/nixos", exist_ok=True)
     os.makedirs("@efiSysMountPoint@/loader/entries", exist_ok=True)
diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix
index d9a1535ffc7..6f0a62d0ea8 100644
--- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix
+++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix
@@ -7,14 +7,12 @@ let
 
   efi = config.boot.loader.efi;
 
-  python3 = pkgs.python3.withPackages (ps: [ ps.packaging ]);
-
   systemdBootBuilder = pkgs.substituteAll {
     src = ./systemd-boot-builder.py;
 
     isExecutable = true;
 
-    inherit python3;
+    inherit (pkgs) python3;
 
     systemd = config.systemd.package;
 
@@ -52,7 +50,7 @@ let
   };
 
   checkedSystemdBootBuilder = pkgs.runCommand "systemd-boot" {
-    nativeBuildInputs = [ pkgs.mypy python3 ];
+    nativeBuildInputs = [ pkgs.mypy ];
   } ''
     install -m755 ${systemdBootBuilder} $out
     mypy \