nixos/systemd-boot-builder: remove old devicetree files

I just stumbled across this during code inspection. I haven't tested
this at all.
This commit is contained in:
Jeremy Fleischman
2025-09-02 15:46:11 +01:00
parent 7e2191d43f
commit 683d9e3b54

View File

@@ -258,6 +258,8 @@ def remove_old_entries(gens: list[SystemIdentifier]) -> None:
bootspec = get_bootspec(gen.profile, gen.generation)
known_paths.append(copy_from_file(bootspec.kernel, True).name)
known_paths.append(copy_from_file(bootspec.initrd, True).name)
if bootspec.devicetree is not None:
known_paths.append(copy_from_file(bootspec.devicetree, True).name)
for path in (BOOT_MOUNT_POINT / "loader/entries").glob("nixos*-generation-[1-9]*.conf", case_sensitive=False):
if rex_profile.match(path.name):
prof = rex_profile.sub(r"\1", path.name)