From 7b1d4709498651fcdb34d66b5ecd9c3ed2572493 Mon Sep 17 00:00:00 2001 From: Jesse Smith Date: Sat, 29 Sep 2018 17:12:12 -0300 Subject: [PATCH] Added check for kernel parameter init.autocon=1. If this exists, then init will try to open its own console. If not, then any console= parameters will be ignored. This avoids conflicts with native kernel created consoles. --- doc/Changelog | 4 ++++ src/init.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index 600106f..29a4e78 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -22,6 +22,10 @@ sysvinit (2.91) UNRELEASED; urgency=low Updated manual page with new -q (quiet) mode. Added -h flag for pidof, which was recognized before, but not used. The -h flag now displays brief usage information for pidof. + * Added check for kernel parameter init.autocon=1. If this exists, then + init will try to open its own console. If not, then any console= + parameters will be ignored. This avoids conflicts with native kernel + created consoles. sysvinit (2.90) world; urgency=low diff --git a/src/init.c b/src/init.c index 3d6f3ab..2d59955 100644 --- a/src/init.c +++ b/src/init.c @@ -1345,6 +1345,8 @@ void check_kernel_console() } if (fgets(buf, sizeof(buf), fp)) { char* p = buf; + if ( strstr(p, "init.autocon=1") ) + { while ((p = strstr(p, "console="))) { char* e; p += strlen("console="); @@ -1398,7 +1400,8 @@ void check_kernel_console() initlog(L_VB, "added agetty on %s with id %s", dev, id); } } - } + } + } } fclose(fp); return;