On 09.04.2013 12:37, Leif Lindholm wrote:

> On Mon, Apr 08, 2013 at 12:49:18PM +0200, Vladimir '??-coder/phcoder' 
> Serbinenko wrote:
>> On 03.04.2013 18:17, Leif Lindholm wrote:
>>
>>>>> +  disk->total_sectors = GRUB_DISK_SIZE_UNKNOWN;
>>>>>
>>>>> Is there any way to get size from uboot?
>>> Not that I've found. As in, not that can be relied on.
>>>  
>>
>> di_stor.block_count works perfectly on my raspberry pi.
>> Any reason not to use it?
> 
> I did at one point have a platform reporting 0 here, but otherwise
> functioning. This may have been platform initialisation issues though,
> and something that you may consider should be resolved there rather than
> dealt with in GRUB. I'm OK to include this.
>  

That's surely a U-Boot bug but we're accustomed to workarounding
firmware bugs. I'm OK with special-casing 0.

>> === modified file 'grub-core/disk/uboot/ubootdisk.c'
>> --- grub-core/disk/uboot/ubootdisk.c 2013-04-07 00:41:07 +0000
>> +++ grub-core/disk/uboot/ubootdisk.c 2013-04-08 08:34:08 +0000
>> @@ -246,7 +246,7 @@
>>    grub_dprintf ("ubootdisk", "(%s) blocksize=%d, log_sector_size=%d\n",
>>              disk->name, d->block_size, disk->log_sector_size);
>>  
>> -  disk->total_sectors = GRUB_DISK_SIZE_UNKNOWN;
>> +  disk->total_sectors = devinfo->di_stor.block_count;
>>    disk->data = d;
>>  
>>    return GRUB_ERR_NONE;
> 
> /
>     Leif
> 



Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to