Re: [Patch 0/3] Ext4Pkg: Add Ext4Pkg


Michael D Kinney
 

Hi Pedro,

When I run BaseTools/Scripts/Patchcheck.py on this patch series, I see the following issues:


Checking git commit: 5f0db07586
Ext4Pkg: Add Ext4Dxe driver.
The commit message format passed all checks.
Code format is not valid:
* EFI_D_ERROR was used, but DEBUG_ERROR is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Directory.c
Line: DEBUG ((EFI_D_ERROR, "[ext4] Could not open root inode - status %x\n", Status));
* EFI_D_ERROR was used, but DEBUG_ERROR is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Directory.c
Line: DEBUG ((EFI_D_ERROR, "[ext4] dirent size %lu too small (compared to %lu)\n", Dirent->rec_len, RequiredSize));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Directory.c
Line: DEBUG ((EFI_D_INFO, "[ext4] Ext4ReadDir offset %lu\n", Offset));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Directory.c
Line: DEBUG ((EFI_D_INFO, "[ext4] Length read %lu, offset %lu\n", Len, Offset));
* EFI_D_ERROR was used, but DEBUG_ERROR is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Directory.c
Line: DEBUG ((EFI_D_ERROR, "[ext4] Invalid dirent at offset %lu\n", Offset));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Directory.c
Line: DEBUG ((EFI_D_INFO, "[ext4] dirent size %lu\n", Entry.rec_len));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Directory.c
Line: DEBUG ((EFI_D_INFO, "[ext4] Listing file %s\n", TempFile->FileName));
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
Line:
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
Line:
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
Line:
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
Line:
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
Line:
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
Line:
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
Line:
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
Line:
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
Line:
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c
Line: DEBUG ((EFI_D_INFO, "[Ext4] Binding to controller\n"));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c
Line: DEBUG ((EFI_D_INFO, "[Ext4] Controller supports DISK_IO\n"));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c
Line: DEBUG ((EFI_D_INFO, "[Ext4] Controller supports DISK_IO2\n"));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c
Line: DEBUG ((EFI_D_INFO, "Opening partition\n"));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c
Line: DEBUG ((EFI_D_INFO, "[ext4] Error mounting %x\n", Status));
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
Line: #
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
Line: #
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
Line: #
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
Line: #
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
Line: #
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
Line: #
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
Line: #
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
Line: #
* EFI_D_ERROR was used, but DEBUG_ERROR is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Extents.c
Line: DEBUG ((EFI_D_ERROR, "[ext4] Invalid extent header depth %u\n", Header->eh_depth));
* EFI_D_ERROR was used, but DEBUG_ERROR is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Extents.c
Line: DEBUG ((EFI_D_ERROR, "[ext4] Invalid extent header magic %x\n", Header->eh_magic));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Extents.c
Line: DEBUG ((EFI_D_INFO, "[ext4] Looking up extent for block %lu\n", LogicalBlock));
* EFI_D_ERROR was used, but DEBUG_ERROR is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Extents.c
Line: DEBUG ((EFI_D_ERROR, "[ext4] Invalid extent checksum\n"));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Extents.c
Line: /* DEBUG((EFI_D_INFO, "[ext4] extent 1 %u extent 2 %u = %ld\n", Extent1->ee_block,
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Extents.c
Line: // DEBUG((EFI_D_INFO, "[ext4] comparing %u %u\n", Block, Extent->ee_block));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/File.c
Line: DEBUG ((EFI_D_INFO, "[ext4] Ext4Open %s\n", FileName));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/File.c
Line: DEBUG ((EFI_D_INFO, "[ext4] Opening %s\n", PathSegment));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/File.c
Line: DEBUG ((EFI_D_INFO, "Open successful\n"));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/File.c
Line: DEBUG ((EFI_D_INFO, "Opened filename %s\n", Current->FileName));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/File.c
Line: DEBUG ((EFI_D_INFO, "[ext4] Closed file %p (inode %lu)\n", File, File->InodeNum));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/File.c
Line: DEBUG ((EFI_D_INFO, "[ext4] ReadDir status %lx\n", Status));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/File.c
Line: DEBUG ((EFI_D_INFO, "[ext4] ReadDir retlen %lu\n", *BufferSize));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Inode.c
Line: // DEBUG((EFI_D_INFO, "Ext4Read[Offset %lu, Length %lu]\n", Offset, *Length));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Inode.c
Line: // DEBUG((EFI_D_INFO, "[ext4] may read %lu, remaining %lu\n", ExtentMayRead, RemainingRead));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Inode.c
Line: // DEBUG((EFI_D_INFO, "[ext4] Reading block %lu\n", (ExtentStartBytes + ExtentOffset) / Partition->BlockSize));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Inode.c
Line: // DEBUG((EFI_D_INFO, "File length %lu crc %x\n", BeenRead, CalculateCrc32(original, BeenRead)));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Inode.c
Line: DEBUG ((EFI_D_INFO, "[ext4] Inode %d csum %x vs %x\n", InodeNum, Csum, DiskCsum));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Superblock.c
Line: DEBUG ((EFI_D_INFO, "[Ext4] Unsupported %lx\n", Partition->FeaturesIncompat & ~gSupportedIncompatFeat));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Superblock.c
Line: DEBUG ((EFI_D_INFO, "[Ext4] Unsupported ro compat %x\n", UnsupportedRoCompat));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Superblock.c
Line: DEBUG ((EFI_D_INFO, "Read only = %u\n", Partition->ReadOnly));
* EFI_D_ERROR was used, but DEBUG_ERROR is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Superblock.c
Line: DEBUG ((EFI_D_ERROR, "[ext4] Bad superblock checksum %lx\n", Ext4CalculateSuperblockChecksum (Partition, Sb)));
* Trailing whitespace found
File: Features/Ext4Pkg/Ext4Dxe/Superblock.c
Line:
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Superblock.c
Line: DEBUG ((EFI_D_INFO, "[ext4] Block group descriptor %u has an invalid checksum\n", Index));
* EFI_D_INFO was used, but DEBUG_INFO is now recommended
File: Features/Ext4Pkg/Ext4Dxe/Superblock.c
Line: DEBUG ((EFI_D_INFO, "[ext4] Root File %p\n", Partition->Root));

Best regards,

Mike

-----Original Message-----
From: Pedro Falcato <pedro.falcato@gmail.com>
Sent: Friday, July 30, 2021 9:17 AM
To: devel@edk2.groups.io
Cc: Pedro Falcato <pedro.falcato@gmail.com>; Leif Lindholm <leif@nuviainc.com>; Kinney, Michael D
<michael.d.kinney@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>
Subject: [Patch 0/3] Ext4Pkg: Add Ext4Pkg

This patch-set adds Ext4Pkg, a package designed to hold various drivers and
utilities related to the EXT4 filesystem.

Right now, it holds a single read-only UEFI EXT4 driver (Ext4Dxe), which consumes the
DISK_IO, BLOCK_IO and DISK_IO2 protocols and produce EFI_FILE_PROTOCOL and
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL; this driver allows the mounting of EXT4 partitions and
the reading of their contents.

Relevant RFC discussion, which includes a more in-depth walkthrough of EXT4 internals and
driver limitations is available at https://edk2.groups.io/g/devel/topic/84368561.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>

Pedro Falcato (3):
Ext4Pkg: Add Ext4Pkg.dec and Ext4Pkg.uni.
Ext4Pkg: Add Ext4Dxe driver.
Ext4Pkg: Add .DSC file.

Features/Ext4Pkg/Ext4Dxe/BlockGroup.c | 208 ++++++
Features/Ext4Pkg/Ext4Dxe/Collation.c | 157 +++++
Features/Ext4Pkg/Ext4Dxe/Crc16.c | 75 ++
Features/Ext4Pkg/Ext4Dxe/Crc32c.c | 84 +++
Features/Ext4Pkg/Ext4Dxe/Directory.c | 492 ++++++++++++++
Features/Ext4Pkg/Ext4Dxe/DiskUtil.c | 83 +++
Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h | 450 ++++++++++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c | 454 +++++++++++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h | 942 ++++++++++++++++++++++++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf | 147 ++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.uni | 15 +
Features/Ext4Pkg/Ext4Dxe/Extents.c | 616 +++++++++++++++++
Features/Ext4Pkg/Ext4Dxe/File.c | 583 ++++++++++++++++
Features/Ext4Pkg/Ext4Dxe/Inode.c | 468 +++++++++++++
Features/Ext4Pkg/Ext4Dxe/Partition.c | 120 ++++
Features/Ext4Pkg/Ext4Dxe/Superblock.c | 257 +++++++
Features/Ext4Pkg/Ext4Pkg.dec | 17 +
Features/Ext4Pkg/Ext4Pkg.dsc | 68 ++
Features/Ext4Pkg/Ext4Pkg.uni | 14 +
19 files changed, 5250 insertions(+)
create mode 100644 Features/Ext4Pkg/Ext4Dxe/BlockGroup.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Collation.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Crc16.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Crc32c.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Directory.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/DiskUtil.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.uni
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Extents.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/File.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Inode.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Partition.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Superblock.c
create mode 100644 Features/Ext4Pkg/Ext4Pkg.dec
create mode 100644 Features/Ext4Pkg/Ext4Pkg.dsc
create mode 100644 Features/Ext4Pkg/Ext4Pkg.uni

--
2.32.0

Join devel@edk2.groups.io to automatically receive all group messages.