linux/init
Alexander Graf 2678fd2fe9 initramfs: Expose retained initrd as sysfs file
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 <graf@amazon.com>
Tested-by: Bagas Sanjaya <bagasdotme@gmail.com>
Link: https://lore.kernel.org/r/20231207235654.16622-1-graf@amazon.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-15 17:23:00 +01:00
..
.gitignore
build-version
calibrate.c
do_mounts.c init/mount: print pretty name of root device when panics 2023-10-19 11:02:46 +02:00
do_mounts.h
do_mounts_initrd.c
do_mounts_rd.c
init_task.c As usual, lots of singleton and doubleton patches all over the tree and 2023-11-02 20:53:31 -10:00
initramfs.c initramfs: Expose retained initrd as sysfs file 2023-12-15 17:23:00 +01:00
Kconfig
main.c proc: sysctl: prevent aliased sysctls from getting passed to init 2023-11-01 12:10:02 -07:00
Makefile x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN 2023-10-20 13:02:23 +02:00
noinitramfs.c
version-timestamp.c
version.c