From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SMF0g-0004cP-90 for mharc-grub-devel@gnu.org; Mon, 23 Apr 2012 04:52:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMF0d-0004c5-3b for grub-devel@gnu.org; Mon, 23 Apr 2012 04:52:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SMF0W-0007CW-Oh for grub-devel@gnu.org; Mon, 23 Apr 2012 04:52:34 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:41165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMF0W-0007CJ-Es for grub-devel@gnu.org; Mon, 23 Apr 2012 04:52:28 -0400 Received: by werj55 with SMTP id j55so9463899wer.0 for ; Mon, 23 Apr 2012 01:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; bh=aD95E2X91QN9FsXzujb+meK0zB5tO2ar5Z6BOcvp41I=; b=Fc9y9pB/dfnVMtexni5xgYjNtwOf86RBOMj3AO1PLH7l3/7Lg26JBzakfWT3iuGgbM EVOFoliSPI46fC8frJtum59lPL38ugXUcEL7p3BolynfwNcxnX9NiYwJ024WSJvMFGks yPzfrH0kI80GKNpx5D3MJ4VMmVFjsrc39y2HZcUu4nXPRR6sF31Exv26BsJbeCwNZmLo TNJ5widiyy8Kyjs4ggWKT/EZ0tPQYlMw1hP48HVKnTVIchqQbQ0itA0JUsMx2TNHAO/N Oez2WtxqvwCnCH7uYCJ4y4bAyYHeSZskarl8JiAcyII1tSz+5P/KlTqwO9mTPGRk98W5 nVTw== Received: by 10.180.88.67 with SMTP id be3mr19123350wib.20.1335171146342; Mon, 23 Apr 2012 01:52:26 -0700 (PDT) Received: from fedora.x201.phnet (111-233.197-178.cust.bluewin.ch. [178.197.233.111]) by mx.google.com with ESMTPS id u9sm21348097wix.0.2012.04.23.01.52.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Apr 2012 01:52:24 -0700 (PDT) Message-ID: <4F951839.4070309@gmail.com> Date: Mon, 23 Apr 2012 10:52:09 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH,HURD] Fix grub-probe with userland partition support References: <20120422182439.GE4755@type.famille.thibault.fr> In-Reply-To: <20120422182439.GE4755@type.famille.thibault.fr> X-Enigmail-Version: 1.4 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigD0A1185A858450879E870254" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 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, 23 Apr 2012 08:52:36 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD0A1185A858450879E870254 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 22.04.2012 20:24, Samuel Thibault wrote: > Hello, > > GNU/Hurd is moving to userland partition support, i.e. /dev/hd0s* slice= s > are actually served by userland translators which use libparted. The > grub probe code needs to be fixed for that, here is a proposed patch. > > The principle is that it gets the store translator behind the file bein= g > probed for, and compares the storage area there with what grub detects > itself. That is why it makes use of the map array, which I preferred > to rename to hostdisk_map (thus big but trivial changes in hostdisk.c):= > even if it was already an external symbol, it's preferrable to prefix > it. map was never intended to be globally visible. At most perhaps "semi-local" due to difficulties of split between getroot.c and hostdisk.= c Moreover the behaviour of find_root_device must be independent of what is already in map since we don't rely anymore at map being populated at all and at entries only on as-needed basis. Additional problems include: + if (disk->dev->id !=3D GRUB_DISK_DEVICE_BIOSDISK_ID && disk->dev->= id !=3D GRUB_DISK_DEVICE_HOSTDISK_ID) + { No need to check for BIOSDISK. It's not used for hostdisk. + store_offset_t start =3D partition->start * GRUB_DISK_SECTOR_SIZE,= + length =3D partition->len * GRUB_DISK_SECTOR_SIZE, This is both stylistically incorrect and wrong. Stylistically at declaration we repeat type on every line. Additionally partition->start is only relative to container, not whole di= sk. You have to use grub_disk_partition_get_start for this. > > Samuel > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigD0A1185A858450879E870254 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.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk+VGDkACgkQNak7dOguQgmcPAEAvA2rtpvxhJmIf1pm+Bak5HcN 8WKxtEz0V8WZXbdmerIBAJqVnqDIVyXcsd8YR3YeK8zmXketcHoT7PuYUsI97EMV =EF1K -----END PGP SIGNATURE----- --------------enigD0A1185A858450879E870254--