From patchwork Mon Feb 25 04:10:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 1047572 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 (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4477xH74Cqz9sCH for ; Mon, 25 Feb 2019 15:18:59 +1100 (AEDT) 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="NO2nDequ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="bEyvBwI0"; 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 4477xH5hYTzDq5h for ; Mon, 25 Feb 2019 15:18:59 +1100 (AEDT) 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.26; helo=out2-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="NO2nDequ"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="bEyvBwI0"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4477m965GjzDq5j for ; Mon, 25 Feb 2019 15:11:05 +1100 (AEDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 93A5121841; Sun, 24 Feb 2019 23:11:02 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 24 Feb 2019 23:11:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=fm2; bh=YmV8qpbQGr/E6 tPoC2oWiwIaC3cWlNPaihRMt2rZ5J0=; b=NO2nDequjDTt+uRQGoKhCRhGaDP3j K/uc6mQTsiDHtdE3GR8fxnY3WNGo7STMrm4qjNxIsPQM8SI4eFAvrrdNaUZp9WIb yzWDSTrX12TDi6w1LViZ5mDIaCN9im+ko9gVnt4JVOwj8L+BMaXVMmEzwnjumpOA VeCyspkVmjiGihTwDnpQmsfUDMk3SNU8rudmH2Rdwuoy0SSBL+ogOqQIthzUP20j RUxyR2ltn8ibm8K09idZpAm2Qp7uAJ+ilDaMgZ0CHDBTuyV7x0FFtHvkbutP17PF MkJVehO/uEtEGQEhS97O6kThfIN0lMIPWk3edCOvUdgt9bcwItpMVunZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=YmV8qpbQGr/E6tPoC 2oWiwIaC3cWlNPaihRMt2rZ5J0=; b=bEyvBwI011Depcbf1gXnFOwG5e6byMGEP 3iB1MYyywTyrrFXqQB050c7F3tU5XYIjOwIbz/58guNauP63ncC1ZSrUW8+hC3mz 2ewnI9ywbAE3v8lt5+CV7kU6A0mFelTw3An9XO4YQcAeW4Oc6FzCOaf5Z9ypPeA6 KlEWQBYNn62jdN4MaWnJntohdHTRebrc3i+XPmPABrlk9tip/1SsJuu1LlAZBy/m qKnA3EaYYgq3XFN9F4G9FE8018VKYLf/iDRIXbwTg91l3XEP6HTnDbr5nJ/BNfCr mD4sNKTRGeWx9u/7mQ0q6pLg2Jnit0TQFG+DfcTEzqnZx8EqQBtMw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrudehgdeiieculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepufgrmhhuvghlucfovghnughoiigrqdflohhnrghsuceoshgrmhes mhgvnhguohiirghjohhnrghsrdgtohhmqeenucfkphepuddvvddrleelrdekvddruddtne curfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmsehmvghnughoiigrjhhonhgrshdrtgho mhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from v4.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 00EF7E4438; Sun, 24 Feb 2019 23:11:00 -0500 (EST) From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH] utils/pb-console: Trap SIGTERM on boot Date: Mon, 25 Feb 2019 15:10:51 +1100 Message-Id: <20190225041051.30911-1-sam@mendozajonas.com> 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: , Cc: Samuel Mendoza-Jonas Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" On kexec all processes will be sent a SIGTERM and SIGKILL. By default there are messages on the console alerting the user to this, however in some implementations these messages are disabled. This can have the effect of the UI seemingly exiting to the shell on boot and hanging for a short while before the kexec actually jumps into the next kernel. Trap the SIGTERM sent to the pb-console parent process and print a short message to the screen instead of momentarily dropping to the shell and printing the usual help messages. While here also cleanup the shell help messages below which are now handled in the shell's .shrc file. Signed-off-by: Samuel Mendoza-Jonas --- utils/pb-console | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/pb-console b/utils/pb-console index ad601e2e..5ba98cc4 100644 --- a/utils/pb-console +++ b/utils/pb-console @@ -135,12 +135,11 @@ fi dmesg -n 1 trap '' SIGINT +trap 'reset; echo "SIGTERM received, booting..."; sleep 2' SIGTERM while : do $ui $verbose_opt reset - echo "Exiting petitboot. Type 'exit' to return." - echo "You may run 'pb-sos' to gather diagnostic data" $shell done