Commit e4813f7a authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Juerg Haefliger
parent fa02bafe
...@@ -27,7 +27,7 @@ Architecture: ARCH ...@@ -27,7 +27,7 @@ Architecture: ARCH
Section: kernel Section: kernel
Priority: optional Priority: optional
Provides: linux-image, fuse-module, =PROVIDES=${linux:rprovides} Provides: linux-image, fuse-module, =PROVIDES=${linux:rprovides}
Depends: ${misc:Depends}, ${shlibs:Depends}, kmod Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base
Recommends: BOOTLOADER, initramfs-tools | linux-initramfs-tool Recommends: BOOTLOADER, initramfs-tools | linux-initramfs-tool
Suggests: fdutils, SRCPKGNAME-doc-PKGVER | SRCPKGNAME-source-PKGVER, SRCPKGNAME-tools, linux-headers-PKGVER-ABINUM-FLAVOUR Suggests: fdutils, SRCPKGNAME-doc-PKGVER | SRCPKGNAME-source-PKGVER, SRCPKGNAME-tools, linux-headers-PKGVER-ABINUM-FLAVOUR
Description: Linux kernel image for version PKGVER on DESC Description: Linux kernel image for version PKGVER on DESC
......
#!/bin/sh
set -e
case "$0::$1" in
*.postinst::configure|*.postrm::remove)
depmod -a -F /boot/System.map-=V =V || true
for dir in "/etc/kernel/postinst.d" "/etc/kernel/postinst.d/=V"
do
if [ -d "$dir" ]; then
run-parts --verbose --exit-on-error --arg="=V" --arg="/boot/=K-=V" "$dir"
fi
done
;;
esac
#!/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 : Sat Aug 5 13:20:22 2006
# Last Machine Used: glaurung.internal.golden-gryphon.com
# Update Count : 45
# Status : Unknown, Use with caution!
# HISTORY :
# Description :
#
#
#
# arch-tag: 1c716174-2f0a-476d-a626-a1322e62503a
#
$|=1;
# Predefined values:
my $version = "=V";
my $kimage = "=K";
my $package_name = "linux-image-$version";
# Ignore all invocations uxcept when called on to configure.
exit 0 unless ($ARGV[0] && $ARGV[0] =~ /configure/);
#known variables
my $image_dest = "/";
my $realimageloc = "/boot/";
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;
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*$/;
$header_postinst_hook = "$1" if /^\s*header_postinst_hook\s*=\s*(\S+)/ig;
}
close CONF;
}
}
sub exec_script {
my $type = shift;
my $script = shift;
print STDERR "Running $type hook script $script.\n";
system ("$script $version $realimageloc$kimage-$version") &&
print STDERR "User $type hook script [$script] ";
if ($?) {
if ($? == -1) {
print STDERR "failed to execute: $!\n";
}
elsif ($? & 127) {
printf STDERR "died with signal %d, %s coredump\n",
($? & 127), ($? & 128) ? 'with' : 'without';
}
else {
printf STDERR "exited with value %d\n", $? >> 8;
}
exit $? >> 8;
}
}
sub run_hook {
my $type = shift;
my $script = shift;
if ($script =~ m,^/,) {
# Full path provided for the hook script
if (-x "$script") {
&exec_script($type,$script);
}
else {
die "The provided $type hook script [$script] could not be run.\n";
}
}
else {
# Look for it in a safe path
for my $path ('/bin', '/sbin', '/usr/bin', '/usr/sbin') {
if (-x "$path/$script") {
&exec_script($type, "$path/$script");
return 0;
}
}
# No luck
print STDERR "Could not find $type hook script [$script].\n";
die "Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'\n";
}
}
## Run user hook script here, if any
if (-x "$header_postinst_hook") {
&run_hook("postinst", $header_postinst_hook);
}
if (-d "/etc/kernel/header_postinst.d") {
print STDERR "Examining /etc/kernel/header_postinst.d.\n";
system ("run-parts --verbose --exit-on-error --arg=$version " .
"--arg=$realimageloc$kimage-$version " .
"/etc/kernel/header_postinst.d") &&
die "Failed to process /etc/kernel/header_postinst.d";
}
if (-d "/etc/kernel/header_postinst.d/$version") {
print STDERR "Examining /etc/kernel/header_postinst.d/$version.\n";
system ("run-parts --verbose --exit-on-error --arg=$version " .
"--arg=$realimageloc$kimage-$version " .
"/etc/kernel/header_postinst.d/$version") &&
die "Failed to process /etc/kernel/header_postinst.d/$version";
}
exit 0;
__END__
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -81,6 +81,18 @@ define install_zfs = ...@@ -81,6 +81,18 @@ define install_zfs =
$(kmake) -C $(builddir)/build-$* SUBDIRS=`pwd` modules_install $(zfsopts) $(kmake) -C $(builddir)/build-$* SUBDIRS=`pwd` modules_install $(zfsopts)
endef endef
define install_control =
for which in $(3); \
do \
template="$(DROOT)/templates/$(2).$$which.in"; \
script="$(DROOT)/$(1).$$which"; \
sed -e 's/@abiname@/$(abi_release)/g' \
-e 's/@localversion@/-$*/g' \
-e 's/@image-stem@/$(instfile)/g' \
<"$$template" >"$$script"; \
done
endef
# Install the finished build # Install the finished build
install-%: pkgdir = $(CURDIR)/debian/$(bin_pkg_name)-$* install-%: pkgdir = $(CURDIR)/debian/$(bin_pkg_name)-$*
install-%: pkgdir_ex = $(CURDIR)/debian/$(extra_pkg_name)-$* install-%: pkgdir_ex = $(CURDIR)/debian/$(extra_pkg_name)-$*
...@@ -228,24 +240,12 @@ endif ...@@ -228,24 +240,12 @@ endif
$(pkgdir)/lib/modules/$(abi_release)-$*/initrd/; \ $(pkgdir)/lib/modules/$(abi_release)-$*/initrd/; \
fi fi
# Now the image scripts $(call install_control,$(bin_pkg_name)-$*,image,postinst postrm preinst prerm)
install -d $(pkgdir)/DEBIAN
for script in postinst postrm preinst prerm; do \
sed -e 's/=V/$(abi_release)-$*/g' -e 's/=K/$(instfile)/g' \
-e 's/=L/$(loader)/g' -e 's@=B@$(build_arch)@g' \
$(DROOT)/control-scripts/$$script > $(pkgdir)/DEBIAN/$$script; \
chmod 755 $(pkgdir)/DEBIAN/$$script; \
done
ifeq ($(do_extras_package),true) ifeq ($(do_extras_package),true)
# Install the postinit/postrm scripts in the extras package. # Install the postinit/postrm scripts in the extras package.
if [ -f $(DEBIAN)/control.d/$(target_flavour).inclusion-list ] ; then \ if [ -f $(DEBIAN)/control.d/$(target_flavour).inclusion-list ] ; then \
install -d $(pkgdir_ex)/DEBIAN; \ $(call install_control,$(extra_pkg_name)-$*,extra,postinst postrm); \
for script in postinst postrm ; do \
sed -e 's/=V/$(abi_release)-$*/g' -e 's/=K/$(instfile)/g' \
-e 's/=L/$(loader)/g' -e 's@=B@$(build_arch)@g' \
debian/control-scripts/extra-post > $(pkgdir_ex)/DEBIAN/$$script; \
chmod 755 $(pkgdir_ex)/DEBIAN/$$script; \
done; \
fi fi
endif endif
...@@ -264,16 +264,7 @@ ifneq ($(skipsub),true) ...@@ -264,16 +264,7 @@ ifneq ($(skipsub),true)
/sbin/depmod -b debian/$(bin_pkg_name)-$$sub \ /sbin/depmod -b debian/$(bin_pkg_name)-$$sub \
-ea -F debian/$(bin_pkg_name)-$$sub/boot/System.map-$(abi_release)-$* \ -ea -F debian/$(bin_pkg_name)-$$sub/boot/System.map-$(abi_release)-$* \
$(abi_release)-$*; \ $(abi_release)-$*; \
install -d debian/$(bin_pkg_name)-$$sub/DEBIAN; \ $(call install_control,$(bin_pkg_name)--$$sub,image,postinst postrm preinst prerm); \
for script in postinst postrm preinst prerm; do \
sed -e 's/=V/$(abi_release)-$*/g' \
-e 's/=K/$(instfile)/g' \
-e 's/=L/$(loader)/g' \
-e 's@=B@$(build_arch)@g' \
$(DROOT)/control-scripts/$$script > \
debian/$(bin_pkg_name)-$$sub/DEBIAN/$$script;\
chmod 755 debian/$(bin_pkg_name)-$$sub/DEBIAN/$$script;\
done; \
done done
endif endif
...@@ -338,13 +329,7 @@ endif ...@@ -338,13 +329,7 @@ endif
$(hdrdir)/Module.symvers $(hdrdir)/Module.symvers
# Now the header scripts # Now the header scripts
install -d $(CURDIR)/debian/$(basepkg)-$*/DEBIAN $(call install_control,$(hdrs_pkg_name)-$*,headers,postinst)
for script in postinst; do \
sed -e 's/=V/$(abi_release)-$*/g' -e 's/=K/$(instfile)/g' \
$(DROOT)/control-scripts/headers-$$script > \
$(CURDIR)/debian/$(basepkg)-$*/DEBIAN/$$script; \
chmod 755 $(CURDIR)/debian/$(basepkg)-$*/DEBIAN/$$script; \
done
# At the end of the package prep, call the tests # At the end of the package prep, call the tests
DPKG_ARCH="$(arch)" KERN_ARCH="$(build_arch)" FLAVOUR="$*" \ DPKG_ARCH="$(arch)" KERN_ARCH="$(build_arch)" FLAVOUR="$*" \
......
#!/bin/sh
set -e
version=@abiname@@localversion@
image_path=/boot/@image-stem@-$version
if [ "$1" != configure ]; then
exit 0
fi
depmod -a -F /boot/System.map-$version $version || true
if [ -d /etc/kernel/postinst.d ]; then
DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
--arg="$image_path" /etc/kernel/postinst.d
fi
exit 0
#!/bin/sh
set -e
version=@abiname@@localversion@
image_path=/boot/@image-stem@-$version
if [ "$1" != remove ]; then
exit 0
fi
depmod -a -F /boot/System.map-$version $version 2>/dev/null || true
if [ -d /etc/kernel/postinst.d ]; then
DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
--arg="$image_path" /etc/kernel/postinst.d
fi
exit 0
#!/bin/sh
set -e
version=@abiname@@localversion@
if [ "$1" != configure ]; then
exit 0
fi
if [ -d /etc/kernel/headers_postinst.d ]; then
DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
/etc/kernel/headers_postinst.d
fi
exit 0
#!/bin/sh
set -e
version=@abiname@@localversion@
image_path=/boot/@image-stem@-$version
if [ "$1" != configure ]; then
exit 0
fi
depmod $version
if [ -f /lib/modules/$version/.fresh-install ]; then
change=install
else
change=upgrade
fi
linux-update-symlinks $change $version $image_path
rm -f /lib/modules/$version/.fresh-install
if [ -d /etc/kernel/postinst.d ]; then
DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
--arg=$image_path /etc/kernel/postinst.d
fi
exit 0
#!/bin/sh
set -e
version=@abiname@@localversion@
image_path=/boot/@image-stem@-$version
rm -f /lib/modules/$version/.fresh-install
if [ "$1" != upgrade ] && command -v linux-update-symlinks >/dev/null; then
linux-update-symlinks remove $version $image_path
fi
if [ -d /etc/kernel/postrm.d ]; then
DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
--arg=$image_path /etc/kernel/postrm.d
fi
if [ "$1" = purge ]; then
for extra_file in 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; do
eval rm -f /lib/modules/$version/$extra_file
done
rmdir /lib/modules/$version || true
fi
exit 0
#!/bin/sh
set -e
version=@abiname@@localversion@
image_path=/boot/@image-stem@-$version
if [ "$1" = abort-upgrade ]; then
exit 0
fi
if [ "$1" = install ]; then
# Create a flag file for postinst
mkdir -p /lib/modules/$version
touch /lib/modules/$version/.fresh-install
fi
if [ -d /etc/kernel/preinst.d ]; then
DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
--arg=$image_path /etc/kernel/preinst.d
fi
exit 0
#!/bin/sh
set -e
version=@abiname@@localversion@
image_path=/boot/@image-stem@-$version
if [ "$1" != remove ]; then
exit 0
fi
linux-check-removal $version
if [ -d /etc/kernel/prerm.d ]; then
DEB_MAINT_PARAMS="$*" run-parts --report --exit-on-error --arg=$version \
--arg=$image_path /etc/kernel/prerm.d
fi
exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment