From patchwork Thu Nov 22 23:36:27 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: 1002069 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 431G9F1h3Cz9s3q for ; Fri, 23 Nov 2018 10:38:41 +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="exW0/SGS"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="MT8V+YOo"; 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 431G9F05GSzDqSQ for ; Fri, 23 Nov 2018 10:38:41 +1100 (AEDT) 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="exW0/SGS"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="MT8V+YOo"; 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.28; helo=out4-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="exW0/SGS"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="MT8V+YOo"; dkim-atps=neutral Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 431G7K2JbZzDqRw for ; Fri, 23 Nov 2018 10:37:01 +1100 (AEDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 002E821751; Thu, 22 Nov 2018 18:36:59 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 22 Nov 2018 18:36:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=fm1; bh=AIjKOZaEJGltBrbtvECq7EbwN4LXYJUyi1wPSGhdqjk=; b=exW0/ SGSOWTHfvvEkkgrsLM6tR0XYmU5Ff1Er21W0kuTHF/WwZUA1EFCY/6Wm9aGVzBl1 T59Ui8fMRI5f5RPjqpByyH8v8UdptCa+6UA/IuwR+B5InVa9Js8HLszo+zBDpbju MHFRonPolcjzN4U68Otb/C+GiPwumCzDtybDZNcjvhfjk+8kXPuS+zYDKZi8cati 8qInpnQd/lMtFwaFGl0tvCnmcg/l5VOU6NgjGyxx7eTy1C6eR5VvuQjVozoipHSi dQs9gnJm+AV5fRxjfQtLBI4QK1JDRvWFaKUF4YGYhcrL5GwIBJO+/MqjOEhEzPNA LvY3sDf36SEOhC74w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=AIjKOZaEJGltBrbtvECq7EbwN4LXYJUyi1wPSGhdqjk=; b=MT8V+YOo o9aCvdV1uuJ4mQx3rlzJdbyWutxZG9KoMkNUf3tUYjbSkxBdPDXRBFaOFV1ZXVtd c9QT1iGdIRW2a+OnV+DJWvonnwQ/KVQNEzwVm2kUyhSQEub0t0/488wGNwLGhkWi 1Ld23317cisPGGskEtZSVYcYHymBeU5khQ3T6QlNUJdEl7Nja/vwLSDpwpDBmnsq Zqo4WC3uOv2wdVcqc/n1rVOcnWVTmnJh3v7di8DEbyPMCul2Zg/QdZgBYroqTAxb OEW1ZX70CJQRLbsc0gxbl02aMDExV9b4MRbaYo0UnOX3NsqGNLO/6EQoCiXN2T2W U+xSdDquE+p2iA== X-ME-Sender: X-ME-Proxy: Received: from v4.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 7EDC6102E4; Thu, 22 Nov 2018 18:36:57 -0500 (EST) From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH 10/13] ui/ncurses: Simplify starting shell Date: Fri, 23 Nov 2018 10:36:27 +1100 Message-Id: <20181122233630.6303-11-sam@mendozajonas.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181122233630.6303-1-sam@mendozajonas.com> References: <20181122233630.6303-1-sam@mendozajonas.com> 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" Instead of calling sh twice to echo the 'exiting' message just call sh by itself and leave any welcome message to the shell's interactive config. Also drop the explicit nc_scr_unpost() in cui_run_cmd() since clear() will blank out the screen anyway. Signed-off-by: Samuel Mendoza-Jonas --- ui/ncurses/nc-cui.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c index 8ad89553..3c754546 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -206,31 +206,17 @@ void cui_resize(struct cui *cui) void cui_on_exit(struct pmenu *menu) { struct cui *cui = cui_from_pmenu(menu); - char *sh_cmd; cui_cancel_autoboot_on_exit(cui); - sh_cmd = talloc_asprintf(cui, - "echo \"Exiting petitboot. Type 'exit' to return.\";\ - echo \"You may run 'pb-sos' to gather diagnostic data\";\ - %s", pb_system_apps.sh); - - if (!sh_cmd) { - pb_log("Failed to allocate shell arguments\n"); - return; - } - const char *argv[] = { pb_system_apps.sh, - "-c", - sh_cmd, NULL }; cui_run_cmd(cui, argv); nc_scr_status_printf(cui->current, _("Returned from shell")); - talloc_free(sh_cmd); } /** @@ -263,11 +249,9 @@ int cui_run_cmd(struct cui *cui, const char **cmd_argv) nc_scr_status_printf(cui->current, _("Running %s..."), cmd_argv[0]); - nc_scr_unpost(cui->current); + def_prog_mode(); clear(); refresh(); - - def_prog_mode(); endwin(); result = process_run_sync(process);