Parrot Community

Community portal of the Parrot Project.

You are not logged in.

Announcement

Welcome Aboard Pirate!

Support us on Patreon and contribute to our project!

HappyHacking!

#1 2017-07-15 04:03:12

FenrirTheinsomniac
Community Member
From: Wandering In The Shadows
Registered: 2017-07-15
Posts: 3

[TUTORIAL] Grub Customization...

GRUB2 Configuration Basics

GRUB2 doesn't use a menu.lst file. Instead, its main configuration file is /boot/grub/grub.cfg, it is recommended that you shouldn't edit this file by hand as the file is just for GRUB2'S own usage. It's automatically created by running the update-grub command as root -- in other words, by running sudo upate-grub

Your own GRUB settings are stored in the /etc/default/grub file. Edit this file to change GRUB2'S settings. Scripts are also located in the /etc/grub.d/ directory.

When you run the update-grub command, GRUB automatically combines the settings from the /etc/default/grub file, the scripts from the /etc/grub.d/directory, and everything else, creating a /boot/grub/grub.cfg file that's read at boot.

In other words, to customize your GRUB2 settings, you'll have to edit the /etc/default/grub file (i prefer to use nano here, or kate if you got it) and then run the sudo update-grub command.

Edit the GRUB Configuration File

Open the /etc/default/grub file for editing in a standard text editor. If you want to use a graphical text editor, open a terminal an run the following command:

gksu gedit /etc/default/grub

For an easy to use terminal based editor --Nano (i recommend for most config file edits) use the following command. You can use any text editor you like, of course including good old vi editor

sudo nano /etc/default/grub

The /etc/default/grub file is short and should be easy to edit. As with any other configuration file, you need to edit the options to your desired state and then change the file. If any of the options below doesn't already appear in the file, add it on a new line. If it does, edit the existing line instead of adding a duplicate one.

Choose the Default OS: Change the GRUB_DEFAULT= line. By default, GRUB_DEFAULT=0 uses the first entry as the default ---- change the number to 1 to use the second entry, 2 to use the third entry, or so on. You could also use GRUB_DEFAULT=SAVED and GRUB would automatically boot the last operating system you chose each time you boot. You can also specify a label in quotes. For example, if you had an operating system named Windows 7 (loader) in your os list you could use GRUB_DEFAULT="Windows 7 (loader)"

Save a Default Operating System: If you choose GRUB_DEFAULT=saved, you also need to add a GRUB_SAVEDEFAULT=true line ---- otherwise it won't work.

Choose Whether GRUB is Hidden: With only one operating system installed, parrot defaults GRUB to automatically boot to the default OS with the GRUB_HIDDEN_TIMEOUT=0 option. This option specifies GRUB will be hidden and it will automatically boot to the default OS after 0 seconds -immediately, in other words. You can still access the menu by holding shift as your comp boots. To set a higher timeout, use something like GRUB_HIDDEN_TIMEOUT=5, GRUB will display an empty screen or splash screen for five seconds, during which you can press any key to view the menu. To prevent GRUB from being automatically hidden, comment the line out --- just add a # before it so that it reads #GRUB_HIDDEN_TIMEOUT=0

Control GRUB's Menu Timeout: If GRUB isn't automatically hidden, you'll see the menu each time your computer boots. GRUB will automatically boot the default operating system after a period of time, usually ten seconds. During that time, you can choose another OS or leave it be to automatically boot. To change the timeout period, edit the GRUB_TIMEOUT=10 line and enter any number of seconds you like. (Remember, this is only used if GRUB isn't hidden.) To prevent GRUB from booting automatically and always wait for you to choose an OS, change the line to GRUB_TIMEOUT=-1

Choose a Background Image: The GRUB_BACKGROUND line controls whether a background image is used --- by default, GRUB uses a white-on-black monochrome look. You can add a line like GRUB_BACKGROUND="/home/user/Pictures/background.png" to specify an image file GRUB will use.

The image file must meet various specifications. GRUB supports jpg/jpeg images, but these are limited to 256 colors --- so you probally wont want to use a jpg image. Instead, you'll probally want to use a png image that can have any number of colors. You could also use a TGA image file.

Make Your Changes Take Effect

To have yor changes take effect, simply save the text file --- File > Save in Gedit or Ctrl + O and then enter to save the file in nano --- and then run the sudo update-grub command. Your changes will become part of the grub.cfg file and will be used each time you boot your compy.

These aren’t all of GRUB’s settings, but they are some of the most commonly changed. Other settings can be customized in the /etc/default/grub file, or by editing the scripts in the /etc/grub.d directory.

If you don’t want to edit the files by hand, you may be able to find graphical tools for customizing GRUB2 in your Linux distribution’s software repositories. The above method should work even on Linux distros where such tools aren’t easily available, or if you just have command-line access and want to do it by hand.


Ar Scáth a chéile a mhaireann na daoine-Séamus Heaney
(People live in each other's shadows)

Offline

#2 2017-07-29 04:12:49

Gavaudan
Community Member
Registered: 2017-05-05
Posts: 23

Re: [TUTORIAL] Grub Customization...

Much obliged, I've often wondered how to change or add a picture to the grub background in particular.

Offline

#3 2017-08-23 22:54:18

FenrirTheinsomniac
Community Member
From: Wandering In The Shadows
Registered: 2017-07-15
Posts: 3

Re: [TUTORIAL] Grub Customization...

no problem at all, happy to help, as it isn't immediately apparent where the grub config settings would be


Ar Scáth a chéile a mhaireann na daoine-Séamus Heaney
(People live in each other's shadows)

Offline

Board footer

Powered by FluxBB

Design by Klocek.