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.
>
>> 195 + self.android_offsets_and_sizes = [
>> 196 + (63 * self.sector_size, 270272 * self.sector_size),
>> 197 + (270336 * self.sector_size, 524288 * self.sector_size),
>> 198 + (794624 * self.sector_size, 524288 * self.sector_size),
>> 199 + (1318912 * self.sector_size, (self.android_image_size -
>> 200 + 1318912 * self.sector_size)),
>> 201 + ((1318912 + 32) * self.sector_size, ((1048576 - 32) *
>> 202 + self.sector_size)),
>> 203 + ((2367488 + 32) * self.sector_size,
>> 204 + self.android_image_size - (2367488 + 32) * self.sector_size)
>> 205 + ]
>>
>> The reason for adding and substracting 32 here is that it seems that
>> the extended partition uses that much space. That space gets stolen
>> from the first partition even though sizes and offsets are explicitly
>> requested by the sfdisk commands.
>
> You must've had some fun to figure that out, eh? :P
Well there are people who consider pain to be fun, but I'm not one of them. ;)
> It'd be nice to have this as a comment, I think.
True, I'll add a comment about this as well as the map/zip decision.
On Fri, Jun 10, 2011 at 3:25 PM, Guilherme Salgado image_size = 2 * 1024**3 # rounded up from ~1.13GiB
<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.
> offsets_ and_sizes = [ image_size - image_size - (2367488 + 32) * self.sector_size)
>> 195 + self.android_
>> 196 + (63 * self.sector_size, 270272 * self.sector_size),
>> 197 + (270336 * self.sector_size, 524288 * self.sector_size),
>> 198 + (794624 * self.sector_size, 524288 * self.sector_size),
>> 199 + (1318912 * self.sector_size, (self.android_
>> 200 + 1318912 * self.sector_size)),
>> 201 + ((1318912 + 32) * self.sector_size, ((1048576 - 32) *
>> 202 + self.sector_size)),
>> 203 + ((2367488 + 32) * self.sector_size,
>> 204 + self.android_
>> 205 + ]
>>
>> The reason for adding and substracting 32 here is that it seems that
>> the extended partition uses that much space. That space gets stolen
>> from the first partition even though sizes and offsets are explicitly
>> requested by the sfdisk commands.
>
> You must've had some fun to figure that out, eh? :P
Well there are people who consider pain to be fun, but I'm not one of them. ;)
> It'd be nice to have this as a comment, I think.
True, I'll add a comment about this as well as the map/zip decision.