[SLOF] [PATCH v4 2/2] usb/storage: Implement block write support

Laurent Vivier lvivier at redhat.com
Thu Dec 20 20:50:49 AEDT 2018


On 20/12/2018 07:57, Alexey Kardashevskiy wrote:
> 
> 
> On 13/12/2018 07:23, Laurent Vivier wrote:
>> The only missing parts were to manage the transfer direction in
>> do-bulk-command and to copy the data to the buffer before the
>> write operation.
>>
>> This is needed as GRUB2 wants to write the grubenv file at start
>> and hangs because the data are not provided to the disk controller.
>>
>> I've checked the file is correctly modified by modifying an environment
>> variable in GRUB2 with "set saved_entry=2" then "save_env saved_entry"
>> and checking the result in linux with "grub2-editenv list".
>>
>> Fixes: Fixes: a0b96fe66fcd991b407c1d67ca842921e477a6fd
>>        (Provide "write" function in the disk-label package)
> 
> Thanks for the patches, I applied them.

Thank you.

> But the commit log confuses me.
> 
> The "fixes" patch added forwarding of "write" to the parent in
> disk-label, how does this one fix it?
> 
> Why only usb? scsi does it right already?
> 

All is fine with SCSI, the problem was at the USB storage driver level.

It fixes it because the "write" was forwarded to the USB storage driver
and the USB storage driver doesn't support it and GRUB2 fails to boot.
Without Thomas' patch, GRUB2 cannot write but there is a clean error and
it can load the kernel and boot it.

Thank you,
Laurent


More information about the SLOF mailing list