summaryrefslogtreecommitdiffstats
path: root/client/engine/Boot.lib
diff options
context:
space:
mode:
authorIrina Gómez <irinagomez@us.es>2019-04-25 11:22:44 +0200
committerIrina Gómez <irinagomez@us.es>2019-04-25 11:22:44 +0200
commitb0a7050136d336391db2f38718e3f34f4ab9a99f (patch)
tree15bbcac8ca792604897ff2dddcf9c5aa13ec4c71 /client/engine/Boot.lib
parent528ff4ca943d3f439d18d6d467c699329bece768 (diff)
#802 #888 If UEFI active, always installs rEFInd and sets it as bootloader (NVRAM) second entry. New Nvram management functions: Add new entry, get and set de next boot entry.
Diffstat (limited to 'client/engine/Boot.lib')
-rwxr-xr-xclient/engine/Boot.lib6
1 files changed, 6 insertions, 0 deletions
diff --git a/client/engine/Boot.lib b/client/engine/Boot.lib
index 3e573acb..47a3ee33 100755
--- a/client/engine/Boot.lib
+++ b/client/engine/Boot.lib
@@ -2717,6 +2717,12 @@ else
[ -d $REFINDDIR ] || ogRaiseError $OG_ERR_NOTFOUND "refind-install or $REFINDDIR" || return $?
cp -r $REFINDDIR $EFIDIR
fi
+# Creamos entrada en NVRAM
+ogNvramAddEntry refind /EFI/refind/grubx64.efi
+# La ponemos en el segundo lugar del orden de arranque
+NUMENTRY=$(efibootmgr |awk '{ if ($2=="refind") print substr($1,5,4)}')
+NEWORDER="$(ogNvramGetOrder|awk -v NEW="$NUNENTRY" '{ gsub(",", " "); printf "%x %x %s\n", $1 ,NEW, substr($0, index($0,$2)) }')"
+ogNvramSetOrder $NEWORDER
# Para la configuración del ogLive
ogMountCache &>/dev/null