Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Lg0u7-0005py-BZ for mharc-grub-devel@gnu.org; Sat, 07 Mar 2009 13:05:43 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lg0u5-0005ph-T4 for grub-devel@gnu.org; Sat, 07 Mar 2009 13:05:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lg0u3-0005pI-E2 for grub-devel@gnu.org; Sat, 07 Mar 2009 13:05:40 -0500 Received: from [199.232.76.173] (port=36119 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lg0u3-0005pF-8s for grub-devel@gnu.org; Sat, 07 Mar 2009 13:05:39 -0500 Received: from ti-out-0910.google.com ([209.85.142.189]:12756) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lg0u2-0003q3-Dy for grub-devel@gnu.org; Sat, 07 Mar 2009 13:05:38 -0500 Received: by ti-out-0910.google.com with SMTP id j3so514307tid.10 for ; Sat, 07 Mar 2009 10:05:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=cK6s47UYgfMRIo+tZVpTo8+Jabqk2fGs6qzmPc9Dv+Y=; b=PMa7nUEjz8aLPunof2rhM1i75mlZ4tTdhpjHYySNsRw/kWagLWn+E3TIEFzya94nK1 /QaZasDGUxzL8ckLTzUA+zeAXv+De2Ol3RTYVQ6tEr05Ipdi8YoAbZ5u9PG9sPw/bugd Gc9wLk9tDaqyBAXTuiQkchPCGrVRXHcfXRkCA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=aR/BVaA5BPJa4ID1K/kcj04sXHGCNqNF65G0SK1frVna/ofMmdJzao09IHv+ico3nb IWTn3XYyJF3XcsWlovH6lHIbEZ/8bBfRuv2bDPspeU134YDIYJHEWjqVToVAFha+uvcm 29yXeLb8GGcB+l712fS3SXO0Bg7hi8uxzVGyU= MIME-Version: 1.0 Received: by 10.110.69.5 with SMTP id r5mr5824871tia.36.1236449136609; Sat, 07 Mar 2009 10:05:36 -0800 (PST) In-Reply-To: <49B29AEE.4000409@gmail.com> References: <49B28BA6.3030109@gmail.com> <20090307153815.GA15220@thorin> <49B29AEE.4000409@gmail.com> Date: Sun, 8 Mar 2009 02:05:36 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [Design] nested partitions: Unify grub_partition and grub_disk 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: Sat, 07 Mar 2009 18:05:42 -0000 Hi, >Hello. I was looking into nested partitions issue and propose to unify gru= b_partition and grub_disk. In this case when a code calls grub_disk_read wi= th a >grub_disk_t which represents a partition it will correct the offset a= nd call grub_disk_read with underlying partition or disk. In this way not o= nly nested partitions >become natural but also conceptually similar fields = of total_sectors and len become unified. As it's an important design change= I send this e-mail before coding it Actually, this is already how it works. grub_disk has a partition pointer, which indicate if it is partition or disk, and grub_disk_adjust_range adjust the offset for partition. My suggestion is, always treats grub_disk as a partition, and use the offset. For the root partition, offset is 0 so we get the whole disk. On Sun, Mar 8, 2009 at 12:03 AM, phcoder wrote: > I forgot to speak about another question: partition naming. I see 2 > possibilities > 1) purely numeric unified naming scheme. It means that > (hd0,1,a) becomes (hd0,1,1) > On one hand mixed number-letter scheme is similar to what freebsd uses bu= t > on the other hand numerical scheme is versatile and allows unlimited > nestedness. And I don't see why we would use a scheme specific to one of > many supported OSes. > 2) Every partition map is allowed to pick the name that it likes as long = as > it contains no comma. In this way we would need to keep partition-name > parsing functions in partitition map modules. It means that this code wou= ld > be duplicated. But this scheme is better in the cases when partition map = has > no numbering scheme but instead has labels attached to partitions. But in > this case IMO search command should be used find the partition > > I personally would prefer the first way I'm fine with names like (hd0,1,1). >> >> Also an interesting question is how would "has_partitions" field be >> handled in this scheme. > > Just ignored. It's actually used only to optimise some code out based on = the > assumption that some media has no partitions. Performance gain is negligi= ble > but if this assumption doesn't hold true grub won't be able to access the > partitions which are really here. Famous example is a cdrom. Most people > would assume that cdrom has no partitions. But on powerpc bootable cdroms > use APM This flag could be useful sometimes. For example, in raid devices, the first disk may contain partition table, but we shouldn't use it. --=20 Bean