staging.inyokaproject.org

Hintergrund Bootloader

Status: Gelöst | Ubuntu-Version: Ubuntu 12.10 (Quantal Quetzal)
Antworten |

rolli0815

(Themenstarter)

Anmeldungsdatum:
2. April 2010

Beiträge: Zähle...

kaputnik

Hallo, nach update-grub wird die Zeile:

1
Found background image: /usr/share/images/desktop-base/desktop-grub.png

leider nicht ausgegeben, obwohl ich sie vorher bei update alternatives ausgewählt hatte.

kaputtnik

Anmeldungsdatum:
31. Dezember 2007

Beiträge: 9245

Hast Du denn mal geschaut, ob die Datei in diesem Pfad vorhanden ist?

Ist das System verschlüsselt?

Das Bild wird vom Skript /etc/grub.d/05_debian_theme gefunden. Ist das Skript bei Dir vorhanden?

rolli0815

(Themenstarter)

Anmeldungsdatum:
2. April 2010

Beiträge: Zähle...

Das ist mein skript

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/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(){
	# Set a monochromatic theme for 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
}

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

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

kaputtnik

Anmeldungsdatum:
31. Dezember 2007

Beiträge: 9245

Was ist mit den anderen Fragen?

Wenn das System verschlüsselt ist, kann GRUB nicht auf das Verzeichnis /etc zugreifen. Dann müsstest Du das Bild im Ordner /boot/grub ablegen.

Zeig mal:

 sudo fdisk -l

und

ls -l  /usr/share/images/desktop-base/

rolli0815

(Themenstarter)

Anmeldungsdatum:
2. April 2010

Beiträge: Zähle...

Hallo, anbei die Ausgaben 1.sudo fdisk -l

[sudo] password for rolf: 

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 Köpfe, 63 Sektoren/Spur, 60801 Zylinder, zusammen 976773168 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Festplattenidentifikation: 0x000d3168

   Gerät  boot.     Anfang        Ende     Blöcke   Id  System
/dev/sda1   *          63    98130282    49065110    7  HPFS/NTFS/exFAT
/dev/sda2        98131966   976773119   439320577    5  Erweiterte
/dev/sda5        98131968   304375807   103121920   83  Linux
/dev/sda6       964704256   976773119     6034432   82  Linux Swap / Solaris
/dev/sda7       304377856   862302208   278962176+   7  HPFS/NTFS/exFAT
/dev/sda8       862305003   964703440    51199219   83  Linux

Partitionstabelleneinträge sind nicht in Platten-Reihenfolge

Disk /dev/sdb: 500.1 GB, 500106780160 bytes
255 Köpfe, 63 Sektoren/Spur, 60801 Zylinder, zusammen 976771055 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Festplattenidentifikation: 0xedc6edc6

   Gerät  boot.     Anfang        Ende     Blöcke   Id  System
/dev/sdb1            2048   976769023   488383488    7  HPFS/NTFS/exFAT

Disk /dev/sdc: 1000.2 GB, 1000202043392 bytes
255 Köpfe, 63 Sektoren/Spur, 121600 Zylinder, zusammen 1953519616 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Festplattenidentifikation: 0x000d22af

   Gerät  boot.     Anfang        Ende     Blöcke   Id  System
/dev/sdc1              63   124310969    62155453+   7  HPFS/NTFS/exFAT
/dev/sdc2       124310970   620671274   248180152+   7  HPFS/NTFS/exFAT
/dev/sdc3       620671275  1106364419   242846572+   7  HPFS/NTFS/exFAT
/dev/sdc4      1106364481  1953517567   423576543+   5  Erweiterte
/dev/sdc5      1106364483  1597889159   245762338+   7  HPFS/NTFS/exFAT
/dev/sdc6      1597890560  1949329407   175719424   83  Linux
/dev/sdc7      1949331456  1953517567     2093056   82  Linux Swap / Solaris
rolf@rolf-EP31-DS3L:~$ 
ode text
Code

2. ls.l /usr....

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
rolf@rolf-EP31-DS3L:~$ ls -l  /usr/share/images/desktop-base/
gesamt 3260
-rw-r--r-- 1 root root  71101 Okt  4 14:25 debian-blueish-wallpaper-640x480.png
-rw-r--r-- 1 root root 111524 Okt  4 14:23 debian-blueish-wallpaper.svg
-rw-r--r-- 1 root root 111962 Okt  4 14:23 debian-blueish-wallpaper-widescreen.svg
lrwxrwxrwx 1 root root     18 Okt  4 14:23 default -> desktop-background
lrwxrwxrwx 1 root root     36 Mär 28 11:36 desktop-background -> /etc/alternatives/desktop-background
lrwxrwxrwx 1 root root     40 Mär 28 11:36 desktop-background.xml -> /etc/alternatives/desktop-background.xml
lrwxrwxrwx 1 root root     30 Mär 28 11:36 desktop-grub.png -> /etc/alternatives/desktop-grub
lrwxrwxrwx 1 root root     32 Mär 28 11:36 desktop-splash -> /etc/alternatives/desktop-splash
-rw-r--r-- 1 root root  13476 Okt  4 14:25 gnome-splash-curves.png
-rw-r--r-- 1 root root  26528 Okt  4 14:25 joy-grub.png
-rw-r--r-- 1 root root 378437 Okt  4 14:23 joy-inksplat-wallpaper_1920x1080.svg
-rw-r--r-- 1 root root  10331 Okt  4 14:23 joy-wallpaper_1280x1024.svg
-rw-r--r-- 1 root root  10323 Okt  4 14:23 joy-wallpaper_1600x1200.svg
-rw-r--r-- 1 root root  10066 Okt  4 14:23 joy-wallpaper_1920x1080.svg
-rw-r--r-- 1 root root  10389 Okt  4 14:23 joy-wallpaper_1920x1200.svg
-rw-r--r-- 1 root root    528 Okt  4 14:23 joy.xml
-rw-r--r-- 1 root root   2714 Okt  4 14:23 login-background.svg
-rw-r--r-- 1 root root  34893 Okt  4 14:25 moreblue-orbit-grub.png
-rw-r--r-- 1 root root  90044 Okt  4 14:23 moreblue-orbit-splash.png
-rw-r--r-- 1 root root 341555 Okt  4 14:23 moreblue-orbit-wallpaper.png
-rw-r--r-- 1 root root 272722 Okt  4 14:23 moreblue-orbit-wallpaper.svg
-rw-r--r-- 1 root root 314794 Okt  4 14:23 moreblue-orbit-wallpaper-widescreen.png
-rw-r--r-- 1 root root 268863 Okt  4 14:23 moreblue-orbit-wallpaper-widescreen.svg
-rw-r--r-- 1 root root 107640 Okt  4 14:23 nightly-splash.png
-rw-r--r-- 1 root root 165551 Okt  4 14:25 nightly-wallpaper.png
-rw-r--r-- 1 root root  30799 Okt  4 14:23 spacefun-grub.png
-rw-r--r-- 1 root root 103176 Okt  4 14:23 spacefun-grub-widescreen.png
-rw-r--r-- 1 root root 316749 Okt  4 14:23 spacefun-splash.svg
-rw-r--r-- 1 root root 240803 Okt  4 14:23 spacefun-wallpaper.svg
-rw-r--r-- 1 root root 241652 Okt  4 14:23 spacefun-wallpaper-widescreen.svg
rolf@rolf-EP31-DS3L:~$ 

Soweit mir bekannt, ist das System nicht verschlüsselt. Allerdings fehlen mir die Fähigkeiten dies festzustellen.

Lidux

Anmeldungsdatum:
18. April 2007

Beiträge: 16801

Hallo bowman,

Stimmt muss bei einer Intel GK gemacht werden. Bei dem Hintergrundbild lag ich mit dem Script daneben, d.h. dies gehört in die /default/grub. Ins custom Script werden die Schriftfarben eingetragen.

Gruss Lidux

kaputtnik

Anmeldungsdatum:
31. Dezember 2007

Beiträge: 9245

Auf bowmams Aussage hast Du auch noch keine Antwort gegeben.

rolli0815 schrieb:

Hallo, irgendwie sieht mein /etc/default/grub merkwürdig aus. Die beiden letzten Zeilen stammen aus den letzten Versuchen.

[..]
export GRUB_BACKGROUND="/boot/grub/images/spacefun-grub-widescreen.png" 

Liegt das Bild denn auch im entsprechenden Verzeichnis? Ansonsten musst Du natürlich das richtige Verzeichnis angeben oder, besser, das Bild nach /boot/grub/images/ kopieren.

Nehme erst einmal ein Bild mit einer Auflösung von 640x480.

rolli0815

(Themenstarter)

Anmeldungsdatum:
2. April 2010

Beiträge: Zähle...

hallo kaputtnik, das Problem ist gelöst. Es lag am falschen Pfad zur Hintergrunddatei. Diese lag nach der Installation auf /usr/share/images/.....

Nochmals vielen Dank für die vielen Hilfen.

Antworten |