pve-kernel-lowlatency-qoup/debian/proxmox-kernel.postrm.in
Fabian Grünbichler 6e72c5b2b7 integrate meta packages and change prefix
long overdue, and avoids the issue of the meta packages version going down
after being folded in from the pve-kernel-meta repository.

the ABI needs to be bumped for every published kernel package now that modules
are signed, else the booted kernel image containing the public part of the
ephemeral signing key, and the on-disk (potentially upgraded in-place) signed
module files can disagree, and module loading would fail.

not changed (yet): git repository name, pve-firmware

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-08-01 14:27:29 +02:00

47 lines
1.2 KiB
Perl

#!/usr/bin/perl
use strict;
use warnings;
# Ignore all 'upgrade' invocations .
exit 0 if $ARGV[0] =~ /upgrade/;
my $imagedir = "/boot";
my $version = "@@KVNAME@@";
if (-d "/etc/kernel/postrm.d") {
print STDERR "Examining /etc/kernel/postrm.d.\n";
system (
"run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/postrm.d"
) && die "Failed to process /etc/kernel/postrm.d";
}
unlink "$imagedir/initrd.img-$version";
unlink "$imagedir/initrd.img-$version.bak";
unlink "/var/lib/initramfs-tools/$version";
# Ignore all invocations except when called on to purge.
exit 0 unless $ARGV[0] =~ /purge/;
my @files_to_remove = qw{
modules.dep modules.isapnpmap modules.pcimap
modules.usbmap modules.parportmap
modules.generic_string modules.ieee1394map
modules.ieee1394map modules.pnpbiosmap
modules.alias modules.ccwmap modules.inputmap
modules.symbols modules.ofmap
modules.seriomap modules.*.bin
modules.softdep modules.devname
};
foreach my $extra_file (@files_to_remove) {
for (glob("/lib/modules/$version/$extra_file")) {
unlink;
}
}
system ("rmdir", "/lib/modules/$version") if -d "/lib/modules/$version";
exit 0