Centos 7: Customize GRUB2 menu to include options to boot GUI or CLI
Hello I have created a USB with CENTOS 7. I use this for work to do testing on various systems. Sometimes I need GUI and sometimes I need to use pure CLI (Console) environment.
I know you can hit the "e" button at the GRUB menu and change Run Level to 3 by adding a 3 at the end of the "linux" line, it has been tested and works. I would like know if there is a way to add an entry for GUI or CLI off the same kernel from the grub menu. As a bonus change the time out to 60sec. The default boot would be GUI. Any help would be greatly appreciated. |
That is easy. I just tested it and it works.
Open /boot/grub/grub.cfg in your text editor (mine is gedit - I don't know what your CENTOS 7 uses...) Code:
gksu gedit /boot/grub/grub.cfg This is what mine looks like: Code:
menuentry 'Linux Mint 17.2 Cinnamon 64-bit, 3.16.0-38-generic (/dev/sda2)' --class ubuntu --class gnu-linux --class gnu --class os { Paste your menuentry at the end of the file. Add CONSOLE ONLY to the title line: Like this: Code:
menuentry 'Linux Mint 17.2 Cinnamon CONSOLE ONLY (/dev/sda2)' Then edit the line that starts with "linux" Remove "quiet splash" if that is there. Add "text" Like this: Code:
linux /boot/vmlinuz-3.16.0-38-generic root=UUID=a2cd308e-2307-4bb4-8382-b54b792b8a79 ro radeon.dpm=1 text Code:
sudo update-grub |
Change the menu timeout to 60 seconds:
Code:
gksu gedit /etc/default/grub GRUB_TIMEOUT=5 To: GRUB_TIMEOUT=60 Save Code:
sudo update-grub |
Thank you for the quick reply, however it did not work. This is grub2 in CENTOS7
Here is the what I put in the file as you mentioned, I copyed it from Code:
/etc/grub.d/40_custom Code:
#!/bin/sh Then ran: Code:
grub2-mkconfig -o /boot/grub2/grub2.cfg Code:
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub2.cfg Then Reboot (No new menu item) |
looks like your missing the
Code:
{ |
Quote:
Code:
#!/bin/sh Code:
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub2.cfg |
Quote:
|
Thank however when I put "{" vs "}" which was copied directly from grub2. I get an "compile"error.
|
All times are GMT -5. The time now is 04:07 PM. |