0
1

ciao a tutti, sono nuovo del forum e avrei bisogno di una mano. Vorrei impostare un immagine di sfondo nel grub2 del mio ubuntu 13.04 in dual boot con windows 7. Ho seguito milioni di guide ma non sono arrivato ad una conclusione, l'immagine non si vede! Ditemi che file devo postarmi per avere un aiutino!

chiesto 09 Aug '13, 09:58

fabio1401's gravatar image

fabio1401
4111

modificato 17 Aug '13, 20:13

pietroalbini's gravatar image

pietroalbini ♦♦
3.2k2947


La risposta migliore credo che sia questa, presa da Ask Ubuntu.

In sostanza, basta che metti l'immagine che ti interessa nella cartella /boot/grub, con due restrizioni

  1. Deve essere in ColorSpace RGB
  2. Se è di tipo jpeg, deve essere con una profondità di 8 bit.

Poi sarà Grub a preoccuparsi della risoluzione e tutto il resto.

coll. permanente

ha risposto 09 Aug '13, 11:42

dadexix86's gravatar image

dadexix86 ♦♦
17.0k916161

Ciao, innanzitutto grazie per la risposta. Purtroppo però non va. ho seguito dinuovo la guida ma non avuto soluzione. Ti posto qualche file:

sudo gedit /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=10
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_BACKGROUND=/usr/share/images/grub/einstain.tga
GRUB_THEME="/path/to/gfxtheme"

# 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 ...)

# 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'

# 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"

#export GRUB_MENU_PICTURE="/usr/share/images/grub/einstein_lavagna.tga"
#export GRUB_COLOR_NORMAL="light-cyan/black"
#export GRUB_COLOR_HIGHLIGHT="red/black"
#GRUB_DISABLE_LINUX_RECOVERY="true"
GRUB_FONT="/boot/grub/unicode.pf2"
GRUB_GFXMODE=1366x768

sudo gedit /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(){ 
  if [ "$GRUB_DISTRIBUTOR" = Ubuntu ] || [ "$GRUB_DISTRIBUTOR" = Kubuntu ]; then 
    # Set a monochromatic theme for Ubuntu. 
    echo "${1}set menu_color_normal=cyan/blue" 
    echo "${1}set menu_color_highlight=white/blue"

    if [ -e /lib/plymouth/themes/default.grub ]; then 
      sed "s/^/${1}/" /lib/plymouth/themes/default.grub 
    fi 
  else 
    # Set the traditional Debian blue theme. 
    echo "${1}set menu_color_normal=cyan/blue" 
    echo "${1}set menu_color_highlight=white/blue"

  fi 
}

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}" 
    echo "${1}set menu_color_normal=blue/black" 
    echo "${1}set menu_color_highlight=yellow/black"

  fi 
  if [ -n "${3}" ]; then 
    echo "  set color_highlight=yellow/blue" 
    echo "${1}set menu_color_normal=blue/black" 
    echo "${1}set menu_color_highlight=yellow/black"

  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. 
if [ "$GRUB_DISTRIBUTOR" != Ubuntu ] && [ "$GRUB_DISTRIBUTOR" != Kubuntu ] && \ 
   set_background_image "/usr/share/images/grub/einstain.tga"; then 
  exit 0 
fi

# Finally, if all of the above fails, use the default theme. 
set_default_theme
(09 Aug '13, 12:25) fabio1401 fabio1401's gravatar image

Alcune considerazioni. Questo non è un forum, quindi usa i commenti, non aggiungere risposte. Entrando nel merito, quali pacchetti hai installato provando a modificare l'immaigne e quali altre cose hai modificato?

(09 Aug '13, 15:33) dadexix86 ♦♦ dadexix86's gravatar image

Altra domanda in arrivo, ma hai aggiornato il grub dopo aver aggiunto l'immagine nella cartella di cui sopra?

sudo update-grub

(09 Aug '13, 15:35) dadexix86 ♦♦ dadexix86's gravatar image

ciao, qui spiega molto in modo molto semplice: http://www.istitutomajorana.it/index.php?option=com_content&task=view&id=1678&Itemid=248 , io ad esempio ho messo la mia personale chiamandola logicamente "sfondo.png"

(09 Aug '13, 15:37) dxgiusti dxgiusti's gravatar image

Installare un pacchetto fuori dai repo, di cui non sono presenti né i sorgenti né la licenza? No grazie :)

Considerazioni personali a parte, il file .sh contenuto dentro al .tar.gz (non dentro al .deb di cui mancano i sorgenti e la licenza) fa esattamente copiare l'immagine desiderata nella cartella di cui sopra.

(09 Aug '13, 15:46) dadexix86 ♦♦ dadexix86's gravatar image

Personalmente seguo sempre questa prassi sia su ubuntu che su debian o altro e funziona sempre.

con Gimp converto l'immagine che voglio usare come sfondo del grub in formato tga e la rinomino in "splash-image.tga". La copio nella cartella /boot/grub/ e poi eseguo nel terminale "sudo update-grub". Fine. al prossimo riavvio avro la mia immagine di sfondo.

(28 Aug '16, 18:22) m3nhir m3nhir's gravatar image
La tua risposta
abilita/disabilita anteprima

Segui questa domanda

Via email:

Una volta eseguito l'accesso potrai iscriverti a tutti gli aggiornamenti qui

Via RSS:

Risposte

Risposte e commenti

Basi di markdown

  • *corsivo* o __corsivo__
  • **grassetto** o __grassetto__
  • collegamento:[testo](http://url.com/ "titolo")
  • immagine?![alt testo](/path/img.jpg "titolo")
  • elenco numerato: 1. Foo 2. Bar
  • per aggiungere un'interruzione di riga, aggiungi due spazi a fine riga e premi «Invio»
  • è supportato anche semplice HTML

Tag:

×264

domanda posta: 09 Aug '13, 09:58

domanda visualizzata: 5,866 volte

ultimo aggiornamento: 28 Aug '16, 18:22

Chiedi è un servizio di supporto gestito da Ubuntu-it. Contattaci!

powered by OSQAPostgreSQL database
Ubuntu e Canonical sono marchi registrati da Canonical Ltd.