Skip to content

Commit

Permalink
blspec.py: clean-up type 2 (uki) also if no type 1 directory present
Browse files Browse the repository at this point in the history
On systems without systemd-boot we might still install and boot UKIs,
with e.g. refind, or directly from firmware. On such systems the 'loader'
directory (bls type 1) won't be present. Instead we only have the
ESP/EFI/Linux directory (bls type 2), which we still want to clean-up.

Signed-off-by: Andrew Ammerlaan <[email protected]>
  • Loading branch information
Nowa-Ammerlaan committed Apr 8, 2024
1 parent 5a840b6 commit 9b47e19
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ecleankernel/layout/blspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ def __init__(self,
raise LayoutNotFound("/etc/machine-id not found")

for d in self.potential_dirs:
# Present if type 1
bootloaderdir = root / d / "loader"
if bootloaderdir.is_dir():
# Present if type 2
ukidir = root / d / "EFI" / "Linux"
if bootloaderdir.is_dir() or ukidir.is_dir():
# Type 1 entries (linux+initrd) are in
# $BOOT/ENTRY-TOKEN/KERNEL-VERSION/
self.blsdir = root / d / self.kernel_id
# Type 2 entries (uki's) are in
# $BOOT/EFI/Linux/ENTRY-TOKEN-KERNEL-VERSION.efi
self.ukidir = root / d / "EFI" / "Linux"
self.ukidir = ukidir
return
else:
raise LayoutNotFound("/boot/[EFI/]loader not found")
Expand Down

0 comments on commit 9b47e19

Please sign in to comment.