aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/package/builddeb
diff options
context:
space:
mode:
authorFrans Pop <elendil@planet.nl>2009-04-22 19:10:10 -0400
committerSam Ravnborg <sam@ravnborg.org>2009-06-09 16:37:37 -0400
commitfe233cb6bfd36fcf5a36bbde7fa116d8ab5f4301 (patch)
tree05ff7fb1b16a9715738dffc95320650c0b5233df /scripts/package/builddeb
parentc72c75db86cf9f53c4c0df6724c0cf06db017652 (diff)
kbuild, deb-pkg: allow alternative hook scripts directory in .deb packages
Hook scripts in the default directory /etc/kernel are also executed by official Debian kernel packages as well as kernel packages created using make-kpkg. Allow to specify an alternative hook scripts directory by exporting the environment variable KDEB_HOOKDIR. Signed-off-by: Frans Pop <elendil@planet.nl> Acked-by: maximilian attems <max@stro.at> Cc: Andres Salomon <dilinger@debian.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/package/builddeb')
-rw-r--r--scripts/package/builddeb12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 5868c0f2e613..c01f81287ce6 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -6,8 +6,9 @@
6# Simple script to generate a deb package for a Linux kernel. All the 6# Simple script to generate a deb package for a Linux kernel. All the
7# complexity of what to do with a kernel after it is installed or removed 7# complexity of what to do with a kernel after it is installed or removed
8# is left to other scripts and packages: they can install scripts in the 8# is left to other scripts and packages: they can install scripts in the
9# /etc/kernel/{pre,post}{inst,rm}.d/ directories that will be called on 9# /etc/kernel/{pre,post}{inst,rm}.d/ directories (or an alternative location
10# package install and removal. 10# specified in KDEB_HOOKDIR) that will be called on package install and
11# removal.
11 12
12set -e 13set -e
13 14
@@ -73,8 +74,11 @@ if grep -q '^CONFIG_MODULES=y' .config ; then
73fi 74fi
74 75
75# Install the maintainer scripts 76# Install the maintainer scripts
77# Note: hook scripts under /etc/kernel are also executed by official Debian
78# kernel packages, as well as kernel packages built using make-kpkg
79debhookdir=${KDEB_HOOKDIR:-/etc/kernel}
76for script in postinst postrm preinst prerm ; do 80for script in postinst postrm preinst prerm ; do
77 mkdir -p "$tmpdir/etc/kernel/$script.d" 81 mkdir -p "$tmpdir$debhookdir/$script.d"
78 cat <<EOF > "$tmpdir/DEBIAN/$script" 82 cat <<EOF > "$tmpdir/DEBIAN/$script"
79#!/bin/sh 83#!/bin/sh
80 84
@@ -83,7 +87,7 @@ set -e
83# Pass maintainer script parameters to hook scripts 87# Pass maintainer script parameters to hook scripts
84export DEB_MAINT_PARAMS="\$@" 88export DEB_MAINT_PARAMS="\$@"
85 89
86test -d /etc/kernel/$script.d && run-parts --arg="$version" /etc/kernel/$script.d 90test -d $debhookdir/$script.d && run-parts --arg="$version" $debhookdir/$script.d
87exit 0 91exit 0
88EOF 92EOF
89 chmod 755 "$tmpdir/DEBIAN/$script" 93 chmod 755 "$tmpdir/DEBIAN/$script"