From patchwork Wed Apr 22 23:10:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frans Pop X-Patchwork-Id: 19447 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3MN8b5l031480 for ; Wed, 22 Apr 2009 23:10:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751192AbZDVXKP (ORCPT ); Wed, 22 Apr 2009 19:10:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751732AbZDVXKO (ORCPT ); Wed, 22 Apr 2009 19:10:14 -0400 Received: from Cpsmtpm-eml107.kpnxchange.com ([195.121.3.11]:64929 "EHLO CPSMTPM-EML107.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751192AbZDVXKN (ORCPT ); Wed, 22 Apr 2009 19:10:13 -0400 Received: from aragorn.fjphome.nl ([84.85.147.182]) by CPSMTPM-EML107.kpnxchange.com with Microsoft SMTPSVC(7.0.6001.18000); Thu, 23 Apr 2009 01:10:12 +0200 From: Frans Pop To: linux-kbuild@vger.kernel.org Subject: [PATCH 6/14] deb-pkg: allow alternative hook scripts directory in .deb packages Date: Thu, 23 Apr 2009 01:10:10 +0200 User-Agent: KMail/1.9.9 Cc: Sam Ravnborg , maximilian attems , Andres Salomon References: <200904230034.59627.elendil@planet.nl> In-Reply-To: <200904230034.59627.elendil@planet.nl> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200904230110.11919.elendil@planet.nl> X-OriginalArrivalTime: 22 Apr 2009 23:10:12.0232 (UTC) FILETIME=[7D120880:01C9C39F] Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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 Cc: maximilian attems Cc: Andres Salomon --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 < "$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"