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

if [ "$grub_platform" = "pc" ]; then
longpanda's avatar
longpanda committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
    menuentry 'Search and boot Windows' --class=boot_windows {
    
        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
42
43
44
45
46
47
48
49
    menuentry 'Search and boot Grub4dos' --class=boot_g4d {
        if search -n -s -f /grldr; then
            ntldr /grldr
        else
            echo "Grub4dos NOT found ..."
        fi        
    }
    
    menuentry 'Boot the 1st local disk' --class=boot_disk {
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 {
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 {
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 {    
longpanda's avatar
longpanda committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
        
        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
                fi
            else
                break
            fi
            vt_incr partid 1
        done
                
longpanda's avatar
longpanda committed
86
87
88
89
90
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
        else
            echo "Windows NOT found ..."
        fi        
    }
    
longpanda's avatar
longpanda committed
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
    if [ "$grub_cpu" = "i386" ]; then
        menuentry 'Search and boot BOOTIA32.EFI' --class=boot_uefi {
            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        
        }
    elif [ "$grub_cpu" = "arm64" ]; then
        menuentry 'Search and boot BOOTAA64.EFI' --class=boot_uefi {
            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
        menuentry 'Search and boot BOOTX64.EFI' --class=boot_uefi {
            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        
        }
    fi
    
    
longpanda's avatar
longpanda committed
137
138
139

fi

longpanda's avatar
longpanda committed
140
menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
longpanda's avatar
longpanda committed
141
142
    echo 'Return ...'
}