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> 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