2009-12-12 Robert Millan <rmh@aybabtu.com>

* gendistlist.sh (EXTRA_DISTFILES): Add `genvideolist.sh'.
        * genmk.rb (video): New variable.
        (CLEANFILES, VIDEOFILES): Add #{video}.
        (#{video}): New target rule.
        * genvideolist.sh: New file.
        * Makefile.in (pkglib_DATA): Add video.lst.
        (video.lst): New target rule.
        * util/grub-mkconfig.in: Initialize ${GRUB_VIDEO_BACKEND} using
        `video.lst'.
        * util/grub.d/30_os-prober.in: Replace `vbe' with
        ${GRUB_VIDEO_BACKEND}.
This commit is contained in:
Robert Millan 2009-12-12 00:43:32 +00:00
parent 2a4bfcf0da
commit dc0c71d974
7 changed files with 57 additions and 10 deletions

View file

@ -1,3 +1,17 @@
2009-12-12 Robert Millan <rmh@aybabtu.com>
* gendistlist.sh (EXTRA_DISTFILES): Add `genvideolist.sh'.
* genmk.rb (video): New variable.
(CLEANFILES, VIDEOFILES): Add #{video}.
(#{video}): New target rule.
* genvideolist.sh: New file.
* Makefile.in (pkglib_DATA): Add video.lst.
(video.lst): New target rule.
* util/grub-mkconfig.in: Initialize ${GRUB_VIDEO_BACKEND} using
`video.lst'.
* util/grub.d/30_os-prober.in: Replace `vbe' with
${GRUB_VIDEO_BACKEND}.
2009-12-11 Robert Millan <rmh.grub@aybabtu.com>
* THANKS: Add David Miller.

View file

@ -169,7 +169,7 @@ endif
### General targets.
CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA) po/*.mo
pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst
pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst
moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk
cat $(DEFSYMFILES) /dev/null \
| $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \
@ -190,6 +190,9 @@ handler.lst: $(HANDLERFILES)
parttool.lst: $(PARTTOOLFILES)
cat $^ /dev/null | sort | uniq > $@
video.lst: $(VIDEOFILES)
cat $^ /dev/null | sort | uniq > $@
ifneq (true, $(MAKEINFO))
info_INFOS += docs/grub.info
endif

View file

@ -19,6 +19,7 @@ EXTRA_DISTFILES="AUTHORS COPYING ChangeLog DISTLIST INSTALL NEWS README \
gendistlist.sh genfslist.sh genhandlerlist.sh geninit.sh \
geninitheader.sh genkernsyms.sh.in genmk.rb genmoddep.awk \
genmodsrc.sh genpartmaplist.sh genparttoollist.sh \
genvideolist.sh \
gensymlist.sh.in install-sh mkinstalldirs stamp-h.in"
DISTDIRS="boot bus commands conf disk docs efiemu font fs hello hook include io \

View file

@ -193,6 +193,7 @@ endif
partmap = 'partmap-' + obj.suffix('lst')
handler = 'handler-' + obj.suffix('lst')
parttool = 'parttool-' + obj.suffix('lst')
video = 'video-' + obj.suffix('lst')
dep = deps[i]
flag = if /\.c$/ =~ src then 'CFLAGS' else 'ASFLAGS' end
extra_flags = if /\.S$/ =~ src then '-DASM_FILE=1' else '' end
@ -203,7 +204,7 @@ endif
-include #{dep}
clean-module-#{extra_target}.#{@rule_count}:
rm -f #{command} #{fs} #{partmap} #{handler} #{parttool}
rm -f #{command} #{fs} #{partmap} #{handler} #{parttool} #{video}
CLEAN_MODULE_TARGETS += clean-module-#{extra_target}.#{@rule_count}
@ -212,6 +213,7 @@ FSFILES += #{fs}
PARTTOOLFILES += #{parttool}
PARTMAPFILES += #{partmap}
HANDLERFILES += #{handler}
VIDEOFILES += #{video}
#{command}: #{src} $(#{src}_DEPENDENCIES) gencmdlist.sh
set -e; \
@ -238,6 +240,11 @@ HANDLERFILES += #{handler}
$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
| sh $(srcdir)/genhandlerlist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
#{video}: #{src} $(#{src}_DEPENDENCIES) genvideolist.sh
set -e; \
$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
| sh $(srcdir)/genvideolist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
"
end.join('')
end

26
genvideolist.sh Normal file
View file

@ -0,0 +1,26 @@
#! /bin/sh
#
# Copyright (C) 2005,2008,2009 Free Software Foundation, Inc.
#
# This script is free software; the author
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Read source code from stdin and detect partmap names.
module=$1
# Ignore video.mod.
if test $module = video; then
exit
fi
# For now, this emits only a module name, if the module registers a partition map.
if grep -v "^#" | grep '^ *grub_video_register' >/dev/null 2>&1; then
echo $module
fi

View file

@ -144,13 +144,9 @@ case x${GRUB_TERMINAL_OUTPUT} in
x | xgfxterm)
# If this platform supports gfxterm, try to use it.
if test -e ${grub_prefix}/gfxterm.mod ; then
GRUB_VIDEO_BACKEND=
for i in vbe ; do
if test -e ${grub_prefix}/$i.mod ; then
GRUB_VIDEO_BACKEND=$i
break
fi
done
# FIXME: this should do something smarter than just loading first
# video backend.
GRUB_VIDEO_BACKEND=$(head -n 1 ${grub_prefix}/video.lst || true)
if [ -n "${GRUB_VIDEO_BACKEND}" ] ; then
GRUB_TERMINAL_OUTPUT=gfxterm
elif [ "${GRUB_TERMINAL_OUTPUT}" = "gfxterm" ] ; then

View file

@ -120,7 +120,7 @@ menuentry "${LONGNAME} (on ${DEVICE})" {
EOF
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
cat << EOF
insmod vbe
insmod ${GRUB_VIDEO_BACKEND}
do_resume=0
if [ /var/vm/sleepimage -nt10 / ]; then
if xnu_resume /var/vm/sleepimage; then