diff mbox series

[RFC,06/18] init: Add liveupdate cmdline param

Message ID 20240205120203.60312-7-jgowans@amazon.com (mailing list archive)
State New
Headers show
Series Pkernfs: Support persistence for live update | expand

Commit Message

James Gowans Feb. 5, 2024, 12:01 p.m. UTC
This will allow other subsystems to know when we're going a LU and hence
when they should be restoring rather than reinitialising state.
---
 include/linux/init.h |  1 +
 init/main.c          | 10 ++++++++++
 2 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/include/linux/init.h b/include/linux/init.h
index 266c3e1640d4..d7c68c7bfaf0 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -146,6 +146,7 @@  extern int do_one_initcall(initcall_t fn);
 extern char __initdata boot_command_line[];
 extern char *saved_command_line;
 extern unsigned int saved_command_line_len;
+extern bool liveupdate;
 extern unsigned int reset_devices;
 
 /* used by init/main.c */
diff --git a/init/main.c b/init/main.c
index e24b0780fdff..7807a56c3473 100644
--- a/init/main.c
+++ b/init/main.c
@@ -165,6 +165,16 @@  static char *ramdisk_execute_command = "/init";
 bool static_key_initialized __read_mostly;
 EXPORT_SYMBOL_GPL(static_key_initialized);
 
+bool liveupdate __read_mostly;
+EXPORT_SYMBOL(liveupdate);
+
+static int __init set_liveupdate(char *param)
+{
+	liveupdate = true;
+	return 0;
+}
+early_param("liveupdate", set_liveupdate);
+
 /*
  * If set, this is an indication to the drivers that reset the underlying
  * device before going ahead with the initialization otherwise driver might