From: Frans Pop <elendil@planet.nl>
To: linux-kbuild@vger.kernel.org
Cc: Sam Ravnborg <sam@ravnborg.org>, maximilian attems <max@stro.at>,
Andres Salomon <dilinger@debian.org>
Subject: [PATCH 6/14] deb-pkg: allow alternative hook scripts directory in .deb packages
Date: Thu, 23 Apr 2009 01:10:10 +0200 [thread overview]
Message-ID: <200904230110.11919.elendil@planet.nl> (raw)
In-Reply-To: <200904230034.59627.elendil@planet.nl>
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>
Cc: maximilian attems <max@stro.at>
Cc: Andres Salomon <dilinger@debian.org>
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 5868c0f..c01f812 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -6,8 +6,9 @@
# Simple script to generate a deb package for a Linux kernel. All the
# complexity of what to do with a kernel after it is installed or removed
# is left to other scripts and packages: they can install scripts in the
-# /etc/kernel/{pre,post}{inst,rm}.d/ directories that will be called on
-# package install and removal.
+# /etc/kernel/{pre,post}{inst,rm}.d/ directories (or an alternative location
+# specified in KDEB_HOOKDIR) that will be called on package install and
+# removal.
set -e
@@ -73,8 +74,11 @@ if grep -q '^CONFIG_MODULES=y' .config ; then
fi
# Install the maintainer scripts
+# Note: hook scripts under /etc/kernel are also executed by official Debian
+# kernel packages, as well as kernel packages built using make-kpkg
+debhookdir=${KDEB_HOOKDIR:-/etc/kernel}
for script in postinst postrm preinst prerm ; do
- mkdir -p "$tmpdir/etc/kernel/$script.d"
+ mkdir -p "$tmpdir$debhookdir/$script.d"
cat <<EOF > "$tmpdir/DEBIAN/$script"
#!/bin/sh
@@ -83,7 +87,7 @@ set -e
# Pass maintainer script parameters to hook scripts
export DEB_MAINT_PARAMS="\$@"
-test -d /etc/kernel/$script.d && run-parts --arg="$version" /etc/kernel/$script.d
+test -d $debhookdir/$script.d && run-parts --arg="$version" $debhookdir/$script.d
exit 0
EOF
chmod 755 "$tmpdir/DEBIAN/$script"
next prev parent reply other threads:[~2009-04-22 23:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-22 22:34 [PATCH 0/14] deb-pkg target improvements Frans Pop
2009-04-22 23:08 ` [PATCH 1/14] deb-pkg: minor general improvements in builddeb script Frans Pop
2009-04-22 23:08 ` [PATCH 2/14] deb-pkg: refactor code to reduce duplication Frans Pop
2009-04-22 23:09 ` [PATCH 3/14] deb-pkg: fix 'file not found' error when building .deb package for arm Frans Pop
2009-04-22 23:09 ` [PATCH 4/14] deb-pkg: pass Debian maintainer script parameters to packaging hook scripts Frans Pop
2009-04-22 23:09 ` [PATCH 5/14] deb-pkg: allow to specify a custom revision for .deb packages Frans Pop
2009-04-22 23:10 ` Frans Pop [this message]
2009-04-22 23:10 ` [PATCH 7/14] dep-pkg: improve changelog entry and package descriptions Frans Pop
2009-04-22 23:11 ` [PATCH 8/14] deb-pkg: generate debian/copyright file Frans Pop
2009-04-24 17:08 ` [PATCH 8/14 v2] " Frans Pop
2009-04-22 23:11 ` [PATCH 9/14] deb-pkg: improve maintainer identification Frans Pop
2009-04-22 23:11 ` [PATCH 10/14] deb-pkg: improve Source field Frans Pop
2009-04-22 23:12 ` [PATCH 11/14] deb-pkg: fix generated package name Frans Pop
2009-04-22 23:12 ` [PATCH 12/14] deb-pkg: fix Provides field Frans Pop
2009-04-22 23:12 ` [PATCH 13/14] deb-pkg: fix Section field Frans Pop
2009-04-22 23:12 ` [PATCH 14/14] deb-pkg: bump standards version Frans Pop
2009-04-23 9:14 ` [PATCH 0/14] deb-pkg target improvements maximilian attems
2009-05-01 11:38 ` Sam Ravnborg
2009-05-04 15:17 ` maximilian attems
2009-05-04 15:25 ` Sam Ravnborg
2009-05-05 9:17 ` maximilian attems
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200904230110.11919.elendil@planet.nl \
--to=elendil@planet.nl \
--cc=dilinger@debian.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=max@stro.at \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).