From 3716001bcb7f5822382ac1f2f54226b87312cc6b Mon Sep 17 00:00:00 2001 From: Riku Voipio Date: Wed, 2 Sep 2015 12:57:24 +0300 Subject: deb-pkg: add source package 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 Reviewed-by: maximilian attems Reviewed-by: Ben Hutchings Signed-off-by: Riku Voipio Signed-off-by: Michal Marek --- scripts/package/Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'scripts/package/Makefile') diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 297e75684738..1aca224e8597 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile @@ -23,6 +23,8 @@ # Remove hyphens since they have special meaning in RPM filenames KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) +KDEB_SOURCENAME ?= linux-$(KERNELRELEASE) +export KDEB_SOURCENAME # Include only those top-level files that are needed by make, plus the GPL copy TAR_CONTENT := $(KBUILD_ALLDIRS) .config .scmversion Makefile \ Kbuild Kconfig COPYING $(wildcard localversion*) @@ -83,11 +85,17 @@ quiet_cmd_builddeb = BUILDDEB } && \ \ $$KBUILD_PKG_ROOTCMD $(CONFIG_SHELL) \ - $(srctree)/scripts/package/builddeb + $(srctree)/scripts/package/builddeb $@ deb-pkg: FORCE + $(MAKE) clean + $(call cmd,src_tar,$(KDEB_SOURCENAME)) + $(MAKE) KBUILD_SRC= + +$(call cmd,builddeb) + +bindeb-pkg: FORCE $(MAKE) KBUILD_SRC= - $(call cmd,builddeb) + +$(call cmd,builddeb) clean-dirs += $(objtree)/debian/ @@ -132,8 +140,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' -- cgit