source: server/tftpboot/grub/default @ 5d05b06

Last change on this file since 5d05b06 was f6ab049, checked in by Irina Gómez <irinagomez@…>, 5 years ago

#802 #888 PXE default template for UEFI shows a menu with operating system loaders. Searchs grub, rEFInd, operating system restored with OpenGnsys, windows and Ubuntu.

  • Property mode set to 100644
File size: 1.9 KB
Line 
1# Busca cargadores existentes por orden de prioridad y
2#    muestra menú con las opciones.
3# Si no existe ningún cargador de arranque muestre mensaje de error.
4set timeout=30
5
6set detectado='no'
7# Compruebo si existen distintos cargadores.
8echo "Searching Grub"
9search --file --set rootGrub /EFI/grub/Boot/grubx64.efi
10if [ "$rootGrub" != "" ]; then
11    set detectado='si'
12    menuentry "Grub" {
13        root="$rootGrub"
14        chainloader /EFI/grub/Boot/grubx64.efi
15}
16fi
17
18echo "Searching rEFInd"
19search --file --set rootRefind /EFI/refind/shimx64.efi.signed
20if [ "$rootRefind" != "" ]; then
21    menuentry "rEFInd" {
22        root="$rootRefind"
23        chainloader /EFI/refind/shimx64.efi.signed
24}
25fi
26
27echo "Searching Part-01-02"
28search --file --set rootP2 /EFI/Part-01-02/Boot/ogloader.efi
29if [ "$rootP2" != "" ]; then
30    set detectado='si'
31    menuentry "Part-01-02" {
32        root="$rootP2"
33        chainloader /EFI/Part-01-02/Boot/ogloader.efi
34    }
35fi
36
37echo "Searching Part-01-03"
38search --file --set rootP3 /EFI/Part-01-03/Boot/ogloader.efi
39if [ "$rootP3" != "" ]; then
40    set detectado='si'
41    menuentry "Part-01-03" {
42        root="$rootP3"
43        chainloader /EFI/Part-01-03/Boot/ogloader.efi
44    }
45fi
46
47echo "Searching Microsoft"
48search --file --set rootMS /EFI/Microsoft/Boot/bootmgfw.efi
49if [ "$rootMS" != "" ]; then
50    set detectado='si'
51    menuentry "Microsoft" {
52        root="$rootMS"
53        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
54    }
55fi
56
57echo "Searching Ubuntu"
58search --file --set rootUb /EFI/ubuntu/grubx64.efi
59if [ "$rootUb" != "" ]; then
60    set detectado='si'
61    menuentry "Ubuntu"
62        root="$rootUb"
63        chainloader /EFI/ubuntu/grubx64.efi
64    }
65fi
66
67
68# Si no hay ningún sistema operativo muestro mensaje.
69if [ $detectado == 'no' ]; then
70    menuentry "OpenGnsys no ha detectado ningún sistema operativo" {
71        # para evitar mensajes de error.
72        set root="(hd0,gpt1)"
73    }
74fi
Note: See TracBrowser for help on using the repository browser.