From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lRmb1-0006bL-8l for mharc-grub-devel@gnu.org; Wed, 31 Mar 2021 21:58:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRmb0-0006b7-5k for grub-devel@gnu.org; Wed, 31 Mar 2021 21:58:06 -0400 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]:43891) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRmay-0007Fq-Cw for grub-devel@gnu.org; Wed, 31 Mar 2021 21:58:05 -0400 Received: by mail-oi1-x236.google.com with SMTP id n8so251349oie.10 for ; Wed, 31 Mar 2021 18:58:04 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=aMQcbSLzLBmrwuyZs6S2O7MHq07TvJwO699r9IQPIh4=; b=aNAdKbbvRRS8y3u93VBtAuKHodNIs6jSe7JQ9kMh5Zrfa6Un1oHPZIrg/hR4pNqYCz Gfpo+bkzlKUV0KGjyfTfHpOocgcNM5I5cUVq9Eo9+INS06aSi5ceJL5yF5rvSWw6rkap 6+tMT/JsF10WFsfvBp3iJei+c4/oeH0eIdsI4DR3zvjNxA+pO0QHtTa61IJMZJvPqbQ9 XuYhCm9+C3jjOeZJxb4WpXqFmnIzWVh/hSDR6scuIdH2IAiUCzA+sbjQ8Z27nAaB2vky AUBNR8EF9KU1e++twihFupz3UwZVYgrsrD+ZtdJiHYRhhSg3URBv9vqO63D5Z7C84Njq 9y9Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=aMQcbSLzLBmrwuyZs6S2O7MHq07TvJwO699r9IQPIh4=; b=TfqfG3D7utUpWt4bA5SA+7t8YrFnvqsVgcgZE139hjgaGbydRAt6TWRqWonnP8bJgT DvuLgqD9qmVGo+VU7R8fNDgU2nUlVB6qYeONd50iW45w+dbsYhIZ31185wOgwlbqCAVB nQgkg2hKzlQWxEVwjpM5S/hnKetXpXQFahwF54kFH9BhAqHSn5nOIV3Mapb1HkicVO0M 8chvWNe1N0EFEk8AuIDBewlwMZEaR4EY5kr0AUhsSfUnADgfuxPnLCrRI3xFmf5MJWz5 UlyHzYGtTERt3V3Liw/NyF5J1HcKQ68ji8TRC82Twvb5We/FIGcxPzCp/y8/s6NdERDL AzqA== X-Gm-Message-State: AOAM531VcJxxG52WECuXopwmODOGIzpzjyXsuGxnFLf0cZ4sL8mDHdkZ cm/uUF6t9iYVKsyEyhm6uwFoEA78JgNdvA== X-Google-Smtp-Source: ABdhPJw7GRfXPLoLTVTVNXpYVdVrBmSOvGVnPRDbiCchRI7+E9FgEqQh1exzG/6sLLcvbbne6FpA4Q== X-Received: by 2002:aca:35d4:: with SMTP id c203mr4290637oia.10.1617242283191; Wed, 31 Mar 2021 18:58:03 -0700 (PDT) Received: from localhost.localdomain ([2605:a601:ab16:db00:1cb0:2038:b70a:65b5]) by smtp.gmail.com with ESMTPSA id z25sm902960otj.68.2021.03.31.18.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 18:58:02 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Glenn Washburn Subject: [PATCH 01/12] grub-shell: Allow specifying non-default trim line contents Date: Wed, 31 Mar 2021 20:57:40 -0500 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::236; envelope-from=development@efficientek.com; helo=mail-oi1-x236.google.com 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 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: Thu, 01 Apr 2021 01:58:06 -0000 This will be useful for tests that have unwanted output from setup. This is not documented because its only intended to be internal 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.27.0