edk2/OvmfPkg/Library/GenericQemuLoadImageLib
Miguel Flores Ruiz de Eguino a2ac0fea49 [QemuLoadImageLib] Prefix initrd=initrd in cmdline
The current implementation causes issues when the command line contains
arguments to be passed to /init after "--". Instead we can prepend that
at the beginning of the cmdline.

From: https://www.kernel.org/doc/html/v6.12/admin-guide/kernel-parameters.html

> Everything after “--” is passed as an argument to init.

Example of problematic case:

```
Kernel command line: panic=0 init=/init console=ttyS0 earlyprintk=ttyS0 -- echo hello | nc -l -p 8080 initrd=initrd
[init] running command  echo hello | nc -l -p 8080 initrd=initrd
...
[init] running command  echo hello | nc -l -p 8080 initrd=initrd
nc: exec initrd=initrd: No such file or directory
```

Signed-off-by: Miguel Flores Ruiz de Eguino <miguelfrde@google.com>
2025-05-26 18:31:34 +02:00
..
GenericQemuLoadImageLib.c [QemuLoadImageLib] Prefix initrd=initrd in cmdline 2025-05-26 18:31:34 +02:00
GenericQemuLoadImageLib.inf OvmfPkg/GenericQemuLoadImageLib: Read cmdline from QemuKernelLoaderFs 2021-06-29 12:33:17 +00:00