linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frans Pop <elendil@planet.nl>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH 5a/5] deb-pkg: allow alternative hook scripts directory in .deb packages
Date: Wed, 1 Apr 2009 21:43:51 +0200	[thread overview]
Message-ID: <200904012143.52853.elendil@planet.nl> (raw)
In-Reply-To: <200904012133.37387.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>

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 1b8820f..dada305 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
 
@@ -61,8 +62,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
 
@@ -72,7 +76,7 @@ set -e
 export DEB_MAINT_PARAMS="\$@"
 
 test -d $debhookdir/$script.d && \\
-	run-parts --arg="$version" /etc/kernel/$script.d
+	run-parts --arg="$version" $debhookdir/$script.d
 exit 0
 EOF
 	chmod 755 "$tmpdir/DEBIAN/$script"

  parent reply	other threads:[~2009-04-01 19:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-01 19:33 [PATCH 0/5] Improve flexibility of deb-pkg target Frans Pop
2009-04-01 19:38 ` [PATCH 4/5] Frans Pop
2009-04-01 19:42 ` [PATCH 1/5] deb-pkg: minor general improvements in builddeb script Frans Pop
2009-04-01 21:38   ` maximilian attems
2009-04-01 19:43 ` [PATCH 2/5] deb-pkg: fix 'file not found' error when building .deb package for arm Frans Pop
2009-04-01 19:43 ` [PATCH 3/5] deb-pkg: pass Debian maintainer script parameters to packaging hook scripts Frans Pop
2009-04-01 21:41   ` maximilian attems
2009-04-01 19:43 ` Frans Pop [this message]
2009-04-01 21:42   ` [PATCH 5a/5] deb-pkg: allow alternative hook scripts directory in .deb packages maximilian attems
2009-04-01 19:44 ` [PATCH 5b/5] " Frans Pop
2009-04-01 21:43   ` maximilian attems
2009-04-01 20:24 ` [PATCH 0/5] Improve flexibility of deb-pkg target 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=200904012143.52853.elendil@planet.nl \
    --to=elendil@planet.nl \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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).