From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1k7Sed-0007aL-Sv for mharc-grub-devel@gnu.org; Sun, 16 Aug 2020 20:05:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7Sec-0007Y5-B9 for grub-devel@gnu.org; Sun, 16 Aug 2020 20:05:34 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:36509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7Sea-000640-L3 for grub-devel@gnu.org; Sun, 16 Aug 2020 20:05:34 -0400 Received: by mail-pj1-x1032.google.com with SMTP id ha11so6845743pjb.1 for ; Sun, 16 Aug 2020 17:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i+y1LFxsot96eoCJHXOIepqnktTSk8fhZ/hNCEY6Pa0=; b=sIOCck29jQ9okrryz6H8qIrhfiq9Eig2b8u1ZuBpdHU2PnGT+0LidEAGkQ2qNEuamh MWl+HOxfOAtukBCeE9qcrW2OzTrfDhoqnha3Dpzr0CVyyDRigWy9tYW9pz0gjQWxGUGa c9TqydVZweni4+5pbLPWa0qMagLorkh+K9AVXgFCzjJfn3RGtbiagZMMFh+UDuCBKz37 78qIeKrRDfCvwgSYMu5LlMM+L9YCPUQQMCtU0rPfFhBHUxjqE2X2CRnq48uLbH3jws2Q ajnL1tLXPzCffBEsLHSCGUxfsi+9xxfX/Pyo2OKBxfMQ/hdRrasJ6QWbwtfXL913o+QP nP1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i+y1LFxsot96eoCJHXOIepqnktTSk8fhZ/hNCEY6Pa0=; b=cJ1T73i2IfCniA15ueA8wU5oER0ziVwQBzkbOji3cnTTc6KGjf0/sta4AcnbtA6fpG 7J5hTciEg+Q7O74oZXXwsrmAd4q549uipLMZlo1anELXfaEClB6nm9asz9UxqhaqG2l1 L9ta+9WvN5dDSSbruvt7v7qvLJM5Xbn8wWT55kYDc4uFFqawK67EZFKhQbCIVQCenVNd x5WRZMdwvDo4etgYveAryW66BoJ0YrShIHPjVzr5fmwnaOysVJtxx8afyyp1HmdfLQ76 e9P5MLMBOxlQZEfl0uYUCKGMASvjD2xdeCNzTaD0fyvDEr66/F4HDqNWculQhCfcbBvY 5k8w== X-Gm-Message-State: AOAM531bhE8YVmsUcRLMzHyFerVVJ2YvPE2m5XZ5JIStEtk8rgv67JAR yI7aFnxOhqtmIRCIw98Shw/KH4ZcRDJwrA== X-Google-Smtp-Source: ABdhPJz382yj1OYhWGWoPzWaVJAvzLDQhKtncrD4mnQLtuIJ6OUnRLO6eltrCpWmt8fN9+B66nrfAg== X-Received: by 2002:a17:902:c40f:: with SMTP id k15mr9430839plk.330.1597622731095; Sun, 16 Aug 2020 17:05:31 -0700 (PDT) Received: from crass-HP-ZBook-15-G2.lan ([136.49.44.103]) by smtp.gmail.com with ESMTPSA id h19sm14967000pjv.41.2020.08.16.17.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Aug 2020 17:05:30 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org Cc: Glenn Washburn Subject: [CRYPTOMOUNT-TEST 3/7] grub-shell: Allow specifying non-default trim line contents. Date: Sun, 16 Aug 2020 19:05:14 -0500 Message-Id: <20200817000518.4006518-4-development@efficientek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=development@efficientek.com; helo=mail-pj1-x1032.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2020 00:05:34 -0000 This will be useful for tests that have unwanted output from setup. This is not documented because its only intended at the moment. Also, --no-trim is allowed to explicitly turn off trim. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 93e9f5148..b409962f1 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -32,6 +32,7 @@ PATH="${builddir}:$PATH" export PATH trim=0 +trim_head=664cbea8-132f-4770-8aa4-1696d59ac35c # Usage: usage # Print the usage. @@ -212,8 +213,13 @@ for option in "$@"; do echo "$0 (GNU GRUB ${PACKAGE_VERSION})" exit 0 ;; --trim) - trim=1 + trim=1 ;; + --trim=*) + trim=2 + trim_head=`echo "$option" | sed -e 's/--trim=//' -e 's/,/ /g'` ;; + --no-trim) + trim=0 ;; --debug) debug=1 ;; --modules=*) @@ -336,8 +342,6 @@ terminal_input ${term} terminal_output ${term} EOF -trim_head=664cbea8-132f-4770-8aa4-1696d59ac35c - if [ $trim = 1 ]; then echo "echo $trim_head" >>${cfgfile} fi @@ -452,8 +456,8 @@ fi do_trim () { - if [ $trim = 1 ]; then - awk '{ if (have_head == 1) print $0; } /664cbea8-132f-4770-8aa4-1696d59ac35c/ { have_head=1; }' + if [ $trim = 1 ] || [ $trim = 2 ]; then + awk '{ if (have_head == 1) print $0; } /'"$trim_head"'/ { have_head=1; }' else cat fi -- 2.25.1