Commit Graph

12 Commits

Author SHA1 Message Date
Atharva Lele 82769186dc
OsLoader - Container Type Cleanup (#1816)
* Add Name field to IMAGE_DATA structure

Add a name field to the structure to be used by container parsing
functions. It will be useful to determine the name of the container
component when dealing with special files like ACPI blobs.

Signed-off-by: Atharva Lele <atharva.lele@intel.com>

* OsLoader: save the name of the component when creating array of components

Saving the name will help us deal with special files like ACPI blobs
more easily

Signed-off-by: Atharva Lele <atharva.lele@intel.com>

* OsLoader: streamline container types

Update container functionality to streamline container types:
- Normal: PE32, FV, ELF images. Supports ACPI table update.
- Classic (Linux): Used for a traditional Linux boot setup.
  (cmdline, bzImage, initrd). Additionally supports ACPI table update.
- Multiboot: Used for Multiboot/Multiboot-2 compliant ELF images.
  Supports ACPI table update.

Signed-off-by: Atharva Lele <atharva.lele@intel.com>

* Rename CLASSIC container to CLASSIC_LINUX

This type of container is to be used for a traditional Linux
boot setup consisting of a cmdline, bzImage, initrd(optional),
and other binary blobs or ACPI blobs.

Rename it to CLASSIC_LINUX to make the purpose of the container
clearer.

Signed-off-by: Atharva Lele <atharva.lele@intel.com>

* OsLoader: copy Linux ExtraBlobs to reserved mem and add to cmdline

Until now, SBL loaded the Extra blobs with the Linux kernel
into memory. However, there was no way for the OS to know where
these blobs resided in memory. The blobs were also loaded in
memory that was not marked as reserved.

This patch copies the blobs to reserved memory and adds the
blob addresses into an expected placeholder in the Linux cmdline.
If the placeholder is not present, nothing related to that blob
will be added to the cmdline.

Signed-off-by: Atharva Lele <atharva.lele@intel.com>

---------

Signed-off-by: Atharva Lele <atharva.lele@intel.com>
2023-02-02 09:19:31 -08:00
Mike Crowe 990e3e81e6 Use LF line endings in the repository
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>
2021-11-10 12:46:42 -08:00
Jan Schlosser 8f2af41f52 [IAS] Consider signature for size only if enabled
As per specification of the IAS-Image format
https://github.com/intel/iasimage/blob/master/docs/02_mcd.md
the signature and public key are optional.

As per specification of the header format
https://github.com/intel/iasimage/blob/master/docs/02_mcd.md#image-type

The 8th bit indicate if the signature is included, while the 9th bit
indicates whether the public key is included.

While the previous solution checked if public key is enabled, it did
not check if the signature is included, but rather assumed that it
is always included.

This will lead to a miss-calculation of the `IAS_IMAGE_END` and
`IAS_IMAGE_SIZE` which on the other hand will cause `IsIasImageValid()`
to fail, which will fail the loading of unsigned IAS-Images.

Signed-off-by: Jan Schlosser <jan.schlosser@outlook.com>
2021-06-25 06:37:29 -07:00
Aiden Park 29446a1c2a
Pointer type cast for both 32/64-bit operation (#615)
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>
2020-03-26 17:30:55 -07:00
Subash Lakkimsetti cca25f64ef IAS Library KlocWork fixes
Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-02-05 22:44:10 -08:00
Subash Lakkimsetti d111dcb12a Measured boot update for Linux OS Image
Unified interface is added in TpmLib to extend stage and
OS Image digest. For Container OS Image this interface
is added as callback functionality. IAS image utilizes same
functionality to extend TPM digest.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-01-28 09:35:46 -07:00
Subash Lakkimsetti 71c64f40bd IPP Crypto and Secure boot lib to support multiple hashes
Hash and RSA signing parameters were hardcoded in
Crypto wrappers and secure boot libraries. This patch
address support for multiple hash and key sizes.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-12-12 08:13:04 -07:00
Subash Lakkimsetti 929bca6807 SecureBoot: Publickey and Signature data structure updates
This patch implements pubKey and signature updates done
in storage. Added info as sigining types, signing algo,
key sizes which could be used in secureboot and crypto
libraries.

Information from IASImage is transformed to updated
crypto and secure boot implementation. Only RSA2048 and sha256
support is updated as IAS image supports only this combination.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-12-10 11:42:23 -08:00
Aiden Park b24fd2759c Cosmetic: Convert LF to CRLF
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>
2019-12-02 16:21:19 -08:00
Aiden Park 141d051b8f
OsLoader: Free all allocated memory at failing on a boot option (#453)
While trying to boot all boot options, some allocated memory are not
de-allocated properly. To avoid memory leak while booting next boot
options, OsLoader will track all image data and free the unnecessary
memory at failing to boot current boot option.

Tested and verified with
- Traditional linux image on debug build
- IAS type image
- Container type image
- MultiBoot image
- BootSlot (A/B Boot)
- Trusty image

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-13 09:50:01 -08:00
Guo Dong 5e10bd1e07 Update BSD license to BSD+Patent license
To align with EDK2, update file license
to use BSD+Patent license

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-06-13 10:46:49 -07:00
Maurice Ma c6999f497a Initial check-in for Slim Bootloader source 2018-09-13 16:11:07 -07:00