diff options
author | Ashish Singhal <ashishsingha@nvidia.com> | 2023-11-29 20:51:53 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-11-30 04:58:07 +0000 |
commit | 59b6b5059b90883abfcbd906c411e8f59ac1aa0d (patch) | |
tree | f27ffbcd9af674df024a2b9ffc4ce5913efdc709 /EmbeddedPkg | |
parent | c0207583e02205cf4dfda08fd102ebdb3df0b4f2 (diff) | |
download | edk2-59b6b5059b90883abfcbd906c411e8f59ac1aa0d.zip edk2-59b6b5059b90883abfcbd906c411e8f59ac1aa0d.tar.gz edk2-59b6b5059b90883abfcbd906c411e8f59ac1aa0d.tar.bz2 |
EmbeddedPkg: Allow longer android kernel command line
AndroidBootImgLib allows for platforms to append to kernel command
line but does not allow for the overall kernel command line to go
beyond the limit set by the image header. Address this limitation
by adding a pcd where platform can tell how many extra characters
they expect on their platform in addition to what the image header
specifies.
Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r-- | EmbeddedPkg/EmbeddedPkg.dec | 5 | ||||
-rw-r--r-- | EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c | 2 | ||||
-rw-r--r-- | EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf | 3 |
3 files changed, 8 insertions, 2 deletions
diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index 341ef5e..94dc3c9 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -183,3 +183,8 @@ # Selection between DT and ACPI as a default
#
gEmbeddedTokenSpaceGuid.PcdDefaultDtPref|TRUE|BOOLEAN|0x0000059
+
+ #
+ # Expected Overflow Android Kernel Command Line Characters
+ #
+ gEmbeddedTokenSpaceGuid.PcdAndroidKernelCommandLineOverflow|0|UINT32|0x000005C
diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c index f63648e..d16929f 100644 --- a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c +++ b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c @@ -335,7 +335,7 @@ AndroidBootImgUpdateArgs ( return Status;
}
- NewKernelArgSize = ANDROID_BOOTIMG_KERNEL_ARGS_SIZE;
+ NewKernelArgSize = ANDROID_BOOTIMG_KERNEL_ARGS_SIZE + PcdGet32 (PcdAndroidKernelCommandLineOverflow);
*KernelArgs = AllocateZeroPool (sizeof (CHAR16) * NewKernelArgSize);
if (*KernelArgs == NULL) {
DEBUG ((DEBUG_ERROR, "Fail to allocate memory\n"));
diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf index 8eefeef..9754664 100644 --- a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf +++ b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf @@ -45,5 +45,6 @@ gEfiAcpiTableGuid
gFdtTableGuid
-[FeaturePcd]
+[Pcd]
gEmbeddedTokenSpaceGuid.PcdAndroidBootLoadFile2
+ gEmbeddedTokenSpaceGuid.PcdAndroidKernelCommandLineOverflow
|