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