From patchwork Tue Oct 8 09:33:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 1173148 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46nXH83hLSz9s4Y for ; Tue, 8 Oct 2019 20:34:12 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="vo/XuQBL"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46nXH82lzjzDqNZ for ; Tue, 8 Oct 2019 20:34:12 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46nXH265RLzDqLx for ; Tue, 8 Oct 2019 20:34:06 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="vo/XuQBL"; dkim-atps=neutral Received: by ozlabs.org (Postfix, from userid 1023) id 46nXH22VRmz9sN1; Tue, 8 Oct 2019 20:34:06 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1570527246; bh=A6MLzdo8Qeqf6bfo44wGf2moaOGYkdG0aW1zirRERZI=; h=From:To:Subject:Date:From; b=vo/XuQBLuI91Nm0X5TXO8gadqe9x/3MAKTyDyKBYAluYEjPg3FUDCYxxn9CSCcOP6 VBpLsFIwMYeUv4CyBq7EwtQFRf9TwxDBdwWQ7O1NQiMbvft8srU3C5/LbR7xH6rzA2 cHBwBgfVOTOBk3VKsJx7Q+Oq0VmUii2bM0heLiSzxlFxC7YZjvEfAXOcqWsFy6qnTo rEzce9dDtizU2yKAUKSIPh+f7NW3kIrVuNGBJdnVcVy1dqC/XKnvRp5We+hvEWOD5S +rbaUViBJm1bTrR5fSGA8x313Z5LfqTd1X1YNMMgbw4RjFn7q1uCeufnPpMq047NSI oxlbeJZrJTMhQ== From: Jeremy Kerr To: petitboot@lists.ozlabs.org Subject: [PATCH 1/2] pb-console: start shell as a login shell Date: Tue, 8 Oct 2019 17:33:53 +0800 Message-Id: <20191008093354.15060-1-jk@ozlabs.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" The environment that pb-console starts is minimal, as we have likely been run by udev. Because we're starting a shell, we want the proper profile set up, so run as a login shell. This assumes the shell accepts -l, but we already have an assumption for supporting -m (as /bin/ash does). Signed-off-by: Jeremy Kerr --- utils/pb-console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/pb-console b/utils/pb-console index ab5eaaa..8245b33 100644 --- a/utils/pb-console +++ b/utils/pb-console @@ -141,5 +141,5 @@ while : do $ui $verbose_opt reset - $shell -m + $shell -ml done From patchwork Tue Oct 8 09:33:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 1173149 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 46nXHJ6xjCz9s4Y for ; Tue, 8 Oct 2019 20:34:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="OVtk13Gu"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46nXHJ51kDzDqN9 for ; Tue, 8 Oct 2019 20:34:20 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46nXH26cN5zDqM3 for ; Tue, 8 Oct 2019 20:34:06 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="OVtk13Gu"; dkim-atps=neutral Received: by ozlabs.org (Postfix, from userid 1023) id 46nXH237N9z9s4Y; Tue, 8 Oct 2019 20:34:06 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1570527246; bh=Br9f0G6VaSriLn07KUY8Bo1CewB/CpKdHY3YWv1m/44=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OVtk13GuFaZjzJsQ/YjLK5msZAC0bv/nADgfCRBG8dgIV2O8+z7phorTQGJ5N7r4p CPXb9BvmoyhEP4sJjjhoxug8DODWSePmD+YvHuRdw0e92L/VL6VN9FSyqYmv1f/0c7 L9ttIjeS/RvKDe41h43iok2RBBCoRe9eX8mAGT9pMeVZ8BZkZLZOGSbgvI3Kq8qfBN kLyGnaU5gJfKT3Cv2yl3cuF/xMtPy6wjLBmPqwNrohM+20h3Jt6bxmM5adc/ilTidN M5lnvz2vg0oOh5GeyEkb7YsGT6DHkY3RJQG8MNhKWL7+Wbl2K06FOiIrIDnt8CxjHh UOITs7B99466g== From: Jeremy Kerr To: petitboot@lists.ozlabs.org Subject: [PATCH 2/2] pb-console: don't modify PATH unless it's empty Date: Tue, 8 Oct 2019 17:33:54 +0800 Message-Id: <20191008093354.15060-2-jk@ozlabs.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191008093354.15060-1-jk@ozlabs.org> References: <20191008093354.15060-1-jk@ozlabs.org> MIME-Version: 1.0 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" We're now running pb-console through a proper login shell, so we shouldn't need to modify PATH, as we expect it to be properly set up by the shell profile. This change removes the unconditional PATH modification, so we only set a basic PATH if it's currently empty. Signed-off-by: Jeremy Kerr --- utils/pb-console | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/pb-console b/utils/pb-console index 8245b33..012d242 100644 --- a/utils/pb-console +++ b/utils/pb-console @@ -119,10 +119,8 @@ esac # we may have been run from udev - ensure we have a sensible PATH if [ -z "$PATH" ] then - PATH=/usr/bin:/usr/sbin:/bin:/sbin + export PATH=/usr/bin:/usr/sbin:/bin:/sbin fi -PATH=/var/lib/pb-plugins/bin:$PATH -export PATH verbose_opt= if $pb_config debug | grep -q enabled