From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.groups.io (mail04.groups.io [45.79.224.9]) by spool.mail.gandi.net (Postfix) with ESMTPS id 496497803CF for ; Wed, 17 Apr 2024 20:31:03 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Pgmnw/URpIQPx8YyzrnMlcggnAyk5uNKQfE8tHAZbtM=; c=relaxed/simple; d=groups.io; h=From:Message-id:MIME-version:Subject:Date:In-reply-to:Cc:To:References:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-type; s=20240206; t=1713385861; v=1; b=zLZmbfCA24MSXJql3eOnskROWXcLOfVGzvY4yBmCTph8dOrLfd+jYF791xT09yxI9q0XgH0G ou0ehp8IPhgDHHinK0O+AEkodeNvL9FOIo2oUFd7Z42W6VUBQb737nzrHgM6oLk1KMsp7lfqCiZ iOIgKiXaHaWyOMVyJ9z6Jwfu6xW+lgzoNmBYnZ8ODleuUNft2KuCyp+tg+AoU197vWYuVWT8xq0 A3sQLXE/mJ2ndHDibsYW0vpbZZJAN4Nf7uVvwBCNdHdk661y3/QSm33//wIX4xuhZzy/E8EPwbS JHGdo97AE73OycnMLvntV4eK0d//MG4oakT4AwXsrkYXw== X-Received: by 127.0.0.2 with SMTP id zg9SYY7687511xPgMj9O1Opw; Wed, 17 Apr 2024 13:31:01 -0700 X-Received: from ma-mailsvcp-mx-lapp02.apple.com (ma-mailsvcp-mx-lapp02.apple.com [17.32.222.23]) by mx.groups.io with SMTP id smtpd.web10.24757.1713385861251800291 for ; Wed, 17 Apr 2024 13:31:01 -0700 X-Received: from rn-mailsvcp-mta-lapp03.rno.apple.com (rn-mailsvcp-mta-lapp03.rno.apple.com [10.225.203.151]) by ma-mailsvcp-mx-lapp02.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0SC300GPZSZIZ630@ma-mailsvcp-mx-lapp02.apple.com> for devel@edk2.groups.io; Wed, 17 Apr 2024 13:31:00 -0700 (PDT) X-Received: from rn-mailsvcp-mmp-lapp03.rno.apple.com (rn-mailsvcp-mmp-lapp03.rno.apple.com [17.179.253.16]) by rn-mailsvcp-mta-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0SC300UHBSZLW4N0@rn-mailsvcp-mta-lapp03.rno.apple.com>; Wed, 17 Apr 2024 13:30:57 -0700 (PDT) X-Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp03.rno.apple.com by rn-mailsvcp-mmp-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) id <0SC300D00SP94R00@rn-mailsvcp-mmp-lapp03.rno.apple.com>; Wed, 17 Apr 2024 13:30:57 -0700 (PDT) X-Va-A: X-Va-T-CD: 6a24260988ff4c7771286df56eb9e085 X-Va-E-CD: 16ac8ebe155b29385efb935ad329a370 X-Va-R-CD: 10c2fc0eaf5a989fd894765b7c87f1ae X-Va-ID: bc17419f-a16e-488e-bb18-d2bec18157aa X-Va-CD: 0 X-V-A: X-V-T-CD: 6a24260988ff4c7771286df56eb9e085 X-V-E-CD: 16ac8ebe155b29385efb935ad329a370 X-V-R-CD: 10c2fc0eaf5a989fd894765b7c87f1ae X-V-ID: ba5dd303-ae08-4c26-a20c-5dd96d3d9326 X-V-CD: 0 X-Received: from smtpclient.apple (unknown [17.234.115.86]) by rn-mailsvcp-mmp-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPSA id <0SC300V1VSZE7N00@rn-mailsvcp-mmp-lapp03.rno.apple.com>; Wed, 17 Apr 2024 13:30:51 -0700 (PDT) From: "Andrew Fish via groups.io" Message-id: MIME-version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Re: [edk2-devel] Is there a way to create filesystem in UEFI Shell ? Date: Wed, 17 Apr 2024 13:30:40 -0700 In-reply-to: <30325.1712200260725716779@groups.io> Cc: Yoshinoya To: edk2-devel-groups-io , yuinyee.chew@starfivetech.com References: <30325.1712200260725716779@groups.io> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 17 Apr 2024 13:31:01 -0700 Resent-From: afish@apple.com Reply-To: devel@edk2.groups.io,afish@apple.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: guN2zPhBGylVJtB8vdyrUJMqx7686176AA= Content-type: multipart/alternative; boundary="Apple-Mail=_A8E556A1-66B3-4946-A524-593FBE739118" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=zLZmbfCA; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.9 as permitted sender) smtp.mailfrom=bounce@groups.io --Apple-Mail=_A8E556A1-66B3-4946-A524-593FBE739118 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 FYI you can have much larger files in the newer version of the filesystem. = See EFI_COMMON_SECTION_HEADER2 https://uefi.org/specs/PI/1.8A/V3_Code_Definitions.html#firmware-file-syste= m https://uefi.org/specs/PI/1.8A/V3_Code_Definitions.html#firmware-file-secti= on Thanks, Andrew Fish > On Apr 3, 2024, at 8:11=E2=80=AFPM, John Chew wrote: >=20 > On Wed, Apr 3, 2024 at 03:48 PM, Yoshinoya wrote: > Maybe ref to ramdisk sample, create a memory type block io device, then m= ount file system on it. > UEFI supports fat file system, some 3rd drivers could be added to support= ext4 filesystem. > Search them on github website > Thanks Yoshinoya for your input. =3D) >=20 > =20 > I have tried to compile the filesystem into my FD image as a separate FV.= Then building FV HOB with it using "BuildFvHob". >=20 > Next, using the "GetSectionFromAnyFv" to load the filesystem into buffer = as follow: >=20 > >=20 > Finally, create a disk with the filesystem buffer created earlier.=20 >=20 > >=20 > This works without having to create filesystem in EDK2. Instead loading i= t from somewhere else. >=20 > However, this method has some limitations because the maximum size of eac= h SECTION in FFS is only 16MB. >=20 > >=20 > Thus, I still couldn't TFTP Linux (~25MB) into my filesystem "FS0:" >=20 > =20 > My solution: >=20 > >=20 > 1. Allocate buffer >=20 > 2. Populate the buffer by with100MB FAT16 header >=20 > 3. Register virtual disk with the buffer >=20 > =20 > I'm able to allocate 100MB of FAT16 filesystem and TFTP Linux successfull= y: > >=20 > >=20 > =20 > Thanks everyone!! >=20 > John >=20 > =20 >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117933): https://edk2.groups.io/g/devel/message/117933 Mute This Topic: https://groups.io/mt/105212723/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --Apple-Mail=_A8E556A1-66B3-4946-A524-593FBE739118 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 FYI you can have much larger file= s in the newer version of the filesystem. See EFI_COMMON_SECTION_HEADER2

https://uefi.org/specs/PI/1.8A/V3_Code_Definitions.html#fi= rmware-file-system

Andrew Fish

On Apr 3, 2024, at 8:11=E2= =80=AFPM, John Chew <yuinyee.chew@starfivetech.com> wrote:

On Wed, Apr 3, 2024 at 03:48 P= M, Yoshinoya wrote:
Maybe ref to ramdisk sample, create a memory type block io device, the= n mount file system on it.
UEFI supports fat file system, some 3rd drivers could be added to supp= ort ext4 filesystem.
Search them on github website

Thanks Yoshinoya for your input. =3D)

 

I have tried to compile the filesy= stem into my FD image as a separate FV. Then building FV HOB with it using = "BuildFvHob".

Next, using the "GetSectionFromAnyFv" to load the files= ystem into buffer as follow:

<dummyfile.0.part>

Finally, create a d= isk with the filesystem buffer created earlier. 

<dummyfile.1.part><= /p>

This works without having to create filesystem in EDK2. Instead loadi= ng it from somewhere else.

However, this method has some limitations = because the maximum size of each SECTION in FFS is only 16MB.

<dummyfile.2.part>=

Thus, I still couldn't TFTP Linux (~25MB) into my filesystem = "FS0:"

 

My sol= ution:

<= dummyfile.3.part> <dummyfile.4.part>

1. Allocate buffer

2. Populate the buffer by with100MB FAT16 header

3. Register virt= ual disk with the buffer

 

I'm able to allocate 100MB of FAT16 filesystem and TFTP Linux s= uccessfully:
&= lt;dummyfile.5.part>

<dummyfile.6.part>

 

Thanks everyone!!

John

 

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#117933) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--Apple-Mail=_A8E556A1-66B3-4946-A524-593FBE739118--