From 3bc3c5d5bb7b98ea22d868eb62281c3a7a7a39f8 Mon Sep 17 00:00:00 2001 From: kozorizki Date: Fri, 8 Nov 2024 12:09:29 +0300 Subject: [PATCH] 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. --- bin/pveupgrade | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/bin/pveupgrade b/bin/pveupgrade index 04b3f7ac3..569bb3601 100755 --- a/bin/pveupgrade +++ b/bin/pveupgrade @@ -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'); }