On 02/26/20 00:43, Laszlo Ersek wrote: > On 02/25/20 10:39, Ard Biesheuvel wrote:
>> +" 2. The initrd is not unloaded when the shell exits, and will remain >> active\r\n" >> +" until it is unloaded again by a different invocation of the >> shell.\r\n" >> +" Consumers of the LoadFile2 protocol on the >> LINUX_EFI_INITRD_MEDIA_GUID\r\n" >> +" device path that are started via means other than the shell will be >> able\r\n" >> +" to locate the protocol and invoke it.\r\n" >> > > (16) So, I don't see how paragraph#2 works here. When the shell exits, > all our global variables disappear. (LoadFile2 disappears too.) The next > time the shell is launched (in the same "UEFI session", so to say), we > won't know that we had loaded an initrd before. Is that right? Sorry, I guess I missed the core idea behind dynamic shell commands :( The dynamic shell command seems like a separate DXE driver, after all. The shell can call into it (via EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL), but its lifecycle is independent of the shell's. The shell can also unload it (like the shell can unload any other driver). So please ignore my point (16). (But then, I do think we leak the initrd, if one has been loaded, in LinuxInitrdDynamicShellCommandUnload()). I.e., pls see my point (15).) Thanks Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#54831): https://edk2.groups.io/g/devel/message/54831 Mute This Topic: https://groups.io/mt/71530296/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-