Bonjour,

Avec Fedora 16, je n'arrive pas à personnaliser grub2.
Je voudrais mettre une image de fond personnalisée.
Lorsque mon ordinateur démarre, le menu grub2 est un texte blanc, sur un fond noir.
Si quelqu'un a réussi qu'il me dise comment il a fait ...
Sous Fedora 15, je l'avais fait, mais ça n'était pas grub2 le chargeur de démarrage.
Salut! Je crois que c'est pas possible pour l'instant parce qu'il n'y a pas de "_theme" dans /etc/grub.d/ ... Si tu trouve comment, dit le :-P
T'as réussi Refuznik ? Je veux pas "casser" grub2..

Bon ben j'essai en VM.
En virtual machine, pour la couleur ça fonctionne mais pas pour le background



# cat /etc/grub.d/05_fedora_theme
#!/bin/bash -e
 
source /usr/lib/grub/grub-mkconfig_lib
 
set_mono_theme()
{
  cat << EOF
set menu_color_normal=yellow/black
set menu_color_highlight=red/white
EOF
}
 
# check for usable backgrounds
use_bg=false
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
  for i in {/boot/grub,/usr/share/backgrounds/verne/default/normalish}/verne.{png,tga} ; do
    if is_path_readable_by_grub $i ; then 
      bg=$i
      case ${bg} in
        *.png)		reader=png ;;
        *.tga)		reader=tga ;;
        *.jpg|*.jpeg)	reader=jpeg ;;
      esac
      if test -e /boot/grub/${reader}.mod ; then
        echo "Found Fedora background: `basename ${bg}`" >&2
        use_bg=true
        break
      fi
    fi
  done
fi
 
# set the background if possible
if ${use_bg} ; then
  prepare_grub_to_access_device `${grub_probe} --target=device ${bg}`
  cat << EOF
insmod ${reader}
if background_image `make_system_path_relative_to_its_root ${bg}` ; then
  set color_normal=yellow/black
  set color_highlight=red/light-blue
else
EOF
fi
 
# otherwise, set a monochromatic theme for Ubuntu
if ${use_bg} ; then
  set_mono_theme | sed -e "s/^/  /g"
  echo "fi"
else
  set_mono_theme
fi
Pour regénérer GRUB2
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-0.rc1.git0.2.fc17.x86_64
Found initrd image: /boot/initramfs-3.2.0-0.rc1.git0.2.fc17.x86_64.img
Found linux image: /boot/vmlinuz-3.1.0-7.fc16.x86_64
Found initrd image: /boot/initramfs-3.1.0-7.fc16.x86_64.img
done
Il serait supposer de donner -> Found Fedora background: .... ??

/usr/share/backgrounds/verne/default/normalish/verne.png: PNG image data, 1280 x 1024, 8-bit/color RGBA, non-interlaced
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
Donc j'ai rajouté -> GRUB_TERMINAL_OUTPUT=gfxterm à /etc/default/grub
# grub2-mkconfig -o /boot/grub2/grub.cfg 
No font for gfxterm found.

# locate gfxterm
/boot/grub2/gfxterm.mod
/usr/lib/grub2/i386-pc/gfxterm.mod
Quelqu'un aurait-il une idée ?
J'ai enfin réussi grâce à ce site http://aborrecido.wordpress.com/2010/08/08/grub2-and-fedora/
aborrecido wrote: I couldn’t find a package with this font, so I needed to download unifont from http://unifoundry.com/unifont.html and convert it with “grub2-mkfont -o /boot/grub2/unifont.pf2 /path/to/font/unifont.pcf“. Permission sanity check so that grub can actually see the font!
Ensuite, exemple ->

# cat /etc/grub.d/05_fedora_theme
#!/bin/bash -e
 
source /usr/lib/grub/grub-mkconfig_lib
 
set_mono_theme()
{
  cat << EOF
set menu_color_normal=cyan/black
set menu_color_highlight=blue/white
EOF
}

# check for usable backgrounds
use_bg=false
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
  for i in {/boot/grub,/usr/share/backgrounds/verne/default/normalish}/verne.{png,tga} ; do
    if is_path_readable_by_grub $i ; then 
      bg=$i
      case ${bg} in
        *.png)		reader=png ;;
        *.tga)		reader=tga ;;
        *.jpg|*.jpeg)	reader=jpeg ;;
      esac
      if test -e /boot/grub2/${reader}.mod ; then
        echo "Found Fedora background: `basename ${bg}`" >&2
        use_bg=true
        break
      fi
    fi
  done
fi
 
# set the background if possible
if ${use_bg} ; then
  prepare_grub_to_access_device `${grub_probe} --target=device ${bg}`
  cat << EOF
insmod ${reader}
if background_image `make_system_path_relative_to_its_root ${bg}` ; then
  set color_normal=cyan/black
  set color_highlight=blue/white
else
EOF
fi
 
# otherwise, set a monochromatic theme for Ubuntu
if ${use_bg} ; then
  set_mono_theme | sed -e "s/^/  /g"
  echo "fi"
else
  set_mono_theme
fi
/usr/share/backgrounds/verne/default/normalish/verne.png: PNG image data, 1280 x 1024, 8-bit/color RGBA, non-interlaced

# cat /etc/default/grub
GRUB_GFXMODE=1280x1024x32
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_TERMINAL_OUTPUT=gfxterm
Puis
# grub2-mkconfig -o /boot/grub2/grub.cfg 
Generating grub.cfg ...
Found Fedora background: verne.png
Found linux image: /boot/vmlinuz-3.1.0-7.fc16.x86_64
Found initrd image: /boot/initramfs-3.1.0-7.fc16.x86_64.img
  No volume groups found
done
5 jours plus tard
Effectivement ça marche.
Merci à DiEOrLivE et aux autres.
J'espère que lorsque Fedora 17 sortira ça sera plus simple et intégré à la distrib' pour mettre une image de fond perso à grub2.
chark wrote:J'espère que lorsque Fedora 17 sortira ça sera plus simple et intégré à la distrib' pour mettre une image de fond perso à grub2.
Derien, j'espère moi aussi! :-P
bonjour,
chez moi impossible d'afficher verne.png
grub2-mkconfig -o /boot/grub2/grub.cfg 
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.1.1-1.fc16.x86_64
Found initrd image: /boot/initramfs-3.1.1-1.fc16.x86_64.img
Found linux image: /boot/vmlinuz-3.1.0-7.fc16.x86_64
Found initrd image: /boot/initramfs-3.1.0-7.fc16.x86_64.img
  No volume groups found
Found Windows Recovery Environment (loader) on /dev/sda1
Found Windows 7 (loader) on /dev/sda2
done
etrange
quelle erreur je commet ?

a+
re,
cat /etc/default/grub
GRUB_GFXMODE=1280x1024x32
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_TERMINAL_OUTPUT=gfxterm
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Fedora"
GRUB_DEFAULT=saved
GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 quiet LANG=fr_FR.UTF-8 SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0  KEYTABLE=fr-latin9"

cat /etc/grub.d/05_fedora_theme
#!/bin/bash -e
 
source /usr/lib/grub/grub-mkconfig_lib
 
set_mono_theme()
{
  cat << EOF
set menu_color_normal=cyan/black
set menu_color_highlight=blue/white
EOF
}

# check for usable backgrounds
use_bg=false
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
  for i in {/boot/grub,/usr/share/backgrounds/verne/default/normalish}/plasma.{png,tga} ; do
                      
    if is_path_readable_by_grub $i ; then 
      bg=$i
      case ${bg} in
        *.png)          reader=png ;;
        *.tga)          reader=tga ;;
        *.jpg|*.jpeg)   reader=jpeg ;;
      esac
      if test -e /boot/grub2/${reader}.mod ; then
        echo "Found Fedora background: `basename ${bg}`" >&2
        use_bg=true
        break
      fi
    fi
  done
fi
 
# set the background if possible
if ${use_bg} ; then
  prepare_grub_to_access_device `${grub_probe} --target=device ${bg}`
  cat << EOF
insmod ${reader}
if background_image `make_system_path_relative_to_its_root ${bg}` ; then
  set color_normal=cyan/black
  set color_highlight=blue/white
else
EOF
fi
 
# otherwise, set a monochromatic theme for fedora
if ${use_bg} ; then
  set_mono_theme | sed -e "s/^/  /g"
  echo "fi"
else
  set_mono_theme
fi
a+
Re, est-ce que tu as bien l'image plasma ?
$ file /usr/share/backgrounds/verne/default/normalish/plasma.*
re, oui
c'etait un teste avec l'image si je mets verne ça ne fonctionne pas par contre n'etant pas trop fort en anglais
ce paragraphe
I’ve decided to hack the config file I had generated earlier and made the replacements necessary by hand.

I’ve added the following:

01	# load font module & load unifont.pf2. loadfont can only be used after font module being loaded
02	# keep in mind that paths on config file refer to /boot/ which is the root of grub2. By using /grub2 we're actually pointing to /boot/grub2 from the filesystem root.
03	insmod font
04	loadfont /grub2/unifont.pf2
05	 
06	# load the modules I need
07	insmod vbe
08	insmod gfxterm
09	insmod png
10	 
11	# load the stuff I need
12	set gfxmode="1366x768x32"
13	set gfxpayload=keep
14	terminal_output gfxterm
15	terminal gfxterm
16	use_bg=true
17	background_image /grub2/goddard-1366x768.png

du lien
http://aborrecido.wordpress.com/2010/08/08/grub2-and-fedora/
il faut en faire quelque chose ?
a+
Dans le lien j'ai seulement suivi cette partie ->
http://unifoundry.com/unifont.html and convert it with “grub2-mkfont -o /boot/grub2/unifont.pf2 /path/to/font/unifont.pcf“
Comme tu n'as pas d'erreur en rechargeant les configs de grub2, tu as installé correctement la "font".

Hum peux tu paster
ls -l /etc/grub.d/05_fedora_theme
Il doit être executable.

Edit: Sinon je me demande qu'est-ce qu'il n'a pas de correct..
bonjour,
ok c'est bon
donc résumons car il me semble que les explications sont trop succincte pour ne pas poser de problème
la 1 er chose à faire est de charger la font unifont ici http://unifoundry.com/unifont.html
unifont-5.1.20080907.pcf.gz
je l'ai renommer unifont.pcf.gz
ensuite en root vous taper
grub2-mkfont -o /boot/grub2/unifont.pf2 /home/user/Téléchargements/unifont.pcf.gz  
si c'est la que se trouve la font sinon adapter
ensuite vous créer 05_fedora_theme comme déjà indique suivant le modèle de Dieorlive
rendez le exécutable
vous ajouter à /etc/default/grub les lignes
GRUB_GFXMODE=1280x1024x32
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_TERMINAL_OUTPUT=gfxterm
et maintenant
un petit
grub2-mkconfig -o /boot/grub2/grub.cfg 
et voila
votre grub est un peu moins austere...
http://members.iinet.net/~herman546/p20/GRUB2%20Splashimages.html
quelques images déjà prête si verne ne vous plait pas
Merci à DiEOrLivE et aux autres.
grub2 parait bien compliquer mais des que vous avez compris sont fonctionnement ça roule
a+
grub2
2 mois plus tard
Chez moi ça ne fonctionne pas;
les couleurs sont prises en compte mais pass l'image :X

je regarderai demain
4 mois plus tard
Bonjour,je déterre le post,j'ai une petite question qui me préoccupe.

Je ne sais pas comment adapter le script dans 05_fedora_theme.

le chemin pour aller jusqu'à verne est chez moi :
/usr/share/backgrounds/default/normalish/verne.png
et non:
/usr/share/backgrounds/verne/default/normalish/plasma
je suppose que je dois mettre:
for i in {/boot/grub,/usr/share/backgrounds/verne/default/normalish}/verne.{png,tga} ; do

et non:
for i in {/boot/grub,/usr/share/backgrounds/verne/default/normalish}/plasma.{png,tga} ; do
Désolé,mais j'ai pas envie de faire de bêtises et j'y connais rien en langage informatique.

d'avance,merci

jtro