Skip to contentSkip to conversation

kbuild: allow to specify a custom revision for .deb packages

PATCH In review Frans Pop 2 participants 4 messages Feb 13, 2008 – Feb 15, 2008 Kbuild

lore
Share & tools
lore

Frans Pop

author
#0 lore raw

PATCH 1/1 kbuild: allow to specify a custom revision for .deb packages

From: Frans Pop <[email protected]>

Allow to specify a custom revision for the generated .deb package by exporting the environment variable KERNELDEBREVISION.

scripts/package/builddeb +6 -1
index ba6bf5d..2577dec 100644
@@ -14,6 +14,11 @@ set -e
 # Some variables and settings used throughout the script
 version=$KERNELRELEASE
 revision=`cat .version`
+if [ x"$KERNELDEBREVISION" = x ]; then
+	debrevision=$version-$revision
+else
+	debrevision=$KERNELDEBREVISION
+fi
 tmpdir="$objtree/debian/tmp"
 packagename=linux-$version
 
@@ -66,7 +71,7 @@ done
 name="Kernel Compiler <$(id -nu)@$(hostname -f)>"
 # Generate a simple changelog template
 cat <<EOF > debian/changelog
-linux ($version-$revision) unstable; urgency=low
+linux ($debrevision) unstable; urgency=low
 
   * A standard release
 
author
#1 lore raw

PATCH 1/1 kbuild: allow alternative hook script dir in .deb packages

From: Frans Pop <[email protected]>

Hook scripts in the default directory /etc/kernel are also executed by packages created using make-kpkg (including official Debian kernels). Allow to specify an alternative hook scripts directory by exporting the environment variable KERNELDEBHOOKDIR so that this can be avoided.

scripts/package/builddeb +5 -2
index 2577dec..c76bbf1 100644
@@ -55,14 +55,17 @@ if grep -q '^CONFIG_MODULES=y' .config ; then
 fi
 
 # Install the maintainer scripts
+# Note: hook scripts under /etc/kernel are also executed by kernel packages
+# built using make-kpkg (from the "kernelpackage" package)
+debhookdir=${KERNELDEBHOOKDIR:-/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
 
 set -e
 
-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"
#2 lore raw

Re: [PATCH] kbuild: allow alternative hook script dir in .deb packages

Quoted 7 lines · Frans Pop

From: Frans Pop <[email protected]>

Hook scripts in the default directory /etc/kernel are also executed by packages created using make-kpkg (including official Debian kernels). Allow to specify an alternative hook scripts directory by exporting the environment variable KERNELDEBHOOKDIR so that this can be avoided.

Do we have similar hook scripts for rpm for instance? If we have then a deb specific solution is not acceptable, we would need something that works across all packages.

Does this btw have to be an environment variable? Why not make it a config option?

Sam

#3 lore raw
In reply to Frans Pop
Quoted 4 lines · Frans Pop

From: Frans Pop <[email protected]>

Allow to specify a custom revision for the generated .deb package by exporting the environment variable KERNELDEBREVISION.

If this is needed I think we need such functionality across all package targets.
So please try to come up with a solution that would fit rpm as well as deb.

Sam