On Tue, 2010-12-07 at 15:33 +0000, Dave Martin wrote:
> Hi,
> 
> On Tue, Dec 7, 2010 at 3:10 PM, Robert Nelson <robertcnel...@gmail.com> wrote:
> > Hi Guilherme,
> >
> >> I know you found a workaround with fdisk so you're probably no longer
> >> using parted, but I was wondering if you were able to use parted to
> >> change the geometry in the partition table to 255heads/63sectors as the
> >> boot rom seems to require?
> >
> > Actually with current x-loader/u-boot the 255heads/63sectors isn't a
> > hard requirement anymore for the boot partition, so i've dropped it..
> >
> > https://github.com/RobertCNelson/omap-image-builder/blob/master/tools/setup_sdcard.sh#L348
> >
> > So far tested on:
> >
> > Beagle B6 (oldest still booting beagle i have, any boards before that
> > had serial-ic overheating problems and eventually die under warrente.)
> > Beagle C2 & C4
> > Beagle xM A2
> >
> > with angstrom's: MLO-beagleboard-1.44+r16 & u-boot-beagleboard-2010.03+r65
> >
> > Panda A1
> >
> > with mlo/u-boot from: http://gitorious.org/pandaboard
> >
> > So right now i use parted to create the second partition.  We could
> > drop fdisk for the first, if we could figure out how to make parted
> > create a partition starting at the first cylinder.
> >
> > For example, I've tried this and it doesn't boot:
> >
> > parted --script ${MMC} mkpart primary fat16 0 64
> >
> >> I ask because I'm working on converting our script to python and it'd be
> >> nice if I could use python-parted for that, but it doesn't seem to be
> >> able to.
> 
> What about sfdisk?  This is by far the simplest tool and works well
> for parts of linaro-media-create: by direct consequence of its
> simplicity it seems to be the most controllable and has the fewest
> unexpected limitations and failure modes among the tools I've played
> with, as well as being friendly to being program-driven.  For manually
> generating an optimal partition layout for Beagles I've also found
> this the best tool to use.

sfdisk works indeed, but it'd be nicer if I could use a python library
since I'm converting the whole script.  The python-parted API is crap
and undocumented, though, so I'll stick to running sfdisk in a
subprocess.

> 
> Certainly it's horrible to have to use a different partitioner to
> create each partition...

Yeah, I was not planning to do that, although we currently use parted to
create a fresh partition table. It'd be nice if we could use sfdisk to
do that, but I don't think we can?

> 
> sfdfisk works well for me though, e.g.:
> 
> S=63; H=255
> BC=5
> cat <<EOF | sfdisk -S63 -H255 -C523 -L -uS <device>
> $S,$((5*BC*S-S)),0xc,*
> $(((5*BC*S+2047)/2048*2048))
> EOF
> 
> ...will set up by 4GB card a treat, with a working boot partition and
> an aligned filesystem partition, with the CHS fields for the first
> partition filled in correctly:
> 
> 00000000  80 01 01 00 0c fe 3f 04  3f 00 00 00 86 39 01 00
> 00000010  00 19 15 05 83 2a a0 0a  00 40 01 00 00 c0 7e 00
> 00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
> 00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
> 
> (BC is the number of cylinders for the boot partition. The only
> constraint here is that the partition must be unambiguously FAT32,
> i.e. > 65534 clusters -- which gives a minimum sector count of 66593.
> 5 is simply (65593 + 63*255-1)/(63*255))
> 
> 
> Of course, the DOS partition table format is so trivial that if we're
> having to jump through a lot of hoops, it's tempting to suggest we
> could implement it ourselves (though I know I'm not supposed to say
> that due to fragmentation etc., etc....)
> 
> Cheers
> ---Dave

-- 
Guilherme Salgado <https://launchpad.net/~salgado>

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to