mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
Various fixes:
- Fix an uninitialized variable - Fix compile bug to bootconfig userspace tool (in tools directory) - Suppress some error messages of bootconfig userspace tool - Remove unneded CONFIG_LIBXBC from bootconfig - Allocate bootconfig xbc_nodes dynamically. To ease complaints about taking up static memory at boot up - Use of parse_args() to parse bootconfig instead of strstr() usage Prevents issues of double quotes containing the interested string - Fix missing ring_buffer_nest_end() on synthetic event error path - Return zero not -EINVAL on soft disabled synthetic event (soft disabling must be the same as hard disabling, which returns zero) - Consolidate synthetic event code (remove duplicate code) -----BEGIN PGP SIGNATURE----- iIoEABYIADIWIQRRSw7ePDh/lE+zeZMp5XQQmuv6qgUCXkMTwRQccm9zdGVkdEBn b29kbWlzLm9yZwAKCRAp5XQQmuv6qnJQAQD5aKiD6jx+zGtLsFTuZMcEGvhhUuJ6 oUaSvhKO3UqezwD/V5avKuuC0wWt//gOWDY+0+4QNjmvn1GLnaNYohs6fg0= =NLT9 -----END PGP SIGNATURE----- Merge tag 'trace-v5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "Various fixes: - Fix an uninitialized variable - Fix compile bug to bootconfig userspace tool (in tools directory) - Suppress some error messages of bootconfig userspace tool - Remove unneded CONFIG_LIBXBC from bootconfig - Allocate bootconfig xbc_nodes dynamically. To ease complaints about taking up static memory at boot up - Use of parse_args() to parse bootconfig instead of strstr() usage Prevents issues of double quotes containing the interested string - Fix missing ring_buffer_nest_end() on synthetic event error path - Return zero not -EINVAL on soft disabled synthetic event (soft disabling must be the same as hard disabling, which returns zero) - Consolidate synthetic event code (remove duplicate code)" * tag 'trace-v5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Consolidate trace() functions tracing: Don't return -EINVAL when tracing soft disabled synth events tracing: Add missing nest end to synth_event_trace_start() error case tools/bootconfig: Suppress non-error messages bootconfig: Allocate xbc_nodes array dynamically bootconfig: Use parse_args() to find bootconfig and '--' tracing/kprobe: Fix uninitialized variable bug bootconfig: Remove unneeded CONFIG_LIBXBC tools/bootconfig: Fix wrong __VA_ARGS__ usage
This commit is contained in:
commit
61a7595403
12 changed files with 167 additions and 173 deletions
37
init/main.c
37
init/main.c
|
@ -142,6 +142,15 @@ static char *extra_command_line;
|
|||
/* Extra init arguments */
|
||||
static char *extra_init_args;
|
||||
|
||||
#ifdef CONFIG_BOOT_CONFIG
|
||||
/* Is bootconfig on command line? */
|
||||
static bool bootconfig_found;
|
||||
static bool initargs_found;
|
||||
#else
|
||||
# define bootconfig_found false
|
||||
# define initargs_found false
|
||||
#endif
|
||||
|
||||
static char *execute_command;
|
||||
static char *ramdisk_execute_command;
|
||||
|
||||
|
@ -336,17 +345,30 @@ u32 boot_config_checksum(unsigned char *p, u32 size)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int __init bootconfig_params(char *param, char *val,
|
||||
const char *unused, void *arg)
|
||||
{
|
||||
if (strcmp(param, "bootconfig") == 0) {
|
||||
bootconfig_found = true;
|
||||
} else if (strcmp(param, "--") == 0) {
|
||||
initargs_found = true;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __init setup_boot_config(const char *cmdline)
|
||||
{
|
||||
static char tmp_cmdline[COMMAND_LINE_SIZE] __initdata;
|
||||
u32 size, csum;
|
||||
char *data, *copy;
|
||||
const char *p;
|
||||
u32 *hdr;
|
||||
int ret;
|
||||
|
||||
p = strstr(cmdline, "bootconfig");
|
||||
if (!p || (p != cmdline && !isspace(*(p-1))) ||
|
||||
(p[10] && !isspace(p[10])))
|
||||
strlcpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE);
|
||||
parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
|
||||
bootconfig_params);
|
||||
|
||||
if (!bootconfig_found)
|
||||
return;
|
||||
|
||||
if (!initrd_end)
|
||||
|
@ -562,11 +584,12 @@ static void __init setup_command_line(char *command_line)
|
|||
* to init.
|
||||
*/
|
||||
len = strlen(saved_command_line);
|
||||
if (!strstr(boot_command_line, " -- ")) {
|
||||
if (initargs_found) {
|
||||
saved_command_line[len++] = ' ';
|
||||
} else {
|
||||
strcpy(saved_command_line + len, " -- ");
|
||||
len += 4;
|
||||
} else
|
||||
saved_command_line[len++] = ' ';
|
||||
}
|
||||
|
||||
strcpy(saved_command_line + len, extra_init_args);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue