Skip to content

Commit

Permalink
Fix traceback when removing ZFSBootMenu entry
Browse files Browse the repository at this point in the history
  • Loading branch information
pkgdemon committed Jan 14, 2024
1 parent 0fa5373 commit 8544b60
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions installer/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ def cleanup():
for entry in entries:
existing_entry = subprocess.check_output(["efibootmgr"]).decode()
if entry in existing_entry:
# Remove the existing entries before creating a new one
entry_number = existing_entry.split()[0].replace("Boot", "").replace("*", "")
# Find the entry number in the output
entry_number_start = existing_entry.find("Boot")
entry_number_end = existing_entry.find("*", entry_number_start)
entry_number = existing_entry[entry_number_start:entry_number_end].replace("Boot", "").strip()
# Remove the existing entry
subprocess.run(["efibootmgr", "-Bb", entry_number], check=True)

# Make MNT directory if it does not exist
Expand Down

0 comments on commit 8544b60

Please sign in to comment.