feat(pveupgrade): adding a kernel update

Added removal of old kernels and installation of new kernel versions.'update-kernel' checks if the new kernel is installed correctly and displays a message asking to reboot the system.
This commit is contained in:
Константин Козориз 2024-11-08 12:09:29 +03:00
parent 2ab397b671
commit 3bc3c5d5bb

View File

@ -59,20 +59,13 @@ if (!$st || (time() - $st->mtime) > (3*24*3600)) {
print "Your System is up-to-date\n\n";
}
my $newkernel;
foreach my $p (@$oldlist) {
if (($p->{Package} =~ m/^(?:pve|proxmox)-kernel/) &&
!grep { $_->{Package} eq $p->{Package} } @$pkglist) {
$newkernel = 1;
last;
}
}
print "Removing old kernels...\n";
system('remove-old-kernels');
if ($newkernel) {
print "\n";
print "Seems you installed a kernel update - Please consider rebooting\n" .
"this node to activate the new kernel.\n\n";
}
print "Updating kernel and modules...\n";
# Inside checks for kernel installation and asks for a reboot
system('update-kernel');
}