根据/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的帮助!