Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JCb6g-0000sA-FD for mharc-grub-devel@gnu.org; Wed, 09 Jan 2008 08:36:34 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JCb6e-0000qS-ER for grub-devel@gnu.org; Wed, 09 Jan 2008 08:36:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JCb6d-0000ot-J4 for grub-devel@gnu.org; Wed, 09 Jan 2008 08:36:31 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JCb6d-0000oc-4R for grub-devel@gnu.org; Wed, 09 Jan 2008 08:36:31 -0500 Received: from smtp-vbr3.xs4all.nl ([194.109.24.23]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JCb6c-0007lw-Uv for grub-devel@gnu.org; Wed, 09 Jan 2008 08:36:31 -0500 Received: from peder.flower (peder.xs4all.nl [82.93.198.126]) by smtp-vbr3.xs4all.nl (8.13.8/8.13.8) with ESMTP id m09DaT5h005839; Wed, 9 Jan 2008 14:36:29 +0100 (CET) (envelope-from janneke-list@xs4all.nl) Received: from [127.0.0.1] (localhost [127.0.0.1]) by peder.flower (Postfix) with ESMTP id E86CBAC7BA; Wed, 9 Jan 2008 14:36:28 +0100 (CET) From: Jan Nieuwenhuizen To: The development of GRUB 2 In-Reply-To: <20080109114134.GB11819@thorin> References: <20080108121314.GC4270@thorin> <1199797210.7601.3.camel@localhost.localdomain> <1199798453.7601.17.camel@localhost.localdomain> <20080108150140.GA470@thorin> <20080108152102.GA13078@thorin> <1199826360.6104.19.camel@peder.flower> <20080108215515.GA7346@thorin> <1199869237.6137.2.camel@peder.flower> <20080109114134.GB11819@thorin> Content-Type: multipart/mixed; boundary="=-OSdyhiz9Zd/hnNEcqfQs" Organization: lilypond-design.org Date: Wed, 09 Jan 2008 14:36:28 +0100 Message-Id: <1199885788.12433.52.camel@peder.flower> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Subject: Re: [PATCH] force load of lvm and raid before entering normal mode (Re: LVM on debian) 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: Wed, 09 Jan 2008 13:36:33 -0000 --=-OSdyhiz9Zd/hnNEcqfQs Content-Type: text/plain Content-Transfer-Encoding: 7bit Robert Millan writes: > I reworked and cleaned up the patch a bit. Please, can you test this one? This has lvm after biosdisk, which looks ok. grub-mkimage --output=/boot/grub/core.img --prefix=/tmp/boot/grub ext2 biosdisk lvm _chain Haven't boot-tested this yet, but should be ok. Btw, I'm editing grub-install all the time to not really install, what about a --dry-run option? (patch against your version attached) Greetings, Jan. -- Jan Nieuwenhuizen | GNU LilyPond - The music typesetter http://www.xs4all.nl/~jantien | http://www.lilypond.org --=-OSdyhiz9Zd/hnNEcqfQs Content-Disposition: attachment; filename=grub-install.diff Content-Type: text/x-patch; name=grub-install.diff; charset=utf-8 Content-Transfer-Encoding: 7bit Index: ChangeLog =================================================================== RCS file: /sources/grub/grub2/ChangeLog,v retrieving revision 1.484 diff -p -u -r1.484 ChangeLog --- ChangeLog 8 Jan 2008 11:38:18 -0000 1.484 +++ ChangeLog 9 Jan 2008 13:33:51 -0000 @@ -1,3 +1,7 @@ +2008-01-09 Jan Nieuwenhuizen + + * util/i386/pc/grub-install.in: Add --dry-run option. + 2008-01-08 Robert Millan * loader/i386/pc/linux.c (grub_rescue_cmd_linux): For --- util/i386/pc/grub-install.in~ 2008-01-09 14:32:02.000000000 +0100 +++ util/i386/pc/grub-install.in 2008-01-09 14:28:25.000000000 +0100 @@ -44,6 +44,7 @@ force_lba= recheck=no debug=no +dry_run= # for make_system_path_relative_to_its_root() . ${libdir}/grub/update-grub_lib @@ -57,6 +58,7 @@ -h, --help print this message and exit -v, --version print the version information and exit + -n, --dry-run do not install grub, just print install commands --modules=MODULES pre-load specified modules MODULES --root-directory=DIR install GRUB images under the directory DIR instead of the root directory @@ -86,6 +88,8 @@ -v | --version) echo "grub-install (GNU GRUB ${PACKAGE_VERSION})" exit 0 ;; + -n | --dry-run) + dry_run=echo ;; --modules=*) modules=`echo "$option" | sed 's/--modules=//'` ;; --root-directory=*) @@ -174,8 +178,8 @@ fi # Create the GRUB directory if it is not present. -test -d "$bootdir" || mkdir "$bootdir" || exit 1 -test -d "$grubdir" || mkdir "$grubdir" || exit 1 +test -d "$bootdir" || $dry_run mkdir "$bootdir" || exit 1 +test -d "$grubdir" || $dry_run mkdir "$grubdir" || exit 1 # If --recheck is specified, remove the device map, if present. if test $recheck = yes; then @@ -203,11 +207,11 @@ # Copy the GRUB images to the GRUB directory. for file in ${grubdir}/*.mod ${grubdir}/*.lst ${grubdir}/*.img; do if test -f $file && [ "`basename $file`" != menu.lst ]; then - rm -f $file || exit 1 + $dry_run rm -f $file || exit 1 fi done for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst ${pkglibdir}/*.img; do - cp -f $file ${grubdir} || exit 1 + $dry_run cp -f $file ${grubdir} || exit 1 done # Create the core image. First, auto-detect the filesystem module. @@ -229,13 +233,14 @@ # _chain is often useful modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module _chain" -$grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}` $modules || exit 1 +$dry_run $grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}` $modules || exit 1 # Now perform the installation. -$grub_setup --directory=${grubdir} --device-map=${device_map} \ +$dry_run $grub_setup --directory=${grubdir} --device-map=${device_map} \ ${install_device} || exit 1 # Prompt the user to check if the device map is correct. +test -n "$dry_run" && echo "DRY RUN: Grub was not (re)installed." echo "Installation finished. No error reported." echo "This is the contents of the device map $device_map." echo "Check if this is correct or not. If any of the lines is incorrect," --=-OSdyhiz9Zd/hnNEcqfQs--