From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1PHl6q-0007Px-6C for mharc-grub-devel@gnu.org; Sun, 14 Nov 2010 17:31:40 -0500 Received: from [140.186.70.92] (port=56104 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHl6m-0007Pp-NI for grub-devel@gnu.org; Sun, 14 Nov 2010 17:31:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PHl6i-0003xS-Rc for grub-devel@gnu.org; Sun, 14 Nov 2010 17:31:36 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:53070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PHl6i-0003xG-Gh for grub-devel@gnu.org; Sun, 14 Nov 2010 17:31:32 -0500 Received: by bwz16 with SMTP id 16so4835511bwz.0 for ; Sun, 14 Nov 2010 14:31:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=DF9k9oVV0M2sp8wyYHiL6wj2GHS+me/RAn7n/YUZw2U=; b=gaeXccCIr4dmsSk85aLfRW5f8K1llEtt+cqBtf2P61CRKXwA2SBmmuB9xQBQYK5rv0 /G46Pgbv0kvyFkWy3mJl2EuiXO2DK20cedcyTFtiilMaZcHbwUZwBnjVEG58pipV0PLO ZHeJl7v5C6mS5h6NX6Qq8uqiwJfjlBaHktH10= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=E91C6y8uPysLH0cc7lSMojJf76ENFYLE9eQNt4aVZ4NOzvBICh/imxecXsYS6hYvb1 IhkhThixl3L6zhfkFdPuOIoMbfbAyNU937+0PvjPiAMhdpOyCTzq6FUzEw3NwjBzvSm1 qWDtkBJUDlgRt0OJZUz5650diRM4gJgwdKAJE= Received: by 10.204.117.195 with SMTP id s3mr5293127bkq.203.1289773890330; Sun, 14 Nov 2010 14:31:30 -0800 (PST) Received: from debian.bg45.phnet (185-118.203-62.cust.bluewin.ch [62.203.118.185]) by mx.google.com with ESMTPS id a25sm2684724bks.20.2010.11.14.14.31.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 14 Nov 2010 14:31:28 -0800 (PST) Message-ID: <4CE06326.8070606@gmail.com> Date: Sun, 14 Nov 2010 23:31:02 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: grub-devel@gnu.org References: <4C818DBC.10002@gmail.com> <4CCF5BFC.1020907@gmail.com> <4CCFD919.7080205@gmail.com> <4CD03517.9000500@gmail.com> In-Reply-To: <4CD03517.9000500@gmail.com> X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigD7FE1D092F1C1278A4ACFFB7" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [RFT] nested partition issues X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Nov 2010 22:31:39 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD7FE1D092F1C1278A4ACFFB7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11/02/2010 04:58 PM, Gr=C3=A9goire Sutre wrote: > Hi, > > The main issue at hand is that, to support NetBSD, we need a working > grub-setup for the (very common) case where the NetBSD disklabel is > placed > in an MSDOS partition. > > If we need to add yet other ``strcmp (..._partmap->name, ...)'' tests t= o > grub-setup, then we likely have bad abstractions. > Usually I would have agreed with you. Unfortunately on-disk layout isn't something that is well structured. There is a bunch of special cases, exceptions and plain brain damage that the code to handle all possibilities will necessarily be more complicated than it should. And I feel like the abstractions taken for NetBSD are the right one. As for embedding code it's written specially in the following way if () { =2E.. } else if () { =2E.. } else { error ("Something unusual, better fail than damage anything"); } If you test the netbsd case and it works as it should you can add the strcmp (..._partmap->name, ...) part. > >> Actually now we follow the actual nesting of partitions. Even though >> net-/openbsd label metadate is placed inside a partition it still >> describes the whole disk as is manifested by it having entries for >> partitions not contained inside the partition containing label metadat= a. >> E.g. >> (hd0,netbsd6) may be physically contained within (hd0,msdos3) but stil= l >> be described inside the label present in second sector (hd0,msdos2). >> Place of metadata is secondary to deciding what the nesting of >> partitions is. Primary criteria is what this metadata describes. > > So, basically, as soon as a disklabel uses absolute offsets, this > disklabel > must be viewed as a top-level disklabel? No. Even using absolute offsets the label can be limited to current partition. It's the case of minix and FreeBSD. Main criteria is "If there can be only one label of this type per disk and it may describe (sub)partitions outside its own partition, then it's top-level" > > I'm afraid that this will make things more complicated than they should= > be. But that's just me. > > >> This is, of course, very unfortunate design but since we support NetBS= D >> we need such hacks. It's better than being faced with the problems of >> kind "My XYZOS handles my partition scheme perfectly but GRUB doesn't >> see half of partitions." > > I did not see reports of such problems (for NetBSD partitions) since I > merged the code to ``external'' partitions [1]. Could you please > point me > to such reports? > This was based on the image you sent me once. > In the previous implementation, if partition e: in a NetBSD disklabel i= s > discarded, it's because e: describes an ``external'' partition. This > external partition is (in all useful cases) described in another > partition > map, where it is properly nested, hence it will be found by GRUB. > Hm, it doesn't seem to be what you told me previously. AFAIR you told me that disklabel only handles first label found, and now you say that the same information is duplicated in every NetBSD partition. > Gr=C3=A9goire > > [1] http://lists.gnu.org/archive/html/grub-devel/2010-07/msg00109.html > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigD7FE1D092F1C1278A4ACFFB7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAkzgYyYACgkQNak7dOguQgnlMwEAp/USa17vFboisXhD9NPC9CVJ pgBK0tlk4KvMdTc2G3IA/1OcdjOr4qO2JByGH2o3p0K8Z5yNgOyO/GV2EZTL67rx =fOIQ -----END PGP SIGNATURE----- --------------enigD7FE1D092F1C1278A4ACFFB7--