flowy: avoid invoking no-op efibootmgr operations
This commit is contained in:
@@ -45,11 +45,12 @@
|
|||||||
bootCurrent=''${bootCurrent/BootCurrent: /}
|
bootCurrent=''${bootCurrent/BootCurrent: /}
|
||||||
bootOrder=$(echo "$efi" | grep '^BootOrder: ')
|
bootOrder=$(echo "$efi" | grep '^BootOrder: ')
|
||||||
bootOrder=''${bootOrder/BootOrder: /}
|
bootOrder=''${bootOrder/BootOrder: /}
|
||||||
# prepend the current boot entry to the boot order...
|
if ! [[ "$bootOrder" =~ ^"$bootCurrent", ]]; then
|
||||||
newBootOrder="$bootCurrent,$bootOrder"
|
# booted entry was not the default,
|
||||||
# but in a way that's idempotent :)
|
# so prepend it to the boot order:
|
||||||
newBootOrder=''${newBootOrder/$bootCurrent,$bootCurrent/$bootCurrent}
|
newBootOrder="$bootCurrent,$bootOrder"
|
||||||
(set -x; efibootmgr -o "$newBootOrder")
|
(set -x; efibootmgr -o "$newBootOrder")
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in lib.getExe makeDefaultBootEntry;
|
in lib.getExe makeDefaultBootEntry;
|
||||||
|
Reference in New Issue
Block a user