From patchwork Thu Jun 28 06:41:48 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: 935962 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41GVcF4gsqz9ryk for ; Thu, 28 Jun 2018 16:43:57 +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="mD1iVZEe"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="s3NX6tkK"; 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 41GVcF3CCCzF1RC for ; Thu, 28 Jun 2018 16:43:57 +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="mD1iVZEe"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="s3NX6tkK"; 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="mD1iVZEe"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="s3NX6tkK"; 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 41GVZb3VBCzF1Q6 for ; Thu, 28 Jun 2018 16:42:31 +1000 (AEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 0129021BCA; Thu, 28 Jun 2018 02:42:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 28 Jun 2018 02:42:23 -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=U5Wl1WWamXBWC//iSi39wdRYPDj7cYUlFOJGspBYbpc=; b=mD1iVZEe sjrHHmNWykqRFND3Pt5kAeH/g2lqmzZdeCdRNps9vPbXoHuf5x1x52/uD+qmOq47 bJP/zM72AgAG8MIhkpC7W+mwDBa3svc5CD1M9yafbF+x6uKWVhEa4rMKkbd1jJ7O EhaCYMdUoUqiU0y8f8LAYWVwkMUjrhadQDCSDAD78H3xAL9VCZdA53oH0K0G0/Ut nLssEyLN8fVT0H0eWjdKz0fzhh4tpyZzJ0C41vJxWbQi2nN0gHDxE0bxgNeP0dhl Q/fCDbdMocM2Ba7onUmo3cfd1/LpUsQNKNvUNPFTOfMXfZdct9Ssy73pHYJwhcVs 8vy9FG/+70Wzpg== 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=U5Wl1WWamXBWC//iSi39wdRYPDj7cYUlFOJGspBYbpc=; b=s3NX6tkK KvF9GlWz1vywwGSv05qFeHS8SMMAkwtJv0quLvG54rZ/wtFR6wvDeLTYxi5atWnA iAdGD1gLyA7brrjLJzZNtjBTcMPMutJq7U1M1iQeQO9OrQf+G4cZkumShFn+xUEQ kpUhKAG8Yy0evq1+hFmGbkJUL+fh9V1umGZ00I1MJ9IImmUHsn4cDOs7meYAwHbJ mHWqHNWOPZjgelJJups43UQlduhWb/DGTk25C0vHWaQ7wqyd8sDeMhxU+8uMp+yq jEsZ1MpQgIUgx8M/5lEsClMLQ1vcDrRFXj/aPDMfC2i+gSQa1QuPj0GukmDJWLU1 PSYZ1pzcvoCyZQ== 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 4B70B10326; Thu, 28 Jun 2018 02:42:21 -0400 (EDT) From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [RFC PATCH 10/13] ui/ncurses: Simplify starting shell Date: Thu, 28 Jun 2018 16:41:48 +1000 Message-Id: <20180628064151.13370-11-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" 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 8a3f97d..0b421c6 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -171,31 +171,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); } /** @@ -217,11 +203,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);