[1874ce9] | 1 | ##NO-TOCAR-ESTA-LINEA Sin-designar |
---|
[7e4b9e0] | 2 | # |
---|
| 3 | # Arranque por defecto en OpenGnsys |
---|
| 4 | # Busca cargadores existentes por orden de prioridad y |
---|
| 5 | # muestra menú con las opciones |
---|
[f6ab049] | 6 | # Si no existe ningún cargador de arranque muestra mensaje de error. |
---|
| 7 | set timeout=30 |
---|
[1874ce9] | 8 | |
---|
[f6ab049] | 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 |
---|
[1874ce9] | 18 | } |
---|
[f6ab049] | 19 | fi |
---|
[7e4b9e0] | 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 |
---|
[1874ce9] | 27 | } |
---|
[7e4b9e0] | 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 |
---|
[f6ab049] | 33 | set detectado='si' |
---|
[7e4b9e0] | 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 |
---|
[f6ab049] | 43 | set detectado='si' |
---|
[7e4b9e0] | 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 |
---|
[f6ab049] | 53 | set detectado='si' |
---|
[7e4b9e0] | 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 |
---|
[f6ab049] | 63 | set detectado='si' |
---|
[7e4b9e0] | 64 | menuentry "Ubuntu" |
---|
| 65 | root="$rootUb" |
---|
| 66 | chainloader /EFI/ubuntu/grubx64.efi |
---|
| 67 | } |
---|
| 68 | fi |
---|
[f6ab049] | 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 |
---|