@@ -688,6 +688,7 @@ files are there, and which are missing.
bus Directory containing bus specific information
cmdline Kernel command line, both from bootloader and embedded
in the kernel image.
+ cmdline_load Kernel command line obtained from kernel image (6.6)
cpuinfo Info about the CPU
devices Available devices (block and character)
dma Used DMS channels
@@ -3,6 +3,7 @@
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
+#include <asm/setup.h>
#include "internal.h"
static int cmdline_proc_show(struct seq_file *m, void *v)
@@ -12,6 +13,13 @@ static int cmdline_proc_show(struct seq_file *m, void *v)
return 0;
}
+static int cmdline_load_proc_show(struct seq_file *m, void *v)
+{
+ seq_puts(m, boot_command_line);
+ seq_putc(m, '\n');
+ return 0;
+}
+
static int __init proc_cmdline_init(void)
{
struct proc_dir_entry *pde;
@@ -19,6 +27,11 @@ static int __init proc_cmdline_init(void)
pde = proc_create_single("cmdline", 0, NULL, cmdline_proc_show);
pde_make_permanent(pde);
pde->size = saved_command_line_len + 1;
+ if (IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE)) {
+ pde = proc_create_single("cmdline_load", 0, NULL, cmdline_load_proc_show);
+ pde_make_permanent(pde);
+ pde->size = strnlen(boot_command_line, COMMAND_LINE_SIZE) + 1;
+ }
return 0;
}
fs_initcall(proc_cmdline_init);
@@ -112,6 +112,7 @@
#define __REFCONST .section ".ref.rodata", "a"
#ifndef __ASSEMBLY__
+
/*
* Used for initialization calls..
*/
@@ -143,7 +144,7 @@ struct file_system_type;
/* Defined in init/main.c */
extern int do_one_initcall(initcall_t fn);
-extern char __initdata boot_command_line[];
+extern char boot_command_line[];
extern char *saved_command_line;
extern unsigned int saved_command_line_len;
extern unsigned int reset_devices;
@@ -135,7 +135,7 @@ EXPORT_SYMBOL(system_state);
void (*__initdata late_time_init)(void);
/* Untouched command line saved by arch-specific code. */
-char __initdata boot_command_line[COMMAND_LINE_SIZE];
+char boot_command_line[COMMAND_LINE_SIZE] __ro_after_init;
/* Untouched saved command line (eg. for /proc) */
char *saved_command_line __ro_after_init;
unsigned int saved_command_line_len __ro_after_init;