On Mon, Jun 13, 2011 at 3:21 PM, Guilherme Salgado
<email address hidden> wrote:
> On Fri, 2011-06-10 at 13:46 +0000, Mattias Backman wrote:
>> On Fri, Jun 10, 2011 at 3:25 PM, Guilherme Salgado
>> <email address hidden> wrote:
>> > On Fri, 2011-06-10 at 10:56 +0000, Mattias Backman wrote:
>> >> 193 + self.sector_size = 512
>> >> 194 + self.android_image_size = 2 * 1024**3 # rounded up from ~1.13GiB
>> >
>> > I'm confused by the 1.13GiB. I thought 1024**3 wass 1GiB?
>>
>> Oh, yes. The sfdisk command (stolen from the production code) creates
>> partitions that would consume at least 1.13 GiB. So I figured I'd
>> round that up to 2 GiB since that would be more like an actual size sd
>> card than fractions of GiBs. I'm still not sure if I should clarify
>> the comment or change the partition sizes so we don't create a 2 GiB
>> tempfile.
>
> Yeah, it'd be nice to avoid creating a file that big if possible. Do you
> have any idea how much the creation of a 2GiB file adds up to the
> runtime of the test suite?
I'll tweak the partitions for the test file. The test doesn't take any
more time when creating a huge file than creating a small one. All it
does is to write nothing to the file since count=0. So it just touches
the file I guess, which seems instantaneous and then creates
partitions with sfdisk.
On Mon, Jun 13, 2011 at 3:21 PM, Guilherme Salgado image_size = 2 * 1024**3 # rounded up from ~1.13GiB
<email address hidden> wrote:
> On Fri, 2011-06-10 at 13:46 +0000, Mattias Backman wrote:
>> On Fri, Jun 10, 2011 at 3:25 PM, Guilherme Salgado
>> <email address hidden> wrote:
>> > On Fri, 2011-06-10 at 10:56 +0000, Mattias Backman wrote:
>> >> 193 + self.sector_size = 512
>> >> 194 + self.android_
>> >
>> > I'm confused by the 1.13GiB. I thought 1024**3 wass 1GiB?
>>
>> Oh, yes. The sfdisk command (stolen from the production code) creates
>> partitions that would consume at least 1.13 GiB. So I figured I'd
>> round that up to 2 GiB since that would be more like an actual size sd
>> card than fractions of GiBs. I'm still not sure if I should clarify
>> the comment or change the partition sizes so we don't create a 2 GiB
>> tempfile.
>
> Yeah, it'd be nice to avoid creating a file that big if possible. Do you
> have any idea how much the creation of a 2GiB file adds up to the
> runtime of the test suite?
I'll tweak the partitions for the test file. The test doesn't take any
more time when creating a huge file than creating a small one. All it
does is to write nothing to the file since count=0. So it just touches
the file I guess, which seems instantaneous and then creates
partitions with sfdisk.