summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrina Gómez <irinagomez@us.es>2019-10-29 14:06:31 +0100
committerIrina Gómez <irinagomez@us.es>2019-10-29 14:06:31 +0100
commitd0bf22a973a01ce2baa6e2beba9ed664f646ebbd (patch)
treeed11f962c5955e25f9589f32d35d47ded8413c2b
parent25bb3d131a96fee5ffb41017de7f4de87a65004c (diff)
#802 #890 ogGrubInstallMbr: Adds NVRAM entry for grub and place it in second order.
-rwxr-xr-xclient/engine/Boot.lib8
1 files changed, 7 insertions, 1 deletions
diff --git a/client/engine/Boot.lib b/client/engine/Boot.lib
index e6a07bc5..1937051c 100755
--- a/client/engine/Boot.lib
+++ b/client/engine/Boot.lib
@@ -784,7 +784,7 @@ function ogGrubInstallMbr ()
# Variables locales.
local PART DISK VERSION FIRSTAGE SECONSTAGE CHECKOS KERNELPARAM BACKUPNAME
-local EFIDISK EFIPART EFISECONDSTAGE EFISUBDIR EFIOPTGRUB
+local EFIDISK EFIPART EFISECONDSTAGE EFISUBDIR EFIOPTGRUB GRUBENTRY NEWORDER
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
@@ -893,6 +893,12 @@ if ogIsEfiActive; then
cp /usr/lib/shim/shimx64.efi.signed ${EFISECONDSTAGE}/EFI/$EFISUBDIR/Boot/shimx64.efi
# Nombre OpenGnsys para cargador
cp ${EFISECONDSTAGE}/EFI/$EFISUBDIR/Boot/{grubx64.efi,ogloader.efi}
+
+ # Creamos entrada NVRAM y la ponemos en segundo lugar
+ ogNvramAddEntry grub /EFI/grub/Boot/shimx64.efi
+ GRUBENTRY=$(ogNvramList| awk '/grub/ {print $1}')
+ NEWORDER="$(ogNvramGetOrder|awk -v ENTRY=$GRUBENTRY '{gsub(",", " "); printf "%x %x %s\n", $1 , ENTRY , substr($0, index($0,$2))}')"
+ ogNvramSetOrder $NEWORDER
fi
return $EVAL