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 <ashishsin...@nvidia.com> --- EmbeddedPkg/EmbeddedPkg.dec | 5 +++++ EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c | 2 +- EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index 341ef5e6a6..94dc3c9b76 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 02769cd0df..abd3f87d14 100644 --- a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c +++ b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c @@ -643,7 +643,7 @@ AndroidBootImgBoot ( goto Exit; } - NewKernelArgSize = ANDROID_BOOTIMG_KERNEL_ARGS_SIZE; + NewKernelArgSize = ANDROID_BOOTIMG_KERNEL_ARGS_SIZE + PcdGet32 (PcdAndroidKernelCommandLineOverflow); NewKernelArg = AllocateZeroPool (sizeof (CHAR16) * NewKernelArgSize); if (NewKernelArg == NULL) { DEBUG ((DEBUG_ERROR, "Fail to allocate memory\n")); diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.inf index 8eefeef4f9..9754664df5 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 -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110338): https://edk2.groups.io/g/devel/message/110338 Mute This Topic: https://groups.io/mt/102284240/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-