]> git.proxmox.com Git - pve-manager.git/commitdiff
pve5to6: add check for stock debian kernel package
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 12 May 2020 10:11:09 +0000 (12:11 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 12 May 2020 12:18:34 +0000 (14:18 +0200)
on current debian buster, stock kernel images recommend
firmware-linux-free which conflict with our pve-firmware package
which leads to apt wanting to remove promxox-ve

check for the meta package in the update check script

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/CLI/pve5to6.pm

index 42c41bbdf9f29dca2b8c9178e883aac58b056913..01a3a819d0934839d9a2374706bff194d5a020ef 100644 (file)
@@ -19,6 +19,7 @@ use PVE::Storage;
 use PVE::Tools qw(run_command $IPV4RE $IPV6RE);
 use PVE::QemuServer;
 
+use AptPkg::Cache;
 use Socket qw(AF_INET AF_INET6 inet_ntop);
 use Term::ANSIColor;
 
@@ -249,6 +250,19 @@ sub check_pve_packages {
        } else {
            log_warn("unexpected running and installed kernel '$kernel_ver'.");
        }
+
+    }
+    print "\nChecking for installed Debian Kernel..\n";
+    if(my $apt_cache = AptPkg::Cache->new()) {
+       my $p = $apt_cache->{'linux-image-amd64'};
+       if ($p && $p->{SelectedState} eq 'Install') {
+           log_fail("Stock Debian kernel package installed. Please remove package 'linux-image-amd64'.");
+       } else {
+           log_pass("Stock Debian kernel package not installed.");
+       }
+
+    } else {
+       log_fail("unable to initialize AptPkg::Cache\n");
     }
 }