2023-06-13 16:14:15 +03:00
|
|
|
#!/usr/bin/perl
|
2017-03-15 16:43:11 +03:00
|
|
|
|
|
|
|
use strict;
|
2023-06-13 16:14:15 +03:00
|
|
|
use warnings;
|
2017-03-15 16:43:11 +03:00
|
|
|
|
|
|
|
# Ignore all invocations uxcept when called on to remove
|
|
|
|
exit 0 unless ($ARGV[0] && $ARGV[0] =~ /remove/) ;
|
|
|
|
|
|
|
|
# do nothing if run from proxmox installer
|
|
|
|
exit 0 if -e "/proxmox_install_mode";
|
|
|
|
|
|
|
|
my $imagedir = "/boot";
|
|
|
|
|
|
|
|
my $version = "@@KVNAME@@";
|
|
|
|
|
|
|
|
if (-d "/etc/kernel/prerm.d") {
|
|
|
|
print STDERR "Examining /etc/kernel/prerm.d.\n";
|
2023-06-13 16:14:15 +03:00
|
|
|
system(
|
|
|
|
"run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/prerm.d"
|
|
|
|
) && die "Failed to process /etc/kernel/prerm.d";
|
2017-03-15 16:43:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
exit 0
|