Ext2Fs->Ext2FsFeaturesIncompat report EXT2F_INCOMPAT_CSUM_SEED
so that fail into not support.
boot tested with old/new yocto image, ubuntu.
Signed-off-by: Randy <randy.lin@intel.com>
This patch fixes 2 issues related to symbolic links:
1. when "fs ls" a directory, symbolic links are not shown.
It is because Ext2fsLs() only shows regular files and directories.
2. when "fs ls <symbolic_link>" the output is incorrect.
It is because File->FileNamePtr points to a local variable,
"NameBuf" in Ext2fsOpen(), if the file is a symbolic link
This patch replaces File->FileNamePtr with FileNameBuf.
It slightly increases Ext2fsLs/Ext2fsOpen/SearchDirectory time,
because of the use of strcpy and strcat.
Test method:
1. create a regular file, "a", in directory "x"
2. create a symbolic link file, "b", pointing to "a".
3. under the shell of OSLoader,
"fs ls x"
- expected result: a, b (symbolic link)
"fs ls x/a"
- expected result: a and its file size is shown
"fs ls x/b"
- expected result: b -> a, and the file size of a is shown
Verify: TGL-UP3 RVP
Signed-off-by: Stanley Chang <stanley.chang@intel.com>
This patch fixes an issue that SBL fails to load a file in Ext4 partition,
when
1. the ext4 partition uses Extent
2. the inode's first extent block is an internal node
3. the node has only one entry (i.e., eh_entries = 1)
Under the above conditions, the data block may point to the child of
first ei_block when accessing the data within the range of child node.
Test method:
1. Install Ubuntu 20.04.5 LTS/(min install) in an eMMC disk
Note: this issue is only reproducible when loading a file
satisfying all conditions mentioned above (i.e., eh_entries = 1).
So far, the /boot/initrd.img after installing Ubuntu in an eMMC
(where part table: 500MB(FAT), 20GB (EXT4), 4GB (Swap)) satisfies
the conditions. However, for some reasons, when using USB SATA disk,
it will not generate a /boot/initr.rd meeting the conditions.
2. Boot to OSLoader
3. "fs init 2:0 0 1" the eMMC disk (assume the HW:SW-part is 0 1)
4. "fs load boot/initrd.img"
Expected result:
1. With this patch: successfully load the file.
2. Without this patch: ASSERT [OsLoader] ..
Verified: EHL CRB
Signed-off-by: Stanley Chang <stanley.chang@intel.com>
This patch fixes an invalid memory access issue caused by
the fs->Ext2FsGDSize is smaller than the size of EXT2GD.
The EXT2GD is a 64-byte structure, but fs->Ext2FsGDSize is not always 32.
Before this patch, Ext2fsOpen() allocates a smaller memory than expected:
i.e., Ext2FsGrpDes = AllocatePool (Ext2FsGDSize * Ext2FsNumCylinder);
When ReadGDBlock() loads data (E2FS_CGLOAD) into fs->Ext2FsGrpDes,
it possibly accesses mem out of the allocated Ext2FsGrpDes space.
This patch loads each element into fs->Ext2FsGrpDes.
This patch also
1. prints informative messages when OS Loader fails to load Linux files.
2. increase EHL's PLD_HEAP_SIZE (since the size of initrd in Ubuntu LiveCD
is over 130MB)
Test method:
1. create a huge EXT FS (says, at least 36GB)
2. In the fs, place the following file/dir:
a: non-empty file
b: dir
b/c: non-empty file
3. boot with SBL OS Loader and enter Shell.
4. execute "fs init <...skip...>" to init the fs
5. execute "fs ls"
6. execute "fs ls b/c"
7. execute "fs load a"
8. execute "fs load b/c"
Verify:
1. 10MB/10GB/100GB/200GB EXT2/EXT3/EXT4 FS
2. EHL CRB
Signed-off-by: Stanley Chang <stanley.chang@intel.com>
Convert the line endings stored for all text files in the repository to
LF. The majority previously used DOS-style CRLF line endings. Add a
.gitattributes file to enforce this and treat certain extensions as
never being text files.
Update PatchCheck.py to insist on LF line endings rather than CRLF.
However, its other checks fail on this commit due to lots of
pre-existing complaints that it only notices because the line endings
have changed.
Silicon/QemuSocPkg/FspBin/Patches/0001-Build-QEMU-FSP-2.0-binaries.patch
needs to be treated as binary since it contains a mixture of line
endings.
This change has implications depending on the client platform you are
using the repository from:
* Windows
The usual configuration for Git on Windows means that text files will
be checked out to the work tree with DOS-style CRLF line endings. If
that's not the case then you can configure Git to do so for the entire
machine with:
git config --global core.autocrlf true
or for just the repository with:
git config core.autocrlf true
Line endings will be normalised to LF when they are committed to the
repository. If you commit a text file with only LF line endings then it
will be converted to CRLF line endings in your work tree.
* Linux, MacOS and other Unices
The usual configuration for Git on such platforms is to check files out
of the repository with LF line endings. This is probably the right thing
for you. In the unlikely even that you are using Git on Unix but editing
or compiling on Windows for some reason then you may need to tweak your
configuration to force the use of CRLF line endings as described above.
* General
For more information see
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings .
Fixes: https://github.com/slimbootloader/slimbootloader/issues/1400
Signed-off-by: Mike Crowe <mac@mcrowe.com>
For EXT2 filesystem revision 0, there are some fixed fields in the
super block structure according to the documentation. The code should
always use those fixed values for safe regardless of the value inside
the image.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch runs basic check during EXT FS initialization
by opening root directory to ensure superblock been
validated.
Signed-off-by: Stanley Chang <stanley.chang@intel.com>
This patch changes the return code of SearchDirectory
to EFI_NOT_FOUND when a file to search cannot be found
Signed-off-by: Stanley Chang <stanley.chang@intel.com>
In the Ext23Lib support for symbolic links was recently enabled
but there was a limitation imposed to use the CFG data boot
option filepath limit of 16 bytes which does not need to be also
be imposed on symbolic link paths. This will allow symbolic link
paths to be up to 260 characters long.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
Some of the boot option file paths used when
booting with OS Loader payload are failing
because the Ext23Lib does not support symbolic
soft links (e.g. ln -s <file> <link>). This
patch adds support for loading the soft link
succesfully.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
This will allow necessary messages to be printed to consoles.
These macros will redirect debug message to consoles.
CONSOLE_PRINT
CONSOLE_PRINT_UNICODE
These conditional macros will redirect debug message to consoles or
DEBUG(). The PrintLevel is valid only when redirected to DEBUG().
CONSOLE_PRINT_CONDITION
CONSOLE_PRINT_UNICODE_CONDITION
Signed-off-by: Aiden Park <aiden.park@intel.com>
Visual Studio reports more pointer type cast errors with 64-bit build.
This will cover the issue on the existing targets.
Signed-off-by: Aiden Park <aiden.park@intel.com>
This patch allows both 32/64-bit addressing properly.
- Pointer type cast with UINTN
- Add missing EFIAPI for APIs
Signed-off-by: Aiden Park <aiden.park@intel.com>
In order to sync up with EDK201911 stable release, it is required
to add missing header files in the INF file. Otherwise, the build
will throw warnings. This patch added the missing headers in INF
files.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This will fully support PatchCheck.py.
- Remove all trailing whitespace
- Convert LF to CRLF by default
- Update EFI_D_* to DEBUG_*
- Re-enable CRLF check in PatchCheck.py
Signed-off-by: Aiden Park <aiden.park@intel.com>
This allows 'fs ls' command to print directory or file lists to both serial
and display console according to CONSOLE_OUT_DEVICE_MASK.
Signed-off-by: Aiden Park <aiden.park@intel.com>
This patch will print a filename with 16 chars aligned size.
- left justified filename with padding up to 16 chars
- length of filename > 16 chars, full filename is printed as it is
Signed-off-by: Aiden Park <aiden.park@intel.com>
This patch updates function/APIs definition and comment syntax
with EDK coding convention.
- No functional changes
- Remove unused funtions
Signed-off-by: Aiden Park <aiden.park@intel.com>
This 'fs' shell command can be used for basic file system check.
Usage: fs init [device no.] [hwpart no.] [swpart no.]
fs close
fs info
fs ls [dir or file path]
- 'device no.' is from Platform Device Table.
- all 0s by default if 'fs init' has no parameters
- root dir by default if 'fs ls' has no dir or file path
Signed-off-by: Aiden Park <aiden.park@intel.com>
The EXT library has some unused code that
we can remove to help reduce the size and
to clean things up some more. Also add a
routine for dumping the group descriptor
table which can be helpful for debugging
issues.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
EXT2/3 library has some limiatation to support
hardware block sizes larger than 512 (e.g. 4KB)
and also does not currently support the flag
INCOMPAT_64BIT which indicates larger group
descriptor sizes. This patch adds flexibility
to support 512 and 4KB block sizes as well as
64bit EXT file systems.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
- 'OpenFile may be used uninitialized' in ExtLib
- 'undefined reference to memcpy' in FatLib
- 'Lasa/Laml may be used uninitialized' in TpmLib
- 'Adjust may be used uninitialized' in Stage2Support
Signed-off-by: Aiden Park <aiden.park@intel.com>