Skip to content

Instantly share code, notes, and snippets.

/grub.cfg Secret

Created July 23, 2015 17:48
Show Gist options
  • Save anonymous/07fe464370636e3b4b69 to your computer and use it in GitHub Desktop.
Save anonymous/07fe464370636e3b4b69 to your computer and use it in GitHub Desktop.
grub.cfg that crashes TrustedGRUB2
# Automatically generated. DO NOT EDIT THIS FILE!
search --set=drive1 --fs-uuid XXXX-XXXX
if [ -s $prefix/grubenv ]; then
load_env
fi
# ‘grub-reboot’ sets a one-time saved entry, which we process here and
# then delete.
if [ "${saved_entry}" ]; then
# The next line *has* to look exactly like this, otherwise KDM's
# reboot feature won't work properly with GRUB 2.
set default="${saved_entry}"
set saved_entry=
set prev_saved_entry=
save_env saved_entry
save_env prev_saved_entry
set timeout=1
else
set default=0
set timeout=2
fi
# Setup the graphics stack for bios and efi systems
if [ "${grub_platform}" = "efi" ]; then
insmod efi_gop
insmod efi_uga
else
insmod vbe
fi
insmod font
if loadfont ($drive1)//boot/grub/fonts/unicode.pf2; then
insmod gfxterm
if [ "${grub_platform}" = "efi" ]; then
set gfxmode=auto
set gfxpayload=keep
else
set gfxmode=1024x768
set gfxpayload=text
fi
terminal_output gfxterm
fi
insmod png
if background_image ($drive1)//background.png; then
set color_normal=white/black
set color_highlight=black/white
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
insmod part_gpt
menuentry "OS - Default" {
search --set=drive1 --fs-uuid XXXX-XXXX
linux ($drive1)//kernels/bzImage1 systemConfig=/nix/store/os1.cfg init=/nix/store/os1.init
initrd ($drive1)//kernels/initrd1
}
submenu "OS - All configurations" {
menuentry "OS - Configuration 2" {
search --set=drive1 --fs-uuid XXXX-XXXX
linux ($drive1)//kernels/bzImage2 systemConfig=/nix/store/os2.cfg init=/nix/store/os2.init
initrd ($drive1)//kernels/initrd2
}
menuentry "OS - Configuration 3" {
search --set=drive1 --fs-uuid XXXX-XXXX
linux ($drive1)//kernels/bzImage3 systemConfig=/nix/store/os3.cfg init=/nix/store/os3.init
initrd ($drive1)//kernels/initrd3
}
menuentry "OS - Configuration 4" {
search --set=drive1 --fs-uuid XXXX-XXXX
linux ($drive1)//kernels/bzImage4 systemConfig=/nix/store/os4.cfg init=/nix/store/os4.init
initrd ($drive1)//kernels/initrd4
}
menuentry "OS - Configuration 5" {
search --set=drive1 --fs-uuid XXXX-XXXX
linux ($drive1)//kernels/bzImage5 systemConfig=/nix/store/os5.cfg init=/nix/store/os5.init
initrd ($drive1)//kernels/initrd5
}
#
# Adding another menu entry crashes TrustedGRUB2!
# Try by uncommenting the next menuentry.
#
#menuentry "OS - Configuration 6" {
# search --set=drive1 --fs-uuid XXXX-XXXX
# linux ($drive1)//kernels/bzImage6 systemConfig=/nix/store/os6.cfg init=/nix/store/os6.init
# initrd ($drive1)//kernels/initrd6
#}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment