]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Add new all_video module.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 26 Feb 2012 17:09:07 +0000 (18:09 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 26 Feb 2012 17:09:07 +0000 (18:09 +0100)
* grub-core/Makefile.am (moddep.lst): Make dependent on video.lst.
* grub-core/Makefile.core.def (all_video): New module.
* grub-core/genmoddep.awk: Generate dependency of all_video from
video.lst.
* grub-core/lib/fake_module.c: New file.
* grub-core/normal/main.c (features): Add feature_all_video_module.
* util/grub.d/00_header.in: Define locale_dir based on $prefix and
don't do explicit search again.
insmod all_video in load_video if available.

ChangeLog
grub-core/Makefile.am
grub-core/Makefile.core.def
grub-core/genmoddep.awk
grub-core/lib/fake_module.c [new file with mode: 0644]
grub-core/normal/main.c
util/grub.d/00_header.in

index 539575f3f0b99934358045329e0a695feef6402a..5d8793aa52380a11c6ee541d0b90f17fdf8bf621 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2012-02-25  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Add new all_video module.
+
+       * grub-core/Makefile.am (moddep.lst): Make dependent on video.lst.
+       * grub-core/Makefile.core.def (all_video): New module.
+       * grub-core/genmoddep.awk: Generate dependency of all_video from
+       video.lst.
+       * grub-core/lib/fake_module.c: New file.
+       * grub-core/normal/main.c (features): Add feature_all_video_module.
+       * util/grub.d/00_header.in: Define locale_dir based on $prefix and
+       don't do explicit search again.
+       insmod all_vidoe in load_video if available.
+
 2012-02-25  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Another round of string clarification and adding TRANSLATORS comments.
index 4a46e1d9cb425c69b0b3f8e2324881deff198ab5..80b24b949efcbc006426bfa9debc8746a2347350 100644 (file)
@@ -336,7 +336,7 @@ syminfo.lst: gensyminfo.sh kernel_syms.lst $(MODULE_FILES)
        mv $@.new $@
 
 # generate global module dependencies list
-moddep.lst: syminfo.lst genmoddep.awk
+moddep.lst: syminfo.lst genmoddep.awk video.lst
        cat $< | sort | awk -f $(srcdir)/genmoddep.awk > $@ || (rm -f $@; exit 1)
 platform_DATA += moddep.lst
 CLEANFILES += config.log syminfo.lst moddep.lst
index cda6f94ce710fdd846dc47569f4e2f35001ce716..fbc85d344f13b6f7fef7f27fc89d6bbff05735b6 100644 (file)
@@ -1794,3 +1794,8 @@ module = {
   name = crc64;
   common = lib/crc64.c;
 };
+
+module = {
+  name = all_video;
+  common = lib/fake_module.c;
+};
index e412d437029f893ed8881cf1833d49f1d28c3b07..9ffea7309dc0f7d925d0799fd51440325f642840 100644 (file)
@@ -57,6 +57,14 @@ END {
     for (depmod in uniqmods) {
       modlist = modlist " " depmod;
     }
+    if (mod == "all_video") {
+       continue;
+    }
     printf "%s:%s\n", mod, modlist;
   }
+  modlist = ""
+  while (getline <"video.lst") {
+      modlist = modlist " " $1;
+  }
+  printf "all_video:%s\n", modlist;
 }
diff --git a/grub-core/lib/fake_module.c b/grub-core/lib/fake_module.c
new file mode 100644 (file)
index 0000000..3646ced
--- /dev/null
@@ -0,0 +1,4 @@
+/* This file is intentionally empty: it's used to generate modules with no code or data.  (purely dependency modules)  */
+#include <grub/dl.h>
+
+GRUB_MOD_LICENSE ("GPLv3+");
index aea540457152bcf8466a273cdf8bafe5cd41ad33..50c314dfa358b2d69d427a2e9fe1b13bc37b899e 100644 (file)
@@ -475,7 +475,7 @@ static grub_command_t cmd_clear;
 static void (*grub_xputs_saved) (const char *str);
 static const char *features[] = {
   "feature_chainloader_bpb", "feature_ntldr", "feature_platform_search_hint",
-  "feature_default_font_path"
+  "feature_default_font_path", "feature_all_video_module"
 };
 
 GRUB_MOD_INIT(normal)
index 24212e0cf055c821dd33f98bf9b72ffc43310f07..a319d58b5940adbb7711f0dc2d1095ea710b2d72 100644 (file)
@@ -22,7 +22,6 @@ transform="@program_transform_name@"
 prefix="@prefix@"
 exec_prefix="@exec_prefix@"
 datarootdir="@datarootdir@"
-locale_dir=`echo ${GRUB_PREFIX}/locale | sed ${transform}`
 grub_lang=`echo $LANG | cut -d . -f 1`
 
 . "@datadir@/@PACKAGE@/grub-mkconfig_lib"
@@ -83,17 +82,21 @@ if [ -n "${GRUB_VIDEO_BACKEND}" ]; then
   insmod ${GRUB_VIDEO_BACKEND}
 EOF
 else
-    # Insert all available backends; GRUB will use the most appropriate.
-    have_video=0;
-    for backend in $(cat "${GRUB_PREFIX}/video.lst"); do
-       have_video=1;
-       cat <<EOF
-  insmod ${backend}
+# If all_video.mod isn't available load all modules available
+# with versions prior to introduction of all_video.mod
+cat <<EOF
+  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
 EOF
-    done
-    if [ x$have_video = x0 ]; then
-       echo "true"
-    fi
 fi
 cat <<EOF
 }
@@ -167,10 +170,9 @@ EOF
 EOF
 
 # Gettext variables and module
-if [ "x${LANG}" != "xC" ] && [ -d "${locale_dir}" ] ; then
-    prepare_grub_to_access_device $(${grub_probe} --target=device ${locale_dir}) | sed -e "s/^/  /"
+if [ "x${LANG}" != "xC" ] ; then
   cat << EOF
-  set locale_dir=(\$root)$(make_system_path_relative_to_its_root ${locale_dir})
+  set locale_dir=\$prefix/locale
   set lang=${grub_lang}
   insmod gettext
 EOF