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