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