From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Mon, 17 Sep 2012 12:07:36 -0600 Subject: [U-Boot] [PATCH v3 5/7] gpt: Support for GPT (GUID Partition Table) restoration In-Reply-To: <1347523805-17825-6-git-send-email-l.majewski@samsung.com> References: <1345795995-24656-1-git-send-email-l.majewski@samsung.com> <1347523805-17825-1-git-send-email-l.majewski@samsung.com> <1347523805-17825-6-git-send-email-l.majewski@samsung.com> Message-ID: <505766E8.9090504@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09/13/2012 02:10 AM, Lukasz Majewski wrote: > The restoration of GPT table (both primary and secondary) is now possible. > Simple GUID generation is supported. > diff --git a/include/part.h b/include/part.h > +int set_gpt_table(block_dev_desc_t *dev_desc, > + gpt_header *gpt_h, gpt_entry *gpt_e); The API here isn't very generic; it requires the caller to have formatted the GPT entirely by itself, which means having complete knowledge of how to lay out a GPT header and partition table entry. Right now, all that knowledge is contained inside the implementation of the "gpt" command - what if some other unrelated code wanted to write a GPT; it'd have to duplicate everything. I was thinking of a much more generic interface, where each partition is described using abstract structs, and the creation of the actual on-disk layout is handling inside the set_gpt_table() function. That would presumably allow the same abstract structs to be passed to e.g. set_mbr_partition_table() and a generic "ptable create" command to be created.