mirror of
https://github.com/torvalds/linux.git
synced 2026-12-02 19:42:26 +00:00
When the kernel command line option "retain_initrd" is set, we do not free the initrd memory. However, we also don't expose it to anyone for consumption. That leaves us in a weird situation where the only user of this feature is ppc64 and arm64 specific kexec tooling. To make it more generally useful, this patch adds a kobject to the firmware object that contains the initrd context when "retain_initrd" is set. That way, we can access the initrd any time after boot from user space and for example hand it into kexec as --initrd parameter if we want to reboot the same initrd. Or inspect it directly locally. With this patch applied, there is a new /sys/firmware/initrd file when the kernel was booted with an initrd and "retain_initrd" command line option is set. Signed-off-by: Alexander Graf <[email protected]> Tested-by: Bagas Sanjaya <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
9 lines
310 B
Plaintext
9 lines
310 B
Plaintext
What: /sys/firmware/initrd
|
|
Date: December 2023
|
|
Contact: Alexander Graf <[email protected]>
|
|
Description:
|
|
When the kernel was booted with an initrd and the
|
|
"retain_initrd" option is set on the kernel command
|
|
line, /sys/firmware/initrd contains the contents of the
|
|
initrd that the kernel was booted with.
|