mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@sig21.net>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org, Rob Herring <rob.herring@calxeda.com>
Subject: Re: [PATCH 2/5] filetype: add GPT support
Date: Fri, 15 Feb 2013 08:43:32 +0100	[thread overview]
Message-ID: <20130215074332.GA18670@sig21.net> (raw)
In-Reply-To: <20130214220855.GW19322@game.jcrosoft.org>

On Thu, Feb 14, 2013 at 11:08:55PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 20:17 Thu 14 Feb     , Sascha Hauer wrote:
> > On Thu, Feb 14, 2013 at 06:05:07PM +0100, Johannes Stezenbach wrote:
> > > On Thu, Feb 14, 2013 at 05:53:23PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > On 17:36 Thu 14 Feb     , Sascha Hauer wrote:
> > > > > On Thu, Feb 14, 2013 at 04:52:24PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > > GPT need to be check before MBR
...
> > > > > > +	if (bufsize >= 520 && strncmp(&buf8[512], "EFI PART", 8) == 0)
> > > > > > +		return filetype_gpt;
> > > > > > +
> > > > > 
> > > > > The list is sorted by size, so please move this below:
> > > > on purpose
> > > > 
> > > > EFI need to be detect before mbr
> > > 
> > > IMHO the check is too simple, it will give false positive if
> > > GPT is replaced by DOS MBR and not zeroed out.  Need to check
> > > for protective MBR.
> > 
> > So is_fat_or_mbr() should test if the MBR is a protective MBR and return
> > false in this case?
> 
> no as the efi is more I do the check in efi.c protective bit and right type
> 
> I move the code to filetype
> 
> but efi need to be before MBR as you could have both for retro compatibility

Yes, Wikipedia says Apple Bootcamp creates hybrid MBR.
But if you run fdisk to create DOS MBR it will only
replace the first sector and leave the GPT alone.
Thus I think for usability it is important to check MBR
(for 0xAA55 marker and one of the part types must be 0xee).

Johannes

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-02-15  7:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 15:47 [PATCH 0/5] add EFI GUID Partition Table support Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 15:52 ` [PATCH 1/5] linux/types: import __aligned_x64 from the kernel Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 15:52   ` [PATCH 2/5] filetype: add GPT support Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 16:36     ` Sascha Hauer
2013-02-14 16:53       ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 17:05         ` Johannes Stezenbach
2013-02-14 19:17           ` Sascha Hauer
2013-02-14 22:08             ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-15  7:43               ` Johannes Stezenbach [this message]
2013-02-15 10:47                 ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 15:52   ` [PATCH 3/5] partitons: add framework Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 20:37     ` Sascha Hauer
2013-02-14 15:52   ` [PATCH 4/5] disk: introduce partition name Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 20:51     ` Sascha Hauer
2013-02-14 21:30       ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 21:42         ` Sascha Hauer
2013-02-14 15:52   ` [PATCH 5/5] disk: partitions: add EFI GUID Partition Table Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 22:42 [PATCH 0/5] add EFI GUID Partition Table support Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 22:44 ` [PATCH 1/5] linux/types: import __aligned_x64 from the kernel Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 22:44   ` [PATCH 2/5] filetype: add GPT support Jean-Christophe PLAGNIOL-VILLARD
2013-02-15  7:46     ` Johannes Stezenbach
2013-02-15  9:00     ` Sascha Hauer
2013-02-15 10:45       ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-15 10:56         ` Sascha Hauer
2013-02-15 12:59 [PATCH 0/5 v3] add EFI GUID Partition Table support Jean-Christophe PLAGNIOL-VILLARD
2013-02-15 13:35 ` [PATCH 1/5] linux/types: import __aligned_x64 from the kernel Jean-Christophe PLAGNIOL-VILLARD
2013-02-15 13:35   ` [PATCH 2/5] filetype: add GPT support Jean-Christophe PLAGNIOL-VILLARD
2013-02-15 17:32     ` Sascha Hauer
2013-02-15 17:36       ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-15 17:48         ` Sascha Hauer
2013-02-16 11:38 [PATCH 0/5 v4] add EFI GUID Partition Table support Jean-Christophe PLAGNIOL-VILLARD
2013-02-16 13:47 ` [PATCH 1/5] linux/types: import __aligned_x64 from the kernel Jean-Christophe PLAGNIOL-VILLARD
2013-02-16 13:47   ` [PATCH 2/5] filetype: add GPT support Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130215074332.GA18670@sig21.net \
    --to=js@sig21.net \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=rob.herring@calxeda.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox