Skip to content

My grub2 configuration with LibreELEC manual menu entries

License

Notifications You must be signed in to change notification settings

ceskyDJ/grub2-configs-libreelec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

My grub2 configuration

This repository contains files of my grub2 configuration with LibreELEC menu entires (manual config). It has special submenu for "advanced options" and "recovery" menu entries.

Preview

Example output (/boot/grub2/grub2.cnf):

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set btrfs_relative_path="y"
export btrfs_relative_path
if [ -f ${config_directory}/grubenv ]; then
  load_env -f ${config_directory}/grubenv
elif [ -s $prefix/grubenv ]; then
  load_env
fi

if [ "${env_block}" ] ; then
  set env_block="(${root})${env_block}"
  export env_block
  load_env -f "${env_block}"
fi

if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   if [ "${env_block}" ] ; then
     save_env -f "${env_block}" next_entry
   fi
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    if [ "${env_block}" ] ; then
      save_env -f "${env_block}" saved_entry
    else
      save_env saved_entry
    fi

  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if loadfont unicode ; then
  if [ "${grub_platform}" = "efi" ]; then
    echo "Please press 't' to show the boot menu on this console"
  fi

  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
insmod part_gpt
insmod btrfs
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  6ea93d29-f18c-4561-a424-f2c6edcab3d5
else
  search --no-floppy --fs-uuid --set=root 6ea93d29-f18c-4561-a424-f2c6edcab3d5
fi
insmod gfxmenu
loadfont ($root)/grub2/themes/Vimix/dejavu_sans_12.pf2
loadfont ($root)/grub2/themes/Vimix/dejavu_sans_14.pf2
loadfont ($root)/grub2/themes/Vimix/dejavu_sans_16.pf2
loadfont ($root)/grub2/themes/Vimix/dejavu_sans_24.pf2
loadfont ($root)/grub2/themes/Vimix/dejavu_sans_48.pf2
loadfont ($root)/grub2/themes/Vimix/dejavu_32.pf2
loadfont ($root)/grub2/themes/Vimix/terminus-12.pf2
loadfont ($root)/grub2/themes/Vimix/terminus-14.pf2
loadfont ($root)/grub2/themes/Vimix/terminus-16.pf2
loadfont ($root)/grub2/themes/Vimix/terminus-18.pf2
insmod jpeg
insmod png
set theme=($root)/grub2/themes/Vimix/theme.txt
export theme
if [ x${boot_once} = xtrue ]; then
  set timeout=0
elif [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=10
fi
if [ -n "$extra_cmdline" ]; then
  menuentry "Help on bootable snapshot #$snapshot_num" {
    echo "Select the default entry of the snapshot boot menu."
    echo "Examine the snapshot, and if it's OK,"
    echo "   run 'snapper rollback' and reboot."
    echo "See 'System Rollback by Booting from Snapshots'"
    echo "   in the manual for more information."
    echo "  ** Hit Any Key to return to boot menu **  "
    read
  }
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/00_tuned ###
set tuned_params=""
set tuned_initrd=""
### END /etc/grub.d/00_tuned ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'openSUSE Tumbleweed'  --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-a5ed0bf0-33f8-4307-886b-be283c4db4b8' {
    load_video
    set gfxpayload=keep
    insmod gzio
        insmod part_gpt
        insmod btrfs
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  6ea93d29-f18c-4561-a424-f2c6edcab3d5
        else
          search --no-floppy --fs-uuid --set=root 6ea93d29-f18c-4561-a424-f2c6edcab3d5
        fi
    echo 'Loading Linux 5.8.2-1.g71b519a-default ...'
    linuxefi /vmlinuz-5.8.2-1.g71b519a-default root=UUID=a5ed0bf0-33f8-4307-886b-be283c4db4b8  ${extra_cmdline} splash=silent resume=/dev/disk/by-label/openSUSE-Swap mitigations=auto quiet
    echo 'Loading initial ramdisk ...'
    initrdefi       /initrd-5.8.2-1.g71b519a-default
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

# Windows
menuentry "Windows 10" --class windows --class os $menuentry_id_option 'osprober-efi-CE56-A237' {
    insmod part_gpt
    insmod fat
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root CE56-A237
    else
      search --no-floppy --fs-uuid --set=root CE56-A237
    fi
    chainloader /efi/Microsoft/Boot/bootmgfw.efi
}

# LibreELEC
menuentry "LibreELEC" --class libreelec --class gnu-linux --class gnu --class os {
        search --set=root --label LibreELEC-System
        linux /KERNEL boot=LABEL=LibreELEC-System disk=LABEL=LibreELEC-Data quiet
}
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/50_recovery ###
submenu 'Recovery options' --class recovery --hotkey=1 $menuentry_id_option 'gnulinux-advanced-a5ed0bf0-33f8-4307-886b-be283c4db4b8' {
    menuentry 'LibreELEC (recovery mode)' --class libreelec --class gnu-linux --class gnu --class os {
        search --set=root --label LibreELEC-System
        linux /KERNEL boot=LABEL=LibreELEC-System disk=LibreELEC-Data debugging
    }
        menuentry 'openSUSE Tumbleweed, with Linux 5.8.2-1.g71b519a-default (advanced options)'  --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.8.2-1.g71b519a-default-advanced-a5ed0bf0-33f8-4307-886b-be283c4db4b8' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod btrfs
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  6ea93d29-f18c-4561-a424-f2c6edcab3d5
                else
                  search --no-floppy --fs-uuid --set=root 6ea93d29-f18c-4561-a424-f2c6edcab3d5
                fi
                echo    'Loading Linux 5.8.2-1.g71b519a-default ...'
                linuxefi /vmlinuz-5.8.2-1.g71b519a-default root=UUID=a5ed0bf0-33f8-4307-886b-be283c4db4b8  ${extra_cmdline} splash=silent resume=/dev/disk/by-label/openSUSE-Swap mitigations=auto quiet
                echo    'Loading initial ramdisk ...'
                initrdefi       /initrd-5.8.2-1.g71b519a-default
        }
        menuentry 'openSUSE Tumbleweed, with Linux 5.8.2-1.g71b519a-default (recovery mode)' --hotkey=1 --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.8.2-1.g71b519a-default-recovery-a5ed0bf0-33f8-4307-886b-be283c4db4b8' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod btrfs
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root  6ea93d29-f18c-4561-a424-f2c6edcab3d5
                else
                  search --no-floppy --fs-uuid --set=root 6ea93d29-f18c-4561-a424-f2c6edcab3d5
                fi
                echo    'Loading Linux 5.8.2-1.g71b519a-default ...'
                linuxefi /vmlinuz-5.8.2-1.g71b519a-default root=UUID=a5ed0bf0-33f8-4307-886b-be283c4db4b8  ${extra_cmdline} 
                echo    'Loading initial ramdisk ...'
                initrdefi       /initrd-5.8.2-1.g71b519a-default
        }
    menuentry 'Go back' --class cancel {
          reboot
    }
}
### END /etc/grub.d/50_recovery ###

### BEGIN /etc/grub.d/80_suse_btrfs_snapshot ###
btrfs-mount-subvol ($root) /.snapshots @/.snapshots
if [ -f "/.snapshots/grub-snapshot.cfg" ]; then
  source "/.snapshots/grub-snapshot.cfg"
fi
### END /etc/grub.d/80_suse_btrfs_snapshot ###

### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ###

### BEGIN /etc/grub.d/95_textmode ###
if [ "${grub_platform}" = "efi" ]; then
  # On EFI systems we can only have graphics *or* serial, so allow the user
  # to switch between the two
  hiddenentry 'Text mode' --hotkey 't' {
    set textmode=true
    terminal_output console
  }
fi
### END /etc/grub.d/95_textmode ###

About

My grub2 configuration with LibreELEC manual menu entries

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages