[pve-devel] [PATCH pve-kernel-meta 5/5] proxmox-boot: status: print present kernel versions

Stoiko Ivanov s.ivanov at proxmox.com
Wed Jul 7 23:09:54 CEST 2021


gives a better overview in case the system was switched at one time
from uefi to legacy (or the other way around).

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 bin/proxmox-boot-tool | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/bin/proxmox-boot-tool b/bin/proxmox-boot-tool
index 1e984d6..93760fb 100755
--- a/bin/proxmox-boot-tool
+++ b/bin/proxmox-boot-tool
@@ -353,16 +353,18 @@ _status_detail() {
 
 	result=""
 	if [ -f "${mountpoint}/$PMX_LOADER_CONF" ]; then
-		result="uefi"
 		if [ ! -d "${mountpoint}/$PMX_ESP_DIR" ]; then
 			warn "${path}/$PMX_ESP_DIR does not exist"
 		fi
+		versions_uefi=$(ls -1 ${mountpoint}/$PMX_ESP_DIR | awk '{printf (NR>1?", ":"") $0}')
+		result="uefi (versions: ${versions_uefi})"
 	fi
 	if [ -d "${mountpoint}/grub" ]; then
+		versions_grub=$(ls -1 ${mountpoint}/vmlinuz-* | awk '{ gsub(/.*\/vmlinuz-/, ""); printf (NR>1?", ":"") $0 }')
 		if [ -n "$result" ]; then
-		    result="${result},grub"
+		    result="${result}, grub (versions: ${versions_grub})"
 		else
-		    result="grub"
+		    result="grub (versions: ${versions_grub})"
 		fi
 	fi
 	echo "$curr_uuid is configured with: $result"
-- 
2.30.2






More information about the pve-devel mailing list