From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pFMoB-0005Nv-9k for mharc-grub-devel@gnu.org; Tue, 10 Jan 2023 17:09:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFMo8-0005NH-KW for grub-devel@gnu.org; Tue, 10 Jan 2023 17:09:24 -0500 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFMo7-0005f1-24 for grub-devel@gnu.org; Tue, 10 Jan 2023 17:09:24 -0500 Received: by mail-il1-x12d.google.com with SMTP id h26so7104149ila.11 for ; Tue, 10 Jan 2023 14:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iklOyQxjWgNjCyrLUhjSPyNTYPSIGLopYzXUT0GBvxk=; b=vE/xCfaN9fvWdOxSedL3MjFjWJP4OPY6Cp7dds6tmJZNzGKVVKBSPWCFY5mq3hCERj ZpKejRcoxBp7fx3zBZsfCclWUP6BUYSIDAetG+yCcARCx0nkNYl2abqp5eLX/iVx0gIM E0SczqRlwRhkHuZrq+8zR+RP+mUaTqVxAsQiIkrZu2Ad7v6ef4xpvCH5jb4vwvXEBGpD BBddv71+yq2DuVjbqeFIwmZCXpfbbWE9jWOtaltr7xIYq3r2mOBuqqfwlUmgdee0eZwS TkkYBjwtyaVxHMcuwJ20AM1JHS3UFDs9tLvtJqWfHlH0jvuQ8v1DH5rsi3D9IN4lEXU+ h7nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iklOyQxjWgNjCyrLUhjSPyNTYPSIGLopYzXUT0GBvxk=; b=tWxXefFLPgwgjMf33WsZ0PqZN7jDyMOu1t/QMp4nA1dQHmfTQSsJPGkplZGWpGuZ+f hg60pW4A+/WFhQeNxnGtBxATKdx6yA/fiiQdeLNnURInOqG6/i44EhnnZVDjKxTExtG/ Og0wc5KhdwS+v/qHLHTFLgbIU0EW/FT88T9ZMxvZGqa5joB4p75yOt+k1TmWhtouC58o 4lzUMtVUdpuEJVB8MlkhCiq00RSmzZb8tzAPw+t8a25oyKFDug/U6Z3RoZzgEfiMf6tZ xDmJf5w6xX/qPq55vD5tMbjuM6SG7OWpb2vjdZxr/9EFBlSlZYKF9Xy7kbQ0XAhQjKmp 0F3w== X-Gm-Message-State: AFqh2kqWYTPGG4mmw89jwCcNBXSCCEEEgotaVBj9nONvVeWxKTJYq2kH RIRo7tWf71An5n4vRnxuTs3Qb+x8vu+ssfBF X-Google-Smtp-Source: AMrXdXu8GCmjjGNwIBIm4Kap4wmcv6VV+5I1Fib5C/CKJmaqjN9Gbbl9R8XFG+idw523KBlGSwJGkQ== X-Received: by 2002:a05:6e02:1d18:b0:30d:93f7:9b5f with SMTP id i24-20020a056e021d1800b0030d93f79b5fmr14333686ila.22.1673388561563; Tue, 10 Jan 2023 14:09:21 -0800 (PST) Received: from crass-HP-ZBook-15-G2.lan ([199.254.238.56]) by smtp.gmail.com with ESMTPSA id c3-20020a029603000000b0038ac01fb3bcsm3980811jai.14.2023.01.10.14.09.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 14:09:20 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Patrick Steinhardt , Glenn Washburn Subject: [PATCH 3/6] grub-shell: Allow specifying non-default trim line contents Date: Tue, 10 Jan 2023 16:08:57 -0600 Message-Id: <20230110220900.1248367-4-development@efficientek.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230110220900.1248367-1-development@efficientek.com> References: <20230110220900.1248367-1-development@efficientek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::12d; envelope-from=development@efficientek.com; helo=mail-il1-x12d.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.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2023 22:09:24 -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 e5d34d1d35..585f0d066e 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. @@ -226,8 +227,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=*) @@ -353,8 +359,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 @@ -479,8 +483,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.34.1