#1 Le 06/07/2015, à 20:11
- Orbital_Verbose
[Résolu] Couleur de Grub
Bonjour à tous,
J'ai un petit soucis avec le grub, rien de bien méchant, juste la couleur de la police que j'arrive pas à changer en dépit de mes recherche et de mes efforts.
Ci-joint mon /etc/default/grub :
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT="0"
#GRUB_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="120"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL="console"
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE="1366x768x32,640x480"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID="true"
# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
set MENU_PICTURE="/boot/grub/loup_a_moto.png"
set COLOR_NORMAL=green/black
set COLOR_HIGHLIGHT=light-green/black
Je suppose que le problème vient des deux dernières lignes,
J'ai aussi essayé avec et avec/sans les guillements
set MENU_COLOR_NORMAL=green/black
set MENU_COLOR_HIGHLIGHT=light-green/black
Si quelqu'un pouvait me dire où je me suis planté ce serait super sympa
Dernière modification par Orbital_Verbose (Le 07/07/2015, à 20:45)
Si ça intéresse, un roman que j'écris et qui est lisible gratuitement sur le net : Le conflit du Multivers
Hors ligne
#2 Le 06/07/2015, à 20:55
- Orbital_Verbose
Re : [Résolu] Couleur de Grub
J'ai oublié de préciser : je reste avec les couleurs grises/noires de base...
Si ça intéresse, un roman que j'écris et qui est lisible gratuitement sur le net : Le conflit du Multivers
Hors ligne
#3 Le 06/07/2015, à 20:55
- nany
Re : [Résolu] Couleur de Grub
Bonjour,
commence par enlever les set qui n’ont rien à faire dans ce fichier.
Ensuite, en regardant de plus près /etc/grub.d/05_debian_theme, on peut voir ceci :
# Next try to use the background image and colors specified by desktop-base.
if set_background_image "${WALLPAPER}" "${COLOR_NORMAL}" "${COLOR_HIGHLIGHT}"; then
exit 0
fi
Ce qui me fait penser que ça devrait marcher en enlevant donc les set et en remplaçant MENU_PICTURE (que je ne sais pas d’où tu le sors) par WALLPAPER et en supprimant les MENU_.
En ligne
#4 Le 06/07/2015, à 20:58
- Orbital_Verbose
Re : [Résolu] Couleur de Grub
Bonjour, merci pour cette réponse rapide.
J'ai pas de problèmes avec le fond d'écran, c'est la couleur de la police qui m'ennuie...
Si ça intéresse, un roman que j'écris et qui est lisible gratuitement sur le net : Le conflit du Multivers
Hors ligne
#5 Le 06/07/2015, à 21:27
- nany
Re : [Résolu] Couleur de Grub
Si ton fond d’écran s’affiche, c’est tout simplement parce que tu as placé l’image dans /boot/grub grace à cette autre partie de /etc/grub.d/05_debian_theme (juste avant celle que j’ai indiquée ci-dessus) :
# Next search for pictures the user put into /boot/grub/ and use the first one.
for background in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA; do
if set_background_image "${background}"; then
exit 0
fi
done
En conclusion, si tu veux une ET des couleurs, fait comme j’ai dit précédemment en déplaçant ton image dans un autre endroit.
En ligne
#6 Le 06/07/2015, à 22:02
- Orbital_Verbose
Re : [Résolu] Couleur de Grub
Rebonsoir,
Alors maintenant, il me mets la bonne couleur de police, mais j'ai pu le fond d'écran...
Ci-joint le code :
set WALLPAPER="/home/orbital/Images/fond_grub/loup_a_moto.png"
set COLOR_NORMAL="green/black"
set COLOR_HIGHLIGHT="light-green/black"
l'image est a la bonne dimension et a 32 bits
Si ça intéresse, un roman que j'écris et qui est lisible gratuitement sur le net : Le conflit du Multivers
Hors ligne
#7 Le 06/07/2015, à 22:14
- Orbital_Verbose
Re : [Résolu] Couleur de Grub
J'ai retiré le "set" de wallpaper, mais pas de changement
Si ça intéresse, un roman que j'écris et qui est lisible gratuitement sur le net : Le conflit du Multivers
Hors ligne
#8 Le 06/07/2015, à 22:39
- nany
Re : [Résolu] Couleur de Grub
Hmm, hhmmm !
À mon avis, c’est dans cette partie (toujours de /etc/grub.d/05_debian_theme) que ça cloche :
# Step #5: Check if GRUB can read the background image directly.
# If so, we can remove the cache file (if any). Otherwise the backgound
# image needs to be cached under /boot/grub/.
if is_path_readable_by_grub "${1}"; then
rm --force "${BACKGROUND_CACHE}.jpeg" \
"${BACKGROUND_CACHE}.png" "${BACKGROUND_CACHE}.tga"
elif cp "${1}" "${BACKGROUND_CACHE}.${reader}"; then
set -- "${BACKGROUND_CACHE}.${reader}" "${2}" "${3}"
else
return 5
fi
# Step #6: Prepare GRUB to read the background image.
if ! prepare_grub_to_access_device "`${grub_probe} --target=device "${1}"`"; then
return 6
fi
Pour voir si update-grub à fait une copie ou non du fichier, donne le retour de :
ls -la /boot/grub
En ligne
#9 Le 06/07/2015, à 22:42
- Orbital_Verbose
Re : [Résolu] Couleur de Grub
voila le retour :
drwxr-xr-x 7 root root 4096 juil. 6 23:38 .
drwxr-xr-x 3 root root 4096 juil. 6 23:31 ..
drwxr-xr-x 2 root root 4096 juil. 6 23:37 fond
drwxr-xr-x 2 root root 4096 juil. 6 23:37 fonts
-rw-r--r-- 1 root root 902 juin 24 21:38 gfxblacklist.txt
-r--r--r-- 1 root root 8306 juil. 6 23:38 grub.cfg
-rw-rw-r-- 1 root root 1024 juil. 6 23:35 grubenv
drwxr-xr-x 2 root root 12288 juin 24 21:28 i386-pc
drwxr-xr-x 2 root root 4096 juin 24 21:28 locale
drwxr-xr-x 2 root root 4096 juil. 2 20:52 themes
-rw-r--r-- 1 root root 150 juil. 2 22:46 unicode.pf2
Si ça intéresse, un roman que j'écris et qui est lisible gratuitement sur le net : Le conflit du Multivers
Hors ligne
#10 Le 06/07/2015, à 22:57
- nany
Re : [Résolu] Couleur de Grub
Donc il considère que ton home est lisible. Mais peut-être que celui-ci est chiffré, ce qui rendrait en fait sa lecture impossible au moment de l’affichage du GRUB.
Quoiqu’il en soit, puisque je vois que tu as un répertoire fond dans /boot/grub, copie ton image dans celui-ci et mets ceci dans /etc/default/grub (sans set, j’insiste ) :
WALLPAPER="/boot/grub/fond/loup_a_moto.png"
COLOR_NORMAL="green/black"
COLOR_HIGHLIGHT="light-green/black"
En ligne
#11 Le 06/07/2015, à 23:03
- Orbital_Verbose
Re : [Résolu] Couleur de Grub
Bonsoir,
Mon "home" n'est pas chiffré. Quand au répertoire "fond" c'est moi qui l'ai crée pour voir si cela pouvait fonctionner en mettant l'image dedans, mais ce fut un echec.
les polices sont en vert par contre.
Si ça intéresse, un roman que j'écris et qui est lisible gratuitement sur le net : Le conflit du Multivers
Hors ligne
#12 Le 07/07/2015, à 00:03
- nany
Re : [Résolu] Couleur de Grub
C’est étrange cette histoire de fond. Si tu as bien les polices en vert, c’est que le script se déroule bien jusqu’au bout. Je ne vois donc pas ce qui empêcherait l’affichage de l’image.
Pour que j’essaie de comprendre, peux-tu donner le retour de ton dernier update-grub ainsi que le contenu de /boot/grub/grub.cfg ?
Si après ça je n’arrive pas à voir ce qui cloche, je t’indiquerai une autre méthode possible. Mais ce serait dommage car je trouvais le fait d’utiliser la fonction du script avec ses trois arguments comme la manière la plus propre et élégante de procéder.
En ligne
#13 Le 07/07/2015, à 05:43
- Orbital_Verbose
Re : [Résolu] Couleur de Grub
Bonjour,
Je suis d'accord que c'est étrange, j'avais essayé d'installer grub-customizer au départ mais ça marchait pas du tout... alors j'en suis venu à l'édition du fichier à la main
update grub :
orbital@Damocles:~$ sudo update-grub
Création du fichier de configuration GRUB…
Image Linux trouvée : /boot/vmlinuz-3.16.0-41-generic
Image mémoire initiale trouvée : /boot/initrd.img-3.16.0-41-generic
Image Linux trouvée : /boot/vmlinuz-3.16.0-30-generic
Image mémoire initiale trouvée : /boot/initrd.img-3.16.0-30-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Windows 7 (loader) trouvé sur /dev/sda1
Windows 7 (loader) trouvé sur /dev/sda2
fait
et /boot/grub/grub.cfg :
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
else
search --no-floppy --fs-uuid --set=root bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=1366x768x32,640x480
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=fr_FR
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=-1
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=120
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=120
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=green/black
set menu_color_highlight=light-green/black
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
else
search --no-floppy --fs-uuid --set=root bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
fi
linux /boot/vmlinuz-3.16.0-41-generic root=UUID=bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.16.0-41-generic
}
submenu 'Options avancées pour Ubuntu' $menuentry_id_option 'gnulinux-advanced-bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6' {
menuentry 'Ubuntu, avec Linux 3.16.0-41-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-41-generic-advanced-bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
else
search --no-floppy --fs-uuid --set=root bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
fi
echo 'Chargement de Linux 3.16.0-41-generic…'
linux /boot/vmlinuz-3.16.0-41-generic root=UUID=bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6 ro quiet splash $vt_handoff
echo 'Chargement du disque mémoire initial…'
initrd /boot/initrd.img-3.16.0-41-generic
}
menuentry 'Ubuntu, avec Linux 3.16.0-30-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-30-generic-advanced-bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
else
search --no-floppy --fs-uuid --set=root bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
fi
echo 'Chargement de Linux 3.16.0-30-generic…'
linux /boot/vmlinuz-3.16.0-30-generic root=UUID=bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6 ro quiet splash $vt_handoff
echo 'Chargement du disque mémoire initial…'
initrd /boot/initrd.img-3.16.0-30-generic
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry 'Memory test (memtest86+)' {
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
else
search --no-floppy --fs-uuid --set=root bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
fi
knetbsd /boot/memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
else
search --no-floppy --fs-uuid --set=root bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
fi
knetbsd /boot/memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
else
search --no-floppy --fs-uuid --set=root bcb37a5f-1f01-4e5e-af5c-a0b6bef404e6
fi
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (sur /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-AE52561A5255E81B' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 AE52561A5255E81B
else
search --no-floppy --fs-uuid --set=root AE52561A5255E81B
fi
parttool ${root} hidden-
chainloader +1
}
menuentry 'Windows 7 (loader) (sur /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-chain-7E9E09709E0921EF' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 7E9E09709E0921EF
else
search --no-floppy --fs-uuid --set=root 7E9E09709E0921EF
fi
parttool ${root} hidden-
chainloader +1
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
set timeout=10
fi
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Dernière modification par Orbital_Verbose (Le 07/07/2015, à 05:45)
Si ça intéresse, un roman que j'écris et qui est lisible gratuitement sur le net : Le conflit du Multivers
Hors ligne
#14 Le 07/07/2015, à 06:23
- nany
Re : [Résolu] Couleur de Grub
Alors là, il y a un truc qui m’échappe.
Afin de voir si j’ai bien le même script que chez-toi donne le retour de :
cat /etc/grub.d/05_debian_theme
EDIT : ainsi que
cat /etc/grub.d/00_header
Dernière modification par nany (Le 07/07/2015, à 06:29)
En ligne
#15 Le 07/07/2015, à 19:04
- Orbital_Verbose
Re : [Résolu] Couleur de Grub
Bonsoir
cat /etc/grub.d/05_debian_theme
#!/bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2010 Alexander Kurtz <kurtz.alex@googlemail.com>
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
# Include the GRUB helper library for grub-mkconfig.
. /usr/share/grub/grub-mkconfig_lib
# We want to work in /boot/grub/ only.
test -d /boot/grub; cd /boot/grub
# Set the location of a possibly necessary cache file for the background image.
# NOTE: This MUST BE A DOTFILE to avoid confusing it with user-defined images.
BACKGROUND_CACHE=".background_cache"
set_default_theme(){
case $GRUB_DISTRIBUTOR in
Tanglu|Ubuntu|Kubuntu)
# Set a monochromatic theme for Tanglu/Ubuntu.
echo "${1}set menu_color_normal=green/black"
echo "${1}set menu_color_highlight=light-green/black"
if [ -e /lib/plymouth/themes/default.grub ]; then
sed "s/^/${1}/" /lib/plymouth/themes/default.grub
fi
;;
*)
# Set the traditional Debian blue theme.
echo "${1}set menu_color_normal=cyan/blue"
echo "${1}set menu_color_highlight=white/blue"
;;
esac
}
module_available(){
local module
for module in "${1}.mod" */"${1}.mod"; do
if [ -f "${module}" ]; then
return 0
fi
done
return 1
}
set_background_image(){
# Step #1: Search all available output modes ...
local output
for output in ${GRUB_TERMINAL_OUTPUT}; do
if [ "x$output" = "xgfxterm" ]; then
break
fi
done
# ... and check if we are able to display a background image at all.
if ! [ "x${output}" = "xgfxterm" ]; then
return 1
fi
# Step #2: Check if the specified background image exists.
if ! [ -f "${1}" ]; then
return 2
fi
# Step #3: Search the correct GRUB module for our background image.
local reader
case "${1}" in
*.jpg|*.JPG|*.jpeg|*.JPEG) reader="jpeg";;
*.png|*.PNG) reader="png";;
*.tga|*.TGA) reader="tga";;
*) return 3;; # Unknown image type.
esac
# Step #4: Check if the necessary GRUB module is available.
if ! module_available "${reader}"; then
return 4
fi
# Step #5: Check if GRUB can read the background image directly.
# If so, we can remove the cache file (if any). Otherwise the backgound
# image needs to be cached under /boot/grub/.
if is_path_readable_by_grub "${1}"; then
rm --force "${BACKGROUND_CACHE}.jpeg" \
"${BACKGROUND_CACHE}.png" "${BACKGROUND_CACHE}.tga"
elif cp "${1}" "${BACKGROUND_CACHE}.${reader}"; then
set -- "${BACKGROUND_CACHE}.${reader}" "${2}" "${3}"
else
return 5
fi
# Step #6: Prepare GRUB to read the background image.
if ! prepare_grub_to_access_device "`${grub_probe} --target=device "${1}"`"; then
return 6
fi
# Step #7: Everything went fine, print out a message to stderr ...
echo "Found background image: ${1}" >&2
# ... and write our configuration snippet to stdout. Use the colors
# desktop-base specified. If we're using a user-defined background, use
# the default colors since we've got no idea how the image looks like.
# If loading the background image fails, use the default theme.
echo "insmod ${reader}"
echo "if background_image `make_system_path_relative_to_its_root "${1}"`; then"
if [ -n "${2}" ]; then
echo " set color_normal=${2}"
fi
if [ -n "${3}" ]; then
echo " set color_highlight=${3}"
fi
if [ -z "${2}" ] && [ -z "${3}" ]; then
echo " true"
fi
echo "else"
set_default_theme " "
echo "fi"
}
# Earlier versions of grub-pc copied the default background image to /boot/grub
# during postinst. Remove those obsolete images if they haven't been touched by
# the user. They are still available under /usr/share/images/desktop-base/ if
# desktop-base is installed.
while read checksum background; do
if [ -f "${background}" ] && [ "x`sha1sum "${background}"`" = "x${checksum} ${background}" ]; then
echo "Removing old background image: ${background}" >&2
rm "${background}"
fi
done <<EOF
648ee65dd0c157a69b019a5372cbcfea4fc754a5 debian-blueish-wallpaper-640x480.png
0431e97a6c661084c59676c4baeeb8c2f602edb8 debian-blueish-wallpaper-640x480.png
968ecf6696c5638cfe80e8e70aba239526270864 debian-blueish-wallpaper-640x480.tga
11143e8c92a073401de0b0fd42d0c052af4ccd9b moreblue-orbit-grub.png
d00d5e505ab63f2d53fa880bfac447e2d3bb197c moreblue-orbit-grub.png
f5b12c1009ec0a3b029185f6b66cd0d7e5611019 moreblue-orbit-grub.png
EOF
# Include the configuration of desktop-base if available.
if [ -f "/usr/share/desktop-base/grub_background.sh" ]; then
. "/usr/share/desktop-base/grub_background.sh"
fi
# First check whether the user has specified a background image explicitly.
# If so, try to use it. Don't try the other possibilities in that case
# (#608263).
if [ -n "${GRUB_BACKGROUND+x}" ]; then
set_background_image "${GRUB_BACKGROUND}" || set_default_theme
exit 0
fi
# Next search for pictures the user put into /boot/grub/ and use the first one.
for background in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA; do
if set_background_image "${background}"; then
exit 0
fi
done
# Next try to use the background image and colors specified by desktop-base.
if set_background_image "${WALLPAPER}" "${COLOR_NORMAL}" "${COLOR_HIGHLIGHT}"; then
exit 0
fi
# If we haven't found a background image yet, use the default from desktop-base.
case $GRUB_DISTRIBUTOR in
Ubuntu|Kubuntu)
;;
Tanglu)
if set_background_image "/usr/share/images/grub/grub.png"; then
exit 0
fi
;;
*)
if set_background_image "/usr/share/images/desktop-base/desktop-grub.png"; then
exit 0
fi
;;
esac
# Finally, if all of the above fails, use the default theme.
set_default_theme
et cat /etc/grub.d/00_header :
#!/bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2010 Alexander Kurtz <kurtz.alex@googlemail.com>
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
# Include the GRUB helper library for grub-mkconfig.
. /usr/share/grub/grub-mkconfig_lib
# We want to work in /boot/grub/ only.
test -d /boot/grub; cd /boot/grub
# Set the location of a possibly necessary cache file for the background image.
# NOTE: This MUST BE A DOTFILE to avoid confusing it with user-defined images.
BACKGROUND_CACHE=".background_cache"
set_default_theme(){
case $GRUB_DISTRIBUTOR in
Tanglu|Ubuntu|Kubuntu)
# Set a monochromatic theme for Tanglu/Ubuntu.
echo "${1}set menu_color_normal=green/black"
echo "${1}set menu_color_highlight=light-green/black"
if [ -e /lib/plymouth/themes/default.grub ]; then
sed "s/^/${1}/" /lib/plymouth/themes/default.grub
fi
;;
*)
# Set the traditional Debian blue theme.
echo "${1}set menu_color_normal=cyan/blue"
echo "${1}set menu_color_highlight=white/blue"
;;
esac
}
module_available(){
local module
for module in "${1}.mod" */"${1}.mod"; do
if [ -f "${module}" ]; then
return 0
fi
done
return 1
}
set_background_image(){
# Step #1: Search all available output modes ...
local output
for output in ${GRUB_TERMINAL_OUTPUT}; do
if [ "x$output" = "xgfxterm" ]; then
break
fi
done
# ... and check if we are able to display a background image at all.
if ! [ "x${output}" = "xgfxterm" ]; then
return 1
fi
# Step #2: Check if the specified background image exists.
if ! [ -f "${1}" ]; then
return 2
fi
# Step #3: Search the correct GRUB module for our background image.
local reader
case "${1}" in
*.jpg|*.JPG|*.jpeg|*.JPEG) reader="jpeg";;
*.png|*.PNG) reader="png";;
*.tga|*.TGA) reader="tga";;
*) return 3;; # Unknown image type.
esac
# Step #4: Check if the necessary GRUB module is available.
if ! module_available "${reader}"; then
return 4
fi
# Step #5: Check if GRUB can read the background image directly.
# If so, we can remove the cache file (if any). Otherwise the backgound
# image needs to be cached under /boot/grub/.
if is_path_readable_by_grub "${1}"; then
rm --force "${BACKGROUND_CACHE}.jpeg" \
"${BACKGROUND_CACHE}.png" "${BACKGROUND_CACHE}.tga"
elif cp "${1}" "${BACKGROUND_CACHE}.${reader}"; then
set -- "${BACKGROUND_CACHE}.${reader}" "${2}" "${3}"
else
return 5
fi
# Step #6: Prepare GRUB to read the background image.
if ! prepare_grub_to_access_device "`${grub_probe} --target=device "${1}"`"; then
return 6
fi
# Step #7: Everything went fine, print out a message to stderr ...
echo "Found background image: ${1}" >&2
# ... and write our configuration snippet to stdout. Use the colors
# desktop-base specified. If we're using a user-defined background, use
# the default colors since we've got no idea how the image looks like.
# If loading the background image fails, use the default theme.
echo "insmod ${reader}"
echo "if background_image `make_system_path_relative_to_its_root "${1}"`; then"
if [ -n "${2}" ]; then
echo " set color_normal=${2}"
fi
if [ -n "${3}" ]; then
echo " set color_highlight=${3}"
fi
if [ -z "${2}" ] && [ -z "${3}" ]; then
echo " true"
fi
echo "else"
set_default_theme " "
echo "fi"
}
# Earlier versions of grub-pc copied the default background image to /boot/grub
# during postinst. Remove those obsolete images if they haven't been touched by
# the user. They are still available under /usr/share/images/desktop-base/ if
# desktop-base is installed.
while read checksum background; do
if [ -f "${background}" ] && [ "x`sha1sum "${background}"`" = "x${checksum} ${background}" ]; then
echo "Removing old background image: ${background}" >&2
rm "${background}"
fi
done <<EOF
648ee65dd0c157a69b019a5372cbcfea4fc754a5 debian-blueish-wallpaper-640x480.png
0431e97a6c661084c59676c4baeeb8c2f602edb8 debian-blueish-wallpaper-640x480.png
968ecf6696c5638cfe80e8e70aba239526270864 debian-blueish-wallpaper-640x480.tga
11143e8c92a073401de0b0fd42d0c052af4ccd9b moreblue-orbit-grub.png
d00d5e505ab63f2d53fa880bfac447e2d3bb197c moreblue-orbit-grub.png
f5b12c1009ec0a3b029185f6b66cd0d7e5611019 moreblue-orbit-grub.png
EOF
# Include the configuration of desktop-base if available.
if [ -f "/usr/share/desktop-base/grub_background.sh" ]; then
. "/usr/share/desktop-base/grub_background.sh"
fi
# First check whether the user has specified a background image explicitly.
# If so, try to use it. Don't try the other possibilities in that case
# (#608263).
if [ -n "${GRUB_BACKGROUND+x}" ]; then
set_background_image "${GRUB_BACKGROUND}" || set_default_theme
exit 0
fi
# Next search for pictures the user put into /boot/grub/ and use the first one.
for background in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA; do
if set_background_image "${background}"; then
exit 0
fi
done
# Next try to use the background image and colors specified by desktop-base.
if set_background_image "${WALLPAPER}" "${COLOR_NORMAL}" "${COLOR_HIGHLIGHT}"; then
exit 0
fi
# If we haven't found a background image yet, use the default from desktop-base.
case $GRUB_DISTRIBUTOR in
Ubuntu|Kubuntu)
;;
Tanglu)
if set_background_image "/usr/share/images/grub/grub.png"; then
exit 0
fi
;;
*)
if set_background_image "/usr/share/images/desktop-base/desktop-grub.png"; then
exit 0
fi
;;
esac
# Finally, if all of the above fails, use the default theme.
set_default_theme
orbital@Damocles:~$ ^C
orbital@Damocles:~$ cat /etc/grub.d/00_header
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
grub_lang=`echo $LANG | cut -d . -f 1`
grubdir="`echo "/boot/grub" | sed 's,//*,/,g'`"
quick_boot="1"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
. "${datarootdir}/grub/grub-mkconfig_lib"
# Do this as early as possible, since other commands might depend on it.
# (e.g. the `loadfont' command might need lvm or raid modules)
for i in ${GRUB_PRELOAD_MODULES} ; do
echo "insmod $i"
done
if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi
if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then GRUB_DEFAULT='${saved_entry}' ; fi
if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi
if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=auto ; fi
if [ "x${GRUB_DEFAULT_BUTTON}" = "x" ] ; then GRUB_DEFAULT_BUTTON="$GRUB_DEFAULT" ; fi
if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_entry}' ; fi
if [ "x${GRUB_TIMEOUT_BUTTON}" = "x" ] ; then GRUB_TIMEOUT_BUTTON="$GRUB_TIMEOUT" ; fi
cat << EOF
if [ -s \$prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
EOF
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
cat <<EOF
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
set default="${GRUB_DEFAULT_BUTTON}"
elif [ "\${next_entry}" ] ; then
set default="\${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="${GRUB_DEFAULT}"
fi
EOF
else
cat <<EOF
if [ "\${next_entry}" ] ; then
set default="\${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="${GRUB_DEFAULT}"
fi
EOF
fi
cat <<EOF
if [ x"\${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "\${prev_saved_entry}" ]; then
set saved_entry="\${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "\${boot_once}" ]; then
saved_entry="\${chosen}"
save_env saved_entry
fi
}
EOF
if [ "$quick_boot" = 1 ]; then
cat <<EOF
function recordfail {
set recordfail=1
EOF
FS="$(grub-probe --target=fs "${grubdir}")"
case "$FS" in
btrfs | cpiofs | newc | odc | romfs | squash4 | tarfs | zfs)
cat <<EOF
# GRUB lacks write support for $FS, so recordfail support is disabled.
EOF
;;
*)
cat <<EOF
if [ -n "\${have_grubenv}" ]; then if [ -z "\${boot_once}" ]; then save_env recordfail; fi; fi
EOF
esac
cat <<EOF
}
EOF
fi
cat <<EOF
function load_video {
EOF
if [ -n "${GRUB_VIDEO_BACKEND}" ]; then
cat <<EOF
insmod ${GRUB_VIDEO_BACKEND}
EOF
else
# If all_video.mod isn't available load all modules available
# with versions prior to introduction of all_video.mod
cat <<EOF
if [ x\$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
EOF
fi
cat <<EOF
}
EOF
serial=0;
gfxterm=0;
for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
if [ xserial = "x$x" ]; then
serial=1;
fi
if [ xgfxterm = "x$x" ]; then
gfxterm=1;
fi
done
if [ "x$serial" = x1 ]; then
if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then
grub_warn "$(gettext "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used.")"
GRUB_SERIAL_COMMAND=serial
fi
echo "${GRUB_SERIAL_COMMAND}"
fi
if [ "x$gfxterm" = x1 ]; then
if [ -n "$GRUB_FONT" ] ; then
# Make the font accessible
prepare_grub_to_access_device `${grub_probe} --target=device "${GRUB_FONT}"`
cat << EOF
if loadfont `make_system_path_relative_to_its_root "${GRUB_FONT}"` ; then
EOF
else
for dir in "${pkgdatadir}" "`echo '/boot/grub' | sed "s,//*,/,g"`" /usr/share/grub ; do
for basename in unicode unifont ascii; do
path="${dir}/${basename}.pf2"
if is_path_readable_by_grub "${path}" > /dev/null ; then
font_path="${path}"
else
continue
fi
break 2
done
done
if [ -n "${font_path}" ] ; then
cat << EOF
if [ x\$feature_default_font_path = xy ] ; then
font=unicode
else
EOF
# Make the font accessible
prepare_grub_to_access_device `${grub_probe} --target=device "${font_path}"`
cat << EOF
font="`make_system_path_relative_to_its_root "${font_path}"`"
fi
if loadfont \$font ; then
EOF
else
cat << EOF
if loadfont unicode ; then
EOF
fi
fi
cat << EOF
set gfxmode=${GRUB_GFXMODE}
load_video
insmod gfxterm
EOF
# Gettext variables and module
if [ "x${LANG}" != "xC" ] && [ "x${LANG}" != "x" ]; then
cat << EOF
set locale_dir=\$prefix/locale
set lang=${grub_lang}
insmod gettext
EOF
fi
cat <<EOF
fi
EOF
fi
case x${GRUB_TERMINAL_INPUT} in
x)
# Just use the native terminal
;;
x*)
cat << EOF
terminal_input ${GRUB_TERMINAL_INPUT}
EOF
;;
esac
case x${GRUB_TERMINAL_OUTPUT} in
x)
# Just use the native terminal
;;
x*)
cat << EOF
terminal_output ${GRUB_TERMINAL_OUTPUT}
EOF
;;
esac
if [ "x$gfxterm" = x1 ]; then
if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \
&& is_path_readable_by_grub "$GRUB_THEME"; then
gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&2
prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"`
cat << EOF
insmod gfxmenu
EOF
themedir="`dirname "$GRUB_THEME"`"
for x in "$themedir"/*.pf2 "$themedir"/f/*.pf2; do
if [ -f "$x" ]; then
cat << EOF
loadfont (\$root)`make_system_path_relative_to_its_root $x`
EOF
fi
done
if [ x"`echo "$themedir"/*.jpg`" != x"$themedir/*.jpg" ] || [ x"`echo "$themedir"/*.jpeg`" != x"$themedir/*.jpeg" ]; then
cat << EOF
insmod jpeg
EOF
fi
if [ x"`echo "$themedir"/*.png`" != x"$themedir/*.png" ]; then
cat << EOF
insmod png
EOF
fi
if [ x"`echo "$themedir"/*.tga`" != x"$themedir/*.tga" ]; then
cat << EOF
insmod tga
EOF
fi
cat << EOF
set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME`
export theme
EOF
elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \
&& is_path_readable_by_grub "$GRUB_BACKGROUND"; then
gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&2
case "$GRUB_BACKGROUND" in
*.png) reader=png ;;
*.tga) reader=tga ;;
*.jpg|*.jpeg) reader=jpeg ;;
*) gettext "Unsupported image format" >&2; echo >&2; exit 1 ;;
esac
prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"`
cat << EOF
insmod $reader
background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"`
EOF
fi
fi
make_timeout ()
{
cat << EOF
if [ "\${recordfail}" = 1 ] ; then
set timeout=${GRUB_RECORDFAIL_TIMEOUT:--1}
else
EOF
if [ "x${3}" != "x" ] ; then
timeout="${2}"
style="${3}"
elif [ "x${1}" != "x" ] && \
([ "$quick_boot" = 1 ] || [ "x${1}" != "x0" ]) ; then
# Handle the deprecated GRUB_HIDDEN_TIMEOUT scheme.
timeout="${1}"
if [ "x${2}" != "x0" ] ; then
grub_warn "$(gettext "Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.")"
fi
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
style="hidden"
verbose=
else
style="countdown"
verbose=" --verbose"
fi
else
# No hidden timeout, so treat as GRUB_TIMEOUT_STYLE=menu
timeout="${2}"
style="menu"
fi
cat << EOF
if [ x\$feature_timeout_style = xy ] ; then
set timeout_style=${style}
set timeout=${timeout}
EOF
if [ "x${style}" = "xmenu" ] ; then
cat << EOF
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=${timeout}
EOF
else
cat << EOF
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep${verbose} --interruptible ${timeout} ; then
set timeout=0
EOF
fi
cat << EOF
fi
fi
EOF
}
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
cat <<EOF
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
EOF
make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_STYLE_BUTTON}"
echo else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}" "${GRUB_TIMEOUT_STYLE}"
echo fi
else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}" "${GRUB_TIMEOUT_STYLE}"
fi
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ] && [ "x$GRUB_BUTTON_CMOS_CLEAN" = "xyes" ]; then
cat <<EOF
cmosclean $GRUB_BUTTON_CMOS_ADDRESS
EOF
fi
# Play an initial tune
if [ "x${GRUB_INIT_TUNE}" != "x" ] ; then
echo "play ${GRUB_INIT_TUNE}"
fi
if [ "x${GRUB_BADRAM}" != "x" ] ; then
echo "badram ${GRUB_BADRAM}"
fi
orbital@Damocles:~$ clear
orbital@Damocles:~$ cat /etc/grub.d/00_header
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
grub_lang=`echo $LANG | cut -d . -f 1`
grubdir="`echo "/boot/grub" | sed 's,//*,/,g'`"
quick_boot="1"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
. "${datarootdir}/grub/grub-mkconfig_lib"
# Do this as early as possible, since other commands might depend on it.
# (e.g. the `loadfont' command might need lvm or raid modules)
for i in ${GRUB_PRELOAD_MODULES} ; do
echo "insmod $i"
done
if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi
if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then GRUB_DEFAULT='${saved_entry}' ; fi
if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi
if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=auto ; fi
if [ "x${GRUB_DEFAULT_BUTTON}" = "x" ] ; then GRUB_DEFAULT_BUTTON="$GRUB_DEFAULT" ; fi
if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_entry}' ; fi
if [ "x${GRUB_TIMEOUT_BUTTON}" = "x" ] ; then GRUB_TIMEOUT_BUTTON="$GRUB_TIMEOUT" ; fi
cat << EOF
if [ -s \$prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
EOF
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
cat <<EOF
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
set default="${GRUB_DEFAULT_BUTTON}"
elif [ "\${next_entry}" ] ; then
set default="\${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="${GRUB_DEFAULT}"
fi
EOF
else
cat <<EOF
if [ "\${next_entry}" ] ; then
set default="\${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="${GRUB_DEFAULT}"
fi
EOF
fi
cat <<EOF
if [ x"\${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "\${prev_saved_entry}" ]; then
set saved_entry="\${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "\${boot_once}" ]; then
saved_entry="\${chosen}"
save_env saved_entry
fi
}
EOF
if [ "$quick_boot" = 1 ]; then
cat <<EOF
function recordfail {
set recordfail=1
EOF
FS="$(grub-probe --target=fs "${grubdir}")"
case "$FS" in
btrfs | cpiofs | newc | odc | romfs | squash4 | tarfs | zfs)
cat <<EOF
# GRUB lacks write support for $FS, so recordfail support is disabled.
EOF
;;
*)
cat <<EOF
if [ -n "\${have_grubenv}" ]; then if [ -z "\${boot_once}" ]; then save_env recordfail; fi; fi
EOF
esac
cat <<EOF
}
EOF
fi
cat <<EOF
function load_video {
EOF
if [ -n "${GRUB_VIDEO_BACKEND}" ]; then
cat <<EOF
insmod ${GRUB_VIDEO_BACKEND}
EOF
else
# If all_video.mod isn't available load all modules available
# with versions prior to introduction of all_video.mod
cat <<EOF
if [ x\$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
EOF
fi
cat <<EOF
}
EOF
serial=0;
gfxterm=0;
for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
if [ xserial = "x$x" ]; then
serial=1;
fi
if [ xgfxterm = "x$x" ]; then
gfxterm=1;
fi
done
if [ "x$serial" = x1 ]; then
if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then
grub_warn "$(gettext "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used.")"
GRUB_SERIAL_COMMAND=serial
fi
echo "${GRUB_SERIAL_COMMAND}"
fi
if [ "x$gfxterm" = x1 ]; then
if [ -n "$GRUB_FONT" ] ; then
# Make the font accessible
prepare_grub_to_access_device `${grub_probe} --target=device "${GRUB_FONT}"`
cat << EOF
if loadfont `make_system_path_relative_to_its_root "${GRUB_FONT}"` ; then
EOF
else
for dir in "${pkgdatadir}" "`echo '/boot/grub' | sed "s,//*,/,g"`" /usr/share/grub ; do
for basename in unicode unifont ascii; do
path="${dir}/${basename}.pf2"
if is_path_readable_by_grub "${path}" > /dev/null ; then
font_path="${path}"
else
continue
fi
break 2
done
done
if [ -n "${font_path}" ] ; then
cat << EOF
if [ x\$feature_default_font_path = xy ] ; then
font=unicode
else
EOF
# Make the font accessible
prepare_grub_to_access_device `${grub_probe} --target=device "${font_path}"`
cat << EOF
font="`make_system_path_relative_to_its_root "${font_path}"`"
fi
if loadfont \$font ; then
EOF
else
cat << EOF
if loadfont unicode ; then
EOF
fi
fi
cat << EOF
set gfxmode=${GRUB_GFXMODE}
load_video
insmod gfxterm
EOF
# Gettext variables and module
if [ "x${LANG}" != "xC" ] && [ "x${LANG}" != "x" ]; then
cat << EOF
set locale_dir=\$prefix/locale
set lang=${grub_lang}
insmod gettext
EOF
fi
cat <<EOF
fi
EOF
fi
case x${GRUB_TERMINAL_INPUT} in
x)
# Just use the native terminal
;;
x*)
cat << EOF
terminal_input ${GRUB_TERMINAL_INPUT}
EOF
;;
esac
case x${GRUB_TERMINAL_OUTPUT} in
x)
# Just use the native terminal
;;
x*)
cat << EOF
terminal_output ${GRUB_TERMINAL_OUTPUT}
EOF
;;
esac
if [ "x$gfxterm" = x1 ]; then
if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \
&& is_path_readable_by_grub "$GRUB_THEME"; then
gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&2
prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"`
cat << EOF
insmod gfxmenu
EOF
themedir="`dirname "$GRUB_THEME"`"
for x in "$themedir"/*.pf2 "$themedir"/f/*.pf2; do
if [ -f "$x" ]; then
cat << EOF
loadfont (\$root)`make_system_path_relative_to_its_root $x`
EOF
fi
done
if [ x"`echo "$themedir"/*.jpg`" != x"$themedir/*.jpg" ] || [ x"`echo "$themedir"/*.jpeg`" != x"$themedir/*.jpeg" ]; then
cat << EOF
insmod jpeg
EOF
fi
if [ x"`echo "$themedir"/*.png`" != x"$themedir/*.png" ]; then
cat << EOF
insmod png
EOF
fi
if [ x"`echo "$themedir"/*.tga`" != x"$themedir/*.tga" ]; then
cat << EOF
insmod tga
EOF
fi
cat << EOF
set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME`
export theme
EOF
elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \
&& is_path_readable_by_grub "$GRUB_BACKGROUND"; then
gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&2
case "$GRUB_BACKGROUND" in
*.png) reader=png ;;
*.tga) reader=tga ;;
*.jpg|*.jpeg) reader=jpeg ;;
*) gettext "Unsupported image format" >&2; echo >&2; exit 1 ;;
esac
prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"`
cat << EOF
insmod $reader
background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"`
EOF
fi
fi
make_timeout ()
{
cat << EOF
if [ "\${recordfail}" = 1 ] ; then
set timeout=${GRUB_RECORDFAIL_TIMEOUT:--1}
else
EOF
if [ "x${3}" != "x" ] ; then
timeout="${2}"
style="${3}"
elif [ "x${1}" != "x" ] && \
([ "$quick_boot" = 1 ] || [ "x${1}" != "x0" ]) ; then
# Handle the deprecated GRUB_HIDDEN_TIMEOUT scheme.
timeout="${1}"
if [ "x${2}" != "x0" ] ; then
grub_warn "$(gettext "Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.")"
fi
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
style="hidden"
verbose=
else
style="countdown"
verbose=" --verbose"
fi
else
# No hidden timeout, so treat as GRUB_TIMEOUT_STYLE=menu
timeout="${2}"
style="menu"
fi
cat << EOF
if [ x\$feature_timeout_style = xy ] ; then
set timeout_style=${style}
set timeout=${timeout}
EOF
if [ "x${style}" = "xmenu" ] ; then
cat << EOF
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=${timeout}
EOF
else
cat << EOF
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep${verbose} --interruptible ${timeout} ; then
set timeout=0
EOF
fi
cat << EOF
fi
fi
EOF
}
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
cat <<EOF
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
EOF
make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_STYLE_BUTTON}"
echo else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}" "${GRUB_TIMEOUT_STYLE}"
echo fi
else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}" "${GRUB_TIMEOUT_STYLE}"
fi
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ] && [ "x$GRUB_BUTTON_CMOS_CLEAN" = "xyes" ]; then
cat <<EOF
cmosclean $GRUB_BUTTON_CMOS_ADDRESS
EOF
fi
# Play an initial tune
if [ "x${GRUB_INIT_TUNE}" != "x" ] ; then
echo "play ${GRUB_INIT_TUNE}"
fi
if [ "x${GRUB_BADRAM}" != "x" ] ; then
echo "badram ${GRUB_BADRAM}"
fi
Si ça intéresse, un roman que j'écris et qui est lisible gratuitement sur le net : Le conflit du Multivers
Hors ligne
#16 Le 07/07/2015, à 20:40
- nany
Re : [Résolu] Couleur de Grub
Ok, je comprends. C’est la fonction set_default_theme du script 05_debian_theme qui intègre ces couleurs.
Peut-être que le script a été modifié à ton insu lorsque tu as utilisé grub-customizer.
Alors deux solutions sont possibles : la première est de transférer les trois lignes de /etc/default/grub vers /etc/grub.d/05_debian_theme (juste après la ligne BACKGROUND_CACHE=".background_cache") et la deuxième qui consiste à utiliser /etc/grub.d/40_custom. Je préfère la deuxième car après tout le script 40_custom est là pour ça et on n’a pas à modifier les autres fichiers système.
Voici donc ce que je te propose :
remettre /etc/default/grub à son état d’origine ;
placer l’image dans /boot/grub ;
modifier /etc/grub.d/40_custom en y ajoutant ces deux lignes
set menu_color_normal=green/black set menu_color_highlight=light-green/black
Si tu souhaites voir TOUT le grub en vert, ajoute aussi cette troisième ligne
set color_normal=green/black
Il ne te restera plus, en principe, qu’à faire un update-grub et à redémarrer pour admirer le résultat.
En ligne
#17 Le 07/07/2015, à 20:43
- Orbital_Verbose
Re : [Résolu] Couleur de Grub
Ok, ca roule !
Tout fonctionne ! Génial ! Merci encore de être penchée sur le sujet.
Sujet Résolu !
Si ça intéresse, un roman que j'écris et qui est lisible gratuitement sur le net : Le conflit du Multivers
Hors ligne