From cd8795e20fd0dd28221a418b33a1ce12765533cc Mon Sep 17 00:00:00 2001 From: Jacek Konieczny Date: Thu, 24 Oct 2013 18:08:19 +0200 Subject: [PATCH] Remove and re-add each boot variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit efibootmgr --bootnum does not work as advertised – it doesn't modify boot variable. --- efi-boot-update | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/efi-boot-update b/efi-boot-update index af62b68..2e55aa9 100755 --- a/efi-boot-update +++ b/efi-boot-update @@ -143,13 +143,13 @@ add_bootmgr_entry () { binary="$(echo -nE "$binary"|sed -e's;/;\\;g')" if [ -n "$bootnum" ] ; then - verbose_cmd $EFIBOOTMGR $EFIBOOTMGR_OPTS --quiet \ - --bootnum "$bootnum" --loader "$binary" -u "$args" - else - verbose_cmd $EFIBOOTMGR $EFIBOOTMGR_OPTS --create \ - --quiet --label "$label" --loader "$binary" -u "$args" - bootnum="$(find_bootmgr_entry "$label")" + # efibootmgr doesn't seem to update the arguments + # we need to remove old entry and create a new one + verbose_cmd $EFIBOOTMGR $EFIBOOTMGR_OPTS --quiet --delete-bootnum -b "$bootnum" fi + verbose_cmd $EFIBOOTMGR $EFIBOOTMGR_OPTS --create \ + --quiet --label "$label" --loader "$binary" -u "$args" + bootnum="$(find_bootmgr_entry "$label")" echo -n "$bootnum" } -- 2.43.0