b378aab5417efafe1dd6202c4a733a862d7a8f3e
[grml-live.git] / templates / secureboot / grub.cfg
1 set grml_orig_prefix=$prefix
2 export grml_orig_prefix
3 set grml_orig_root=$root
4 export grml_orig_root
5
6 set prefix=(hd0)/boot/grub/
7 set root=(hd0)
8 source (hd0)/boot/grub/grmlenv.cfg
9 set prefix=(hd0)/boot/grub/
10
11 if [ "$grml_secureboot" = false ] ; then
12   set root=(hd0)
13   configfile /boot/grub/grub.cfg
14 else
15   set prefix=$grml_orig_prefix
16   set root=$grml_orig_root
17
18   set timeout=20
19   set root=(hd0)
20
21   # this is basically a copy of templates/boot/grub/header.cfg but to avoid
22   # failures due to Secure Boot restrictions and sourcing addons.cfg via
23   # /boot/grub/loopback.cfg (and then showing entries that are at the wrong
24   # position as well as don't work at all) we have to specify the appropriate
25   # config here
26   if loadfont /boot/grub/ascii.pf2 ; then
27     set gfxmode=auto
28     insmod efi_gop
29     insmod efi_uga
30     insmod gfxterm
31     insmod png
32     # this is forbidden to be loaded under Secure Boot:
33     #insmod vbe
34     terminal_output gfxterm
35   fi
36
37   if [ -f /boot/grub/%GRML_NAME%-theme/theme.txt ] ; then
38     set theme=/boot/grub/%GRML_NAME%-theme/theme.txt
39     export theme
40   elif [ -f /boot/grub/grml-theme/theme.txt ] ; then
41     set theme=/boot/grub/grml-theme/theme.txt
42     export theme
43   else
44     set menu_color_normal=white/black
45     set menu_color_highlight=black/light-gray
46     set color_normal=white/black
47   fi
48
49   menuentry "Boot %GRML_NAME% in normal mode (release %VERSION%, Secure Boot enabled)" {
50       set gfxpayload=keep
51       echo 'Loading kernel...'
52       linux   /boot/%SHORT_NAME%/vmlinuz apm=power-off boot=live live-media-path=/live/%GRML_NAME%/ bootid=%BOOTID% "${loopback}" "${kernelopts}" nomce net.ifnames=0 
53       echo 'Loading initrd...'
54       initrd  /boot/%SHORT_NAME%/initrd.img
55   }
56
57   menuentry "Boot %GRML_NAME% - enable persistency" {
58       set gfxpayload=keep
59       echo 'Loading kernel...'
60       linux   /boot/%SHORT_NAME%/vmlinuz apm=power-off boot=live live-media-path=/live/%GRML_NAME%/ bootid=%BOOTID% "${loopback}" "${kernelopts}" nomce net.ifnames=0 persistence 
61       echo 'Loading initrd...'
62       initrd  /boot/%SHORT_NAME%/initrd.img
63   }
64
65   menuentry "Boot %GRML_NAME% - copy %GRML_NAME% to RAM" {
66       set gfxpayload=keep
67       echo 'Loading kernel...'
68       linux   /boot/%SHORT_NAME%/vmlinuz apm=power-off boot=live live-media-path=/live/%GRML_NAME%/ bootid=%BOOTID% "${loopback}" "${kernelopts}" nomce net.ifnames=0 toram=%GRML_NAME%.squashfs 
69       echo 'Loading initrd...'
70       initrd  /boot/%SHORT_NAME%/initrd.img
71   }
72
73   menuentry "Boot %GRML_NAME% - copy whole medium to RAM" {
74       set gfxpayload=keep
75       echo 'Loading kernel...'
76       linux   /boot/%SHORT_NAME%/vmlinuz apm=power-off boot=live live-media-path=/live/%GRML_NAME%/ bootid=%BOOTID% "${loopback}" "${kernelopts}" nomce net.ifnames=0 toram 
77       echo 'Loading initrd...'
78       initrd  /boot/%SHORT_NAME%/initrd.img
79   }
80
81   menuentry "Boot %GRML_NAME% - disable framebuffer/kernel mode setting" {
82       set gfxpayload=keep
83       echo 'Loading kernel...'
84       linux   /boot/%SHORT_NAME%/vmlinuz apm=power-off boot=live live-media-path=/live/%GRML_NAME%/ bootid=%BOOTID% "${loopback}" "${kernelopts}" nomce net.ifnames=0 video=vesafb:off cirrus.modeset=0 i915.modeset=0 mgag200.modeset=0 nomodeset nouveau.modeset=0 radeon.modeset=0 
85       echo 'Loading initrd...'
86       initrd  /boot/%SHORT_NAME%/initrd.img
87   }
88
89   menuentry "Boot %GRML_NAME% - enable forensic mode" {
90       set gfxpayload=keep
91       echo 'Loading kernel...'
92       linux   /boot/%SHORT_NAME%/vmlinuz apm=power-off boot=live live-media-path=/live/%GRML_NAME%/ bootid=%BOOTID% "${loopback}" "${kernelopts}" nomce net.ifnames=0 read-only nofstab noraid nodmraid nolvm noautoconfig noswap raid=noautodetect 
93       echo 'Loading initrd...'
94       initrd  /boot/%SHORT_NAME%/initrd.img
95   }
96
97   menuentry "Boot %GRML_NAME% - enable serial console" {
98       set gfxpayload=keep
99       echo 'Loading kernel...'
100       linux   /boot/%SHORT_NAME%/vmlinuz apm=power-off boot=live live-media-path=/live/%GRML_NAME%/ bootid=%BOOTID% "${loopback}" "${kernelopts}" nomce net.ifnames=0 video=vesafb:off console=tty1 console=ttyS0,9600n8 
101       echo 'Loading initrd...'
102       initrd  /boot/%SHORT_NAME%/initrd.img
103   }
104
105   menuentry "Boot %GRML_NAME% - debug mode" {
106       set gfxpayload=keep
107       echo 'Loading kernel...'
108       linux   /boot/%SHORT_NAME%/vmlinuz apm=power-off boot=live live-media-path=/live/%GRML_NAME%/ bootid=%BOOTID% "${loopback}" "${kernelopts}" nomce net.ifnames=0 initcall verbose debug=vc systemd.log_level=debug systemd.log_target=kmsg log_buf_len=1M 
109       echo 'Loading initrd...'
110       initrd  /boot/%SHORT_NAME%/initrd.img
111   }
112 fi