From patchwork Sun Apr 25 06:33:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaurav Pathak X-Patchwork-Id: 1470040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=aNjUjXu/; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=pantacor-com.20150623.gappssmtp.com header.i=@pantacor-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=UWK1+ePj; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FSdbn0FNDz9sW4 for ; Sun, 25 Apr 2021 16:36:51 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=WHBiAhMSjblVTUNk7EjMvVEZoeDNS+rSu6G1p3xFcF0=; b=aNjUjXu/pCWeGJutr4H1h365RT lYMGRGyLqyYmGHCr+CqTSlGcQ3joV8RpV1esRPeel3AdOqooFH2mNI9zBysJFQxHkKnUkuLIhsAil LFpnqhn1eAJTi2XDgv5SiJ/XcWNT7KBv+C4f7h7Fp+1PbFD55GpCuGMm5koTi1ef7QCQ05oNVLGLG NO+xAYs/m9UVw/ZTvCS9iKJaPg0AabMttk4iKCyzhoPQlRvdkzB0pAO5fFP68dNexeQF1GzsuP2nW rxHSTJJOJcuswcl59mFSoJPZesOJUK1T2KeWdY/MJN/YWIQgYlvQqfHcaWuRsHYL4dMTcn482p94v c9DhN68w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1laYLR-0058Uf-39; Sun, 25 Apr 2021 06:34:17 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1laYLH-0058Ta-L1 for openwrt-devel@lists.openwrt.org; Sun, 25 Apr 2021 06:34:11 +0000 Received: by mail-pj1-x102f.google.com with SMTP id nm3-20020a17090b19c3b029014e1bbf6c60so3477669pjb.4 for ; Sat, 24 Apr 2021 23:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantacor-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dgrFRa5DLC0Vsokxne4Wp0OCgAyUkm+065yEDfYxRGk=; b=UWK1+ePj19PDq2dLlZZdskbD2mcNhN3mN5BeprnAXbV5o8D99LDstbklb7hwU8Fw6I 0El01/E7owNvmvKAY2NUPQcMnNALihvdgiJMmvwCQdLetm4b318BQF5zDrxGrrJb6tyw khC4lFoLZQ460A3xohyvfUYzTZjawr63rVHIBiVckE32/7ZjWUDfKc4K98Yp4JH91fGg DNng/JYZNKn+KaALeLygniENZ4gBEp9isGJ73TfapQGs5K1gQFwGuUdtvnjmGZQwljKU RXpZU6WOmEvrwx4Cq8xr2jHu71VTjdyTO3MaowbmWx3Z2EAi4UkCryPs/ehjjG+OZL1a xA9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dgrFRa5DLC0Vsokxne4Wp0OCgAyUkm+065yEDfYxRGk=; b=suzGiyXQGQPiE9yHt4ov3W0axAiGDU8HhXPZrnTjjKMvcfmQCVioyK5drZkGAfK0Wq fZHZyrlShJRRkXQXB6SFODH0lqVIvAX9dP/WrZys+7aGJmBih+spQZe+hEufem08jtK4 lpH1cxf6j+UqONc+gIuVHXDq8MWmfmXuBgQHtio1MzHunMwCTEmYcjlnAYKeCPqrgp+7 UWO39iU9UEmXyUmIichOpOs02Rt89oPauVeu9ecv4/WnXi09Lp/AwchE/6zGsQIDoX92 vT4WQc0fTl90yw2XjUwD8QBzO94Z6DnIWrkyRftccT5zjJ0AWqeKU686hiO3j2cibzE7 05Cg== X-Gm-Message-State: AOAM533ylo/Re2RLrTe6IqrH1lRESa8XheKNj7F88+0M6TeSWgQjbCzI QzAoCd/3n5BL65/4zX/0aIi2HQ== X-Google-Smtp-Source: ABdhPJwS5xp5rF+QjGztXoMZzNYnewDG+NIH5+XehohxsM6tT86e4A5hg9xygbVqyBZ0LxTizX7qUg== X-Received: by 2002:a17:902:f2c1:b029:eb:7b66:9c0a with SMTP id h1-20020a170902f2c1b02900eb7b669c0amr12175032plc.50.1619332444655; Sat, 24 Apr 2021 23:34:04 -0700 (PDT) Received: from localhost.localdomain ([122.169.76.130]) by smtp.gmail.com with ESMTPSA id 16sm11466775pjk.15.2021.04.24.23.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Apr 2021 23:34:04 -0700 (PDT) From: Gaurav Pathak To: daniel@makrotopia.org Subject: [RFC] procd: Use /dev/console for serial console if exists Date: Sun, 25 Apr 2021 12:03:56 +0530 Message-Id: <20210425063356.1162225-1-gaurav.pathak@pantacor.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210425_073408_840836_A79775E8 X-CRM114-Status: GOOD ( 11.16 ) X-Spam-Score: 1.0 (+) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: inittab.c: Use "/dev/console" character device (5,1) if it is present, before trying "/sys/class/tty/console/active" in case if console kernel command line is not provided during boot and to allow con [...] Content analysis details: (1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102f listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@lists.openwrt.org Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org inittab.c: Use "/dev/console" character device (5,1) if it is present, before trying "/sys/class/tty/console/active" in case if console kernel command line is not provided during boot and to allow container environment to use it as login PTY console. Signed-off-by: Gaurav Pathak --- inittab.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inittab.c b/inittab.c index 2c2270c..716bcee 100644 --- a/inittab.c +++ b/inittab.c @@ -190,7 +190,13 @@ static void askconsole(struct init_action *a) */ tty = get_cmdline_val("console", line, sizeof(line)); if (tty == NULL) { - tty = get_active_console(line, sizeof(line)); + if (dev_exist("/dev/console")) { + tty = "/dev/console"; + } + else { + tty = get_active_console(line, sizeof(line)); + } + } if (tty != NULL) { split = strchr(tty, ',');