scorpion77 |
10-16-2012 10:40 AM |
Quote:
Originally Posted by imprazaguy
(Post 4806673)
The problem is caused by this reason:
In grub 2.00, if you don't set GRUB_FONT, it will generate config that prefers default font name "unicode.pf2"
However, the SlackBuild script on SBo uses unifont.pf2 instead of unicode.pf2.
Read the generated grub.cfg. You find that if loading font fail, it won't execute load_video.
This is the problem.
The possible solutions are:
1) change SlackBuild script to use "unicode.pf2"
2) use GRUB_FONT
I personally test method 1 and it works.
Remember to rerun grub-install, because it'll install the font to /boot
|
I have just recompiled grub2 modifying grub2.SlackBuild. Still not working. I post the source of the slackbuild:
Code:
#!/bin/sh
# Slackware build script for grub2
# Written by crocket (crockabiscuit@gmail.com)
PRGNAM=grub2
VERSION=${VERSION:-2.00}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
ARCNAM=grub
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
FONT_SIZE=${FONT_SIZE:-19}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
# -fPIC generates errors with grub2 1.99
# SLKCFLAGS="-O2 -fPIC"
SLKCFLAGS="-O2"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $ARCNAM-$VERSION
tar xvf $CWD/$ARCNAM-$VERSION.tar.xz
cd $ARCNAM-$VERSION
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# We use initrd.gz here, so look for it too
patch -p1 < $CWD/initrd_naming.patch
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--infodir=/usr/info \
--mandir=/usr/man \
--build=$ARCH-slackware-linux \
make
make install DESTDIR=$PKG
mkdir -p $PKG/etc/default
cat $CWD/etc.default.grub > $PKG/etc/default/grub
find $PKG/usr/bin | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find $PKG/usr/sbin | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
# convert gnu-unicode to a font useable by grub2 gfxterm.
$PKG/usr/bin/grub-mkfont -o $PKG/usr/share/grub/unicode.pf2 -abv \
-s $FONT_SIZE /usr/share/fonts/TTF/unicode.ttf
rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*.info*
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $(find $PKG/usr/man -type l); do ln -s $(readlink $i).gz $i.gz; rm $i; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README THANKS TODO \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
# Add .new extension to all configuration files
# and add them to doinst.sh
for file in $(find $PKG/etc -type f -perm -444)
do
mv $file $file.new
# This leads grub-mkconfig to abnormal behaviors.
# chmod -x $file.new
echo "config ${file#$PKG/}.new" >> $PKG/install/doinst.sh
done
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
Here it is the new grub.cfg:
Code:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
else
search --no-floppy --fs-uuid --set=root 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=it_IT
insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
else
search --no-floppy --fs-uuid --set=root 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
fi
insmod jpeg
background_image -m stretch /boot/grub/slack-background.jpg
set timeout=10
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Slackware-14.0 GNU/Linux' --class slackware-14.0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-7e8a3222-43c9-4f72-98bb-c52e1b8656b1' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
else
search --no-floppy --fs-uuid --set=root 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
fi
echo 'Caricamento Linux 3.2.29...'
linux /boot/vmlinuz-huge-3.2.29 root=/dev/sda6 ro quiet splash vga=792
}
submenu 'Opzioni avanzate per Slackware-14.0 GNU/Linux' $menuentry_id_option 'gnulinux-advanced-7e8a3222-43c9-4f72-98bb-c52e1b8656b1' {
menuentry 'Slackware-14.0 GNU/Linux, con Linux 3.2.29' --class slackware-14.0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.29-advanced-7e8a3222-43c9-4f72-98bb-c52e1b8656b1' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
else
search --no-floppy --fs-uuid --set=root 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
fi
echo 'Caricamento Linux 3.2.29...'
linux /boot/vmlinuz-huge-3.2.29 root=/dev/sda6 ro quiet splash vga=792
}
menuentry 'Slackware-14.0 GNU/Linux, con Linux 3.2.29 (modalità ripristino)' --class slackware-14.0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.29-recovery-7e8a3222-43c9-4f72-98bb-c52e1b8656b1' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
else
search --no-floppy --fs-uuid --set=root 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
fi
echo 'Caricamento Linux 3.2.29...'
linux /boot/vmlinuz-huge-3.2.29 root=/dev/sda6 ro single
}
menuentry 'Slackware-14.0 GNU/Linux, con Linux 3.2.29' --class slackware-14.0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.29-advanced-7e8a3222-43c9-4f72-98bb-c52e1b8656b1' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
else
search --no-floppy --fs-uuid --set=root 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
fi
echo 'Caricamento Linux 3.2.29...'
linux /boot/vmlinuz-generic-3.2.29 root=/dev/sda6 ro quiet splash vga=792
}
menuentry 'Slackware-14.0 GNU/Linux, con Linux 3.2.29 (modalità ripristino)' --class slackware-14.0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.29-recovery-7e8a3222-43c9-4f72-98bb-c52e1b8656b1' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
else
search --no-floppy --fs-uuid --set=root 7e8a3222-43c9-4f72-98bb-c52e1b8656b1
fi
echo 'Caricamento Linux 3.2.29...'
linux /boot/vmlinuz-generic-3.2.29 root=/dev/sda6 ro single
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (su /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-D48471A584718AAE' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 D48471A584718AAE
else
search --no-floppy --fs-uuid --set=root D48471A584718AAE
fi
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Any idea to solve?
|