[pve-devel] [PATCH kernel-meta 09/13] efiboot: move kernel CMDLINE check

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jul 10 17:05:07 CEST 2019


from global scope to where it is actually used, otherwise this gets
called/printed too often/early.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 efiboot/zz-pve-efiboot | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/efiboot/zz-pve-efiboot b/efiboot/zz-pve-efiboot
index 560856f..134d4ab 100755
--- a/efiboot/zz-pve-efiboot
+++ b/efiboot/zz-pve-efiboot
@@ -32,13 +32,6 @@ trap cleanup EXIT INT TERM QUIT
 
 BOOT_KVERS="$(boot_kernel_list "$@")"
 
-if [ -f /etc/kernel/cmdline ]; then
-	CMDLINE="$(cat /etc/kernel/cmdline)"
-else
-	warn "No /etc/kernel/cmdline found - falling back to /proc/cmdline"
-	CMDLINE="$(cat /proc/cmdline)"
-fi
-
 potential_esps(){
 	lsblk --list -o PATH,UUID,FSTYPE,PARTTYPE,MOUNTPOINT |
 	awk '$3 == "vfat" && $4 == "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" && $5 == "" {print $1,$2}'
@@ -52,6 +45,13 @@ update_esps() {
 	    warn "${esps}"
 	    exit 1
 	fi
+	if [ -f /etc/kernel/cmdline ]; then
+		CMDLINE="$(cat /etc/kernel/cmdline)"
+	else
+		warn "No /etc/kernel/cmdline found - falling back to /proc/cmdline"
+		CMDLINE="$(cat /proc/cmdline)"
+	fi
+
 	cat "${ESP_LIST}" | while IFS= read -r uuid; do
 		if ! (echo "${uuid}" | grep -qE '[0-9a-fA-F]{4}-[0-9a-fA-F]{4}'); then
 			warn "WARN: ${uuid} read from ${ESP_LIST} does not look like a VFAT-UUID - skipping"
-- 
2.20.1





More information about the pve-devel mailing list