linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] builddeb: allow selection of .deb compressor
@ 2020-01-04  9:55 Michał Mirosław
  2020-01-04  9:55 ` [PATCH 2/2] builddeb: make headers package thinner Michał Mirosław
  2020-01-11  6:51 ` [PATCH 1/2] builddeb: allow selection of .deb compressor Masahiro Yamada
  0 siblings, 2 replies; 4+ messages in thread
From: Michał Mirosław @ 2020-01-04  9:55 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek; +Cc: linux-kbuild, linux-kernel

Select deb compression using KPKG_COMPRESS make variable. This allows to
use gzip compression for local or test builds, and that's way faster
than now-default xz compression.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 scripts/package/builddeb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index c4c580f547ef..d289c4ebc891 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -43,7 +43,7 @@ create_package() {
 
 	# Create the package
 	dpkg-gencontrol -p$pname -P"$pdir"
-	dpkg --build "$pdir" ..
+	dpkg-deb ${KPKG_COMPRESS:+-Z$KPKG_COMPRESS} --build "$pdir" ..
 }
 
 version=$KERNELRELEASE
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] builddeb: make headers package thinner
  2020-01-04  9:55 [PATCH 1/2] builddeb: allow selection of .deb compressor Michał Mirosław
@ 2020-01-04  9:55 ` Michał Mirosław
  2020-01-11  6:13   ` Masahiro Yamada
  2020-01-11  6:51 ` [PATCH 1/2] builddeb: allow selection of .deb compressor Masahiro Yamada
  1 sibling, 1 reply; 4+ messages in thread
From: Michał Mirosław @ 2020-01-04  9:55 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek; +Cc: linux-kbuild, linux-kernel

Remove a bunch of files not used during external module builds:
 - foreign architecture headers
 - subtree Makefiles
 - Kconfig files
 - perl scripts

On amd64 system this looses a third of the resulting .deb size.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 scripts/package/builddeb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index d289c4ebc891..fb68916d5898 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -165,8 +165,8 @@ EOF
 done
 
 # Build kernel header package
-(cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) > "$objtree/debian/hdrsrcfiles"
-(cd $srctree; find arch/*/include include scripts -type f -o -type l) >> "$objtree/debian/hdrsrcfiles"
+(cd $srctree; find . arch/$SRCARCH -maxdepth 1 -name Makefile\*) > "$objtree/debian/hdrsrcfiles"
+(cd $srctree; find include scripts -type f -o -type l) >> "$objtree/debian/hdrsrcfiles"
 (cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles"
 (cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles"
 if is_enabled CONFIG_STACK_VALIDATION; then
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] builddeb: make headers package thinner
  2020-01-04  9:55 ` [PATCH 2/2] builddeb: make headers package thinner Michał Mirosław
@ 2020-01-11  6:13   ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2020-01-11  6:13 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List

On Sat, Jan 4, 2020 at 6:56 PM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
>
> Remove a bunch of files not used during external module builds:
>  - foreign architecture headers
>  - subtree Makefiles
>  - Kconfig files
>  - perl scripts
>
> On amd64 system this looses a third of the resulting .deb size.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

Applied to linux-kbuild.
Thanks.


> ---
>  scripts/package/builddeb | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index d289c4ebc891..fb68916d5898 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -165,8 +165,8 @@ EOF
>  done
>
>  # Build kernel header package
> -(cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) > "$objtree/debian/hdrsrcfiles"
> -(cd $srctree; find arch/*/include include scripts -type f -o -type l) >> "$objtree/debian/hdrsrcfiles"
> +(cd $srctree; find . arch/$SRCARCH -maxdepth 1 -name Makefile\*) > "$objtree/debian/hdrsrcfiles"
> +(cd $srctree; find include scripts -type f -o -type l) >> "$objtree/debian/hdrsrcfiles"
>  (cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles"
>  (cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles"
>  if is_enabled CONFIG_STACK_VALIDATION; then
> --
> 2.20.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] builddeb: allow selection of .deb compressor
  2020-01-04  9:55 [PATCH 1/2] builddeb: allow selection of .deb compressor Michał Mirosław
  2020-01-04  9:55 ` [PATCH 2/2] builddeb: make headers package thinner Michał Mirosław
@ 2020-01-11  6:51 ` Masahiro Yamada
  1 sibling, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2020-01-11  6:51 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Michal Marek, Linux Kbuild mailing list,
	Linux Kernel Mailing List, Ben Hutchings, Riku Voipio

(+CC: Ben Hutchings, Riku Voipio)

On Sat, Jan 4, 2020 at 6:56 PM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
>
> Select deb compression using KPKG_COMPRESS make variable. This allows to
> use gzip compression for local or test builds, and that's way faster
> than now-default xz compression.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
>  scripts/package/builddeb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index c4c580f547ef..d289c4ebc891 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -43,7 +43,7 @@ create_package() {
>
>         # Create the package
>         dpkg-gencontrol -p$pname -P"$pdir"
> -       dpkg --build "$pdir" ..
> +       dpkg-deb ${KPKG_COMPRESS:+-Z$KPKG_COMPRESS} --build "$pdir" ..
>  }
>
>  version=$KERNELRELEASE
> --
> 2.20.1
>

I have not seen any comment on this,
but using gzip is indeed way faster.


Some minor comments:

I see some variables staring "KDEB_",
but nothing starting "KPKG_".



masahiro@grover:~/workspace/linux-kbuild$ git grep KDEB_
scripts/Makefile.package:KDEB_SOURCENAME ?= linux-$(KERNELRELEASE)
scripts/Makefile.package:export KDEB_SOURCENAME
scripts/Makefile.package:       $(call cmd,src_tar,$(KDEB_SOURCENAME))
scripts/Makefile.package:               mv $(KDEB_SOURCENAME).tar.gz
../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz
scripts/package/builddeb:# specified in KDEB_HOOKDIR) that will be
called on package install and
scripts/package/builddeb:debhookdir=${KDEB_HOOKDIR:-/etc/kernel}
scripts/package/mkdebian:if [ -n "$KDEB_PKGVERSION" ]; then
scripts/package/mkdebian:       packageversion=$KDEB_PKGVERSION
scripts/package/mkdebian:sourcename=$KDEB_SOURCENAME
scripts/package/mkdebian:if [ -n "$KDEB_CHANGELOG_DIST" ]; then
scripts/package/mkdebian:        distribution=$KDEB_CHANGELOG_DIST
scripts/package/mkdebian:        echo >&2 "Install lsb-release or set
\$KDEB_CHANGELOG_DIST explicitly"
masahiro@grover:~/workspace/linux-kbuild$ git grep KPKG_


Maybe starting KDEB_ seems to be better for consistency?




-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-11  6:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-04  9:55 [PATCH 1/2] builddeb: allow selection of .deb compressor Michał Mirosław
2020-01-04  9:55 ` [PATCH 2/2] builddeb: make headers package thinner Michał Mirosław
2020-01-11  6:13   ` Masahiro Yamada
2020-01-11  6:51 ` [PATCH 1/2] builddeb: allow selection of .deb compressor Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).