History

kbuild: add srcdeb-pkg target

This new target builds only the debian source package. Unify the build rules of deb-pkg, srcdeb-pkg, bindeb-pkg to avoid code duplication. --no-check-builddeps is added to srcdeb-pkg so that build dependencies will not be checked.

Masahiro Yamada committed 3 years ago

Commit 31f735c1 parent ccb2d171 file · +21 −7Browse files

Unified · Split

scripts/Makefile.package+21−7
@@ -5,7 +5,6 @@ include $(srctree)/scripts/Kbuild.include · 4 unmodified lines
5include $(srctree)/scripts/Makefile.lib5include $(srctree)/scripts/Makefile.lib
6 6
7KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))7KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
8KBUILD_PKG_ROOTCMD ?="fakeroot -u"
9# Include only those top-level files that are needed by make, plus the GPL copy8# Include only those top-level files that are needed by make, plus the GPL copy
10TAR_CONTENT := Documentation LICENSES arch block certs crypto drivers fs \9TAR_CONTENT := Documentation LICENSES arch block certs crypto drivers fs \
11 include init io_uring ipc kernel lib mm net rust \10 include init io_uring ipc kernel lib mm net rust \
@@ -86,6 +85,9 @@ binrpm-pkg: · 74 unmodified lines
86 +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \85 +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \
87 $(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec86 $(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec
88 87
88# deb-pkg srcdeb-pkg bindeb-pkg
89# ---------------------------------------------------------------------------
90
89quiet_cmd_debianize = GEN $@91quiet_cmd_debianize = GEN $@
90 cmd_debianize = $(srctree)/scripts/package/mkdebian $(mkdebian-opts)92 cmd_debianize = $(srctree)/scripts/package/mkdebian $(mkdebian-opts)
91 93
@@ -104,14 +106,25 @@ debian-orig: linux.tar.gz debian · 12 unmodified lines
104 cp $< ../$(orig-name); \106 cp $< ../$(orig-name); \
105 fi107 fi
106 108
107PHONY += deb-pkg109KBUILD_PKG_ROOTCMD ?= 'fakeroot -u'
108deb-pkg: debian-orig110
109 +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) \111PHONY += deb-pkg srcdeb-pkg bindeb-pkg
110 --build=source,binary -nc -us -uc112
113deb-pkg: private build-type := source,binary
114srcdeb-pkg: private build-type := source
115bindeb-pkg: private build-type := binary
111 116
112PHONY += bindeb-pkg117deb-pkg srcdeb-pkg: debian-orig
113bindeb-pkg: debian118bindeb-pkg: debian
114 +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc119deb-pkg srcdeb-pkg bindeb-pkg:
120 +$(strip dpkg-buildpackage \
121 --build=$(build-type) --no-pre-clean --unsigned-changes \
122 $(if $(findstring source, $(build-type)), \
123 --unsigned-source) \
124 $(if $(findstring binary, $(build-type)), \
125 -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \
126 --no-check-builddeps) \
127 $(DPKG_FLAGS))
115 128
116PHONY += intdeb-pkg129PHONY += intdeb-pkg
117intdeb-pkg:130intdeb-pkg:
@@ -208,6 +221,7 @@ help: · 90 unmodified lines
208 @echo ' srcrpm-pkg - Build only the source kernel RPM package'221 @echo ' srcrpm-pkg - Build only the source kernel RPM package'
209 @echo ' binrpm-pkg - Build only the binary kernel RPM package'222 @echo ' binrpm-pkg - Build only the binary kernel RPM package'
210 @echo ' deb-pkg - Build both source and binary deb kernel packages'223 @echo ' deb-pkg - Build both source and binary deb kernel packages'
224 @echo ' srcdeb-pkg - Build only the source kernel deb package'
211 @echo ' bindeb-pkg - Build only the binary kernel deb package'225 @echo ' bindeb-pkg - Build only the binary kernel deb package'
212 @echo ' snap-pkg - Build only the binary kernel snap package'226 @echo ' snap-pkg - Build only the binary kernel snap package'
213 @echo ' (will connect to external hosts)'227 @echo ' (will connect to external hosts)'