Remove and re-add each boot variable
authorJacek Konieczny <jajcus@jajcus.net>
Thu, 24 Oct 2013 16:08:19 +0000 (18:08 +0200)
committerJacek Konieczny <jajcus@jajcus.net>
Thu, 24 Oct 2013 16:09:45 +0000 (18:09 +0200)
efibootmgr --bootnum does not work as advertised – it doesn't
modify boot variable.

efi-boot-update

index af62b68..2e55aa9 100755 (executable)
@@ -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"
 }
 
This page took 0.235753 seconds and 4 git commands to generate.