From 8544b604d91525a3be14b4750156ad49ebcd1baa Mon Sep 17 00:00:00 2001 From: pkgdemon Date: Sat, 13 Jan 2024 23:09:40 -0500 Subject: [PATCH] Fix traceback when removing ZFSBootMenu entry --- installer/backend.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/installer/backend.py b/installer/backend.py index 35fba96..734da6a 100755 --- a/installer/backend.py +++ b/installer/backend.py @@ -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