From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OJCLU-0000hC-BZ for mharc-grub-devel@gnu.org; Mon, 31 May 2010 17:16:28 -0400 Received: from [140.186.70.92] (port=32931 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJCLR-0000gy-49 for grub-devel@gnu.org; Mon, 31 May 2010 17:16:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJCLP-000341-O0 for grub-devel@gnu.org; Mon, 31 May 2010 17:16:25 -0400 Received: from ey-out-1920.google.com ([74.125.78.149]:11175) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJCLP-00033l-E0 for grub-devel@gnu.org; Mon, 31 May 2010 17:16:23 -0400 Received: by ey-out-1920.google.com with SMTP id 13so462769eye.34 for ; Mon, 31 May 2010 14:16:22 -0700 (PDT) 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=FuUgOPwdko4WjOa/A9pP3UGnWF0CVjqcXzrovcPSoKc=; b=n+nT9CDHZxlRkgkjr5h+7DIHJeSJ/6CTYO9Kj2OpA3FVyLKhAqN6eGGOur+nE0mnEZ jXy3VCPDyg78jq9Du36c6ilznajK5DYhjGa0HtamSAUzrZ6aysaOyU/rlaO4NKAVo8Mn daumVuNGdnhqAsqHL2PrtufZ3nRy7Pjp+gG0k= 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=wZrmCJSonvVcScK/pyEJnCeCSBoKAkJu4yr6+KfiH3bbIxl4enYDQpdp69OHRAwHnq Prbu7CjLNtoeuygEAIgz2wzAvuUVK0EeeQwU+XHJIc0l+meI/Sb8+0bGBs7/wDX3ogf+ ZWiHThe8C2di+6+2bmMsArNZ7a/VE91FUoKAY= Received: by 10.213.3.83 with SMTP id 19mr2520613ebm.79.1275340581798; Mon, 31 May 2010 14:16:21 -0700 (PDT) Received: from debian.bg45.phnet (gprs17.swisscom-mobile.ch [193.247.250.17]) by mx.google.com with ESMTPS id 16sm3310576ewy.7.2010.05.31.14.16.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 31 May 2010 14:16:19 -0700 (PDT) Message-ID: <4C042719.4050907@gmail.com> Date: Mon, 31 May 2010 23:16:09 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <4BF2DE4F.7070209@gmail.com> <4BF2F68E.8090906@gmail.com> <4BF42759.1010503@gmail.com> <4BF43302.6080106@gmail.com> <4BF43A0A.80801@gmail.com> <4BF8FA66.5060702@gmail.com> In-Reply-To: <4BF8FA66.5060702@gmail.com> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig912E0A7E5D9A366BAC431F9E" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: Are BSD partitions not supported? 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: Mon, 31 May 2010 21:16:26 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig912E0A7E5D9A366BAC431F9E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Gr=C3=A9goire Sutre wrote: > On 05/19/2010 09:20 PM, Vladimir '=CF=86-coder/phcoder' Serbinenko wrot= e: > > [snip] > - delta =3D grub_partition_get_start (disk->partition); > + delta =3D grub_le_to_cpu32 (whole_disk_be.offset); > > As dicsussed on irc, this makes the delta completely dependent on the > c: entry of the disklabel, which could be bogus. > Looks like we have to have different behaviour for different BSDs. Since it looks like generic code would fail for ThisBSD or ThatBSD, I propose to go by as-needed basis. So I think we should: -restrict bsdlabel to being embed into msdos partitions of types a5, a6 or a9. -conditionalise the behaviour and use my patch for a5 (FreeBSD) and current behaviour for a6 (OpenBSD) and a9 (NetBSD). I recognise that it's ugly. Another possibility is to have both (hdX,msdosY,freebsdZ) and (hdX,msdosY,netbsdZ) syntax but it would result in many confusing ghost partitions. But since bsdlabel is so disorganised and ugly I prefer to limit its support to minimum. > For instance, on NetBSD/i386, the system seems to work fine with random= > entries for c: in the disk label stored on the disk. Even a null offset= > is fine. The in-core disklabel shown by the command disklabel (without= > -r) is the correct one. I give an example below, which was obtained on= > system booted from wd0. > > IMHO, the current code is better for the cases where the offsets in the= > disklabel are absolute addresses, since it performs exactly the inverse= > translation of the one done in grub_partition_get_start(), which AFAICS= > is supposed to return the absolute address. > > What we want here is to diverge from that code when the disklabel > offsets are relative. I believe that testing whether c: has a null > offset gives the answer. I changed Vladimir's second patch to do that.= > > We still have the problem that NetSBD uses c: for the whole-disk > partition on many ports (but it's d: on i386 and amd64), see [1]. For > those ports, the normal offset for c: is 0. But maybe it's fair to > assume that, on those ports, the NetBSD slice is never embedded in > another partition? > > Gr=C3=A9goire > > [1] http://nxr.netbsd.org/source/s?defs=3DRAW_PART&project=3D/src > > On-disk label > niagara# disklabel -r wd0 > 16 partitions: > # size offset fstype > a: 263088 10233405 4.2BSD > b: 2097648 10496493 swap > c: 82345673 0 unused > d: 117210240 0 unused > . > . > . > > -----------------------------------------------------------------------= -- > In-core label > > niagara# disklabel wd0 > # /dev/rwd0d: > . > . > . > 16 partitions: > # size offset fstype > a: 263088 10233405 4.2BSD > b: 2097648 10496493 swap > c: 58605120 10233405 unused > d: 117210240 0 unused > . > . > . > -----------------------------------------------------------------------= - > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig912E0A7E5D9A366BAC431F9E 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 iF4EAREKAAYFAkwEJx8ACgkQNak7dOguQgn18wD9EPoiJ56T0/86LZuMNfwTpHmX nF5pmbATMYh+x4tr3YAA+weSZiScxjRyJzptvOUJ9OUFLt13QbZCpIyQ3clh7ozW =gFqL -----END PGP SIGNATURE----- --------------enig912E0A7E5D9A366BAC431F9E--