debian: update postinst, postrm and prerm script style
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
6d345395f3
commit
920c82fb9b
10
debian/pve-kernel.postinst.in
vendored
10
debian/pve-kernel.postinst.in
vendored
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/perl -w
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# Ignore all invocations except when called on to configure.
|
||||
exit 0 unless $ARGV[0] =~ /configure/;
|
||||
@ -16,10 +17,9 @@ system("depmod $version");
|
||||
|
||||
if (-d "/etc/kernel/postinst.d") {
|
||||
print STDERR "Examining /etc/kernel/postinst.d.\n";
|
||||
system ("run-parts --verbose --exit-on-error --arg=$version " .
|
||||
"--arg=$imagedir/vmlinuz-$version " .
|
||||
"/etc/kernel/postinst.d") &&
|
||||
die "Failed to process /etc/kernel/postinst.d";
|
||||
system(
|
||||
"run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/postinst.d"
|
||||
) && die "Failed to process /etc/kernel/postinst.d";
|
||||
}
|
||||
|
||||
exit 0
|
||||
|
28
debian/pve-kernel.postrm.in
vendored
28
debian/pve-kernel.postrm.in
vendored
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/perl -w
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# Ignore all 'upgrade' invocations .
|
||||
exit 0 if $ARGV[0] =~ /upgrade/;
|
||||
@ -11,10 +12,9 @@ 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";
|
||||
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";
|
||||
@ -25,15 +25,15 @@ unlink "/var/lib/initramfs-tools/$version";
|
||||
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
|
||||
};
|
||||
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")) {
|
||||
|
10
debian/pve-kernel.prerm.in
vendored
10
debian/pve-kernel.prerm.in
vendored
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/perl -w
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# Ignore all invocations uxcept when called on to remove
|
||||
exit 0 unless ($ARGV[0] && $ARGV[0] =~ /remove/) ;
|
||||
@ -14,10 +15,9 @@ my $version = "@@KVNAME@@";
|
||||
|
||||
if (-d "/etc/kernel/prerm.d") {
|
||||
print STDERR "Examining /etc/kernel/prerm.d.\n";
|
||||
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";
|
||||
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";
|
||||
}
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user