From patchwork Mon Dec 5 22:54:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Van Hoof X-Patchwork-Id: 129458 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 3A6D01007D4 for ; Tue, 6 Dec 2011 09:55:15 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1RXhRK-0001ZR-KA for incoming@patchwork.ozlabs.org; Mon, 05 Dec 2011 22:55:14 +0000 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.123]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1RXhRI-0001Yn-Tz for fwts-devel@lists.ubuntu.com; Mon, 05 Dec 2011 22:55:13 +0000 X-Authority-Analysis: v=2.0 cv=Nf1kJh/4 c=1 sm=0 a=jrUOvm/RFT1SBfzjC7VLzg==:17 a=gt1yh3TmTlYA:10 a=1XB9yynOT10A:10 a=MuzKI1wxPYON9UzRRcgA:9 a=jrUOvm/RFT1SBfzjC7VLzg==:117 X-Cloudmark-Score: 0 X-Originating-IP: 174.109.107.185 Received: from [174.109.107.185] ([174.109.107.185:55028] helo=haddonfield.itb.ouwish.com) by cdptpa-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 6F/71-05694-FCB4DDE4; Mon, 05 Dec 2011 22:55:11 +0000 Received: from haddonfield.itb.ouwish.com (localhost [127.0.0.1]) by haddonfield.itb.ouwish.com (8.14.4/8.14.4/Debian-2ubuntu2) with ESMTP id pB5MsxLk025458 for ; Mon, 5 Dec 2011 17:54:59 -0500 Received: (from vanhoof@localhost) by haddonfield.itb.ouwish.com (8.14.4/8.14.4/Submit) id pB5Msxex025457 for fwts-devel@lists.ubuntu.com; Mon, 5 Dec 2011 17:54:59 -0500 From: Chris Van Hoof To: fwts-devel@lists.ubuntu.com Subject: [PATCH 3/5] Adding a bit of conditional logic to fwts-frontend-text to better detect if executed in a live image and setting defaults which make the script easier to control Date: Mon, 5 Dec 2011 17:54:57 -0500 Message-Id: <1323125699-25351-4-git-send-email-vanhoof@canonical.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1323125699-25351-1-git-send-email-vanhoof@canonical.com> References: <1323125699-25351-1-git-send-email-vanhoof@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com --- live-image/fwts-frontend-text | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) diff --git a/live-image/fwts-frontend-text b/live-image/fwts-frontend-text index 9b92eb8..dbf6635 100755 --- a/live-image/fwts-frontend-text +++ b/live-image/fwts-frontend-text @@ -19,18 +19,34 @@ FWTS="Firmware Test Suite" OPTIONS="/tmp/options.$$" DIALOG_CMD="/tmp/fwts.cmd.$$" +export DIALOGRC="/usr/share/fwts/fwts-live-dialogrc" FWTS_DATE=`date +%d%m%Y` FWTS_TIME=`date +%H%M` -WORK_DIR=/cdrom/fwts/$FWTS_DATE/$FWTS_TIME - # # for debugging, use: -# WORK_DIR=./fwts/$FWTS_DATE/$FWTS_TIME +# - WORK_DIR=./fwts/$FWTS_DATE/$FWTS_TIME +# if booting in fwts-live +# - change FWTS_AUTO_SHUTDOWN= to alter default shutdown after testing completion # +WORK_DIR=/fwts/$FWTS_DATE/$FWTS_TIME SHUTDOWN_AT_END=1 +# +# set WORK_DIR to /cdrom/fwts if booting via casper +# +if [ `grep -qs boot=casper /proc/cmdline; echo $?` -eq 0 ]; then + CASPER_DETECTED=1 + WORK_DIR=/cdrom/fwts/$FWTS_DATE/$FWTS_TIME +fi + +# +# check /proc/cmdline for FWTS_AUTO_SHUTDOWN to toggle auto shutdown +# +if [ `grep -qs FWTS_AUTO_SHUTDOWN=1 /proc/cmdline; echo $?` -ne 0 -a $CASPER_DETECTED -eq 1 ]; then + SHUTDOWN_AT_END=0 +fi do_help() {