localboot.cfg 6.08 KB
Newer Older
longpanda's avatar
longpanda committed
1
2

if [ "$grub_platform" = "pc" ]; then
longpanda's avatar
longpanda committed
3
    menuentry 'Search and boot Windows' --class=boot_windows --class=F4boot {
longpanda's avatar
longpanda committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
    
        set partid=3
        while [ $partid -le 128 ]; do
            if vt_check_part_exist $partid; then
                for bt in bootmgr BOOTMGR Bootmgr BootMGR; do
                    if [ -f ($vtoydev,$partid)/$bt ]; then
                        set root=($vtoydev,$partid)
                        ntldr /$bt
                        boot
                    fi
                done
            else
                break
            fi
            vt_incr partid 1
        done
    
        if search -n -s -f /Boot/BCD; then
            for bt in bootmgr BOOTMGR Bootmgr BootMGR; do
                if [ -f /$bt ]; then
longpanda's avatar
longpanda committed
24
25
26
27
28
29
                    if regexp '^hd0' $root; then
                        ntldr /$bt
                    else
                        drivemap -s hd0 $root
                        ntldr /$bt
                    fi
longpanda's avatar
longpanda committed
30
31
32
33
34
35
                    break
                fi
            done
        elif search -n -s -f /NTDETECT.COM; then
            drivemap -s hd0 $root
            ntldr /ntldr
longpanda's avatar
longpanda committed
36
37
38
39
40
        else
            echo "Windows NOT found ..."
        fi        
    }
    
longpanda's avatar
longpanda committed
41
    menuentry 'Search and boot Grub4dos' --class=boot_g4d --class=F4boot {
longpanda's avatar
longpanda committed
42
43
44
45
46
47
48
        if search -n -s -f /grldr; then
            ntldr /grldr
        else
            echo "Grub4dos NOT found ..."
        fi        
    }
    
longpanda's avatar
longpanda committed
49
    menuentry 'Boot the 1st local disk' --class=boot_disk --class=F4boot {
longpanda's avatar
longpanda committed
50
51
52
53
54
        set root=(hd0,1)
        chainloader +1
        boot
    }
    
longpanda's avatar
longpanda committed
55
    menuentry 'Boot the 2nd local disk' --class=boot_disk --class=F4boot {
longpanda's avatar
longpanda committed
56
57
58
59
60
        set root=(hd1,1)
        chainloader +1
        boot
    }
    
longpanda's avatar
longpanda committed
61
    menuentry 'Boot the 3rd local disk' --class=boot_disk --class=F4boot {
longpanda's avatar
longpanda committed
62
63
64
65
66
67
68
        set root=(hd2,1)
        chainloader +1
        boot
    }
    
else

longpanda's avatar
longpanda committed
69
    menuentry 'Search and boot Windows' --class=boot_windows --class=F4boot {    
longpanda's avatar
longpanda committed
70
71
72
73
74
75
76
77
78
        
        set partid=3
        while [ $partid -le 128 ]; do
            if vt_check_part_exist $partid; then
                if [ -f ($vtoydev,$partid)/EFI/Microsoft/Boot/bootmgfw.efi ]; then
                    set root=($vtoydev,$partid)
                    terminal_output  console
                    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
                    boot
79
80
81
82
83
                elif [ -f ($vtoydev,$partid)/efi/Microsoft/Boot/bootmgfw.efi ]; then
                    set root=($vtoydev,$partid)
                    terminal_output  console
                    chainloader /efi/Microsoft/Boot/bootmgfw.efi
                    boot
longpanda's avatar
longpanda committed
84
85
86
87
88
89
90
                fi
            else
                break
            fi
            vt_incr partid 1
        done
                
longpanda's avatar
longpanda committed
91
92
93
94
        if search -n -s -f /EFI/Microsoft/Boot/bootmgfw.efi; then
            terminal_output  console
            chainloader /EFI/Microsoft/Boot/bootmgfw.efi
            boot
95
96
97
98
        elif search -n -s -f /efi/Microsoft/Boot/bootmgfw.efi; then
            terminal_output  console
            chainloader /efi/Microsoft/Boot/bootmgfw.efi
            boot
longpanda's avatar
longpanda committed
99
100
101
102
103
        else
            echo "Windows NOT found ..."
        fi        
    }
    
longpanda's avatar
longpanda committed
104
    if [ "$grub_cpu" = "i386" ]; then
longpanda's avatar
longpanda committed
105
        menuentry 'Search and boot BOOTIA32.EFI' --class=boot_uefi --class=F4boot {
longpanda's avatar
longpanda committed
106
107
108
109
110
111
112
113
114
115
116
            set VTOY_SEARCH_NO_VTOYEFI=1
            if search -n -s -f /efi/boot/bootia32.efi; then
                unset VTOY_SEARCH_NO_VTOYEFI
                terminal_output  console
                chainloader /efi/boot/bootia32.efi
                boot
            else
                unset VTOY_SEARCH_NO_VTOYEFI
                echo "BOOTIA32.EFI NOT found ..."
            fi        
        }
longpanda's avatar
longpanda committed
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
        
        menuentry 'Search and boot xorboot' --class=boot_xorboot --class=F4boot {
            set VTOY_SEARCH_NO_VTOYEFI=1
            if search -n -s -f /efi/xorboot/xorboot32.xor; then
                unset VTOY_SEARCH_NO_VTOYEFI
                terminal_output  console
                if [ -f /efi/xorboot/bootia32.efi ]; then
                    chainloader /efi/xorboot/bootia32.efi
                elif [ -f /efi/xorboot/xorboot.efi ]; then
                    chainloader /efi/xorboot/xorboot.efi
                fi
                boot
            else
                unset VTOY_SEARCH_NO_VTOYEFI
                echo "xorboot NOT found ..."
            fi        
        }
longpanda's avatar
longpanda committed
134
    elif [ "$grub_cpu" = "arm64" ]; then
longpanda's avatar
longpanda committed
135
        menuentry 'Search and boot BOOTAA64.EFI' --class=boot_uefi --class=F4boot {
longpanda's avatar
longpanda committed
136
137
138
139
140
141
142
143
144
145
146
147
            set VTOY_SEARCH_NO_VTOYEFI=1
            if search -n -s -f /efi/boot/bootaa64.efi; then
                unset VTOY_SEARCH_NO_VTOYEFI
                terminal_output  console
                chainloader /efi/boot/bootaa64.efi
                boot
            else
                unset VTOY_SEARCH_NO_VTOYEFI
                echo "BOOTAA64.EFI NOT found ..."
            fi        
        }
    else
longpanda's avatar
longpanda committed
148
        menuentry 'Search and boot BOOTX64.EFI' --class=boot_uefi --class=F4boot {
longpanda's avatar
longpanda committed
149
150
151
152
153
154
155
156
157
158
159
            set VTOY_SEARCH_NO_VTOYEFI=1
            if search -n -s -f /efi/boot/bootx64.efi; then
                unset VTOY_SEARCH_NO_VTOYEFI
                terminal_output  console
                chainloader /efi/boot/bootx64.efi
                boot
            else
                unset VTOY_SEARCH_NO_VTOYEFI
                echo "BOOTX64.EFI NOT found ..."
            fi        
        }
longpanda's avatar
longpanda committed
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

        menuentry 'Search and boot xorboot' --class=boot_xorboot --class=F4boot {
            set VTOY_SEARCH_NO_VTOYEFI=1
            if search -n -s -f /efi/xorboot/xorboot.xor; then
                unset VTOY_SEARCH_NO_VTOYEFI
                terminal_output  console
                if [ -f /efi/xorboot/bootx64.efi ]; then
                    chainloader /efi/xorboot/bootx64.efi
                elif [ -f /efi/xorboot/xorboot.efi ]; then
                    chainloader /efi/xorboot/xorboot.efi
                fi
                boot
            else
                unset VTOY_SEARCH_NO_VTOYEFI
                echo "xorboot NOT found ..."
            fi        
        }
longpanda's avatar
longpanda committed
177
178
    fi
    
longpanda's avatar
longpanda committed
179
180
181

fi

longpanda's avatar
longpanda committed
182
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
longpanda's avatar
longpanda committed
183
184
    echo 'Return ...'
}