public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-kernel-meta 5/5] proxmox-boot: status: print present kernel versions
Date: Wed,  7 Jul 2021 23:09:54 +0200	[thread overview]
Message-ID: <20210707210954.765260-6-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20210707210954.765260-1-s.ivanov@proxmox.com>

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@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





  parent reply	other threads:[~2021-07-07 21:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 21:09 [pve-devel] [PATCH pve-kernel-meta 0/5] proxmox-boot-tool improvements Stoiko Ivanov
2021-07-07 21:09 ` [pve-devel] [PATCH pve-kernel-meta 1/5] proxmox-boot: ignore call to grub-install from grub maintscripts Stoiko Ivanov
2021-07-07 21:09 ` [pve-devel] [PATCH pve-kernel-meta 2/5] proxmox-boot: divert call to grub-install to p-b-t init Stoiko Ivanov
2021-07-08  7:06   ` Fabian Grünbichler
2021-07-07 21:09 ` [pve-devel] [PATCH pve-kernel-meta 3/5] proxmox-boot: maintscript: change logic whether to add diversion Stoiko Ivanov
2021-07-07 21:09 ` [pve-devel] [PATCH pve-kernel-meta 4/5] proxmox-boot: print current boot mode with status output Stoiko Ivanov
2021-07-07 21:09 ` Stoiko Ivanov [this message]
2021-07-08  8:05 ` [pve-devel] applied-series: [PATCH pve-kernel-meta 0/5] proxmox-boot-tool improvements Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210707210954.765260-6-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal