* [PATCH v3] deb-pkg: add source package
@ 2015-06-11 8:11 riku.voipio
2015-08-19 13:36 ` Michal Marek
0 siblings, 1 reply; 5+ messages in thread
From: riku.voipio @ 2015-06-11 8:11 UTC (permalink / raw)
To: linux-kbuild, mmarek, debian-kernel
Cc: Riku Voipio, Chris J Arges, maximilian attems, Ben Hutchings
From: Riku Voipio <riku.voipio@linaro.org>
Make deb-pkg build both source and binary package like make rpm-pkg does.
For people who only need binary kernel package, there is now bindeb-pkg
target, same target also used to build the .deb files if built from the
source package using dpkg-buildpackage.
Generated source package will build the same kernel .config than what
was available for make deb-pkg. The name of the source package can
be set with KDEB_SOURCENAME enviroment variable.
The source package is useful for gpl compliance, or for feeding to a
automated debian package builder.
Cc: Chris J Arges <chris.j.arges@canonical.com>
Cc: maximilian attems <maks@stro.at>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
v3,
* Allow setting source package name with KDEB_SOURCENAME
* Fix issues noted by Ben: drop python and fix target in debian/rules
* Merge "ensure $MAKE can use jobserver" oneliner from Chris J Arges
v2, address Maximilians comments
* Isolate from my other patches, so it can be merged easier
* Separate bindeb-pkg target for building just binary debs
* Build source package in deb-pkg target to match rpm-pkg target
scripts/package/Makefile | 13 +++++++++----
scripts/package/builddeb | 43 +++++++++++++++++++++++++++++++++++++++++--
2 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 99ca6e7..f97857c 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -84,11 +84,15 @@ quiet_cmd_builddeb = BUILDDEB
} && \
\
$$KBUILD_PKG_ROOTCMD $(CONFIG_SHELL) \
- $(srctree)/scripts/package/builddeb
+ $(srctree)/scripts/package/builddeb $@
deb-pkg: FORCE
$(MAKE) KBUILD_SRC=
- $(call cmd,builddeb)
+ +$(call cmd,builddeb)
+
+bindeb-pkg: FORCE
+ $(MAKE) KBUILD_SRC=
+ +$(call cmd,builddeb)
clean-dirs += $(objtree)/debian/
@@ -133,8 +137,9 @@ perf-%pkg: FORCE
# ---------------------------------------------------------------------------
help: FORCE
@echo ' rpm-pkg - Build both source and binary RPM kernel packages'
- @echo ' binrpm-pkg - Build only the binary kernel package'
- @echo ' deb-pkg - Build the kernel as a deb package'
+ @echo ' binrpm-pkg - Build only the binary kernel RPM package'
+ @echo ' deb-pkg - Build both source and binary deb kernel packages'
+ @echo ' bindeb-pkg - Build only the binary kernel deb package'
@echo ' tar-pkg - Build the kernel as an uncompressed tarball'
@echo ' targz-pkg - Build the kernel as a gzip compressed tarball'
@echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball'
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 0ccd7ee..079a84b 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -79,6 +79,12 @@ if [ -n "$KDEB_PKGVERSION" ]; then
else
packageversion=$version-$revision
fi
+if [ -n "$KDEB_SOURCENAME" ]; then
+ sourcename=$KDEB_SOURCENAME
+else
+ sourcename=linux-upstream
+fi
+tmpdir="$objtree/debian/tmp"
tmpdir="$objtree/debian/tmp"
fwdir="$objtree/debian/fwtmp"
kernel_headers_dir="$objtree/debian/hdrtmp"
@@ -238,7 +244,7 @@ fi
# Generate a simple changelog template
cat <<EOF > debian/changelog
-linux-upstream ($packageversion) $distribution; urgency=low
+$sourcename ($packageversion) $distribution; urgency=low
* Custom built Linux kernel.
@@ -265,12 +271,16 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public
License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
EOF
+
+build_depends="bc, kmod, cpio "
+
# Generate a control file
cat <<EOF > debian/control
-Source: linux-upstream
+Source: $sourcename
Section: kernel
Priority: optional
Maintainer: $maintainer
+Build-Depends: $build_depends
Standards-Version: 3.8.4
Homepage: http://www.kernel.org/
EOF
@@ -391,4 +401,33 @@ EOF
create_package "$dbg_packagename" "$dbg_dir"
fi
+if [ "x$1" = "xdeb-pkg" ]
+then
+ cat <<EOF > debian/rules
+#!/usr/bin/make -f
+
+build:
+ cp debian/config .config
+ \$(MAKE) oldconfig
+
+binary-arch:
+ \$(MAKE) KDEB_SOURCENAME=${sourcename} KDEB_PKGVERSION=${packageversion} bindeb-pkg
+
+clean:
+ \$(MAKE) clean
+
+binary: binary-arch
+EOF
+
+ (cd $KBUILD_SRC; git archive --prefix=${sourcename}-${version}/ HEAD)|gzip -9 > ../${sourcename}_${version}.orig.tar.gz
+ cp $KCONFIG_CONFIG debian/config
+ tar caf ../${sourcename}_${packageversion}.debian.tar.gz debian/{config,copyright,rules,changelog,control}
+ dpkg-source -cdebian/control -ldebian/changelog --format="3.0 (custom)" --target-format="3.0 (quilt)" \
+ -b / ../${sourcename}_${version}.orig.tar.gz ../${sourcename}_${packageversion}.debian.tar.gz
+ mv ${sourcename}_${packageversion}*dsc ..
+ dpkg-genchanges > ../${sourcename}_${packageversion}_${debarch}.changes
+else
+ dpkg-genchanges -b > ../${sourcename}_${packageversion}_${debarch}.changes
+fi
+
exit 0
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3] deb-pkg: add source package
2015-06-11 8:11 [PATCH v3] deb-pkg: add source package riku.voipio
@ 2015-08-19 13:36 ` Michal Marek
2015-08-21 9:08 ` Ben Hutchings
0 siblings, 1 reply; 5+ messages in thread
From: Michal Marek @ 2015-08-19 13:36 UTC (permalink / raw)
To: Ben Hutchings
Cc: riku.voipio, linux-kbuild, debian-kernel, Chris J Arges,
maximilian attems
On 2015-06-11 10:11, riku.voipio@linaro.org wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
>
> Make deb-pkg build both source and binary package like make rpm-pkg does.
> For people who only need binary kernel package, there is now bindeb-pkg
> target, same target also used to build the .deb files if built from the
> source package using dpkg-buildpackage.
>
> Generated source package will build the same kernel .config than what
> was available for make deb-pkg. The name of the source package can
> be set with KDEB_SOURCENAME enviroment variable.
>
> The source package is useful for gpl compliance, or for feeding to a
> automated debian package builder.
>
> Cc: Chris J Arges <chris.j.arges@canonical.com>
> Cc: maximilian attems <maks@stro.at>
> Cc: Ben Hutchings <ben@decadent.org.uk>
> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
> ---
> v3,
> * Allow setting source package name with KDEB_SOURCENAME
> * Fix issues noted by Ben: drop python and fix target in debian/rules
> * Merge "ensure $MAKE can use jobserver" oneliner from Chris J Arges
Ben,
are you OK with the v3 of this patch?
Thanks,
Michal
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] deb-pkg: add source package
2015-08-19 13:36 ` Michal Marek
@ 2015-08-21 9:08 ` Ben Hutchings
2015-08-21 12:38 ` Michal Marek
0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2015-08-21 9:08 UTC (permalink / raw)
To: Michal Marek
Cc: riku.voipio, linux-kbuild, debian-kernel, Chris J Arges,
maximilian attems
[-- Attachment #1: Type: text/plain, Size: 2106 bytes --]
On Wed, 2015-08-19 at 15:36 +0200, Michal Marek wrote:
> On 2015-06-11 10:11, riku.voipio@linaro.org wrote:
> > From: Riku Voipio <riku.voipio@linaro.org>
> >
> > Make deb-pkg build both source and binary package like make rpm-pkg does.
> > For people who only need binary kernel package, there is now bindeb-pkg
> > target, same target also used to build the .deb files if built from the
> > source package using dpkg-buildpackage.
> >
> > Generated source package will build the same kernel .config than what
> > was available for make deb-pkg. The name of the source package can
> > be set with KDEB_SOURCENAME enviroment variable.
> >
> > The source package is useful for gpl compliance, or for feeding to a
> > automated debian package builder.
> >
> > Cc: Chris J Arges <chris.j.arges@canonical.com>
> > Cc: maximilian attems <maks@stro.at>
> > Cc: Ben Hutchings <ben@decadent.org.uk>
> > Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
> > ---
> > v3,
> > * Allow setting source package name with KDEB_SOURCENAME
> > * Fix issues noted by Ben: drop python and fix target in debian/rules
> > * Merge "ensure $MAKE can use jobserver" oneliner from Chris J Arges
>
> Ben,
>
> are you OK with the v3 of this patch?
I've gone through this with Riku and found a couple of problems:
- The 'clean' rule in the generated debian/rules calls 'make clean',
but scripts/package/Makefile includes debian/ in clean-dirs.
Currently that directory does not get removed for some reason, but I
think that's a bug and the clean rule in debian/rules should guard
against removal.
- Building of the 'orig' tarball uses git, i.e. it depends on the
kernel source being in a git repository and not simply unpacked from
a tarball (or from other VCS). The rpmpkg target doesn't have this
same restriction.
I leave it to you to decide whether these are important enough to block
it.
Ben.
--
Ben Hutchings
Theory and practice are closer in theory than in practice.
- John Levine, moderator of comp.compilers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] deb-pkg: add source package
2015-08-21 9:08 ` Ben Hutchings
@ 2015-08-21 12:38 ` Michal Marek
2015-08-21 14:40 ` Riku Voipio
0 siblings, 1 reply; 5+ messages in thread
From: Michal Marek @ 2015-08-21 12:38 UTC (permalink / raw)
To: Ben Hutchings
Cc: riku.voipio, linux-kbuild, debian-kernel, Chris J Arges,
maximilian attems
On Fri, Aug 21, 2015 at 11:08:44AM +0200, Ben Hutchings wrote:
> I've gone through this with Riku and found a couple of problems:
>
> - The 'clean' rule in the generated debian/rules calls 'make clean',
> but scripts/package/Makefile includes debian/ in clean-dirs.
> Currently that directory does not get removed for some reason, but I
> think that's a bug and the clean rule in debian/rules should guard
> against removal.
Good catch. make clean is indeed supposed to delete the debian/
directory.
> - Building of the 'orig' tarball uses git, i.e. it depends on the
> kernel source being in a git repository and not simply unpacked from
> a tarball (or from other VCS). The rpmpkg target doesn't have this
> same restriction.
Right. make rpm uses the KBUILD_ALLDIRS to generate the tarball. It's
not perfect, but it behaves consistently.
Michal
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] deb-pkg: add source package
2015-08-21 12:38 ` Michal Marek
@ 2015-08-21 14:40 ` Riku Voipio
0 siblings, 0 replies; 5+ messages in thread
From: Riku Voipio @ 2015-08-21 14:40 UTC (permalink / raw)
To: Michal Marek
Cc: Ben Hutchings, linux-kbuild, debian-kernel, Chris J Arges,
maximilian attems
On 21 August 2015 at 15:38, Michal Marek <mmarek@suse.cz> wrote:
>
> On Fri, Aug 21, 2015 at 11:08:44AM +0200, Ben Hutchings wrote:
> > I've gone through this with Riku and found a couple of problems:
> >
> > - The 'clean' rule in the generated debian/rules calls 'make clean',
> > but scripts/package/Makefile includes debian/ in clean-dirs.
> > Currently that directory does not get removed for some reason, but I
> > think that's a bug and the clean rule in debian/rules should guard
> > against removal.
>
> Good catch. make clean is indeed supposed to delete the debian/
> directory.
It looks like debian/ directory isn't cleaned because "scripts" is
missing from "clean-dirs" in
the kernel top-level Makefile - it is in mroper-dirs, and thus debian/
vanishes when "make mrproper"
is run. I'm quite surprised that "clean-dirs" in toplevel makefile
means "recurse" but deeper in directory
tree it starts meaning "rm -rf this"..
If clean-dirs is fixed to remove debian/, this will be annoying to fix
in this patch.
> > - Building of the 'orig' tarball uses git, i.e. it depends on the
> > kernel source being in a git repository and not simply unpacked from
> > a tarball (or from other VCS). The rpmpkg target doesn't have this
> > same restriction.
>
> Right. make rpm uses the KBUILD_ALLDIRS to generate the tarball. It's
> not perfect, but it behaves consistently.
Changing this to match rpmpkg behaviour makes sense.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-21 14:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-11 8:11 [PATCH v3] deb-pkg: add source package riku.voipio
2015-08-19 13:36 ` Michal Marek
2015-08-21 9:08 ` Ben Hutchings
2015-08-21 12:38 ` Michal Marek
2015-08-21 14:40 ` Riku Voipio
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.