mendhak / grub-reboot-picker

Helps with dual booting. Ubuntu tray application to reboot into different OSes or UEFI/BIOS
MIT License
51 stars 5 forks source link

Feature Request: Include custom .cfg menu entries #4

Open Natetronn opened 2 years ago

Natetronn commented 2 years ago

I have a custom.cfg for custom menu entries, which also calls other custom cfgs, which have their own menu entries.

grub-custom-cfgs

For example, in custom.cfg I have the following, which calls liveiso.cfg and gpu-switcher.cfg:

menuentry 'Live ISOs' --class iso {
    insmod part_gpt
    insmod btrfs
    search --no-floppy --fs-uuid --set=root XXXXXX-XXXXXXXXX-XXXXXXXXXXXXXXX
    configfile /@/boot/grub/liveiso.cfg
}
menuentry 'GPU Switcher' --class nvidia {
    insmod part_gpt
    insmod btrfs
    search --no-floppy --fs-uuid --set=root XXXXXX-XXXXXXXXX-XXXXXXXXXXXXXXX
    configfile /@/boot/grub/gpu-switcher.cfg
}

There is also one for btrfs snapshots that's generated on its own (although that's not custom.)

Anyway, if I may, I'd like to request other .cfg file menu entries show up in the grub-reboot-picker as well, please.

Natetronn commented 2 years ago

Here are the items in grub.cfg that make the magic happen for custom configs and snapshots:

### 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/41_snapshots-btrfs ###
submenu 'Manjaro Linux snapshots' {
    configfile "${prefix}/grub-btrfs.cfg"
}
### END /etc/grub.d/41_snapshots-btrfs ###

I do get the Majnaro Linux snapshots submenu entry in grub-reboot-picker, however, I don't get whatever is located in grub-btrfs.cfg or any of the custom.cfg entries.

I prefer using custom entries, over os-prober (it's turned off), since it allows me to customize the icons, menu order and have entries for various tools and ISOs and such.