mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2026-02-01 15:59:39 +00:00
Early Mac EFI returns EFI_INVALID_PARAMETER if storage for any single NVRAM variable exceeds a certain size (leaves 2006 bytes for the value, if the variable has a 4 character name). Since all of fsXX:\efi\tools\, fsXX:\efi\boot\ and fsXX:\ are added to a CHAR16 shell `path` variable for each file system found, the variable exceeds this limit when there are greater than 25 file systems. In the RELEASE shell this causes the `path` variable to get set to a strange value. Unfortunately in the DEBUG shell it causes an ASSERT and the shell does not start. With this patch the DEBUG shell behaves like RELEASE shell: due to the implementation of ShellProtocol SetEnv, when there is an error the variable gets deleted and not recreated, thus the final path variable only contains paths for file systems after the one which caused the error. While this patch is not an ideal fix for the underlying problem, it does simply recreate the longstanding behaviour of the RELEASE shell on the same systems, and is preferable to the DEBUG shell being unusable. Addresses https://github.com/acidanthera/bugtracker/issues/2005