[SOLVED] How to draw a line in GRUB?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
ElStellino
Level 3
Level 3
Posts: 163
Joined: Thu Nov 08, 2012 9:54 am
Location: 192.168.1.136

[SOLVED] How to draw a line in GRUB?

Post by ElStellino »

Happy Sunday!


I’d like to type
_________________________________________

between the standard options and some options I added in GRUB.

I know I have to edit /etc/grub.d/40_custom, but just giving

Code: Select all

menuentry "—————————————————————————————————————————————————————"
it doesn’t show anything. and all the options are displayed in a list with no line.
If I also add

Code: Select all

menuentry "—————————————————————————————————————————————————————" {
}
to maybe give a blank command to this line, it gives me an error when I send the command

Code: Select all

sudo update-grub
so this one isn’t right. It happens also if I add a # between { }

I did it in the past, I had to reinstall, and now I don’t remember how I did it nor I can’t find out how. :(
Can anybody kindly help me out, please?

Thanks in advance!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Linux Mint 21.1 – Cinnamon-64

Hardware, since 2009 – still rocking:
MB - ASRock H55DE3
Core i3 530 2.93Ghz 
4Gb DDR3 Ram Dual Channel
And there’s a new entry!
Acer laptop
Intel© Core™ i5-4200U CPU @ 1.60GHz × 2
6GB RAM
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: How to draw a line in GRUB?

Post by austin.texas »

The only way that worked for me is to copy an entire menuentry and change the title.

Code: Select all

# 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.
menuentry "**************************************************************************" {
set isofile="/boot-isos/linuxmint-17-xfce-dvd-64bit.iso"
loopback loop (hd1,gpt3)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject toram
initrd (loop)/casper/initrd.lz
}
NOTE: copy one of your menuentries - not mine. ((hd1,gpt3)
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
User avatar
ElStellino
Level 3
Level 3
Posts: 163
Joined: Thu Nov 08, 2012 9:54 am
Location: 192.168.1.136

Re: How to draw a line in GRUB?

Post by ElStellino »

Hello austin.texas,

Thanks!
Does this implies that the line of asterisks becomes selectable and as such it has an action?
Edit: of course it does. I’ve just re-read better.
I remember doing it, and it was something real simple (as I worked it out all by myself)
Linux Mint 21.1 – Cinnamon-64

Hardware, since 2009 – still rocking:
MB - ASRock H55DE3
Core i3 530 2.93Ghz 
4Gb DDR3 Ram Dual Channel
And there’s a new entry!
Acer laptop
Intel© Core™ i5-4200U CPU @ 1.60GHz × 2
6GB RAM
User avatar
ElStellino
Level 3
Level 3
Posts: 163
Joined: Thu Nov 08, 2012 9:54 am
Location: 192.168.1.136

Re: How to draw a line in GRUB?

Post by ElStellino »

Found it!

I haven’t tested it yet on my system (just on Virtual Box), but update-grub didn’t report any mistakes and that virtual machine started, so I don’t see why it shouldn’t work here too.

Image

the code entry:

Code: Select all

menuentry "—————————————————————————————————————————————————————"{
echo
}
I will try then to find something nicer than underscore, in GRUB those look pretty bad.
Linux Mint 21.1 – Cinnamon-64

Hardware, since 2009 – still rocking:
MB - ASRock H55DE3
Core i3 530 2.93Ghz 
4Gb DDR3 Ram Dual Channel
And there’s a new entry!
Acer laptop
Intel© Core™ i5-4200U CPU @ 1.60GHz × 2
6GB RAM
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: How to draw a line in GRUB?

Post by austin.texas »

ElStellino wrote:

Code: Select all

menuentry "—————————————————————————————————————————————————————"{
echo
}
Very interesting...
That works.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
User avatar
ElStellino
Level 3
Level 3
Posts: 163
Joined: Thu Nov 08, 2012 9:54 am
Location: 192.168.1.136

Re: [SOLVED] How to draw a line in GRUB?

Post by ElStellino »

Glad it does :)

I may shoot you a line or two regarding the command of your grub menuentry, do you mind @austin.texas?
Linux Mint 21.1 – Cinnamon-64

Hardware, since 2009 – still rocking:
MB - ASRock H55DE3
Core i3 530 2.93Ghz 
4Gb DDR3 Ram Dual Channel
And there’s a new entry!
Acer laptop
Intel© Core™ i5-4200U CPU @ 1.60GHz × 2
6GB RAM
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: [SOLVED] How to draw a line in GRUB?

Post by austin.texas »

Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
User avatar
ElStellino
Level 3
Level 3
Posts: 163
Joined: Thu Nov 08, 2012 9:54 am
Location: 192.168.1.136

Re: [SOLVED] How to draw a line in GRUB?

Post by ElStellino »

So, there’s no longer need of writing you in PM :)

I don’t really need it (or at least I don’t know yet that I need it :D ) but I was really curious about the syntax of that entry, how it works.
It’s useful if something goes wrong in the pc and need to access it from a live system, but on the HD! I seem no longer to damage the GRUB as I was doing before (I now test stuff on VBox first) so it may actually be really useful!

Thanks a lot!
Linux Mint 21.1 – Cinnamon-64

Hardware, since 2009 – still rocking:
MB - ASRock H55DE3
Core i3 530 2.93Ghz 
4Gb DDR3 Ram Dual Channel
And there’s a new entry!
Acer laptop
Intel© Core™ i5-4200U CPU @ 1.60GHz × 2
6GB RAM
Locked

Return to “Installation & Boot”