Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jbNcI-0001S5-8D for mharc-grub-devel@gnu.org; Wed, 20 May 2020 08:14:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbNcH-0001Rg-09 for grub-devel@gnu.org; Wed, 20 May 2020 08:14:33 -0400 Received: from chiark.greenend.org.uk ([212.13.197.229]:49585) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jbNcF-0003xF-O1 for grub-devel@gnu.org; Wed, 20 May 2020 08:14:32 -0400 Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jbNcD-0001Rk-DA; Wed, 20 May 2020 13:14:29 +0100 From: Ian Jackson To: grub-devel@gnu.org Cc: xen-devel@lists.xenproject.org, Ian Jackson Subject: [GRUB PATCH 1/2] 20_linux_xen: Ignore xenpolicy and config files too Date: Wed, 20 May 2020 13:14:19 +0100 Message-Id: <20200520121420.7965-2-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200520121420.7965-1-ian.jackson@eu.citrix.com> References: <20200520121420.7965-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=212.13.197.229; envelope-from=ijackson@chiark.greenend.org.uk; helo=chiark.greenend.org.uk X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/20 08:07:52 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -38 X-Spam_score: -3.9 X-Spam_bar: --- X-Spam_report: (-3.9 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: Wed, 20 May 2020 12:14:33 -0000 "file_is_not_sym" currently only checks for xen-syms. Extend it to disregard xenpolicy (XSM policy files) and files ending .config (which are built by the Xen upstream build system in some configurations and can therefore end up in /boot). Rename the function accordingly, to "file_is_not_xen_garbage". Signed-off-by: Ian Jackson --- util/grub.d/20_linux_xen.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index 81e5f0d7e..30da49d66 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -181,10 +181,14 @@ if [ "x${linux_list}" = "x" ] ; then exit 0 fi -file_is_not_sym () { +file_is_not_xen_garbage () { case "$1" in */xen-syms-*) return 1;; + */xenpolicy-*) + return 1;; + */*.config) + return 1;; *) return 0;; esac @@ -192,7 +196,7 @@ file_is_not_sym () { xen_list= for i in /boot/xen*; do - if grub_file_is_not_garbage "$i" && file_is_not_sym "$i" ; then xen_list="$xen_list $i" ; fi + if grub_file_is_not_garbage "$i" && file_is_not_xen_garbage "$i" ; then xen_list="$xen_list $i" ; fi done prepare_boot_cache= boot_device_id= -- 2.20.1