Thread (64 messages) 64 messages, 14 authors, 2018-04-02
STALE2945d
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 01/16] initrd: Add generic code path for common initrd unloading logic.

From: Shea Levy <hidden>
Date: 2018-03-25 22:25:50
Also in: linux-riscv, linux-sh, linux-um, linuxppc-dev, lkml
Subsystem: filesystems (vfs and infrastructure), kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Alexander Viro, Christian Brauner, Nathan Chancellor, Nicolas Schier, Linus Torvalds

Signed-off-by: Shea Levy <redacted>
---
 init/initramfs.c | 7 +++++++
 usr/Kconfig      | 4 ++++
 2 files changed, 11 insertions(+)
diff --git a/init/initramfs.c b/init/initramfs.c
index 7e99a0038942..5f2e3dba4822 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -526,6 +526,13 @@ extern unsigned long __initramfs_size;
 #include <linux/initrd.h>
 #include <linux/kexec.h>
 
+#ifdef CONFIG_INITRAMFS_GENERIC_UNLOAD
+void __init free_initrd_mem(unsigned long start, unsigned long end)
+{
+       free_reserved_area((void *)start, (void *)end, -1, "initrd");
+}
+#endif
+
 static void __init free_initrd(void)
 {
 #ifdef CONFIG_KEXEC_CORE
diff --git a/usr/Kconfig b/usr/Kconfig
index 43658b8a975e..fd79d4d6fa26 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -233,3 +233,7 @@ config INITRAMFS_COMPRESSION
 	default ".lzma" if RD_LZMA
 	default ".bz2"  if RD_BZIP2
 	default ""
+
+# Arches can select this for a generic initrd unloading codepath
+config INITRAMFS_GENERIC_UNLOAD
+	bool
-- 
2.16.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help