From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Jkzva-0008PZ-85 for mharc-grub-devel@gnu.org; Sun, 13 Apr 2008 06:59:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JkzvY-0008LQ-EF for grub-devel@gnu.org; Sun, 13 Apr 2008 06:59:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JkzvX-0008H6-0e for grub-devel@gnu.org; Sun, 13 Apr 2008 06:59:15 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JkzvW-0008Gk-Ni for grub-devel@gnu.org; Sun, 13 Apr 2008 06:59:14 -0400 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JkzvW-0005vQ-5w for grub-devel@gnu.org; Sun, 13 Apr 2008 06:59:14 -0400 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JkzvU-0006Ct-By for grub-devel@gnu.org; Sun, 13 Apr 2008 12:59:13 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1JkzvB-0005NP-Bp for grub-devel@gnu.org; Sun, 13 Apr 2008 12:58:53 +0200 Date: Sun, 13 Apr 2008 12:58:53 +0200 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20080413105853.GD19533@thorin> References: <20080318202135.GA27452@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080318202135.GA27452@thorin> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] auto-load all partmaps in images generated by grub-mkrescue X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2008 10:59:16 -0000 Committed. On Tue, Mar 18, 2008 at 09:21:35PM +0100, Robert Millan wrote: > > See subject :-) > > -- > Robert Millan > > I know my rights; I want my phone call! > What use is a phone call… if you are unable to speak? > (as seen on /.) > > * 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. > > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -Nurp ../grub2/gendistlist.sh ./gendistlist.sh > --- ../grub2/gendistlist.sh 2005-08-22 19:28:59.000000000 +0200 > +++ ./gendistlist.sh 2008-03-18 13:30:28.000000000 +0100 > @@ -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 -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -Nurp ../grub2/genmk.rb ./genmk.rb > --- ../grub2/genmk.rb 2008-02-01 16:45:16.000000000 +0100 > +++ ./genmk.rb 2008-03-18 21:12:40.000000000 +0100 > @@ -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 -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -Nurp ../grub2/genpartmaplist.sh ./genpartmaplist.sh > --- ../grub2/genpartmaplist.sh 1970-01-01 01:00:00.000000000 +0100 > +++ ./genpartmaplist.sh 2008-03-18 13:29:32.000000000 +0100 > @@ -0,0 +1,21 @@ > +#! /bin/sh > +# > +# Copyright (C) 2005, 2008 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 > + > +# For now, this emits only a module name, if the module registers a partition map. > +if grep -v "^#" | grep '^ *grub_partition_map_register' >/dev/null 2>&1; then > + echo $module > +fi > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -Nurp ../grub2/Makefile.in ./Makefile.in > --- ../grub2/Makefile.in 2008-02-09 13:31:10.000000000 +0100 > +++ ./Makefile.in 2008-03-18 13:22:34.000000000 +0100 > @@ -123,7 +123,7 @@ include $(srcdir)/conf/$(target_cpu)-$(p > ### 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 -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -Nurp ../grub2/util/i386/pc/grub-mkrescue.in ./util/i386/pc/grub-mkrescue.in > --- ../grub2/util/i386/pc/grub-mkrescue.in 2008-02-09 13:31:11.000000000 +0100 > +++ ./util/i386/pc/grub-mkrescue.in 2008-03-18 20:43:27.000000000 +0100 > @@ -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" ] ; th > > # 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" ] ; th > 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 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel -- Robert Millan I know my rights; I want my phone call! What use is a phone call… if you are unable to speak? (as seen on /.)