Benvenuto Ospite Cerca | Topic Attivi | Utenti | | Log In | Registra

[RISOLTO]Cambiare splash image Grub2 Debian Squeeze Opzioni
costamar
Inviato: Tuesday, January 25, 2011 10:13:24 PM

Rank: AiutAmico

Iscritto dal : 1/2/2011
Posts: 124
Vorrei cambiare immagine al Grub2 della mia squeeze, ma essendo il file /etc/grub.d/05_debian_theme diverso da quello di Ubuntu, seguendo la guida del Professor Antonio non trovo corrispondenza all'inserimento dell'immagine. Questo è il mio file:
Code:
#!/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/lib/grub/grub-mkconfig_lib

# We want to work in /boot/grub/ only.
test -d "${GRUB_PREFIX}"; cd "${GRUB_PREFIX}"

# 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(){
    # Set the traditional Debian blue theme.
    echo "${1}set menu_color_normal=cyan/blue"
    echo "${1}set menu_color_highlight=white/blue"
}

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 ! [ -f "${reader}.mod" ]; 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"
    echo "  set color_normal=${2:-black/black}"
    echo "  set color_highlight=${3:-magenta/black}"
    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.
# Next search for pictures the user put into /boot/grub/ and use the first one.
# Next try to use the background image and colors specified by desktop-base.
# If we haven't found a background image yet, use the default from desktop-base.
# Finally, if all of the above fails, use the default theme.
set_background_image "${GRUB_BACKGROUND}" ||
set_background_image "`ls -1 *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA 2>/dev/null | head -1`" ||
set_background_image "${WALLPAPER}" "${COLOR_NORMAL}" "${COLOR_HIGHLIGHT}" ||
set_background_image "/usr/share/images/desktop-base/Lake_mapourika_NZ.tga" ||
set_default_theme


Praticamente la mia immagine è questa, ma non compare all'avvio di Grub, rimanendo la schermata a sfondo nero:
Commenta:
set_background_image "/usr/share/images/desktop-base/Lake_mapourika_NZ.tga" ||

Qualche suggerimento?
Grazie
Sponsor
Inviato: Tuesday, January 25, 2011 10:13:24 PM

 
adamerca
Inviato: Wednesday, January 26, 2011 8:19:50 AM

Rank: AiutAmico

Iscritto dal : 9/1/2008
Posts: 502
costamar,
io uso Mint LMDE e questo è il mio grub.d
Commenta:
#!/bin/sh -e

. /usr/lib/grub/grub-mkconfig_lib

# this allows desktop-base to override our settings
f=/usr/share/desktop-base/grub_background.sh
if test -e ${f} ; then
. ${f}
else
WALLPAPER="/usr/share/images/desktop-base/moreblue-orbit-grub.png"
COLOR_NORMAL="black/black"
COLOR_HIGHLIGHT="magenta/black"
fi

set_blue_theme()
{
cat << EOF
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
EOF
}

# check for usable backgrounds
use_bg=false
for output in ${GRUB_TERMINAL_OUTPUT}; do
if [ "$output" = "gfxterm" ] ; then
for i in /boot/grub/`basename ${WALLPAPER}` ${WALLPAPER} ; 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 background image: `basename ${bg}`" >&2
use_bg=true
break
fi
fi
done
break
fi
done

# 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=${COLOR_NORMAL}
set color_highlight=${COLOR_HIGHLIGHT}
else
EOF
fi

# otherwise, set the traditional Debian blue theme
if ${use_bg} ; then
set_blue_theme | sed -e "s/^/ /g"
echo "fi"
else
set_blue_theme
fi


vedi anche questa discussione:
http://www.linuxmint-italia.org/index.php?topic=4468.0
ciao
costamar
Inviato: Wednesday, January 26, 2011 9:29:59 AM

Rank: AiutAmico

Iscritto dal : 1/2/2011
Posts: 124
Il problema è che a me manca appunto questa sezione (che nel file di Ubuntu è compresa):
Commenta:
WALLPAPER="/usr/share/images/desktop-base/moreblue-orbit-grub.png"
COLOR_NORMAL="black/black"
COLOR_HIGHLIGHT="magenta/black"

Ora vedo il link che mi hai dato...
Grazie

Visto link: quella guida l'ho seguita, ma si riferisce alla grafica mentre carica il sistema e quello funziona bene.
costamar
Inviato: Wednesday, January 26, 2011 11:54:28 AM

Rank: AiutAmico

Iscritto dal : 1/2/2011
Posts: 124
Ho risolto.
Premessa: come al solito la soluzione è sempre scritta da qualche parte nei files di testo di linux, solo l'utente è talmente pigro da non usare il cervello Brick wall
Nel mio caso bastava leggere questa sezione:
Commenta:
# Earlier versions of grub-pc copied the default background image to /boot/grub

Non ho fatto altro che copiare l'immagine in /boot/grub ed il gioco è fatto!!! Dancing
Utenti presenti in questo topic
Guest


Salta al Forum
Aggiunta nuovi Topic disabilitata in questo forum.
Risposte disabilitate in questo forum.
Eliminazione tuoi Post disabilitata in questo forum.
Modifica dei tuoi post disabilitata in questo forum.
Creazione Sondaggi disabilitata in questo forum.
Voto ai sondaggi disabilitato in questo forum.

Main Forum RSS : RSS

Aiutamici Theme
Powered by Yet Another Forum.net versione 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.