Skip to content

Commit 95030d7

Browse files
programmerlexiJohnRTitor
authored andcommitted
nixos/limine: don't modify boot order on bootloader update
1 parent fa9ba60 commit 95030d7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

nixos/modules/system/boot/loader/limine/limine-install.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,16 @@ def main():
388388
efibootmgr = os.path.join(config('efiBootMgrPath'), 'bin', 'efibootmgr')
389389
efi_partition = find_mounted_device(config('efiMountPoint'))
390390
efi_disk = find_disk_device(efi_partition)
391+
392+
efibootmgr_output = subprocess.check_output([efibootmgr], stderr=subprocess.STDOUT, universal_newlines=True)
393+
create_flag = '-c'
394+
# Check the output of `efibootmgr` to find if limine is already installed and present in the boot record
395+
if matches := re.findall(r'Boot[0-9a-fA-F]{4}\*? Limine', efibootmgr_output):
396+
create_flag = '-C' # if present, keep the same boot order
397+
391398
efibootmgr_output = subprocess.check_output([
392399
efibootmgr,
393-
'-c',
400+
create_flag,
394401
'-d', efi_disk,
395402
'-p', efi_partition.removeprefix(efi_disk).removeprefix('p'),
396403
'-l', f'\\efi\\limine\\{boot_file}',

0 commit comments

Comments
 (0)