public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH stable-7 manager] pve7to8: Add check for dkms modules
Date: Fri, 23 Jun 2023 15:28:01 +0200	[thread overview]
Message-ID: <20230623132801.208037-1-c.ebner@proxmox.com> (raw)

... and warn if at least one is present.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 PVE/CLI/pve7to8.pm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/PVE/CLI/pve7to8.pm b/PVE/CLI/pve7to8.pm
index da1e15bc..ecfb4011 100644
--- a/PVE/CLI/pve7to8.pm
+++ b/PVE/CLI/pve7to8.pm
@@ -1287,6 +1287,40 @@ sub check_bootloader {
     }
 }
 
+sub check_dkms_modules {
+    log_info("Check if dkms is installed...");
+
+    my $path;
+    my $filter_path = sub {
+	$path = shift;
+	chomp $path;
+    };
+
+    run_command(['which', 'dkms'], outfunc => $filter_path, noerr => 1);
+
+    if (!$path) {
+	log_skip("dkms not installed, no need to check for installed modules");
+	return;
+    }
+
+    log_info("Check for installed dkms modules...");
+
+    my $count;
+    my $set_count = sub {
+	$count = scalar @_;
+    };
+
+    eval {
+	run_command(['dkms', 'status', '-k', '`uname -r`'], outfunc => $set_count, noerr => 1);
+    };
+
+    if (!$count) {
+	log_pass("no dkms modules found");
+    } else {
+	log_warn("dkms modules found, this might cause issues during upgrade.");
+    }
+}
+
 sub check_misc {
     print_header("MISCELLANEOUS CHECKS");
     my $ssh_config = eval { PVE::Tools::file_get_contents('/root/.ssh/config') };
@@ -1388,6 +1422,7 @@ sub check_misc {
     check_apt_repos();
     check_nvidia_vgpu_service();
     check_bootloader();
+    check_dkms_modules();
 }
 
 my sub colored_if {
-- 
2.39.2





             reply	other threads:[~2023-06-23 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-23 13:28 Christian Ebner [this message]
2023-06-23 15:38 ` 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=20230623132801.208037-1-c.ebner@proxmox.com \
    --to=c.ebner@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