【已解决】grub2已设置背景图片,却无法显示
发表于 : 2009-10-30 17:11
【问题描述】:
根据/etc/grub.d/05_debian_theme下的
也就是把符合要求的图片,放到/boot/grub或者/usr/share/images/desktop-base下,
文件名为moreblue-orbit-grub.png或者moreblue-orbit-grub.tga就行了;
然后运行sudo update-grub
也会显示:
也就是说找到了背景图片,开机时却无法显示?
图片是使用命令:
制作的。。。
grub2的其他设置未修改。。。
什么原因?
【解决办法】:
谢谢smallapple的帮助,
后来在/etc/grub.d/00_head
文件:
此段代码后,回车加入
(详细参照smallapple的grub2教程:viewtopic.php?f=139&t=229387)
/boot目录下新建文件夹splashimages
把需要作背景的图片命名为moreblue-orbit-grub,jpg放到/boot/splashimages中
把/etc/grub.d/05_debian_theme中的
改为:
最后运行
sudo update-grub
就可以了。
谢谢smallapple的帮助!
根据/etc/grub.d/05_debian_theme下的
代码: 全选
# check for usable backgrounds
use_bg=false
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
for i in {/boot/grub,/usr/share/images/desktop-base}/moreblue-orbit-grub.{png,tga} ; 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 Debian background: `basename ${bg}`" >&2
use_bg=true
break
fi
fi
done
fi
# 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=black/black
set color_highlight=magenta/black
else
EOF
fi
文件名为moreblue-orbit-grub.png或者moreblue-orbit-grub.tga就行了;
然后运行sudo update-grub
也会显示:
代码: 全选
Found Debian background: moreblue-orbit-grub.png
图片是使用命令:
代码: 全选
convert 源文件名 -resize 640x480! -colors 24 moreblue-orbit-grub.png
grub2的其他设置未修改。。。
什么原因?
【解决办法】:
谢谢smallapple的帮助,
后来在/etc/grub.d/00_head
文件:
代码: 全选
set default="${GRUB_DEFAULT}"
if [ \${prev_saved_entry} ]; then
saved_entry=\${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
代码: 全选
insmod jpeg
insmod png
/boot目录下新建文件夹splashimages
把需要作背景的图片命名为moreblue-orbit-grub,jpg放到/boot/splashimages中
把/etc/grub.d/05_debian_theme中的
代码: 全选
for i in {/boot/grub,/usr/share/images/desktop-base}/moreblue-orbit-grub.{png,tga} ;
代码: 全选
for i in {/boot/grub,/usr/share/images/desktop-base,/boot/splashimages}/moreblue-orbit-grub.{png,tga,jpg} ;
sudo update-grub
就可以了。
谢谢smallapple的帮助!