public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [EDK2 / UEFI]: Support for flashing ubi-volume using fastboot
@ 2021-04-14 18:12 Pintu Agarwal
  2021-04-14 19:34 ` [edk2-devel] " Andrew Fish
  0 siblings, 1 reply; 6+ messages in thread
From: Pintu Agarwal @ 2021-04-14 18:12 UTC (permalink / raw)
  To: edk2-devel, devel

Hi,

I am new to EDK2 and UEFI.
I am working on an ARM32 embedded Linux board that supports NAND and UBI images.
I have several partitions in my system images, and some partitions
have sub-volumes.
I am looking for help on how to support flashing ubi-volumes directly
using the fastboot flash method.

I see that our EDK2 does not have a mechanism to flash ubi-volumes.
But the underlying UEFI code, have support for ubi-volume.
{{{
UEFI Code flow:
ubi_flasher_write(...)
{
[...]
        if (hdl->is_it_volume) {
                result = ubi_flasher_vol_write(hdl);
                if (result != 0)
                        goto End;
        } else {
                result = ubi_flasher_ubi_write(hdl);
                if (result != 0)
                        goto End;
        }
[...]
}
}}}

When I tried to invoke ubi_flasher_write from EDK2, by passing the
ubifs volume name, instead of PartitionName, it does not work (crash).

Thus I am wondering, what needs to done at EDK2 (and how) to invoke
this ubi volume write at uefi.
Or, is there some functionality missing at the UEFI layer itself ?

Please provide some suggestions on this.

Thanks,
Pintu

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [EDK2 / UEFI]: Support for flashing ubi-volume using fastboot
  2021-04-14 18:12 [EDK2 / UEFI]: Support for flashing ubi-volume using fastboot Pintu Agarwal
@ 2021-04-14 19:34 ` Andrew Fish
  2021-04-14 19:41   ` Michael Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Fish @ 2021-04-14 19:34 UTC (permalink / raw)
  To: devel, pintu.ping; +Cc: edk2-devel



> On Apr 14, 2021, at 11:12 AM, Pintu Agarwal <pintu.ping@gmail.com> wrote:
> 
> Hi,
> 
> I am new to EDK2 and UEFI.
> I am working on an ARM32 embedded Linux board that supports NAND and UBI images.
> I have several partitions in my system images, and some partitions
> have sub-volumes.
> I am looking for help on how to support flashing ubi-volumes directly
> using the fastboot flash method.
> 
> I see that our EDK2 does not have a mechanism to flash ubi-volumes.
> But the underlying UEFI code, have support for ubi-volume.
> {{{
> UEFI Code flow:
> ubi_flasher_write(...)
> {
> [...]
>        if (hdl->is_it_volume) {
>                result = ubi_flasher_vol_write(hdl);
>                if (result != 0)
>                        goto End;
>        } else {
>                result = ubi_flasher_ubi_write(hdl);
>                if (result != 0)
>                        goto End;
>        }
> [...]
> }
> }}}
> 
> When I tried to invoke ubi_flasher_write from EDK2, by passing the
> ubifs volume name, instead of PartitionName, it does not work (crash).
> 

EFI does not have a concept of Volume names, EFI has a concept of EFI_HANDLEs that contain device paths that indentify the volume. 

The UEFI Shell has volume names, but that is a construct produced by the UEFI Shell. 

Thanks,

Andrew Fish

> Thus I am wondering, what needs to done at EDK2 (and how) to invoke
> this ubi volume write at uefi.
> Or, is there some functionality missing at the UEFI layer itself ?
> 
> Please provide some suggestions on this.
> 
> Thanks,
> Pintu
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [EDK2 / UEFI]: Support for flashing ubi-volume using fastboot
  2021-04-14 19:34 ` [edk2-devel] " Andrew Fish
@ 2021-04-14 19:41   ` Michael Brown
  2021-04-15 11:00     ` Laszlo Ersek
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Brown @ 2021-04-14 19:41 UTC (permalink / raw)
  To: devel, afish, pintu.ping; +Cc: edk2-devel

On 14/04/2021 20:34, Andrew Fish via groups.io wrote:
> EFI does not have a concept of Volume names, EFI has a concept of EFI_HANDLEs that contain device paths that indentify the volume.
> 
> The UEFI Shell has volume names, but that is a construct produced by the UEFI Shell.

The filesystem label (if any) also gets exposed via EFI_FILE_SYSTEM_INFO 
in the VolumeLabel field, independently of the UEFI shell.

Michael

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [EDK2 / UEFI]: Support for flashing ubi-volume using fastboot
  2021-04-14 19:41   ` Michael Brown
@ 2021-04-15 11:00     ` Laszlo Ersek
  2021-04-15 17:47       ` Pintu Agarwal
  0 siblings, 1 reply; 6+ messages in thread
From: Laszlo Ersek @ 2021-04-15 11:00 UTC (permalink / raw)
  To: devel, mcb30, afish, pintu.ping; +Cc: edk2-devel

On 04/14/21 21:41, Michael Brown wrote:
> On 14/04/2021 20:34, Andrew Fish via groups.io wrote:
>> EFI does not have a concept of Volume names, EFI has a concept of
>> EFI_HANDLEs that contain device paths that indentify the volume.
>>
>> The UEFI Shell has volume names, but that is a construct produced by
>> the UEFI Shell.
> 
> The filesystem label (if any) also gets exposed via EFI_FILE_SYSTEM_INFO
> in the VolumeLabel field, independently of the UEFI shell.

Also in "EFI_FILE_SYSTEM_VOLUME_LABEL.VolumeLabel".

(This is just a side comment, because I believe Pintu may not need
filesystem-level access (as in, SimpleFs).)

Thanks
Laszlo


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [EDK2 / UEFI]: Support for flashing ubi-volume using fastboot
  2021-04-15 11:00     ` Laszlo Ersek
@ 2021-04-15 17:47       ` Pintu Agarwal
  2021-04-15 17:56         ` Andrew Fish
  0 siblings, 1 reply; 6+ messages in thread
From: Pintu Agarwal @ 2021-04-15 17:47 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: devel, mcb30, afish, edk2-devel

On Thu, 15 Apr 2021 at 16:30, Laszlo Ersek <lersek@redhat.com> wrote:
>
> On 04/14/21 21:41, Michael Brown wrote:
> > On 14/04/2021 20:34, Andrew Fish via groups.io wrote:
> >> EFI does not have a concept of Volume names, EFI has a concept of
> >> EFI_HANDLEs that contain device paths that indentify the volume.
> >>
> >> The UEFI Shell has volume names, but that is a construct produced by
> >> the UEFI Shell.
> >
> > The filesystem label (if any) also gets exposed via EFI_FILE_SYSTEM_INFO
> > in the VolumeLabel field, independently of the UEFI shell.
>
> Also in "EFI_FILE_SYSTEM_VOLUME_LABEL.VolumeLabel".
>
> (This is just a side comment, because I believe Pintu may not need
> filesystem-level access (as in, SimpleFs).)
>

Hi All,

Thank you so much for your reply so far.

Sorry, I am new to UEFI so I think I couldn't quite understand it clearly.
Is it possible to explain with an example about how to implement
volume concept in UEFI using the EDK2 application?

If there are some references available then it will be good to follow.

Thanks,
Pintu

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [EDK2 / UEFI]: Support for flashing ubi-volume using fastboot
  2021-04-15 17:47       ` Pintu Agarwal
@ 2021-04-15 17:56         ` Andrew Fish
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Fish @ 2021-04-15 17:56 UTC (permalink / raw)
  To: Pintu Agarwal
  Cc: Laszlo Ersek, edk2-devel-groups-io, Michael Brown, edk2-devel

[-- Attachment #1: Type: text/plain, Size: 1988 bytes --]



> On Apr 15, 2021, at 10:47 AM, Pintu Agarwal <pintu.ping@gmail.com> wrote:
> 
> On Thu, 15 Apr 2021 at 16:30, Laszlo Ersek <lersek@redhat.com <mailto:lersek@redhat.com>> wrote:
>> 
>> On 04/14/21 21:41, Michael Brown wrote:
>>> On 14/04/2021 20:34, Andrew Fish via groups.io wrote:
>>>> EFI does not have a concept of Volume names, EFI has a concept of
>>>> EFI_HANDLEs that contain device paths that indentify the volume.
>>>> 
>>>> The UEFI Shell has volume names, but that is a construct produced by
>>>> the UEFI Shell.
>>> 
>>> The filesystem label (if any) also gets exposed via EFI_FILE_SYSTEM_INFO
>>> in the VolumeLabel field, independently of the UEFI shell.
>> 
>> Also in "EFI_FILE_SYSTEM_VOLUME_LABEL.VolumeLabel".
>> 
>> (This is just a side comment, because I believe Pintu may not need
>> filesystem-level access (as in, SimpleFs).)
>> 
> 
> Hi All,
> 
> Thank you so much for your reply so far.
> 
> Sorry, I am new to UEFI so I think I couldn't quite understand it clearly.
> Is it possible to explain with an example about how to implement
> volume concept in UEFI using the EDK2 application?
> 

Pintu,

Are you writing an UEFI Shell application or an EFI Application? The UEFI Shell produces extra APIs that abstracts the concept of volume names with a “DOS like” syntax <volumeName:>FilePath. 

In EFI there is no unified system file system API. Each mounted volume produces the same file system API and the root directory is the root of that volume. So the 1st thing you have to do is find the correct file system protocol (API) that matches your volume. As others have mentioned you can query that file system protocol (API) for the volume name, but non of the file system APIs take that volume name as input. That was the point I was trying to make, but sorry I did not give enough detail. 

Thanks,

Andrew Fish

> If there are some references available then it will be good to follow.
> 
> Thanks,
> Pintu


[-- Attachment #2: Type: text/html, Size: 11821 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-15 17:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-14 18:12 [EDK2 / UEFI]: Support for flashing ubi-volume using fastboot Pintu Agarwal
2021-04-14 19:34 ` [edk2-devel] " Andrew Fish
2021-04-14 19:41   ` Michael Brown
2021-04-15 11:00     ` Laszlo Ersek
2021-04-15 17:47       ` Pintu Agarwal
2021-04-15 17:56         ` Andrew Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox