From 58cd3d85e09fc2f6258d981d8cd0c0363e6b58d2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 13 Apr 2008 10:55:19 +0000 Subject: [PATCH] 2008-04-13 Robert Millan * gendistlist.sh (EXTRA_DISTFILES): Add `genpartmaplist.sh'. * genmk.rb (partmap): New variable. (CLEANFILES, PARTMAPFILES): Add #{partmap}. (#{partmap}): New target rule. * genpartmaplist.sh: New file. * Makefile.in (pkglib_DATA): Add partmap.lst. (partmap.lst): New target rule. * util/i386/pc/grub-mkrescue.in: Generate grub.cfg that loads needed modules (including all partition maps), instead of preloading them. --- ChangeLog | 12 ++++++++++++ Makefile.in | 5 ++++- gendistlist.sh | 4 ++-- genmk.rb | 9 ++++++++- util/i386/pc/grub-mkrescue.in | 9 +++++++-- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88fcf7b86..76fac8411 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-04-13 Robert Millan + + * gendistlist.sh (EXTRA_DISTFILES): Add `genpartmaplist.sh'. + * genmk.rb (partmap): New variable. + (CLEANFILES, PARTMAPFILES): Add #{partmap}. + (#{partmap}): New target rule. + * genpartmaplist.sh: New file. + * Makefile.in (pkglib_DATA): Add partmap.lst. + (partmap.lst): New target rule. + * util/i386/pc/grub-mkrescue.in: Generate grub.cfg that loads needed + modules (including all partition maps), instead of preloading them. + 2007-04-13 Fabian Greffrath * util/grub.d/30_os-prober.in: New script. Use `os-prober' and diff --git a/Makefile.in b/Makefile.in index c2f432ff3..afe53a3bc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -123,7 +123,7 @@ include $(srcdir)/conf/$(target_cpu)-$(platform).mk ### General targets. CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA) -pkglib_DATA += moddep.lst command.lst fs.lst +pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk cat $(DEFSYMFILES) /dev/null \ | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \ @@ -135,6 +135,9 @@ command.lst: $(COMMANDFILES) fs.lst: $(FSFILES) cat $^ /dev/null | sort > $@ +partmap.lst: $(PARTMAPFILES) + cat $^ /dev/null | sort > $@ + ifeq (, $(UNIFONT_HEX)) else pkgdata_DATA += unicode.pff ascii.pff diff --git a/gendistlist.sh b/gendistlist.sh index f89365a1a..4c648aa90 100644 --- a/gendistlist.sh +++ b/gendistlist.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (C) 2005 Free Software Foundation, Inc. +# Copyright (C) 2005, 2008 Free Software Foundation, Inc. # # This gendistlist.sh is free software; the author # gives unlimited permission to copy and/or distribute it, @@ -16,7 +16,7 @@ EXTRA_DISTFILES="AUTHORS COPYING ChangeLog DISTLIST INSTALL NEWS README \ THANKS TODO Makefile.in aclocal.m4 autogen.sh config.guess \ config.h.in config.sub configure configure.ac gencmdlist.sh \ - gendistlist.sh genfslist.sh genkernsyms.sh genmk.rb \ + gendistlist.sh genfslist.sh genpartmaplist.sh genkernsyms.sh genmk.rb \ genmodsrc.sh gensymlist.sh install-sh mkinstalldirs stamp-h.in" DISTDIRS="boot commands conf disk font fs hello include io kern loader \ diff --git a/genmk.rb b/genmk.rb index d43244dea..9faea5aad 100644 --- a/genmk.rb +++ b/genmk.rb @@ -141,6 +141,7 @@ endif fake_obj = File.basename(src).suffix('o') command = 'cmd-' + obj.suffix('lst') fs = 'fs-' + obj.suffix('lst') + partmap = 'partmap-' + 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 @@ -150,9 +151,10 @@ endif $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $< -include #{dep} -CLEANFILES += #{command} #{fs} +CLEANFILES += #{command} #{fs} #{partmap} COMMANDFILES += #{command} FSFILES += #{fs} +PARTMAPFILES += #{partmap} #{command}: #{src} $(#{src}_DEPENDENCIES) gencmdlist.sh set -e; \ @@ -164,6 +166,11 @@ FSFILES += #{fs} $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/genfslist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) +#{partmap}: #{src} $(#{src}_DEPENDENCIES) genpartmaplist.sh + set -e; \ + $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ + | sh $(srcdir)/genpartmaplist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) + " end.join('') diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index 620c0f093..53bf8f652 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -109,6 +109,11 @@ cp ${input_dir}/*.mod \ ${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \ ${aux_dir}/boot/grub/ +modules="biosdisk `cat ${input_dir}/partmap.lst` ${modules}" +for i in ${modules} ; do + echo "insmod $i" +done > ${aux_dir}/boot/grub/grub.cfg + if test "x$overlay" = x ; then : ; else cp -dpR ${overlay}/* ${aux_dir}/ fi @@ -121,7 +126,7 @@ if [ "x${image_type}" = "xfloppy" ] ; then # build core.img core_img=`mktemp` - ${grub_mkimage} -d ${input_dir}/ -m ${memdisk_img} -o ${core_img} memdisk cpio biosdisk ${modules} + ${grub_mkimage} -d ${input_dir}/ -m ${memdisk_img} -o ${core_img} memdisk cpio rm -f ${memdisk_img} # build floppy image @@ -130,7 +135,7 @@ if [ "x${image_type}" = "xfloppy" ] ; then else # build core.img core_img=`mktemp` - ${grub_mkimage} -d ${input_dir}/ -o ${core_img} biosdisk iso9660 ${modules} + ${grub_mkimage} -d ${input_dir}/ -o ${core_img} biosdisk iso9660 # build grub_eltorito image cat ${input_dir}/cdboot.img ${core_img} > ${aux_dir}/boot/grub/grub_eltorito