about summary refs log tree commit diff
path: root/nixos/modules/system/boot/loader/systemd-boot
diff options
context:
space:
mode:
authorLin Jian <me@linj.tech>2022-10-07 19:03:15 +0800
committerLin Jian <me@linj.tech>2022-10-07 19:28:43 +0800
commit642323930effc0c520c66ff31d84e00d481f2813 (patch)
treebf509bbd1d846cec1666cf662d124d20416f67e6 /nixos/modules/system/boot/loader/systemd-boot
parente16d04eda784f89c386df2c8b6d1da2416b85a1b (diff)
nixos/systemd-boot: correctly find gen_number for specialisation
Before this patch, the gen_number found by regex contains
"-specialisation-foo" if specialisation is used. As a result, applying
int() to gen_number raises ValueError, causing entries containing
a specialisation part not being removed.
Diffstat (limited to 'nixos/modules/system/boot/loader/systemd-boot')
-rw-r--r--nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py2
1 files changed, 1 insertions, 1 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 5398ef6b84eb8..09e5e88ee022a 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
@@ -175,7 +175,7 @@ def get_specialisations(profile: Optional[str], generation: int, _: Optional[str
 
 def remove_old_entries(gens: List[SystemIdentifier]) -> None:
     rex_profile = re.compile("^@efiSysMountPoint@/loader/entries/nixos-(.*)-generation-.*\.conf$")
-    rex_generation = re.compile("^@efiSysMountPoint@/loader/entries/nixos.*-generation-(.*)\.conf$")
+    rex_generation = re.compile("^@efiSysMountPoint@/loader/entries/nixos.*-generation-([0-9]+)(-specialisation-.*)?\.conf$")
     known_paths = []
     for gen in gens:
         known_paths.append(copy_from_profile(*gen, "kernel", True))