lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y/k+v/Yj8VQ6q32H@fjasle.eu>
Date:   Fri, 24 Feb 2023 23:48:31 +0100
From:   Nicolas Schier <nicolas@...sle.eu>
To:     Masahiro Yamada <masahiroy@...nel.org>
Cc:     linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
        Ben Hutchings <ben@...adent.org.uk>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH v6 12/12] kbuild: add srcdeb-pkg target

On Wed, Feb 15, 2023 at 10:20:34AM +0900 Masahiro Yamada wrote:
> This new target builds only the debian source package.
> 
> Factor similar code out to the 'build-deb-pkg' variable.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---
> 
> Changes in v6:
>   - New patch
> 
>  scripts/Makefile.package | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/Makefile.package b/scripts/Makefile.package
> index b941e6341b36..8650d9432c26 100644
> --- a/scripts/Makefile.package
> +++ b/scripts/Makefile.package
> @@ -100,6 +100,9 @@ binrpm-pkg:
>  	+rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \
>  		$(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec
>  
> +# deb-pkg srcdeb-pkg bindeb-pkg
> +# ---------------------------------------------------------------------------
> +
>  quiet_cmd_debianize = GEN     $@
>        cmd_debianize = $(srctree)/scripts/package/mkdebian
>  
> @@ -117,14 +120,27 @@ debian-orig: linux.tar.gz debian
>  		cp $< ../$(orig-name); \
>  	fi
>  
> +build-deb-pkg = \
> +        dpkg-buildpackage \
> +        --build=$(build-type) --no-pre-clean --unsigned-changes \
> +        $(if $(findstring source, $(build-type)), --unsigned-source) \
> +        $(if $(findstring binary, $(build-type)), -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch)) \
> +        $(DPKG_FLAGS)
> +
>  PHONY += deb-pkg
> +deb-pkg: private build-type := source,binary
>  deb-pkg: debian-orig
> -	+dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) \
> -		--build=source,binary -nc -us -uc
> +	+$(build-deb-pkg)
> +
> +PHONY += srcdeb-pkg
> +srcdeb-pkg: private build-type := source
> +srcdeb-pkg: debian-orig
> +	+$(build-deb-pkg)
>  
>  PHONY += bindeb-pkg
> +bindeb-pkg: private build-type := binary
>  bindeb-pkg: debian
> -	+dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc
> +	+$(build-deb-pkg)
>  
>  PHONY += intdeb-pkg
>  intdeb-pkg:
> @@ -225,6 +241,7 @@ help:
>  	@echo '  srcrpm-pkg          - Build only the source kernel RPM package'
>  	@echo '  binrpm-pkg          - Build only the binary kernel RPM package'
>  	@echo '  deb-pkg             - Build both source and binary deb kernel packages'
> +	@echo '  binsrc-pkg          - Build only the source kernel deb package'

typo: srcdeb-dpkg

With this typo fixed:
Reviewed-by: Nicolas Schier <nicolas@...sle.eu>

>  	@echo '  bindeb-pkg          - Build only the binary kernel deb package'
>  	@echo '  snap-pkg            - Build only the binary kernel snap package'
>  	@echo '                        (will connect to external hosts)'
> -- 
> 2.34.1

Thanks for the patch (and the whole patch set), I appreciate it!

While testing, I stumbled over one thing, not really related to this patch:

As tar complains about any kind of tree changes while it creates an archive,
'olddefconfig' and 'srcdeb-pkg' must not be build at the same time.  Is it
sensible to add another 'mixed-build' check in top-level Makefile against all
target depending on linux.tar.gz?

    $ make olddefconfig srcdeb-pkg -j8
    #
    # No change to .config
    #
      GEN     debian
      UPD     .tmp_filelist
      TAR     linux.tar.gz
    tar: .: file changed as we read it
    make[2]: *** [scripts/Makefile.package:58: linux.tar.gz] Error 1
    make[2]: *** Deleting file 'linux.tar.gz'
    make[1]: *** [Makefile:1654: srcdeb-pkg] Error 2
    make: *** [Makefile:358: __build_one_by_one] Error 2

Kind regards,
Nicolas

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ