From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SMbrV-0003df-PK for mharc-grub-devel@gnu.org; Tue, 24 Apr 2012 05:16:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMbrQ-0003dW-25 for grub-devel@gnu.org; Tue, 24 Apr 2012 05:16:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SMbrJ-00013n-RO for grub-devel@gnu.org; Tue, 24 Apr 2012 05:16:35 -0400 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:36269) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMbrJ-00013i-LM for grub-devel@gnu.org; Tue, 24 Apr 2012 05:16:29 -0400 X-IronPort-AV: E=Sophos;i="4.75,472,1330902000"; d="scan'208";a="155289247" Received: from unknown (HELO type.ipv6) ([193.50.110.104]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 24 Apr 2012 11:16:27 +0200 Received: from samy by type.ipv6 with local (Exim 4.77) (envelope-from ) id 1SMbrH-0001KB-EZ for grub-devel@gnu.org; Tue, 24 Apr 2012 11:16:27 +0200 Date: Tue, 24 Apr 2012 11:16:27 +0200 From: Samuel Thibault To: The development of GNU GRUB Subject: Re: [PATCH,HURD] Fix grub-probe with userland partition support Message-ID: <20120424091627.GC4453@type.bordeaux.inria.fr> References: <4F951839.4070309@gmail.com> <20120423094030.GB4755@type.famille.thibault.fr> <4F9532B5.9050701@gmail.com> <20120423110627.GL4755@type.famille.thibault.fr> <4F953A3B.3000708@gmail.com> <20120423212606.GV4755@type.famille.thibault.fr> <20120423233423.GC4755@type.famille.thibault.fr> <4F966A79.8050700@gmail.com> <20120424090056.GB4453@type.bordeaux.inria.fr> <4F966E6B.7010306@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4F966E6B.7010306@gmail.com> User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.82 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: Tue, 24 Apr 2012 09:16:40 -0000 Vladimir 'φ-coder/phcoder' Serbinenko, le Tue 24 Apr 2012 11:12:11 +0200, a écrit : > On 24.04.2012 11:00, Samuel Thibault wrote: > > Vladimir 'φ-coder/phcoder' Serbinenko, le Tue 24 Apr 2012 10:55:21 +0200, a écrit : > >> On 24.04.2012 01:34, Samuel Thibault wrote: > >>> + if (errno == ENOENT && part >= 5) > >>> + { > >> This introduces an assumption that if part >=5 is missing then there are > >> no additional partitions. While this is true for msdos, it's false for > >> GPT, where such config is common after deleting a partition. Moreover, > >> APM (apple) partitions often start at 8. > > Ok, but what do you suggest? By the very nature of parted-based > > translators, there is no way to know how many partitions there are. > Can we know whether given device is partition? If we know that it is we > can iterate as long as we can, adding some restriction like your 1000 > and issuing error if it's hit since it should never happen. I don't see how knowing whether the device is partition will help to know where to stop. A user could very well have all partition nodes in /dev up to 100, they'll all be partitions. Whether they actually exist is another story, but as you say, you can't assume anything with the absence of a partition. Samuel