I wish to change a menu entry in grub.cfg, for example:
From
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu is wonderful'
To
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu is world famous'
I wish to change a menu entry in grub.cfg, for example:
From
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu is wonderful'
To
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu is world famous'
Edit
/etc/grub.d/10_linux
instead and runsudo update-grub
when you are done. This is a more reliable method, otherwise every time you upgrade to a new kernel your/boot/grub/grub.cfg
will be overwritten and you will lose your changes.Or you can use Grub Customizer. To install it:
How to do it from an emulator to learn how GRUB works, without the risk of breaking anything.
create a Multiboot hello world
main.elf
file. GRUB knows how to boot those files (GRUB also knows how to boot the Linux kernel, even though it is not Multiboot)create a
iso/boot/grub/grub.cfg
file containing:Place
main.elf
underiso/boot/
Generate an image and run it:
This will boot into GRUB, and you will see an entry called
main
.Now edit
grub.cfg
likemenuentry "newmain"
, and upon a reboot the new option name isnewmain
. So your change would work.I have posted the exact code for this example at: https://github.com/cirosantilli/x86-bare-metal-examples/tree/d217b180be4220a0b4a453f31275d38e697a99e0/multiboot/hello-world
As others said, don't do it in practice, since that is normally an output file and will get overwritten on
update-grub
.yes you can edit this file /boot/grub/grub.cfg