mirror of https://github.com/acidanthera/audk.git
Update Shell Binary to integrate an aligned issue in shell binaries.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4950 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
88c8f7fbfd
commit
0a779dbfd0
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,189 @@
|
|||
diff -urN Shell1.04\Shell/Library/DPath.c EdkCompatibilityPkg\Shell/Library/DPath.c
|
||||
--- Shell1.04\Shell/Library/DPath.c 2007-11-15 14:38:52.000000000 +0800
|
||||
+++ EdkCompatibilityPkg\Shell/Library/DPath.c 2008-02-25 13:38:07.000000000 +0800
|
||||
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
-Copyright (c) 2005 - 2007, Intel Corporation
|
||||
+Copyright (c) 2005 - 2008, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -1294,17 +1294,8 @@
|
||||
ASSERT (Str != NULL);
|
||||
ASSERT (DevPath != NULL);
|
||||
|
||||
- if (ST->Hdr.Revision > 0x00020000) {
|
||||
- FvPath = DevPath;
|
||||
- CatPrint (Str, L"Fv(%g)", &FvPath->NameGuid);
|
||||
- } else if (ST->Hdr.Revision < 0x00020000) {
|
||||
- //
|
||||
- // MEDIA_FV_FILEPATH_DP_EFI_1_10 == MEDIA_FV_DP == 0x06
|
||||
- //
|
||||
- _DevPathFvFilePath (Str, DevPath);
|
||||
- } else {
|
||||
- _DevPathNodeUnknown (Str, DevPath);
|
||||
- }
|
||||
+ FvPath = DevPath;
|
||||
+ CatPrint (Str, L"Fv(%g)", &FvPath->NameGuid);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2006,16 +1997,11 @@
|
||||
#if (EFI_SPECIFICATION_VERSION > 0x00020000)
|
||||
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_EFI_2_00 *FvDevicePathNodeUefi_2_00;
|
||||
|
||||
- if (ST->Hdr.Revision > 0x00020000) {
|
||||
+ if (ST->Hdr.Revision != 0x00020000) {
|
||||
if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
|
||||
DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
|
||||
return &FvDevicePathNode->NameGuid;
|
||||
}
|
||||
- } else if (ST->Hdr.Revision < 0x00020000) {
|
||||
- if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
|
||||
- DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP_EFI_1_10) {
|
||||
- return &FvDevicePathNode->NameGuid;
|
||||
- }
|
||||
} else {
|
||||
FvDevicePathNodeUefi_2_00 = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_EFI_2_00 *)FvDevicePathNode;
|
||||
if (DevicePathType (&FvDevicePathNodeUefi_2_00->Piwg.Header) == MEDIA_DEVICE_PATH &&
|
||||
diff -urN Shell1.04\Shell/Library/DPath.h EdkCompatibilityPkg\Shell/Library/DPath.h
|
||||
--- Shell1.04\Shell/Library/DPath.h 2007-11-14 22:48:14.000000000 +0800
|
||||
+++ EdkCompatibilityPkg\Shell/Library/DPath.h 2008-02-25 13:38:07.000000000 +0800
|
||||
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
-Copyright (c) 2005 - 2007, Intel Corporation
|
||||
+Copyright (c) 2005 - 2008, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -161,11 +161,6 @@
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION > 0x00020000)
|
||||
//
|
||||
-// For EFI1.10 FV file device path
|
||||
-//
|
||||
-#define MEDIA_FV_FILEPATH_DP_EFI_1_10 0x06
|
||||
-
|
||||
-//
|
||||
// For UEFI2.0 FV file device path
|
||||
//
|
||||
typedef struct {
|
||||
diff -urN Shell1.04\Shell/Library/FileIO.c EdkCompatibilityPkg\Shell/Library/FileIO.c
|
||||
--- Shell1.04\Shell/Library/FileIO.c 2006-03-15 11:54:44.000000000 +0800
|
||||
+++ EdkCompatibilityPkg\Shell/Library/FileIO.c 2008-03-24 13:44:52.000000000 +0800
|
||||
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
-Copyright (c) 2005, Intel Corporation
|
||||
+Copyright (c) 2005 - 2008, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -253,14 +253,16 @@
|
||||
|
||||
--*/
|
||||
{
|
||||
- EFI_STATUS Status;
|
||||
- EFI_FILE_HANDLE LastHandle;
|
||||
- FILEPATH_DEVICE_PATH *FilePathNode;
|
||||
+ EFI_STATUS Status;
|
||||
+ EFI_FILE_HANDLE LastHandle;
|
||||
+ FILEPATH_DEVICE_PATH *FilePathNode;
|
||||
+ EFI_DEVICE_PATH_PROTOCOL *AlignedFilePath;
|
||||
|
||||
ASSERT (FilePath != NULL);
|
||||
ASSERT (DeviceHandle != NULL);
|
||||
ASSERT (FileHandle != NULL);
|
||||
-
|
||||
+
|
||||
+ AlignedFilePath = NULL;
|
||||
//
|
||||
// File the file system for this file path
|
||||
//
|
||||
@@ -274,12 +276,26 @@
|
||||
*FileHandle = LibOpenRoot (*DeviceHandle);
|
||||
Status = *FileHandle ? EFI_SUCCESS : EFI_UNSUPPORTED;
|
||||
|
||||
+ if (EFI_ERROR (Status)) {
|
||||
+ return Status;
|
||||
+ }
|
||||
+
|
||||
+ //
|
||||
+ // Duplicate FilePath to make sure it is aligned so that
|
||||
+ // FilePathNode->PathName below is 16-bit aligned.
|
||||
+ //
|
||||
+ AlignedFilePath = DuplicateDevicePath(*FilePath);
|
||||
+ if (AlignedFilePath == NULL) {
|
||||
+ (*FileHandle)->Close (*FileHandle);
|
||||
+ *FileHandle = NULL;
|
||||
+ return EFI_OUT_OF_RESOURCES;
|
||||
+ }
|
||||
+ FilePathNode = (FILEPATH_DEVICE_PATH *)AlignedFilePath;
|
||||
//
|
||||
// To access as a file system, the file path should only
|
||||
// contain file path components. Follow the file path nodes
|
||||
// and find the target file
|
||||
//
|
||||
- FilePathNode = (FILEPATH_DEVICE_PATH *) *FilePath;
|
||||
while (!IsDevicePathEnd (&FilePathNode->Header)) {
|
||||
//
|
||||
// For file system access each node should be a file path component
|
||||
@@ -332,6 +348,7 @@
|
||||
if (EFI_ERROR (Status)) {
|
||||
*FileHandle = NULL;
|
||||
}
|
||||
+ FreePool(AlignedFilePath);
|
||||
|
||||
return Status;
|
||||
}
|
||||
diff -urN Shell1.04\Shell/shellenv/var.c EdkCompatibilityPkg\Shell/shellenv/var.c
|
||||
--- Shell1.04\Shell/shellenv/var.c 2006-03-07 16:20:44.000000000 +0800
|
||||
+++ EdkCompatibilityPkg\Shell/shellenv/var.c 2008-02-25 13:38:08.000000000 +0800
|
||||
@@ -389,8 +389,15 @@
|
||||
{
|
||||
UINTN Size;
|
||||
VARIABLE_ID *Var;
|
||||
+ UINTN RoundUpValueSize;
|
||||
|
||||
- Size = sizeof (VARIABLE_ID) + StrSize (Name) + ValueSize;
|
||||
+ //
|
||||
+ // Variable buffer layout: VARIABLE_ID + Value + Name
|
||||
+ // We need to round up the variable size to make sure Name is aligned (for IPF).
|
||||
+ //
|
||||
+ RoundUpValueSize = (ValueSize % 2) ? (ValueSize + 1) : ValueSize;
|
||||
+
|
||||
+ Size = sizeof (VARIABLE_ID) + StrSize (Name) + RoundUpValueSize;
|
||||
Var = AllocateZeroPool (Size);
|
||||
if (Var == NULL) {
|
||||
return NULL;
|
||||
@@ -398,7 +405,7 @@
|
||||
|
||||
Var->Signature = VARIABLE_SIGNATURE;
|
||||
Var->u.Value = ((UINT8 *) Var) + sizeof (VARIABLE_ID);
|
||||
- Var->Name = (CHAR16 *) (Var->u.Value + ValueSize);
|
||||
+ Var->Name = (CHAR16 *) (Var->u.Value + RoundUpValueSize);
|
||||
Var->ValueSize = ValueSize;
|
||||
CopyMem (Var->u.Value, Value, ValueSize);
|
||||
StrCpy (Var->Name, Name);
|
||||
diff -urN Shell1.04\Shell/ver/Ver.inf EdkCompatibilityPkg\Shell/ver/Ver.inf
|
||||
--- Shell1.04\Shell/ver/Ver.inf 2007-03-04 23:30:48.000000000 +0800
|
||||
+++ EdkCompatibilityPkg\Shell/ver/Ver.inf 2008-03-03 13:36:05.000000000 +0800
|
||||
@@ -1,6 +1,6 @@
|
||||
#/*++
|
||||
#
|
||||
-# Copyright (c) 2005 - 2007, Intel Corporation
|
||||
+# Copyright (c) 2005 - 2008, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -45,7 +45,7 @@
|
||||
Ver.c
|
||||
Ver.h
|
||||
|
||||
-[sources.ia32|x64]
|
||||
+[sources.ia32,sources.x64]
|
||||
ia32\ver32.c
|
||||
|
||||
[sources.ipf]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,24 +1,12 @@
|
|||
The binaries of EdkShellBinPkg are generated with EDK-Shell 1.04 release and build with Edk Compatibility & BaseTools Package
|
||||
(r4631)
|
||||
(r4927)
|
||||
|
||||
The following steps can help to re-generate these binaries for customization:
|
||||
1. Check out EdkCompatibilityPkg (r4631) to a directory EdkCompatibilityPkg in workspace (svn https://edk2.tianocore.org/svn/edk2/trunk/edk2/EdkCompatibilityPkg).
|
||||
2. Update to the newest BaseTools package.
|
||||
1. Check out EdkCompatibilityPkg (r4927) to a directory EdkCompatibilityPkg in workspace (svn https://edk2.tianocore.org/svn/edk2/trunk/edk2/EdkCompatibilityPkg).
|
||||
2. Update to the newest BaseTools package. (r4927 or later)
|
||||
2. Download EfiShell 1.04.zip from EDK Shell official release https://efi-shell.tianocore.org/servlets/ProjectDocumentList?folderID=52&expandFolder=52&folderID=45
|
||||
3. Unzip it to be a sub-directory in EdkCompatibilityPkg , i.e. c:\EdkII\EdkCompatibilityPkg\Shell
|
||||
4. Work around an issue in EdkCompatibilityPkg\Shell\ver\Ver.inf to split:
|
||||
[sources.ia32|x64]
|
||||
ia32\ver32.c
|
||||
|
||||
to be:
|
||||
[sources.ia32]
|
||||
ia32\ver32.c
|
||||
|
||||
[sources.x64]
|
||||
ia32\ver32.c
|
||||
|
||||
since current build tools (r4631) do not support this syntax in EDK INF format.
|
||||
|
||||
4. Apply a hot fix Shell_HotFix.diff under EdkShellBinPkg\GenBin directory. This is mainly to fix the unaligned device path node access in shell binary and a rare INF format issue in ver.inf. This patch will be integrated into the later official release.
|
||||
5. Under workspace directory (i.e. c:\EdkII), execute:
|
||||
build -a IA32 -a X64 -a IPF -p EdkShellBinPkg\GenBin\EdkShellPkg.dsc -t WINDDK3790x1830
|
||||
The use of WINDDK instead of MYTOOLS is due to the fact that EDK shell source 1.04 is not
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue