Comment 22 for bug 717129

Revision history for this message
Loïc Minier (lool) wrote : Re: [Bug 717129] Re: linaro-media-create crashes during media setup/partitioning

On Mon, Mar 28, 2011, Mattias Backman wrote:
> Some of the failures happen when running udisks in
> get_boot_and_root_partitions_for_media so some way of checking that
> udisks have gotten notification about partition changes would help in
> that case. Still wouldn't help when the sfdisk call fails after parted
> though. So perhaps this can't be solved by a single neat fix.
>
> A crude way around this would be to just retry the sfdisk command if it
> raises an Error and give up after MAX_RETRIES attempts. The same could
> be done for the calls to udisks methods. It's similar to the sleeps but
> at least won't wait longer than necessary.

 I think you actually need both, for both cases of "unknown time is
 needed for operation to complete"; unfortunately, the sfdisk one is
 worth than you imagine: it seems sometimes the SD card NEVER gets back
 to ready state:
    http://lists.linaro.org/pipermail/linaro-dev/2011-March/003182.html
 the thread has the details.

 I think it would be worthwhile to have a sfdisk -l loop after parted
 mklabel runs, perhaps also when changing the partition tables with
 sfdisk later on.

 Another thing we could try is whether parted does something specific
 which other partitioning tools don't; for instance, perhaps Shawn's USB
 reader breaks in the case of some special USB command triggered by some
 special ioctl() which is optional.

 A completely safe way to deliver the functionality would be to change
 linaro-image-tools to always generate an image file and then write it
 to the SD with a single dd run.

 Thanks a lot for your work on this!

--
Loïc Minier