1 | # Busca cargadores existentes por orden de prioridad e |
---|
2 | # inicia el primero que encuentra. |
---|
3 | # Si no existe ningún cargador de arranque muestre mensaje de error. |
---|
4 | set timeout=0 |
---|
5 | |
---|
6 | # Valor si no detecto ningún sistema |
---|
7 | set label="OpenGnsys: Ningún cargador de arranque detectado." |
---|
8 | set chain="" |
---|
9 | |
---|
10 | # Compruebo si existen distintos cargadores. |
---|
11 | set root='' |
---|
12 | echo "Searching rEFInd" |
---|
13 | search --file --set root /EFI/refind/grubx64.efi |
---|
14 | if [ "$root" != "" ]; then |
---|
15 | set label="rEFInd" |
---|
16 | set chain="chainloader /EFI/refind/grubx64.efi" |
---|
17 | fi |
---|
18 | |
---|
19 | if [ "$root" == "" ]; then |
---|
20 | echo "Searching Part-01-02" |
---|
21 | search --file --set root /EFI/Part-01-02/Boot/ogloader.efi |
---|
22 | if [ "$root" != "" ]; then |
---|
23 | set label="Part-01-02" |
---|
24 | set chain="chainloader /EFI/Part-01-02/Boot/ogloader.efi" |
---|
25 | fi |
---|
26 | fi |
---|
27 | |
---|
28 | if [ "$root" == "" ]; then |
---|
29 | echo "Searching Part-01-03" |
---|
30 | search --file --set root /EFI/Part-01-03/Boot/ogloader.efi |
---|
31 | if [ "$root" != "" ]; then |
---|
32 | set label="Part-01-03" |
---|
33 | set chain="chainloader /EFI/Part-01-03/Boot/ogloader.efi" |
---|
34 | fi |
---|
35 | fi |
---|
36 | |
---|
37 | if [ "$root" == "" ]; then |
---|
38 | echo "Searching Microsoft" |
---|
39 | search --file --set root /EFI/Microsoft/Boot/bootmgfw.efi |
---|
40 | if [ "$root" != "" ]; then |
---|
41 | set label="Microsoft" |
---|
42 | set chain="chainloader /EFI/Microsoft/Boot/bootmgfw.efi" |
---|
43 | fi |
---|
44 | fi |
---|
45 | |
---|
46 | if [ "$root" == "" ]; then |
---|
47 | echo "Searching Ubuntu" |
---|
48 | search --file --set root /EFI/ubuntu/grubx64.efi |
---|
49 | if [ "$root" != "" ]; then |
---|
50 | set label="Ubuntu" |
---|
51 | set chain="chainloader /EFI/ubuntu/grubx64.efi" |
---|
52 | fi |
---|
53 | fi |
---|
54 | |
---|
55 | if [ "$root" != "" ]; then |
---|
56 | set label="OpenGnsys ha detectado: $label" |
---|
57 | else |
---|
58 | # para evitar mensajes de error. |
---|
59 | set root="(hd0,gpt1)" |
---|
60 | fi |
---|
61 | |
---|
62 | menuentry "$label" { |
---|
63 | eval "$chain" |
---|
64 | } |
---|