Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 07/07/2015, à 12:16

ar barzh paour

[Résolu] Personnalisation de GRUB

EDIT je rajoute ici un adverbe que j'aurais du mettre en tête dans le post originel :
d'ailleurs
y a-t-il une solution pour modifier la couleur de police et le fond d'écran ?
-si je place un image dans /boot/grub est bien prise en compte  OK
-je n'arrive à modifier la couleur des polices qu'en agissant directement sur le fichier 05_debian_theme
et 
soit j'ai un fond d'écran modifié avec une couleur de police "standard" (noire/blanche)
soit je n'ai pas de fond d'écran et j'arrive à obtenir une couleur de police modifiée
===> comme si c'était l'un ou l'autre .....

Dernière modification par ar barzh paour (Le 04/08/2015, à 18:00)


PC          : B760M DS3H DDR4,  12th Gen Intel(R) Core(TM) i3-12100, RAM DDR4 8GiB -2400 Ubuntu 22.04, 22.04, 23.04
Portable1 : Intel(R) Core(TM)2 Duo CPU     T6570  @ 2.10GHz RAM 4GiB DDR2 667 MHz Ubuntu 23.04 ( en voyage )
Portable2 : T5750  @ 2.00GHz RAM 1GiB DDR2 667 Mhz Ubuntu 20.04 ( batterie HS )
stourm a ran war bep tachenn (Angela Duval) ( Je combats sur tous les fronts )

Hors ligne

#2 Le 07/07/2015, à 12:26

ar barzh paour

Re : [Résolu] Personnalisation de GRUB

explication supplémentaire :
j'ai modifié /etc/default/grub en ajoutant

COLOR_NORMAL="green/black"
COLOR_HIGHLIGHT="light-green/black"

et en ajoutant une image dans /boot/grub : voila ce que me donne le grub.cfg

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos12'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos12 --hint-efi=hd0,msdos12 --hint-baremetal=ahci0,msdos12  700731a7-ff6c-4343-9863-5c527faf3984
else
  search --no-floppy --fs-uuid --set=root 700731a7-ff6c-4343-9863-5c527faf3984
fi
insmod jpeg
if background_image /boot/grub/2015-02-14:18-44-46-IMG_0471.JPG; then
  true
else
  set menu_color_normal=white/black
  set menu_color_highlight=black/light-gray
  if background_color 44,0,30,0; then
    clear
  fi
fi
### END /etc/grub.d/05_debian_theme ###

et en supprimant mon image de /boot/grub : volia ce que ça donne

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30,0; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

et idem en mettant dans /etc/default/grub

set COLOR_NORMAL="green/black"
set COLOR_HIGHLIGHT="light-green/black"

Dernière modification par cqfd93 (Le 07/07/2015, à 15:18)


PC          : B760M DS3H DDR4,  12th Gen Intel(R) Core(TM) i3-12100, RAM DDR4 8GiB -2400 Ubuntu 22.04, 22.04, 23.04
Portable1 : Intel(R) Core(TM)2 Duo CPU     T6570  @ 2.10GHz RAM 4GiB DDR2 667 MHz Ubuntu 23.04 ( en voyage )
Portable2 : T5750  @ 2.00GHz RAM 1GiB DDR2 667 Mhz Ubuntu 20.04 ( batterie HS )
stourm a ran war bep tachenn (Angela Duval) ( Je combats sur tous les fronts )

Hors ligne

#3 Le 07/07/2015, à 15:25

cqfd93

Re : [Résolu] Personnalisation de GRUB

Modération

Bonjour,

Merci de respecter les règles du forum en :

  • ne squattant pas les discussions des autres membres

  • utilisant les balises codes

  • et pourquoi pas en commençant par un petit bonjour, toujours apprécié !


cqfd93

Hors ligne

#4 Le 07/07/2015, à 16:14

nany

Re : [Résolu] Personnalisation de GRUB

Bonjour ar barzh paour,

pour avoir un bon aperçu d ta situation, donne s’il te plaît les retours des commandes suivantes :

cat /etc/grub.d/00_header
cat /etc/grub.d/05_debian_theme

En ligne

#5 Le 07/07/2015, à 18:01

ar barzh paour

Re : [Résolu] Personnalisation de GRUB

@cqfd93
excusez-moi si j'ai fauté , ma réponse est effectivement ambiguë

mais je considérais que je donnais une explication concernant le post en question

(et d'où l'absence du bonjour )

pour les balises ?? je n'en ai pas mises ?? ou alors j'ai utilisé des "quote" qu'il n'aurait pas fallu utiliser ?
il faut donc utiliser "code" pour du texte même si ce n'est pas du "code" , la prochaine fois je ferais ...


PC          : B760M DS3H DDR4,  12th Gen Intel(R) Core(TM) i3-12100, RAM DDR4 8GiB -2400 Ubuntu 22.04, 22.04, 23.04
Portable1 : Intel(R) Core(TM)2 Duo CPU     T6570  @ 2.10GHz RAM 4GiB DDR2 667 MHz Ubuntu 23.04 ( en voyage )
Portable2 : T5750  @ 2.00GHz RAM 1GiB DDR2 667 Mhz Ubuntu 20.04 ( batterie HS )
stourm a ran war bep tachenn (Angela Duval) ( Je combats sur tous les fronts )

Hors ligne

#6 Le 07/07/2015, à 18:07

ar barzh paour

Re : [Résolu] Personnalisation de GRUB

@nany
mon fichier 00_header ,je n'y ai pas touché

jpb@jpb-desktop:~$ 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
jpb@jpb-desktop:~$

le fichier /etc/grub.d/05_debian_theme est tel qu'il était à l'origine

jpb@jpb-desktop:~$ 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=white/black"
			echo "${1}set menu_color_highlight=black/light-gray"


			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
jpb@jpb-desktop:~$ 

j'avais réussi à modifier les couleurs du menu en agissant directement sur la fonction set_default_theme()


PC          : B760M DS3H DDR4,  12th Gen Intel(R) Core(TM) i3-12100, RAM DDR4 8GiB -2400 Ubuntu 22.04, 22.04, 23.04
Portable1 : Intel(R) Core(TM)2 Duo CPU     T6570  @ 2.10GHz RAM 4GiB DDR2 667 MHz Ubuntu 23.04 ( en voyage )
Portable2 : T5750  @ 2.00GHz RAM 1GiB DDR2 667 Mhz Ubuntu 20.04 ( batterie HS )
stourm a ran war bep tachenn (Angela Duval) ( Je combats sur tous les fronts )

Hors ligne

#7 Le 07/07/2015, à 18:22

cqfd93

Re : [Résolu] Personnalisation de GRUB

ar barzh paour a écrit :

@cqfd93
excusez-moi si j'ai fauté , ma réponse est effectivement ambiguë

mais je considérais que je donnais une explication concernant le post en question

Tes deux messages ressemblent plus à l'exposé de ton problème qui est un peu plus large que celui du post auquel tu répondais, en tout cas c'est ce que le membre qui a signalé tes messages et moi avons compris.

De toutes façons, il n'est jamais bon de mélanger l'aide à deux personnes, ça n'apporte que de la confusion.

pour les balises ?? je n'en ai pas mises ?? ou alors j'ai utilisé des "quote" qu'il n'aurait pas fallu utiliser ?
il faut donc utiliser "code" pour du texte même si ce n'est pas du "code" , la prochaine fois je ferais ...

Oui, tu avais mis des balises quote, mais les textes en question (des contenus de fichiers de configuration) sont vraiment du code.


cqfd93

Hors ligne

#8 Le 07/07/2015, à 18:42

nany

Re : [Résolu] Personnalisation de GRUB

En effet, ton intervention était ambiguë car commençant par une question.
Si j’ai bien compris, dans ton cas, tu arrives soit à afficher une image soit à changer les couleurs mais pas les deux en même temps.
Or tu as bien les mêmes scripts que chez moi (et j’attends de voir le contenu de ceux d’Orbital_Verbose pour tirer des conclusions). Je pense donc qu’en utilisant, dans /etc/default/grub, les variables WALLPAPER, COLOR_NORMAL et COLOR_HIGHLIGHT ça devrait passer :

WALLPAPER="/chemin/autre/que/boot/grub/image.png"
COLOR_NORMAL="green/black"
COLOR_HIGHLIGHT="light-green/black"

Mais il ne faut pas de variable GRUB_BACKGROUND.

Ce que j’avance reste au conditionnel car je suis actuellement sur des tâches qui ne me permettent pas de faire un redémarrage pour vérifier mes dires.


EDIT : par acquis de conscience, j’ai tout de même vérifié avec un update-grub et ce n’est pas pris en compte. Les trois lignes doivent être en fait placées directement dans 05_debian_theme pour que ça marche. Mais, comme je n’aime pas trop conseiller de bidouiller des fichiers système (pouvant être modifiés lors d’une mise à jour), je proposerais plutôt cette autre solution possible : laisser /etc/default/grub comme à l’origine, placer une image dans /boot/grub et ajouter les deux lignes suivantes dans /etc/grub.d/40_cusom.

set menu_color_normal=green/black
set menu_color_highlight=light-green/black

Dernière modification par nany (Le 07/07/2015, à 19:57)

En ligne

#9 Le 08/07/2015, à 18:41

ar barzh paour

Re : [Résolu] Personnalisation de GRUB

@nany
l'image placée dans boot/grub est bien prise en compte

mais pas les couleurs du menu ( /etc/grub.d/42_custom)
que l'on retrouve quand même dans grub.cfg ici

### BEGIN /etc/grub.d/42_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.
COLOR_NORMAL="green/black"
COLOR_HIGHLIGHT="light-green/black"
menuentry 'Ubuntu 14.04.2 LTS (sdb8 modifié) ....{
et la suite
}
### END /etc/grub.d/42_custom ###

(un redémarrage donne image + menu en couleur black/white)


et pourtant on doit y arriver car en ajoutant dans grub.cfg au bon endroit ceci 
  set menu_color_normal=green/black
  set menu_color_highlight=light-green/black
j'obtiens bien image et menu dans les couleurs voulues

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos12'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos12 --hint-efi=hd0,msdos12 --hint-baremetal=ahci0,msdos12  700731a7-ff6c-4343-9863-5c527faf3984
else
  search --no-floppy --fs-uuid --set=root 700731a7-ff6c-4343-9863-5c527faf3984
fi
insmod jpeg
if background_image /boot/grub/IMG_0471.JPG; then
  true
  set menu_color_normal=green/black
  set menu_color_highlight=light-green/black
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
  if background_color 44,0,30,0; then
    clear
  fi
fi
### END /etc/grub.d/05_debian_theme ###

j'arrête ici cette expérience (que j'avais entreprise uniquement pour vérifier ce fonctionnement)
car je m'absente pour une durée certaine

bon courage à tous


PC          : B760M DS3H DDR4,  12th Gen Intel(R) Core(TM) i3-12100, RAM DDR4 8GiB -2400 Ubuntu 22.04, 22.04, 23.04
Portable1 : Intel(R) Core(TM)2 Duo CPU     T6570  @ 2.10GHz RAM 4GiB DDR2 667 MHz Ubuntu 23.04 ( en voyage )
Portable2 : T5750  @ 2.00GHz RAM 1GiB DDR2 667 Mhz Ubuntu 20.04 ( batterie HS )
stourm a ran war bep tachenn (Angela Duval) ( Je combats sur tous les fronts )

Hors ligne

#10 Le 09/07/2015, à 11:20

nany

Re : [Résolu] Personnalisation de GRUB

Ah ben voilà, édite ton 42_custom et remplace

COLOR_NORMAL="green/black"
COLOR_HIGHLIGHT="light-green/black"

par

set menu_color_normal=green/black
set menu_color_highlight=light-green/black

En ligne

#11 Le 15/07/2015, à 02:20

melodie

Re : [Résolu] Personnalisation de GRUB

Bonjour,

J'utilise grub-customizer, c'est assez facile à employer. Il fonctionne bien pour ce qui est de changer le fond d'écran et colorer les fontes. Il permet aussi de modifier l'ordre des entrées, et d'en masquer quand il y en a trop. Après, il ne faut pas lui en demander plus : je ne touche pas aux autres fonctions présentes dans l'interface, lors de tests j'ai trouvé ça risqué. Et pour sauvegarder, je fais juste "sauvegarder" mais pas "installer dans le MBR" car ça aussi, ça m'avait planté le boot, une fois (j'avais réparé depuis un live).

Donc, fond d'écran et couleurs de fontes ok, changer l'ordre des entrées et en masquer, ok aussi. smile
https://doc.ubuntu-fr.org/grub-customizer

Hors ligne

#12 Le 20/07/2015, à 09:36

ar barzh paour

Re : [Résolu] Personnalisation de GRUB

@nany

OK

set menu_color_normal=green/black
set menu_color_highlight=light-green/blackset 

dans le custom ça marche !
mais attention quand même car le menu d'édition du menu grub (touche "e" quand le grub est affiché) ne prend pas les couleurs de police (enfin moi je reste en police de couleur blanche )
mon image étant un paysage de neige c'est complètement illisible , et on ne peut pas par ce biais modifier ce que l'on veut lancer ,
donc si vous voulez utiliser cette "customisation" ......

@melodie
je n'ai pas essayé .. peut-être quand je serai de retour , mais il me semble ne pas avoir vu que du bien de ce logiciel (dans ce forum)

Dernière modification par ar barzh paour (Le 20/07/2015, à 09:39)


PC          : B760M DS3H DDR4,  12th Gen Intel(R) Core(TM) i3-12100, RAM DDR4 8GiB -2400 Ubuntu 22.04, 22.04, 23.04
Portable1 : Intel(R) Core(TM)2 Duo CPU     T6570  @ 2.10GHz RAM 4GiB DDR2 667 MHz Ubuntu 23.04 ( en voyage )
Portable2 : T5750  @ 2.00GHz RAM 1GiB DDR2 667 Mhz Ubuntu 20.04 ( batterie HS )
stourm a ran war bep tachenn (Angela Duval) ( Je combats sur tous les fronts )

Hors ligne

#13 Le 20/07/2015, à 10:27

nany

Re : [Résolu] Personnalisation de GRUB

ar barzh paour a écrit :

mais attention quand même car le menu d'édition du menu grub (touche "e" quand le grub est affiché) ne prend pas les couleurs de police (enfin moi je reste en police de couleur blanche )
mon image étant un paysage de neige c'est complètement illisible , et on ne peut pas par ce biais modifier ce que l'on veut lancer ,
donc si vous voulez utiliser cette "customisation" ......

Dans ce cas, ajoute aussi les deux lignes suivantes dans ton fichier custom.

set color_normal=green/black
set color_highlight=light-green/black

Et là, tu devrais avoir du vert partout. wink

En ligne

#14 Le 04/08/2015, à 17:51

ar barzh paour

Re : [Résolu] Personnalisation de GRUB

et là ça me parait parfait !
=> bien choisir son image
dans la partie 05_debian_theme on trouve

insmod jpeg
if background_image /boot/grub/IMG_0471.JPG; then
  true
else
  set menu_color_normal=white/black
  set menu_color_highlight=black/light-gray
  if background_color 44,0,30,0; then
    clear
  fi
fi
### END /etc/grub.d/05_debian_theme ###

dans la partie /etc/grub.d/42_custom

set menu_color_normal=green/black
set menu_color_highlight=light-green/black
set color_normal=green/black
set color_highlight=light-green/black

PC          : B760M DS3H DDR4,  12th Gen Intel(R) Core(TM) i3-12100, RAM DDR4 8GiB -2400 Ubuntu 22.04, 22.04, 23.04
Portable1 : Intel(R) Core(TM)2 Duo CPU     T6570  @ 2.10GHz RAM 4GiB DDR2 667 MHz Ubuntu 23.04 ( en voyage )
Portable2 : T5750  @ 2.00GHz RAM 1GiB DDR2 667 Mhz Ubuntu 20.04 ( batterie HS )
stourm a ran war bep tachenn (Angela Duval) ( Je combats sur tous les fronts )

Hors ligne