Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1HplqN-0005Nd-Cj for mharc-grub-devel@gnu.org; Sun, 20 May 2007 09:53:07 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HplqM-0005NY-4r for grub-devel@gnu.org; Sun, 20 May 2007 09:53:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HplqK-0005NJ-Ox for grub-devel@gnu.org; Sun, 20 May 2007 09:53:05 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HplqK-0005ND-DR for grub-devel@gnu.org; Sun, 20 May 2007 09:53:04 -0400 Received: from crypt.ethx.net ([82.165.27.140]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HplqJ-0004to-An for grub-devel@gnu.org; Sun, 20 May 2007 09:53:03 -0400 Received: from 62-31-146-25.cable.ubr12.azte.blueyonder.co.uk ([62.31.146.25] helo=xerces) by crypt.ethx.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1HplqG-0002qD-TA; Sun, 20 May 2007 14:53:01 +0100 Received: from sam by xerces with local (Exim 4.63) (envelope-from ) id 1Hplr1-0001EX-8z; Sun, 20 May 2007 14:53:47 +0100 From: Sam Morris To: 423022@bugs.debian.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-7hBnRPPsP+tcnQ6hRI2D" Date: Sun, 20 May 2007 14:53:47 +0100 Message-Id: <1179669227.4178.5.camel@xerces> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 X-Spam-Bars: - X-detected-kernel: Linux 2.6 (newer, 3) Cc: grub-devel@gnu.org Subject: Re: problems detecting partition map on software RAID 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, 20 May 2007 13:53:06 -0000 --=-7hBnRPPsP+tcnQ6hRI2D Content-Type: text/plain Content-Transfer-Encoding: quoted-printable reopen 423022 thanks Hm, this isn't quite fixed yet... users of software RAID still won't be able to boot up, as the generated core.img will not contain the 'raid' module. In fact, I get the error message 'you need to load the kernel first' which doesn't make much sense... I would have expected something more along the lines of 'No such device: (md0)'. Anyway, here's what I came up with for grub-install. It's ugly, but that's shell scripting for you. ;) # Then the partition map module. partmap_module=3D`$grub_probe --target=3Dpartmap --device-map=3D${d= evice_map} ${grubdir}` if test "x$partmap_module" =3D x -a "x$modules" =3D x; then grub_device=3D"$($grub_probe --target=3Ddevice --device-map=3D$= {device_map} ${grubdir})" dev=3D"$(stat -c %t:%T "$grub_device")" # Ugh, shell scripting is crap! Can't use a subshell because it= can't # update the value of partmap_module. Better hope there are nev= er any # kobjects that contain whitespace in their name... for ko in $(find /sys/block -name dev -exec dirname {} \;); do if test "$(cat "$ko/dev")" =3D "$dev"; then partmap_module=3D'pc gpt' case "$ko" in /sys/block/md[0-9]) partmap_module=3D"$partmap_module raid" ;; # Partitionable arrays are apparantly detected by grub-= probe, so # no need to check for them here. #/sys/block/md_d[0-9]) # ;; /sys/block/dm-[0-9]) # We should really look through the output of 'lvdi= splay -c' # at this point, searching for a LVM logical volume= which # matches the detected device's major/minor numbers= . # If that fails then we know it's not LVM; if GRUB = later # grows support for other device-mapper mappings th= en # the output of 'dmsetup status' could be used here= . echo "Assuming that the device-mapper device '$ko' = is part" 1>&2 echo "of an LVM logical volume. If this is not the = case," 1>&2 echo "specify the correct modules with the option \= `--modules'." 1>&2 partmap_module=3D"$partmap_module lvm" ;; *) echo "I don't know which modules GRUB needs to use = to access a" 1>&2 echo "device of type '$ko'." 1>&2 unset partmap_module esac break fi done fi if test "x$partmap_module" =3D x -a "x$modules" =3D x; then echo "Auto-detection of a partition map module failed." 1>&2 echo "Please specify the module with the option \`--modules' ex= plicitly." 1>&2 exit 1 fi =20 Maybe it would be easier to simply include 'raid' and 'lvm' in the fallback list... --=20 Sam Morris http://robots.org.uk/ PGP key id 1024D/5EA01078 3412 EA18 1277 354B 991B C869 B219 7FDB 5EA0 1078 --=-7hBnRPPsP+tcnQ6hRI2D Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGUFLrshl/216gEHgRAgJtAKCnxQxFzf3l2Ctf7fwdioF/4Pk4RgCff9zG 1ocjcqt6/orisu1BwJoSPhc= =EBY1 -----END PGP SIGNATURE----- --=-7hBnRPPsP+tcnQ6hRI2D--