Repository URL to install this package:
|
Version:
4.6.0-rt1tickless-10.00.Custom ▾
|
linux-headers-4.6.0-rt1tickless
/
usr
/
src
/
linux-headers-4.6.0-rt1tickless
/
debian
/
pkg
/
source
/
prerm
|
|---|
#!/usr/bin/perl
# -*- Mode: Cperl -*-
# debian.postinst ---
# Author : Manoj Srivastava ( srivasta@pilgrim.umass.edu )
# Created On : Sat Apr 27 05:42:43 1996
# Created On Node : melkor.pilgrim.umass.edu
# Last Modified By : Manoj Srivastava
# Last Modified On : Mon Apr 13 14:23:50 2009
# Last Machine Used: anzu.internal.golden-gryphon.com
# Update Count : 44
# Status : Unknown, Use with caution!
# HISTORY :
# Description :
#
#
#
# arch-tag: bf48605d-f6e9-4df6-9be3-31017c6406df
#
$| = 1;
# Predefined values:
my $version = "=V";
my $move_image = ''; # target machine defined
my $kimage = "=K"; # Should be empty, mostly
my $image_dir = "=D"; # where the image is located
my $clobber_modules = ''; # target machine defined
my $postinst_hook = ''; #Normally we do not
my $postrm_hook = ''; #Normally we do not
my $preinst_hook = ''; #Normally we do not
my $prerm_hook = ''; #Normally we do not
my $ignore_depmod_err = ''; # normally we do not
my $relink_src_link = 'YES'; # There is no harm in checking the link
my $relink_build_link = 'YES'; # There is no harm in checking the link
my $force_build_link = ''; # There is no harm in checking the link
my $arch = "=A"; # should be same as dpkg --print-architecture
my $kernel_arch = "=B";
my $package_name = "=ST-src-$version";
my $kernel_pkg_version = "=KPV";
# Ignore all invocations uxcept when called on to configure.
exit 0 unless ( $ARGV[0] && $ARGV[0] =~ /configure/ );
#known variables
my $image_dest = "/";
my $realimageloc = "/$image_dir/";
my $have_conffile = "";
my $silent_modules = '';
my $modules_base = '/lib/modules';
my $CONF_LOC = '/etc/kernel-img.conf';
# remove multiple leading slashes; make sure there is at least one.
$realimageloc =~ s|^/*|/|o;
$realimageloc =~ s|/+|/|o;
my $architecture;
chomp( $architecture = `dpkg --print-architecture` );
$architecture = "ppc" if $architecture eq "powerpc";
$architecture = "parisc" if $architecture eq "hppa";
$architecture = "mips" if $architecture eq "mipsel";
$architecture = "x86_64" if $architecture eq "amd64";
my $stop_and_read = 0;
my $src_postinst_hook = '';
my $src_preinst_hook = '';
my $src_prerm_hook = '';
my $src_postrm_hook = '';
# most of our work is done in /usr/src.
chdir '/usr/src' or die "Could not chdir to /usr/src:$!";
if ( -r "$CONF_LOC" && -f "$CONF_LOC" ) {
if ( open( CONF, "$CONF_LOC" ) ) {
while (<CONF>) {
chomp;
s/\#.*$//g;
next if /^\s*$/;
$src_preinst_hook = "$1" if m/^\s*src_preinst_hook\s*=\s*(\S+)/i;
$src_postinst_hook = "$1" if m/^\s*src_postinst_hook\s*=\s*(\S+)/i;
$src_prerm_hook = "$1" if m/^\s*src_prerm_hook\s*=\s*(\S+)/i;
$src_postinst_hook = "$1" if m/^\s*src_postinst_hook\s*=\s*(\S+)/i;
} ## end while (<CONF>)
close CONF;
$have_conffile = "Yes";
} ## end if ( open( CONF, "$CONF_LOC"...))
} ## end if ( -r "$CONF_LOC" &&...)
# Set up the env variable containing our arguments
my $out;
for (@ARGV) {
s,','\\'',g;
$out .= " '$_'";
}
$ENV{'DEB_MAINT_PARAMS'} = "$out";
$ENV{'KERNEL_PACKAGE_VERSION'} = "$kernel_pkg_version";
## Run user hook script here, if any
if ( -d "/etc/kernel/src_prerm.d" ) {
print STDERR "Examining /etc/kernel/src_prerm.d.\n";
system( "run-parts --verbose --exit-on-error --arg=$version "
. "--arg=$realimageloc$kimage-$version "
. "/etc/kernel/src_prerm.d" )
&& die "Failed to process /etc/kernel/src_prerm.d";
} ## end if ( -d "/etc/kernel/src_prerm.d")
if ( -d "/etc/kernel/src_prerm.d/$version" ) {
print STDERR "Examining /etc/kernel/src_prerm.d/$version.\n";
system( "run-parts --verbose --exit-on-error --arg=$version "
. "--arg=$realimageloc$kimage-$version "
. "/etc/kernel/src_prerm.d/$version" )
&& die "Failed to process /etc/kernel/src_prerm.d/$version";
} ## end if ( -d "/etc/kernel/src_prerm.d/$version")
if ( -x "$src_prerm_hook" ) {
system( "$src_prerm_hook", $package, $version )
&& warn "User hook script $src_prerm_hook failed";
}
exit 0;
__END__