// SPDX-License-Identifier: GPL-2.0 #include #include #include #include #include static char new_command_line[COMMAND_LINE_SIZE]; static int cmdline_proc_show(struct seq_file *m, void *v) { seq_puts(m, saved_command_line); seq_putc(m, '\n'); return 0; } static int cmdline_proc_open(struct inode *inode, struct file *file) { return single_open(file, cmdline_proc_show, NULL); } static const struct file_operations cmdline_proc_fops = { .open = cmdline_proc_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; static char *padding = " "; static void replace_flag(char *cmd, const char *flag, const char *flag_new) { char *start_addr, *end_addr; /* Ensure all instances of a flag are replaced */ while ((start_addr = strstr(cmd, flag))) { end_addr = strchr(start_addr, ' '); if (end_addr) { if (strlen(flag)