From patchwork Thu Jun 28 06:41:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 935953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41GVZj31G8z9s29 for ; Thu, 28 Jun 2018 16:42:37 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="JQ4Z90XJ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="MxuU4UXn"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41GVZj1M6HzF1QZ for ; Thu, 28 Jun 2018 16:42:37 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="JQ4Z90XJ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="MxuU4UXn"; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mendozajonas.com (client-ip=66.111.4.25; helo=out1-smtp.messagingengine.com; envelope-from=sam@mendozajonas.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="JQ4Z90XJ"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="MxuU4UXn"; dkim-atps=neutral Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41GVZS5XgkzF1Q2 for ; Thu, 28 Jun 2018 16:42:23 +1000 (AEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 1ED6421AF5; Thu, 28 Jun 2018 02:42:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 28 Jun 2018 02:42:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=GUKpLgW2HAeHHWR08rC6S31QW8/YwFUo1CgWnUaB5JQ=; b=JQ4Z90XJ o433QdbV+ZxIhzyXjjPpm7gkTG2N/1NtLTRMLg77vk12LjVldIFgQ19y7CfbeRfO euejCn/e7Wdtjy8e87Fen/qcMVuv+xHcIBTm0vDwk+0OY+pB0dEpjaMm1YHSFBNJ 9fIUUB5sdEW4TzLydHf7id85ilCq/2oX1gXz9TpSNKynaf+V7+6fLULJzJa5FQRD J4RCljEf4EMRGy0rB/+6QQgXwDrjHSJCgOVL2zlOopPCURF4HWgRXlhduUZBKOpL Z3+F7SE0mp9txCQr/NSDOMhcw6Inf7JfEZ393sbQBlrSi/gZcPqCBC5BhWwiSSbw SOcUVBRCn+tchA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=GUKpLgW2HAeHHWR08rC6S31QW8/YwFUo1CgWnUaB5JQ=; b=MxuU4UXn mxpvl/oDRPOIViqFd1HfTXj4/AxkNnjQSQcBFK/jhJk30QiltXJnMr0AOI2k3Os5 iIctq+XIycCHzsEnJA4JAV0Q3SzYof/sMS18pvhYTLqWwxwbTRm9y9mEHa/qABNU 8gTjTlEj6iaEKYgpQzTnRVXjf7BbVHKvxblIYh5dakjChUk4I8EBysb8aHtA6pOv gTrTopBVGOK7XOMv6W6lAxowmh7tEUmPv7ZhEuUthrXUSGtYF9zWrgVg5zh9p1TU WtK/21Y/g0MpeK57EKEl3XTQOo83SVXKvaXT3kySYPM8yq7JpyopboDcTdu5y8Ny 1Hu6gb4c4W4E4g== X-ME-Proxy: X-ME-Sender: Received: from v4.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 862AE102ED; Thu, 28 Jun 2018 02:42:05 -0400 (EDT) From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [RFC PATCH 01/13] utils/pb-console: Support agetty's autologin option Date: Thu, 28 Jun 2018 16:41:39 +1000 Message-Id: <20180628064151.13370-2-sam@mendozajonas.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180628064151.13370-1-sam@mendozajonas.com> References: <20180628064151.13370-1-sam@mendozajonas.com> X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" If the getty arguments include '-a' do not set the '-l' option. This implies the environment has been configured with users and will launch the subsequent pb-console instance itself. Signed-off-by: Samuel Mendoza-Jonas --- utils/pb-console | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/utils/pb-console b/utils/pb-console index 282fca1..ef9ed0f 100644 --- a/utils/pb-console +++ b/utils/pb-console @@ -80,12 +80,24 @@ then then getty="$getty_arg" fi + + login_arg="-l$0" + for ttyarg in "$@" + do + # If the getty args include autologin don't override with -l + # and leave calling petitboot-nc to the user's init + if [ "$ttyarg" == "-a" ] + then + login_arg="" + fi + done + if [ "$detach" = 1 ] then - $getty -l $0 "$@" & + $getty $login_arg "$@" & exit else - exec $getty -l $0 "$@" + exec $getty $login_arg "$@" fi fi