[parted-devel] [PATCH] Write synced MBR rather than protective MBR on Intel Mac systems

Jim Meyering jim at meyering.net
Mon Mar 30 21:44:41 UTC 2009


Colin Watson wrote:
> The attached patch is from Ubuntu's parted package, originally written
> by Matthew Garrett and extended by me. It copes with the fact that
> Intel-based Macs require a synced MBR, not a protective MBR (Apple broke
> the spec). Since this is incompatible, IMO the best option is to do DMI
> detection of the local system and act accordingly; yes, this does mean
> that you can't partition a disk for an Intel Mac on some other system or
> vice versa, but I don't think this is too bad a restriction.

Thanks for resuming work on this.
A few nits:
  - please don't add trailing blanks (cause "make syntax-check" failure)
  - keep line length <= 80
  - make pointers const when possible

> Sorry, I have no idea of how to test this reasonably.

While some testing with actual hardware would be nice,
it is more reasonable merely to ensure that most of the code
is exercised by synthetic examples via "make check".
I.e., you could add a test that create a partition table
of a form such that running a few parted commands ensures
a few key new code paths work as expected.

If you think up a test that must be run only by root,
or that requires a partitionable device, note that there
are already tests that require those things, so you can
easily model yours after them.  Or just list the commands
you'd run for a test or two, and I'll write the script.



More information about the parted-devel mailing list