All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michel Lespinasse <walken.cr@gmail.com>
To: Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Riku Voipio <riku.voipio@linaro.org>
Cc: linux-kbuild@vger.kernel.org
Subject: Fast target for debian linux-image package creation
Date: Thu, 14 Jan 2021 15:28:35 -0800	[thread overview]
Message-ID: <CAL36u31HRhkYJ-QFjx0tCzRnj0CXSQEW2LqZeGK6fnyt7Z18Zg@mail.gmail.com> (raw)

Hi,

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
package;
- 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
https://patchwork.kernel.org/project/linux-kbuild/patch/20170331130941.5250-4-riku.voipio@linaro.org/
; 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

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"
 done

-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
+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"
+
 PHONY += intdeb-pkg
 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 ?

Thanks,

                 reply	other threads:[~2021-01-14 23:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAL36u31HRhkYJ-QFjx0tCzRnj0CXSQEW2LqZeGK6fnyt7Z18Zg@mail.gmail.com \
    --to=walken.cr@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=riku.voipio@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.