0

I would like to add an entry to my bootloader with custom linux boot arguments.

Using Fedora core 35 with BLS and I can see that it auto-generates items in GRUB using the entries in the /boot/loader/entries folder.

Given these items are auto-generated, is it safe to add an item there like my-custom-launch.conf?

Is there a better way to add a custom item to GRUB?

1 Answer 1

0

You can perfectly use this location and I've been doing that for years. It's pretty safe too since Fedora's entries start with some hash which means they'll never collide with your entries.

The problem with it is that it's rather limited and only allows to boot Linux kernels + initrd + kernel arguments.

If you need the full power of GRUB2, please add your entries to /boot/grub2/custom.cfg - it doesn't exist by default but it will be used if it's there.

Here's my file for reference:

# This is a reminder for myself where the below entries come from
menuentry '************ /boot/efi/EFI/fedora/custom.cfg ************' --unrestricted {
    echo Hello
}

menuentry 'Fedora Pre' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'Fedora-pre-UUID' {
    search --no-floppy --fs-uuid --set=root UUID
    configfile /grub2/grub.cfg
}

menuentry 'Refind' {
    insmod part_gpt
    insmod fat
    set root='hd1,gpt1'
    if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1 UUID
    else
        search --no-floppy --fs-uuid --set=root UUID
    fi
    chainloader /EFI/refind/refind_x64.efi
}

menuentry 'Poweroff  [p]' --hotkey='p' {
    halt
}

menuentry 'Reboot  [r]' --hotkey='r' {
    reboot
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .