Today GRUB2 ships out
with most of the Linux Distribution as a default Boot loader. Let’s take some
time to do customization.
Topics covered:
Changing
your “DEFAULT OPTION”
from Linux to Windows.
Changing
your “TIMEOUT OPTION”
from default 5 sec.
Changing
GRUB2 background Wallpaper “SPLASHIMAGES” of your own.
Remember these configuration
three files:
·
/etc/default/grub
·
/boot/grub2/grub.cfg
·
/etc/grub.d/<<Scripts>>
PART I
Whenever you install
Linux above Windows(i.e Installing Windows OS at first and later installing
Linux) “DEFAULT OPTION” in boot loader will be set to Linux by
default. Timeout is a delay waiting for user inputs before selecting default
option. It’s necessary to change the DEFAULT and TIMEOUT Option for our choice.
Step 1) Identify the
TITLE of Operating system which has to be loaded default.
NOTE: If you install
windows first and above it Linux, Grub2 Boot loader will take care of
identifying already residing OS’s. Grep 'Windows' or 'Fedora' or 'Ubuntu'
keywords from the greub2.cfg file.
#cat /boot/grub2/grub.cfg | egrep -i 'Windows|Fedora|Ubuntu'
or
#cat /etc/grub.cfg | egrep -i 'Windows|Fedora|Ubuntu'
Step 2) Use #grub2-set-default command to set the new value of your choice. You can check the default entry using
#grub2-editenv list to see the changes.
#grub2-set-default='Windows 7 (loader) (on /dev/sda2)'
Step 3) Update #grub2-mkconfig to
update the grub.cfg file.
# grub2-mkconfig -o /etc/grub2.cfg
# grub2-mkconfig -o /boot/grub2/grub.cfg
Step 4) Update value “GRUB_TIMEOUT” in file /etc/default/grub
GRUB_TIMEOUT=20 [Value in seconds]
Step 5) Update #grub2-mkconfig to
update the grub.cfg file.
# grub2-mkconfig -o
/etc/grub2.cfg
# grub2-mkconfig -o
/boot/grub2/grub.cfg
Part II
However it isn't compulsory to change the default background wallpaper, but something of your
own will always add attitude of you, I’m just touching background and font part
in theme.
Step 1) Remove comment for GRUB_THEME
line in /etc/default/grub
GRUB_THEME="/boot/grub2/themes/system/theme.txt"
Step 2) Download / Copy
files to /boot/grub2/themes/system/{default theme parent directory}
Step 3) Edit theme.txt
file in boot/grub2/themes/system/ with desktop-image=”value to latest background
filename”.
desktop-image: "amithbackground.jpg"
Step 4) Update #grub-mkconfig to
update the grub.cfg file
# grub2-mkconfig -o /etc/grub2.cfg
# grub2-mkconfig -o /boot/grub2/grub.cfg
Step 5)Reboot to see changes :) .
Reference : theme.txt
########################################################################
#general settings
message-font:
"DejaVu Serif Regular 12"
message-color:
"#fff"
message-bg-color:
"#000"
terminal-box:
"terminal_box_*.png"
terminal-font: "DejaVu Serif Regular 12"
desktop-image: "amithbackground.jpg"
#help bar at the
bottom
+ label {
top = 100%-25
left = 0
width = 100%
height = 20
text = "@KEYMAP_MIDDLE@"
align = "center"
font = "DejaVu Serif Regular
10"
color = "#FFF"
}
#boot menu
+ boot_menu {
left = 10%
width = 80%
top = 20%
height = 50%
item_font = "DejaVu Serif Regular
12"
item_color = "#3c6eb4"
selected_item_font = "DejaVu Serif
Bold 14"
selected_item_color= "#fff"
selected_item_pixmap_style =
"blob_*.png"
icon_height = 25
icon_width = 25
item_height = 26
item_padding = 0
item_icon_space = 0
item_spacing = 1
scrollbar = true
scrollbar_width = 20
scrollbar_thumb =
"slider_*.png"
menu_pixmap_style =
"boot_menu_*.png"
}
#progress bar
+ progress_bar {
id = "__timeout__"
left = 15%
top = 80%
height = 20
width = 70%
font = "DejaVu Serif Regular
12"
text_color = "#fff"
fg_color = "#3c6eb4"
bg_color = "#294172"
border_color = "#fff"
text =
"@TIMEOUT_NOTIFICATION_LONG@"
}