Merge remote-tracking branch 'origin/github/pr/133'
[grml-live.git] / templates / boot / grub / addons.cfg
1 submenu "Addons ->" --class=submenu {
2
3 # EFI:
4 if [ "${grub_platform}" == "efi" ] ; then
5   # try to detect amd64 by checking whether CPU supports 64-bit (long) mode
6   if cpuid -l ; then
7     if test -e /boot/addons/memtest86+x64.efi ; then
8       menuentry "Memory test (memtest86+x64.efi)" {
9         linuxefi /boot/addons/memtest86+x64.efi
10       }
11     fi
12   else # assume i386
13     if test -e /boot/addons/memtest86+x32.efi ; then
14       menuentry "Memory test (memtest86+x32.efi)" {
15         linuxefi /boot/addons/memtest86+x32.efi
16       }
17     fi
18   fi
19 fi
20
21 # BIOS/non-EFI:
22 if [ "${grub_platform}" != "efi" ] ; then
23   # try to detect amd64 by checking whether CPU supports 64-bit (long) mode
24   if cpuid -l ; then
25     if test -e /boot/addons/memtest86+x64.bin ; then
26       menuentry "Memory test (memtest86+x64.bin)" {
27         insmod linux16
28         linux16 /boot/addons/memtest86+x64.bin
29       }
30     elif test -e /boot/addons/memtest ; then # fallback to old memtest
31       menuentry "Memory test (memtest86+)" {
32         insmod linux16
33         linux16 /boot/addons/memtest
34       }
35     fi
36   else  # assume i386
37     if test -e /boot/addons/memtest86+x32.bin ; then
38       menuentry "Memory test (memtest86+x32.bin)" {
39         insmod linux16
40         linux16 /boot/addons/memtest86+x32.bin
41       }
42     elif test -e /boot/addons/memtest ; then # fallback to old memtest
43       menuentry "Memory test (memtest86+)" {
44         insmod linux16
45         linux16 /boot/addons/memtest
46       }
47     fi
48   fi
49 fi
50
51 menuentry "iPXE - boot via network/PXE" {
52     if [ "${grub_platform}" == "efi" ] ; then
53         chainloader /boot/addons/ipxe.efi
54     else
55         insmod linux16
56         linux16 /boot/addons/ipxe.lkrn
57     fi
58 }
59
60 menuentry "Netboot.xyz" {
61     if [ "${grub_platform}" == "efi" ] ; then
62         chainloader /boot/addons/netboot.xyz.efi
63     else
64         insmod linux16
65         linux16 /boot/addons/netboot.xyz.lkrn
66     fi
67 }
68
69 if [ "${grub_platform}" != "efi" ] ; then
70     menuentry "Netboot.xyz" {
71         insmod linux16
72         linux16 /boot/addons/netboot.xyz.lkrn
73     }
74
75     menuentry "GRUB - all in one image" {
76         insmod linux16
77         linux16  /boot/addons/memdisk
78         initrd16 /boot/addons/allinone.img
79     }
80
81     menuentry "FreeDOS" {
82         insmod linux16
83         linux16  /boot/addons/memdisk
84         initrd16 /boot/addons/balder10.imz
85     }
86
87     if [ ${iso_path} ] ; then
88         # assume loopback.cfg boot
89         menuentry "MirOS bsd4grml (via loopback)" {
90             multiboot   /boot/addons/bsd4grml/ldbsd.com
91             module      /boot/addons/bsd4grml/bsd.rd bsd
92             module      /boot/addons/bsd4grml/loopback.0 boot.cfg
93             module      /boot/addons/bsd4grml/loopback.1 boot.1
94             module      /boot/addons/bsd4grml/loopback.2 boot.2
95             module      /boot/addons/bsd4grml/loopback.3 boot.3
96             module      /boot/addons/bsd4grml/loopback.4 boot.4
97             module      /boot/addons/bsd4grml/loopback.5 boot.5
98             module      /boot/addons/bsd4grml/loopback.6 boot.6
99         }
100     else
101         # assume grub.cfg boot
102         menuentry "MirOS bsd4grml (regular method)" {
103             multiboot   /boot/addons/bsd4grml/ldbsd.com
104         }
105
106         menuentry "MirOS bsd4grml (fallback method)" {
107             multiboot   /boot/addons/bsd4grml/ldbsd.com
108             module      /boot/addons/bsd4grml/bsd.rd bsd.rd
109             module      /boot/addons/bsd4grml/boot.1 boot.1
110             module      /boot/addons/bsd4grml/boot.2 boot.2
111             module      /boot/addons/bsd4grml/boot.3 boot.3
112             module      /boot/addons/bsd4grml/boot.4 boot.4
113             module      /boot/addons/bsd4grml/boot.5 boot.5
114             module      /boot/addons/bsd4grml/boot.6 boot.6
115             module      /boot/addons/bsd4grml/boot.cfg boot.cfg
116             module      /boot/grub/grub.img grub.img
117         }
118     fi # iso_path
119 fi # efi mode
120 }
121
122 if [ "${grub_platform}" == "efi" ] ; then
123 menuentry "UEFI Firmware Settings" {
124     fwsetup
125 }
126 fi # efi mode
127
128 menuentry "Boot from next device" {
129     exit
130 }