treewide: split commandline into command line
This commit is contained in:
committed by
Luca Boccassi
parent
422bf4938a
commit
7c52d5236a
+1
-1
@@ -1276,7 +1276,7 @@ static bool should_parse_proc_cmdline(void) {
|
||||
if (getpid_cached() == 1)
|
||||
return true;
|
||||
|
||||
/* Otherwise, parse the commandline if invoked directly by systemd. */
|
||||
/* Otherwise, parse the command line if invoked directly by systemd. */
|
||||
return invoked_by_systemd();
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ int get_process_cmdline(pid_t pid, size_t max_columns, ProcessCmdlineFlags flags
|
||||
assert(pid >= 0);
|
||||
assert(ret);
|
||||
|
||||
/* Retrieve and format a commandline. See above for discussion of retrieval options.
|
||||
/* Retrieve and format a command line. See above for discussion of retrieval options.
|
||||
*
|
||||
* There are two main formatting modes:
|
||||
*
|
||||
|
||||
+5
-5
@@ -780,7 +780,7 @@ static void set_manager_settings(Manager *m) {
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to set watchdog pretimeout governor to '%s', ignoring: %m", arg_watchdog_pretimeout_governor);
|
||||
|
||||
manager_set_show_status(m, arg_show_status, "commandline");
|
||||
manager_set_show_status(m, arg_show_status, "command line");
|
||||
m->status_unit_format = arg_status_unit_format;
|
||||
}
|
||||
|
||||
@@ -2130,15 +2130,15 @@ static void log_execution_mode(bool *ret_first_boot) {
|
||||
_cleanup_free_ char *id_text = NULL;
|
||||
|
||||
/* Let's check whether we are in first boot. First, check if an override was
|
||||
* specified on the kernel commandline. If yes, we honour that. */
|
||||
* specified on the kernel command line. If yes, we honour that. */
|
||||
|
||||
r = proc_cmdline_get_bool("systemd.condition-first-boot", /* flags = */ 0, &first_boot);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed to parse systemd.condition-first-boot= kernel commandline argument, ignoring: %m");
|
||||
log_debug_errno(r, "Failed to parse systemd.condition-first-boot= kernel command line argument, ignoring: %m");
|
||||
|
||||
if (r > 0)
|
||||
log_full(first_boot ? LOG_INFO : LOG_DEBUG,
|
||||
"Kernel commandline argument says we are %s first boot.",
|
||||
"Kernel command line argument says we are %s first boot.",
|
||||
first_boot ? "in" : "not in");
|
||||
else {
|
||||
/* Second, perform autodetection. We use /etc/machine-id as flag file for
|
||||
@@ -2991,7 +2991,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
r = parse_argv(argc, argv);
|
||||
if (r < 0) {
|
||||
error_message = "Failed to parse commandline arguments";
|
||||
error_message = "Failed to parse command line arguments";
|
||||
goto finish;
|
||||
}
|
||||
|
||||
|
||||
@@ -2334,7 +2334,7 @@ int unit_file_unmask(
|
||||
if (!unit_name_is_valid(*name, UNIT_NAME_ANY))
|
||||
return -EINVAL;
|
||||
|
||||
/* If root_dir is set, we don't care about kernel commandline or generators.
|
||||
/* If root_dir is set, we don't care about kernel command line or generators.
|
||||
* But if it is not set, we need to check for interference. */
|
||||
if (!root_dir) {
|
||||
_cleanup_(install_info_clear) InstallInfo info = {
|
||||
|
||||
@@ -31,7 +31,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
|
||||
static void emit_cmdline_warning(void) {
|
||||
if (arg_quiet || arg_root)
|
||||
/* don't bother checking the commandline if we're operating on a container */
|
||||
/* don't bother checking the command line if we're operating on a container */
|
||||
return;
|
||||
|
||||
_cleanup_free_ char *override = NULL;
|
||||
@@ -41,7 +41,7 @@ static void emit_cmdline_warning(void) {
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed to parse kernel command line, ignoring: %m");
|
||||
if (override)
|
||||
log_notice("Note: found \"%s\" on the kernel commandline, which overrides the default unit.",
|
||||
log_notice("Note: found \"%s\" on the kernel command line, which overrides the default unit.",
|
||||
override);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1523,7 +1523,7 @@ def finalize_options(opts):
|
||||
elif opts.linux or opts.initrd:
|
||||
raise ValueError('--linux/--initrd options cannot be used with positional arguments')
|
||||
else:
|
||||
print("Assuming obsolete commandline syntax with no verb. Please use 'build'.")
|
||||
print("Assuming obsolete command line syntax with no verb. Please use 'build'.")
|
||||
if opts.positional:
|
||||
opts.linux = pathlib.Path(opts.positional[0])
|
||||
# If we have initrds from parsing config files, append our positional args at the end
|
||||
@@ -1543,8 +1543,8 @@ def finalize_options(opts):
|
||||
if opts.cmdline and opts.cmdline.startswith('@'):
|
||||
opts.cmdline = pathlib.Path(opts.cmdline[1:])
|
||||
elif opts.cmdline:
|
||||
# Drop whitespace from the commandline. If we're reading from a file,
|
||||
# we copy the contents verbatim. But configuration specified on the commandline
|
||||
# Drop whitespace from the command line. If we're reading from a file,
|
||||
# we copy the contents verbatim. But configuration specified on the command line
|
||||
# or in the config file may contain additional whitespace that has no meaning.
|
||||
opts.cmdline = ' '.join(opts.cmdline.split())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user