Skip to content

Commit

Permalink
EfiLdr: Made boot loader support only UE format.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailKrichanov committed Oct 30, 2023
1 parent 2eafb70 commit fa683a6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Legacy/BootPlatform/EfiLdr/EfiLdr.inf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
PrintLib
LzmaDecompressLib
SerialPortLib
UefiImageOnlyFvLib
UefiImageOnlyNonFvLib

[Sources]
Support.h
Expand Down
5 changes: 0 additions & 5 deletions Legacy/BootPlatform/EfiLdr/EfiLoader.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Revision History:
#include "Support.h"
#include "LzmaDecompress.h"

#include <Library/SerialPortLib.h>

EFILDR_LOADED_IMAGE DxeCoreImage;
EFILDR_LOADED_IMAGE DxeIplImage;

Expand Down Expand Up @@ -84,7 +82,6 @@ EfiLoader (
&DestinationSize,
&ScratchSize
);

if (EFI_ERROR (Status)) {
SystemHang ("Failed to get decompress information for BFV!\n");
}
Expand All @@ -95,7 +92,6 @@ EfiLoader (
(VOID *)(UINTN)EFI_DECOMPRESSED_BUFFER_ADDRESS,
(VOID *)(UINTN)((EFI_DECOMPRESSED_BUFFER_ADDRESS + DestinationSize + 0x1000) & 0xfffff000)
);

if (EFI_ERROR (Status)) {
SystemHang ("Failed to decompress BFV!\n");
}
Expand Down Expand Up @@ -161,7 +157,6 @@ EfiLoader (
// Decompress the image
//
Status = LzmaUefiDecompressGetInfo (

(VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset),
EFILDRImage->Length,
&DestinationSize,
Expand Down
4 changes: 2 additions & 2 deletions Legacy/BootPlatform/EfiLdr/PeLoader.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ EfiLdrLoadImage (
&ImageContext,
FHand,
BufferSize,
UEFI_IMAGE_SOURCE_FV
UEFI_IMAGE_SOURCE_NON_FV
);
if (EFI_ERROR (Status)) {
return Status;
Expand Down Expand Up @@ -71,7 +71,7 @@ EfiLdrLoadImage (
return EFI_INVALID_PARAMETER;
}

Image->NoPages = EFI_SIZE_TO_PAGES (BufferSize);
Image->NoPages = EFI_SIZE_TO_PAGES (UefiImageGetImageSize (&ImageContext));

//
// Compute the amount of memory needed to load the image and
Expand Down
10 changes: 6 additions & 4 deletions build_duet.tool
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ imgbuild() {
LzmaCompress -e -o "${BUILD_DIR}/FV/DUETEFIMAINFVBLOCKIO${arch}.z" \
"${BUILD_DIR}/FV/DUETEFIMAINFVBLOCKIO${arch}.Fv" || exit 1

echo "Compressing DxeCore.efi..."
echo "Compressing DxeCoreUe.raw..."
ImageTool GenImage -c UE -o "${BUILD_DIR_ARCH}/DxeCoreUe.raw" "${BUILD_DIR_ARCH}/DxeCore.efi"
LzmaCompress -e -o "${BUILD_DIR}/FV/DxeMain${arch}.z" \
"${BUILD_DIR_ARCH}/DxeCore.efi" || exit 1
"${BUILD_DIR_ARCH}/DxeCoreUe.raw" || exit 1

echo "Compressing DxeIpl.efi..."
echo "Compressing DxeIplUe.raw..."
ImageTool GenImage -c UE -o "${BUILD_DIR_ARCH}/DxeIplUe.raw" "${BUILD_DIR_ARCH}/DxeIpl.efi"
LzmaCompress -e -o "${BUILD_DIR}/FV/DxeIpl${arch}.z" \
"$BUILD_DIR_ARCH/DxeIpl.efi" || exit 1
"${BUILD_DIR_ARCH}/DxeIplUe.raw" || exit 1

echo "Generating Loader Image..."

Expand Down

0 comments on commit fa683a6

Please sign in to comment.