Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] How can I Install splashimage at GRUB2? (SOLVED)  (Read 8257 times)

gilpier

  • Guest
[EN] How can I Install splashimage at GRUB2? (SOLVED)
« on: 2013/01/27, 01:04:30 »
I want to edit 05_debian_theme, to install siduction-ridersonthestorm-1280x1024.png.tga  splashimage.

Offline piper

  • User
  • Posts: 1.785
  • we are the priests ... of the temples of syrinx
RE: How can I Install splashimage at GRUB2?
« Reply #1 on: 2013/01/27, 01:59:10 »
There are several ways of doing this (I personally have used 3 different ways)

The quickest, and probably dirtest is to go to
Code: [Select]
/usr/share/images/desktop-baseyou do want to backup that folder right ;)

Put the image you want in there and rename it to whatever you have booting at the moment either from the images in that folder or from looking at
Code: [Select]
/etc/grub.d/05_debian_theme

If your not sure on this, put five images of the same background you want and name them debian-blueish-wallpaper.png, desktop-background.png, desktop-grub.png, joy-grub.png, spacefun-grub.png

reboot
Free speech isn't just fucking saying what you want to say, it's also hearing what you don't want to fucking hear

I either give too many fucks or no fucks at all, it's like I cannot find a middle ground for a moderate fuck distribution, it's like what the fuck

Offline DeepDayze

  • User
  • Posts: 457
RE: How can I Install splashimage at GRUB2?
« Reply #2 on: 2013/01/27, 03:03:39 »
Is there a package that installs the grub2 theme and allows you to select it?

Offline agaida

  • User
  • Posts: 1.760
    • http://g-com.eu
RE: How can I Install splashimage at GRUB2?
« Reply #3 on: 2013/01/27, 03:07:41 »
there is a package, but it works atm without flaws only with grub2 (the real one) from experimental. ;)
There's this special biologist word we use for "stable". It's "dead". ~ Jack Cohen

gilpier

  • Guest
RE: How can I Install splashimage at GRUB2?
« Reply #4 on: 2013/01/27, 15:14:47 »
Piper, I put into /usr/share/images/desktop-base the same image with the names debian-blueish-wallpaper.png, desktop-background.png, desktop-grub.png, joy-grub.png, spacefun-grub.png and then reboot. It doesn't works.
Perhaps is it necessary to edit 05_debian_theme ? Next you can see this archive:
#!/bin/sh
set -e

# grub-mkconfig helper script.
# Copyright (C) 2010  Alexander Kurtz <kurtz>
#
# 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>.

# 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"
   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.
if set_background_image "/usr/share/images/desktop-base/desktop-grub.png"; then
   exit 0
fi

# Finally, if all of the above fails, use the default theme.
set_default_theme

Thanks,

Gilbert

Offline agaida

  • User
  • Posts: 1.760
    • http://g-com.eu
RE: How can I Install splashimage at GRUB2?
« Reply #5 on: 2013/01/27, 15:36:50 »
@gilpier: why you will hack some thing that is be done?
There's this special biologist word we use for "stable". It's "dead". ~ Jack Cohen

gilpier

  • Guest
Re: RE: How can I Install splashimage at GRUB2?
« Reply #6 on: 2013/01/27, 15:41:13 »
Quote from: "agaida"
@gilpier: why you will hack some thing that is be done?


Do you mean to use the experimental package? What is the name of this package and the experimental repository?

Thanks,

Gilbert

Offline agaida

  • User
  • Posts: 1.760
    • http://g-com.eu
Re: RE: How can I Install splashimage at GRUB2?
« Reply #7 on: 2013/01/27, 15:45:55 »
i mean: if you only need a wallpaper, set it in /etc/default/grub. if you are willing to try out theme support, then instal grub themes and set your favorite theme and resolution in /etc/default/grub.

you don't need to hack anything. BTW, i have prepared a siduction grub theme that works with grub/experimental. We will port the eperimental grub to siduction (we need to find a place for it)
There's this special biologist word we use for "stable". It's "dead". ~ Jack Cohen

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 2.358
    • Land of the Buckeye
RE: Re: RE: How can I Install splashimage at GRUB2?
« Reply #8 on: 2013/01/27, 17:57:26 »
I just tested this one -- it works.

1. Install the desktop-base package if you don't already have it.

2. As root, go to /usr/share/images/desktop-base and change the name of the file desktop-grub.png

Code: [Select]
mv desktop-grub.png desktop-grub_png_orig

3. Copy the grub .png image that you have made to /usr/share/images/desktop-base, and rename it to desktop-grub.png.

4. Run update-grub, and reboot to test it.

I assume you have alreadyfound the procedure to make your grub background image ("indexed" mode, 14 colors max, 640x480).
System76 Oryx Pro, Intel Core i7-11800H, SSD 970 EVO Plus;  Asus ROG STRIX X299-E, Core i7-7740X, Nvidia GTX-1060, dual monitors, SSD 860 EVO

Offline ayla

  • User
  • Posts: 1.744
How can I Install splashimage at GRUB2? (SOLVED)
« Reply #9 on: 2013/01/27, 18:31:25 »
Hi,

maybe I understand this all wrong, then sorry for the noise.

After grub2 is in a state one can work with I just use a .jpg image and throw it in to the folder /boot/grub. I run an update-grub and it gets detcted and shows as background immage on grub select sreen.

greets
ayla

gilpier

  • Guest
How can I Install splashimage at GRUB2? (SOLVED)
« Reply #10 on: 2013/01/27, 19:32:46 »
piper, agaida dibl and ayla, thanks for you help: the easiest soluction that I aply was editing /etc/default/grub.
I added this:
#`GRUB_BACKGROUND'
 #    Set a background image for use with the `gfxterm' graphical
 #   terminal.  The value of this option must be a file readable by
 #  GRUB at boot time, and it must end with `.png', `.tga', `.jpg', or
 # `.jpeg'.  The image will be scaled if necessary to fit the screen.
GRUB_BACKGROUND="/usr/share/images/desktop-base/siduction-ridersonthestorm-1280x1024.png"

Now it works fine

Offline DeepDayze

  • User
  • Posts: 457
How can I Install splashimage at GRUB2? (SOLVED)
« Reply #11 on: 2013/01/28, 00:37:46 »
Quote from: "gilpier"
piper, agaida dibl and ayla, thanks for you help: the easiest soluction that I aply was editing /etc/default/grub.
I added this:
#`GRUB_BACKGROUND'
 #    Set a background image for use with the `gfxterm' graphical
 #   terminal.  The value of this option must be a file readable by
 #  GRUB at boot time, and it must end with `.png', `.tga', `.jpg', or
 # `.jpeg'.  The image will be scaled if necessary to fit the screen.
GRUB_BACKGROUND="/usr/share/images/desktop-base/siduction-ridersonthestorm-1280x1024.png"

Now it works fine


Wouldn't that get overwritten every time you update grub?

Offline ayla

  • User
  • Posts: 1.744
How can I Install splashimage at GRUB2? (SOLVED)
« Reply #12 on: 2013/01/28, 00:45:56 »
AFAIK you get the question wether you want to keep your own file or use the new one from the maintainer.
The default is keep.

Offline DeepDayze

  • User
  • Posts: 457
How can I Install splashimage at GRUB2? (SOLVED)
« Reply #13 on: 2013/01/28, 00:49:34 »
Quote from: "ayla"
AFAIK you get the question wether you want to keep your own file or use the new one from the maintainer.
The default is keep.


Thanks...will remember that, but will also note the changes I made to the file in case the newer file has changes that are deemed important and then need to merge my customizations into the new file

Offline spacepenguin

  • User
  • Posts: 862
    • spacepenguin.de
How can I Install splashimage at GRUB2? (SOLVED)
« Reply #14 on: 2013/02/09, 13:51:11 »
I did it the same way ayla did, just copied a picture to /boot/grub and ran update-grub. That's the easiest way...

What is the difference - looking at the result, apart from the chosen picture - between this method and the experimental grub and the siduction theme for it?
Susan | Hardware: SysProfile
Music-Profile: http://www.last.fm/de/user/spacepengu