diff mbox series

Fast target for debian linux-image package creation

Message ID CAL36u31HRhkYJ-QFjx0tCzRnj0CXSQEW2LqZeGK6fnyt7Z18Zg@mail.gmail.com (mailing list archive)
State New
Headers show
Series Fast target for debian linux-image package creation | expand

Commit Message

Michel Lespinasse Jan. 14, 2021, 11:28 p.m. UTC

I am looking for a fast target to build debian linux-image packages,
to be used for quickly testing things (dev/test cycle) rather than for
full proper releases.

The current bindeb-pkg almost does what I want, but not quite:
- It still creates linux-headers and linux-libc-dev packages; overall
taking about 3x the time than would be needed for just the linux-image
- It places packages in .. ; I would prefer to have them in a the root
of my kernel tree or in a subdirectory thereof.

(I figure these goals are probably similar to those of the fastdeb-pkg
target that was proposed in
; I am not sure if there is any ongoing discussion about that)

The following change to the builddeb script implements both of the
desired goals:
- builds only the linux-image package if NO_HEADER_PACKAGES is set;
- creates packages in $UPLOAD_DIR instead of .. if set

 PHONY += intdeb-pkg
        +$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb

This is as clean as I was able to make it, though still not perfect -
I think it would be much nicer if it was possible not to create the
.buildinfo and .changes files at all in the first place.

Would anyone have suggestions as to how to clean up those bits, and
also, would there be any interest in integrating this upstream ?

diff mbox series


diff --git scripts/package/builddeb scripts/package/builddeb
index 91a502bb97e8..b83a4a09a75d 100755
--- scripts/package/builddeb
+++ scripts/package/builddeb
@@ -50,7 +50,7 @@  create_package() {

        # Create the package
        dpkg-gencontrol -p$pname -P"$pdir"
-       dpkg-deb $dpkg_deb_opts ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS}
--build "$pdir" ..
+       dpkg-deb $dpkg_deb_opts ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS}
--build "$pdir" "${UPLOAD_DIR:-..}"

 deploy_kernel_headers () {
@@ -208,7 +208,7 @@  EOF
        chmod 755 "$tmpdir/DEBIAN/$script"

-if [ "$ARCH" != "um" ]; then
+if [ "$ARCH" != "um" -a -z "$NO_HEADER_PACKAGES" ]; then
        if is_enabled CONFIG_MODULES; then
                deploy_kernel_headers debian/linux-headers
                create_package linux-headers-$version debian/linux-headers

Even with this, the .changes and .buildinfo files are still created in
.., though.

I am using the following target in Makefile.package to drive this:

diff --git scripts/Makefile.package scripts/Makefile.package
index f952fb64789d..304073f5fbcd 100644
--- scripts/Makefile.package
+++ scripts/Makefile.package
@@ -82,6 +82,13 @@  bindeb-pkg:
        $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
        +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat
debian/arch) $(DPKG_FLAGS) -b -nc -uc

+PHONY += bindeb-kpkg
+       KDEB_PKGVERSION=1 $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
+       @if test ! -e pkgs; then mkdir pkgs; echo "*" > pkgs/.gitignore; fi
+       +UPLOAD_DIR=pkgs NO_HEADER_PACKAGES=1 dpkg-buildpackage
-r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc
--buildinfo-option=-upkgs --changes-option=-q --changes-option=-upkgs
+       @version="$(KERNELRELEASE)_1_$$(cat debian/arch)" && rm -f
"pkgs/linux-$${version}.buildinfo" "../linux-$${version}.changes" &&
ln -sf "linux-image-$${version}.deb" "pkgs/LATEST.deb"