2008-08-03 Robert Millan <rmh@aybabtu.com>
* util/grub.d/00_header.in: Be platform-agnostic. Probe for existence of modules instead of assuming which platform provides what. * util/update-grub.in: Likewise.
This commit is contained in:
parent
2d52f57f10
commit
52768e37c2
3 changed files with 48 additions and 21 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2008-08-03 Robert Millan <rmh@aybabtu.com>
|
||||||
|
|
||||||
|
* util/grub.d/00_header.in: Be platform-agnostic. Probe for existence
|
||||||
|
of modules instead of assuming which platform provides what.
|
||||||
|
* util/update-grub.in: Likewise.
|
||||||
|
|
||||||
2008-08-03 Robert Millan <rmh@aybabtu.com>
|
2008-08-03 Robert Millan <rmh@aybabtu.com>
|
||||||
|
|
||||||
* kern/i386/pc/init.c (make_install_device): Check for `grub_prefix'
|
* kern/i386/pc/init.c (make_install_device): Check for `grub_prefix'
|
||||||
|
|
|
@ -16,10 +16,12 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
transform="@program_transform_name@"
|
||||||
|
|
||||||
prefix=@prefix@
|
prefix=@prefix@
|
||||||
exec_prefix=@exec_prefix@
|
exec_prefix=@exec_prefix@
|
||||||
libdir=@libdir@
|
libdir=@libdir@
|
||||||
platform=@platform@
|
grub_prefix=`echo /boot/grub | sed ${transform}`
|
||||||
|
|
||||||
. ${libdir}/grub/update-grub_lib
|
. ${libdir}/grub/update-grub_lib
|
||||||
|
|
||||||
|
@ -37,20 +39,37 @@ set default=${GRUB_DEFAULT}
|
||||||
set timeout=${GRUB_TIMEOUT}
|
set timeout=${GRUB_TIMEOUT}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
case ${platform}:${GRUB_TERMINAL} in
|
case x${GRUB_TERMINAL} in
|
||||||
pc:gfxterm)
|
xgfxterm)
|
||||||
# Make the font accessible
|
# Make the font accessible
|
||||||
prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_FONT_PATH}`
|
prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_FONT_PATH}`
|
||||||
|
|
||||||
|
# Pick a video backend
|
||||||
|
video_backend=
|
||||||
|
for i in vbe ; do
|
||||||
|
if test -e ${grub_prefix}/$i.mod ; then
|
||||||
|
video_backend=$i
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if ! [ "${video_backend}" ] ; then
|
||||||
|
echo "No suitable backend could be found for gfxterm." >&2 ; exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
if font `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
|
if font `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
|
||||||
set gfxmode=640x480
|
set gfxmode=640x480
|
||||||
insmod gfxterm
|
insmod gfxterm
|
||||||
insmod vbe
|
insmod ${video_backend}
|
||||||
terminal gfxterm
|
terminal gfxterm
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
*:serial)
|
xserial)
|
||||||
|
if ! test -e ${grub_prefix}/serial.mod ; then
|
||||||
|
echo "Serial terminal not available on this platform." >&2 ; exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then
|
if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then
|
||||||
echo "Warning, requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." >&2
|
echo "Warning, requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." >&2
|
||||||
GRUB_SERIAL_COMMAND=serial
|
GRUB_SERIAL_COMMAND=serial
|
||||||
|
@ -58,7 +77,10 @@ EOF
|
||||||
echo "${GRUB_SERIAL_COMMAND}"
|
echo "${GRUB_SERIAL_COMMAND}"
|
||||||
echo "terminal serial"
|
echo "terminal serial"
|
||||||
;;
|
;;
|
||||||
*:*)
|
x)
|
||||||
|
# Just use the native terminal
|
||||||
|
;;
|
||||||
|
x*)
|
||||||
echo "terminal ${GRUB_TERMINAL}"
|
echo "terminal ${GRUB_TERMINAL}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -26,7 +26,6 @@ sysconfdir=@sysconfdir@
|
||||||
grub_prefix=`echo /boot/grub | sed ${transform}`
|
grub_prefix=`echo /boot/grub | sed ${transform}`
|
||||||
grub_cfg=${grub_prefix}/grub.cfg
|
grub_cfg=${grub_prefix}/grub.cfg
|
||||||
update_grub_dir=${sysconfdir}/grub.d
|
update_grub_dir=${sysconfdir}/grub.d
|
||||||
platform=@platform@
|
|
||||||
|
|
||||||
grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
|
grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
|
||||||
grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
|
grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
|
||||||
|
@ -127,15 +126,15 @@ if test -f ${sysconfdir}/default/grub ; then
|
||||||
. ${sysconfdir}/default/grub
|
. ${sysconfdir}/default/grub
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if ${GRUB_TERMINAL} is set, check it has a sane value. if undefined,
|
case x${GRUB_TERMINAL} in
|
||||||
# fallback to our default
|
x)
|
||||||
case ${platform}:${GRUB_TERMINAL} in
|
# If this platform supports gfxterm, try to use it.
|
||||||
pc:) GRUB_TERMINAL=gfxterm ;;
|
if test -e ${grub_prefix}/gfxterm.mod ; then
|
||||||
ieee1275:) GRUB_TERMINAL=ofconsole ;;
|
GRUB_TERMINAL=gfxterm
|
||||||
*:) GRUB_TERMINAL=console ;;
|
fi
|
||||||
pc:console | pc:serial | ieee1275:ofconsole | ieee1275:console | *:gfxterm)
|
|
||||||
;;
|
;;
|
||||||
*:*) echo "Invalid terminal \"${GRUB_TERMINAL}\"" >&2 ; exit 1 ;;
|
xconsole | xserial | xofconsole | xgfxterm) ;;
|
||||||
|
*) echo "Invalid terminal \"${GRUB_TERMINAL}\"" >&2 ; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# check for terminals that require fonts
|
# check for terminals that require fonts
|
||||||
|
@ -144,16 +143,16 @@ case ${GRUB_TERMINAL} in
|
||||||
if path=`font_path` ; then
|
if path=`font_path` ; then
|
||||||
GRUB_FONT_PATH="${path}"
|
GRUB_FONT_PATH="${path}"
|
||||||
else
|
else
|
||||||
# fallback to console
|
# fallback to the native terminal for this platform
|
||||||
GRUB_TERMINAL=console
|
unset GRUB_TERMINAL
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# does our terminal support utf-8 ?
|
# does our terminal support utf-8 ?
|
||||||
case ${platform}:${GRUB_TERMINAL} in
|
case ${GRUB_TERMINAL} in
|
||||||
*:gfxterm) ;;
|
gfxterm) ;;
|
||||||
*:*)
|
*)
|
||||||
# make sure all our children behave in conformance with ascii..
|
# make sure all our children behave in conformance with ascii..
|
||||||
export LANG=C
|
export LANG=C
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue