summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-03 13:04:06 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-03 13:04:06 +0100
commit8ba576d0e698aebd153c4276aa024dcc5fc99525 (patch)
treeb899e66a106f5dd8fac42ba835035f33b2d919e8 /src/core
parent5dea1c1e7902ca07ca1ea7f1914031c6e3a27be5 (diff)
parent7dcc56715d150ff7e8b5459877879430cff790f7 (diff)
Merge pull request #1744 from evverx/fix-debug-generator
debug-generator: respect kernel parameters for default unit setting
Diffstat (limited to 'src/core')
-rw-r--r--src/core/main.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 578de17fec..ea4fd0589d 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -301,20 +301,6 @@ static int parse_crash_chvt(const char *value) {
static int parse_proc_cmdline_item(const char *key, const char *value) {
- static const char * const rlmap[] = {
- "emergency", SPECIAL_EMERGENCY_TARGET,
- "-b", SPECIAL_EMERGENCY_TARGET,
- "rescue", SPECIAL_RESCUE_TARGET,
- "single", SPECIAL_RESCUE_TARGET,
- "-s", SPECIAL_RESCUE_TARGET,
- "s", SPECIAL_RESCUE_TARGET,
- "S", SPECIAL_RESCUE_TARGET,
- "1", SPECIAL_RESCUE_TARGET,
- "2", SPECIAL_MULTI_USER_TARGET,
- "3", SPECIAL_MULTI_USER_TARGET,
- "4", SPECIAL_MULTI_USER_TARGET,
- "5", SPECIAL_GRAPHICAL_TARGET,
- };
int r;
assert(key);
@@ -415,12 +401,12 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
log_set_target(LOG_TARGET_CONSOLE);
} else if (!in_initrd() && !value) {
- unsigned i;
+ const char *target;
/* SysV compatibility */
- for (i = 0; i < ELEMENTSOF(rlmap); i += 2)
- if (streq(key, rlmap[i]))
- return free_and_strdup(&arg_default_unit, rlmap[i+1]);
+ target = runlevel_to_target(key);
+ if (target)
+ return free_and_strdup(&arg_default_unit, target);
}
return 0;