Ce tuto prendra pour exemple le mien, c'est à dire je vais créer un lanceur pour redémarrer sous windows xp .
Prérequis : grub et un doigt pour tapper au moin.
Dans le haut de fichier menu.lst
sudo gedit /boot/grub/menu.lst
chercher :
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0
Et le changer par:
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default saved
Mettre timeout à 4 seconde par exemple aussi.
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 4
S'assurer que la section concernant windows xp est comme ceci:
title Microsoft Windows XP Professionnel
root (hd0,0)
savedefault 0
makeactive
chainloader +1
Ensuite compter en quel position est votre windows dans le fichier menu.lst, par exemple moi il était en 4eme position (on ne compte pas la ligne de séparation des système linux et windows)
Exemple mon grub ressemble a ça au démarrage en gros:
Ubuntu <== 1
Ubuntu safe
Memtest <== 3
Other blabla(ligne de séparation)
Windows XP <== 4
Donc on retient 4.
Ensuite on créer le script pour redémarrer:
sudo gedit /usr/local/bin/windows
#!/bin/bash
gksudo grub-set-default 4 ##ligne du système que l'on veut démarrer
gksudo reboot
On met les droit d'excecution
sudo chmod +x /usr/local/bin/windows
Ensuite créer un lanceur ou vous voulez avec l'icône que vous voulez avec comme commande : windows
Ou le lancer direct dans un terminal
Voila, si c'est pas clair dites le moi, je suis créver là et ....
Bonne chance
edit: Vous pourrez créer un lancer pour memtest par exemple mais comment faire si je veux cacher la ligne de memtest du menu grub? Une idée?