summaryrefslogtreecommitdiffstats
path: root/server/tftpboot
diff options
context:
space:
mode:
authorIrina Gómez <irinagomez@us.es>2019-10-11 11:01:08 +0200
committerIrina Gómez <irinagomez@us.es>2019-10-11 11:01:08 +0200
commit7e4b9e054204de7a5891c88490c9b472b1c18c0b (patch)
treed717fdf20d8fbce6c656cd3d408aa8df2173be60 /server/tftpboot
parent0fd42f40c79d9389a2180a13d7718c1fc11ed025 (diff)
#802 #888 PXE template for new computers '00unknown' displays a boot menu with ogLive and the other boot loaders finded.
Diffstat (limited to 'server/tftpboot')
-rw-r--r--server/tftpboot/grub/default6
-rw-r--r--server/tftpboot/grub/templates/00unknown77
2 files changed, 56 insertions, 27 deletions
diff --git a/server/tftpboot/grub/default b/server/tftpboot/grub/default
index 6c505de6..e5c74035 100644
--- a/server/tftpboot/grub/default
+++ b/server/tftpboot/grub/default
@@ -1,5 +1,5 @@
-# Busca cargadores existentes por orden de prioridad e
-# inicia el primero que encuentra.
+# Busca cargadores existentes por orden de prioridad y
+# muestra menú con las opciones.
# Si no existe ningún cargador de arranque muestre mensaje de error.
set timeout=5
@@ -56,7 +56,7 @@ if [ "$rootUb" != "" ]; then
fi
-# Si no hay ningún sistam operativo muestro mensaje.
+# Si no hay ningún sistema operativo muestro mensaje.
if [ $detectado == 'no' ]; then
menuentry "OpenGnsys no ha detectado ningún sistema operativo" {
# para evitar mensajes de error.
diff --git a/server/tftpboot/grub/templates/00unknown b/server/tftpboot/grub/templates/00unknown
index 3352a965..628cddba 100644
--- a/server/tftpboot/grub/templates/00unknown
+++ b/server/tftpboot/grub/templates/00unknown
@@ -1,30 +1,59 @@
##NO-TOCAR-ESTA-LINEA Sin-designar
-set default="0"
-set timeout="30"
+#
+# Arranque por defecto en OpenGnsys
+# Busca cargadores existentes por orden de prioridad y
+# muestra menú con las opciones
+set default=0
menuentry 'ogLive' {
-set ISODIR=ogLive
-linux (tftp)/$ISODIR/ogvmlinuz ro boot=oginit quiet splash vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=false ogdebug=false ogtmpfs=15 oglivedir=$ISODIR INFOHOST
-initrd (tftp)/$ISODIR/oginitrd.img
-boot
-}
-menuentry 'ReFind' {
- root='hd0,gpt1'
- chainloader /EFI/refind/shimx64.efi
- boot
-}
-menuentry 'Part-01-02' {
- root='hd0,gpt1'
- chainloader /EFI/Part-01-02/Boot/ogloader.efi
+ set ISODIR=ogLive
+ linux (tftp)/$ISODIR/ogvmlinuz ro boot=oginit quiet splash vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=false ogdebug=false ogtmpfs=15 oglivedir=$ISODIR INFOHOST
+ initrd (tftp)/$ISODIR/oginitrd.img
boot
}
-menuentry 'Windows' {
- root='hd0,gpt1'
- chainloader /EFI/Microsoft/Boot/bootmgfw.efi
- boot
-}
-menuentry 'Ubuntu' {
- root='hd0,gpt1'
- chainloader /EFI/ubuntu/grubx64.efi
- boot
+
+# Compruebo si existen distintos cargadores.
+echo "Searching rEFInd"
+search --file --set rootRefind /EFI/refind/shimx64.efi.signed
+if [ "$rootRefind" != "" ]; then
+ menuentry "rEFInd" {
+ root="$rootRefind"
+ chainloader /EFI/refind/shimx64.efi.signed
}
+fi
+
+echo "Searching Part-01-02"
+search --file --set rootP2 /EFI/Part-01-02/Boot/ogloader.efi
+if [ "$rootP2" != "" ]; then
+ menuentry "Part-01-02" {
+ root="$rootP2"
+ chainloader /EFI/Part-01-02/Boot/ogloader.efi
+ }
+fi
+
+echo "Searching Part-01-03"
+search --file --set rootP3 /EFI/Part-01-03/Boot/ogloader.efi
+if [ "$rootP3" != "" ]; then
+ menuentry "Part-01-03" {
+ root="$rootP3"
+ chainloader /EFI/Part-01-03/Boot/ogloader.efi
+ }
+fi
+
+echo "Searching Microsoft"
+search --file --set rootMS /EFI/Microsoft/Boot/bootmgfw.efi
+if [ "$rootMS" != "" ]; then
+ menuentry "Microsoft" {
+ root="$rootMS"
+ chainloader /EFI/Microsoft/Boot/bootmgfw.efi
+ }
+fi
+
+echo "Searching Ubuntu"
+search --file --set rootUb /EFI/ubuntu/grubx64.efi
+if [ "$rootUb" != "" ]; then
+ menuentry "Ubuntu"
+ root="$rootUb"
+ chainloader /EFI/ubuntu/grubx64.efi
+ }
+fi