All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] deb-pkg: move setting debarch for a separate function
@ 2015-04-10 13:15 riku.voipio
  2015-04-10 13:15 ` [PATCH 2/2] deb-pkg: add source package riku.voipio
  2015-04-15 12:30 ` [PATCH 1/2] deb-pkg: move setting debarch for a separate function Michal Marek
  0 siblings, 2 replies; 13+ messages in thread
From: riku.voipio @ 2015-04-10 13:15 UTC (permalink / raw)
  To: linux-kbuild, mmarek, debian-kernel; +Cc: Riku Voipio

From: Riku Voipio <riku.voipio@linaro.org>

create_package() function tries to resolve used architecture
for everry package. Split the setting the architecture to a
new function, set_debarch(), called once on startup.

This allows using debarch from other parts of script as
needed.
---
 scripts/package/builddeb | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index a9858a4..e397815 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -27,8 +27,15 @@ create_package() {
 	chown -R root:root "$pdir"
 	chmod -R go-w "$pdir"
 
+	# Create the package
+	dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir"
+	dpkg --build "$pdir" ..
+}
+
+set_debarch() {
 	# Attempt to find the correct Debian architecture
-	local forcearch="" debarch=""
+	forcearch=""
+	debarch=""
 	case "$UTS_MACHINE" in
 	i386|ia64|alpha)
 		debarch="$UTS_MACHINE" ;;
@@ -73,10 +80,8 @@ create_package() {
 	if [ -n "$debarch" ] ; then
 		forcearch="-DArchitecture=$debarch"
 	fi
+	export forcearch debarch
 
-	# Create the package
-	dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir"
-	dpkg --build "$pdir" ..
 }
 
 # Some variables and settings used throughout the script
@@ -99,6 +104,7 @@ kernel_headers_packagename=linux-headers-$version
 libc_headers_packagename=linux-libc-dev
 dbg_packagename=$packagename-dbg
 tools_packagename=linux-tools-$version
+set_debarch
 
 if [ "$ARCH" = "um" ] ; then
 	packagename=user-mode-linux-$version
-- 
2.1.4


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

* [PATCH 2/2] deb-pkg: add source package
  2015-04-10 13:15 [PATCH 1/2] deb-pkg: move setting debarch for a separate function riku.voipio
@ 2015-04-10 13:15 ` riku.voipio
  2015-04-22 15:50   ` maximilian attems
  2015-04-15 12:30 ` [PATCH 1/2] deb-pkg: move setting debarch for a separate function Michal Marek
  1 sibling, 1 reply; 13+ messages in thread
From: riku.voipio @ 2015-04-10 13:15 UTC (permalink / raw)
  To: linux-kbuild, mmarek, debian-kernel; +Cc: Riku Voipio

From: Riku Voipio <riku.voipio@linaro.org>

By passing BUILD_SOURCE=y variable, make deb-pkg builds a debian source
package. It will generate a minimal debian/rules file that calls back
to make deb-pkg. Generated source package will build the same kernel
.config than what was available for make deb-pkg.

The source package is useful for gpl compliance, or for feeding to a
automated debian package builder.

Patch depends on the "deb-pkg: move setting debarch for a separate function"
for correct changelog filenames.

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 scripts/package/builddeb | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index e397815..3d77fd3 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -272,12 +272,23 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public
 License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
 EOF
 
+
+build_depends="bc, "
+if [ -n "$BUILD_TOOLS" ]
+then
+	build_depends="$build_depends python-dev, libperl-dev, bison, flex, \
+libaudit-dev, libdw-dev, libelf-dev, libiberty-dev, libnewt-dev, autoconf, \
+automake, libtool, libglib2.0-dev, libudev-dev, libwrap0-dev, libiberty-dev, \
+libunwind8-dev [amd64 arm64 i386], libnuma-dev [amd64 arm64 i386 powerpc ppc64 ppc64el] "
+fi
+
 # Generate a control file
 cat <<EOF > debian/control
 Source: linux-upstream
 Section: kernel
 Priority: optional
 Maintainer: $maintainer
+Build-Depends: $build_depends
 Standards-Version: 3.8.4
 Homepage: http://www.kernel.org/
 EOF
@@ -425,4 +436,35 @@ EOF
 	create_package "$tools_packagename" "$tools_dir"
 fi
 
+if [ -n "$BUILD_SOURCE" ]
+then
+    cat <<EOF > debian/rules
+#!/usr/bin/make -f
+
+build:
+	cp debian/config .config
+	\$(MAKE) oldconfig
+
+binary-arch:
+	\$(MAKE) KDEB_PKGVERSION=${packageversion} BUILD_TOOLS=$BUILD_TOOLS deb-pkg
+
+clean:
+	\$(MAKE) clean
+
+binary: binary-arch
+EOF
+
+	(cd $KBUILD_SRC; git archive --prefix=linux-upstream-${version}/ HEAD)|gzip -9 > ../linux-upstream_${version}.orig.tar.gz
+	cp $KCONFIG_CONFIG debian/config
+	tar caf ../linux-upstream_${packageversion}.debian.tar.gz debian/{config,copyright,rules,changelog,control}
+	dpkg-source -cdebian/control -ldebian/changelog --format="3.0 (custom)" --target-format="3.0 (quilt)" \
+		-b / ../linux-upstream_${version}.orig.tar.gz  ../linux-upstream_${packageversion}.debian.tar.gz
+	mv linux-upstream_${packageversion}*dsc ..
+	dpkg-genchanges > ../linux-upstream_${packageversion}_${debarch}.changes
+else
+	dpkg-genchanges -b > ../linux-upstream_${packageversion}_${debarch}.changes
+fi
+
+
+
 exit 0
-- 
2.1.4


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

* Re: [PATCH 1/2] deb-pkg: move setting debarch for a separate function
  2015-04-10 13:15 [PATCH 1/2] deb-pkg: move setting debarch for a separate function riku.voipio
  2015-04-10 13:15 ` [PATCH 2/2] deb-pkg: add source package riku.voipio
@ 2015-04-15 12:30 ` Michal Marek
  2015-04-16 13:42   ` [PATCH] deb-pkg: v2: " riku.voipio
  1 sibling, 1 reply; 13+ messages in thread
From: Michal Marek @ 2015-04-15 12:30 UTC (permalink / raw)
  To: riku.voipio; +Cc: linux-kbuild, debian-kernel

On 2015-04-10 15:15, riku.voipio@linaro.org wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
> 
> create_package() function tries to resolve used architecture
> for everry package. Split the setting the architecture to a
> new function, set_debarch(), called once on startup.
> 
> This allows using debarch from other parts of script as
> needed.
> ---
>  scripts/package/builddeb | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index a9858a4..e397815 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -27,8 +27,15 @@ create_package() {
>  	chown -R root:root "$pdir"
>  	chmod -R go-w "$pdir"
>  
> +	# Create the package
> +	dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir"
> +	dpkg --build "$pdir" ..
> +}
> +
> +set_debarch() {
>  	# Attempt to find the correct Debian architecture
> -	local forcearch="" debarch=""
> +	forcearch=""
> +	debarch=""
>  	case "$UTS_MACHINE" in
>  	i386|ia64|alpha)
>  		debarch="$UTS_MACHINE" ;;
> @@ -73,10 +80,8 @@ create_package() {
>  	if [ -n "$debarch" ] ; then
>  		forcearch="-DArchitecture=$debarch"
>  	fi
> +	export forcearch debarch

You do not need to export the variables. But it will improve the
readability of the script if you initialize the variables in the
toplevel scope.

Also, the fallback for empty $debarch is $(dpkg --print-architecture).
It makes sense to set it once in the new function.

Michal

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

* [PATCH] deb-pkg: v2: move setting debarch for a separate function
  2015-04-15 12:30 ` [PATCH 1/2] deb-pkg: move setting debarch for a separate function Michal Marek
@ 2015-04-16 13:42   ` riku.voipio
  2015-04-22 14:45     ` Michal Marek
  0 siblings, 1 reply; 13+ messages in thread
From: riku.voipio @ 2015-04-16 13:42 UTC (permalink / raw)
  To: linux-kbuild, mmarek, debian-kernel; +Cc: Riku Voipio

From: Riku Voipio <riku.voipio@linaro.org>

create_package() function tries to resolve used architecture
for everry package. Split the setting the architecture to a
new function, set_debarch(), called once on startup.

This allows using debarch from other parts of script as
needed.

v2: Follow Michals suggestion on setting variables at
top scope and also setting the fallback $debarch in the
new function

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 scripts/package/builddeb | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index a9858a4..d9b7694 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -27,8 +27,13 @@ create_package() {
 	chown -R root:root "$pdir"
 	chmod -R go-w "$pdir"
 
+	# Create the package
+	dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch}" -p$pname -P"$pdir"
+	dpkg --build "$pdir" ..
+}
+
+set_debarch() {
 	# Attempt to find the correct Debian architecture
-	local forcearch="" debarch=""
 	case "$UTS_MACHINE" in
 	i386|ia64|alpha)
 		debarch="$UTS_MACHINE" ;;
@@ -58,6 +63,7 @@ create_package() {
 		fi
 		;;
 	*)
+		debarch=$(dpkg --print-architecture)
 		echo "" >&2
 		echo "** ** **  WARNING  ** ** **" >&2
 		echo "" >&2
@@ -70,13 +76,8 @@ create_package() {
 	if [ -n "$KBUILD_DEBARCH" ] ; then
 		debarch="$KBUILD_DEBARCH"
 	fi
-	if [ -n "$debarch" ] ; then
-		forcearch="-DArchitecture=$debarch"
-	fi
+	forcearch="-DArchitecture=$debarch"
 
-	# Create the package
-	dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir"
-	dpkg --build "$pdir" ..
 }
 
 # Some variables and settings used throughout the script
@@ -99,6 +100,9 @@ kernel_headers_packagename=linux-headers-$version
 libc_headers_packagename=linux-libc-dev
 dbg_packagename=$packagename-dbg
 tools_packagename=linux-tools-$version
+debarch=
+forcearch=
+set_debarch
 
 if [ "$ARCH" = "um" ] ; then
 	packagename=user-mode-linux-$version
-- 
2.1.4


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

* Re: [PATCH] deb-pkg: v2: move setting debarch for a separate function
  2015-04-16 13:42   ` [PATCH] deb-pkg: v2: " riku.voipio
@ 2015-04-22 14:45     ` Michal Marek
  2015-04-22 15:52       ` maximilian attems
  0 siblings, 1 reply; 13+ messages in thread
From: Michal Marek @ 2015-04-22 14:45 UTC (permalink / raw)
  To: riku.voipio; +Cc: linux-kbuild, debian-kernel

On 2015-04-16 15:42, riku.voipio@linaro.org wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
> 
> create_package() function tries to resolve used architecture
> for everry package. Split the setting the architecture to a
> new function, set_debarch(), called once on startup.
> 
> This allows using debarch from other parts of script as
> needed.
> 
> v2: Follow Michals suggestion on setting variables at
> top scope and also setting the fallback $debarch in the
> new function
> 
> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>

Thanks, applied to kbuild.git#misc. But please base your patches on
Linus's or the maintainer's tree next time. Your patch had some
conflicts, because it was based on some non-upstream patches.

Michal

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

* Re: [PATCH 2/2] deb-pkg: add source package
  2015-04-10 13:15 ` [PATCH 2/2] deb-pkg: add source package riku.voipio
@ 2015-04-22 15:50   ` maximilian attems
  2015-04-23  9:01     ` Riku Voipio
  0 siblings, 1 reply; 13+ messages in thread
From: maximilian attems @ 2015-04-22 15:50 UTC (permalink / raw)
  To: riku.voipio; +Cc: linux-kbuild, mmarek, debian-kernel

On Fri, Apr 10, 2015 at 04:15:14PM +0300, riku.voipio@linaro.org wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
> 
> By passing BUILD_SOURCE=y variable, make deb-pkg builds a debian source
> package. It will generate a minimal debian/rules file that calls back
> to make deb-pkg. Generated source package will build the same kernel
> .config than what was available for make deb-pkg.
> 
> The source package is useful for gpl compliance, or for feeding to a
> automated debian package builder.
> 
> Patch depends on the "deb-pkg: move setting debarch for a separate function"
> for correct changelog filenames.
> 
> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
> ---

great this is a much requested feature for wider adoption of make
deb-pkg. In general acked-by me, just minor comment below.

I do not like the BUILD_SOURCE=y variable,
I think it should just be like the other scripts and do it by default.

What we do need is a target that *only* compiles the linux image.

>  scripts/package/builddeb | 42 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index e397815..3d77fd3 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -272,12 +272,23 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public
>  License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
>  EOF
>  
> +
> +build_depends="bc, "
> +if [ -n "$BUILD_TOOLS" ]

why this dual stage?

> +then
> +	build_depends="$build_depends python-dev, libperl-dev, bison, flex, \
> +libaudit-dev, libdw-dev, libelf-dev, libiberty-dev, libnewt-dev, autoconf, \
> +automake, libtool, libglib2.0-dev, libudev-dev, libwrap0-dev, libiberty-dev, \
> +libunwind8-dev [amd64 arm64 i386], libnuma-dev [amd64 arm64 i386 powerpc ppc64 ppc64el] "

how did you generate this list, this seems bogus to me?!

python-dev should probably be python
why would you need automake?

plus I do seem to miss cpio, kmod.

> +fi
> +
>  # Generate a control file
>  cat <<EOF > debian/control
>  Source: linux-upstream
>  Section: kernel
>  Priority: optional
>  Maintainer: $maintainer
> +Build-Depends: $build_depends
>  Standards-Version: 3.8.4
>  Homepage: http://www.kernel.org/
>  EOF
> @@ -425,4 +436,35 @@ EOF
>  	create_package "$tools_packagename" "$tools_dir"
>  fi
>  
> +if [ -n "$BUILD_SOURCE" ]
> +then
> +    cat <<EOF > debian/rules
> +#!/usr/bin/make -f
> +
> +build:
> +	cp debian/config .config
> +	\$(MAKE) oldconfig
> +
> +binary-arch:
> +	\$(MAKE) KDEB_PKGVERSION=${packageversion} BUILD_TOOLS=$BUILD_TOOLS deb-pkg
> +
> +clean:
> +	\$(MAKE) clean
> +
> +binary: binary-arch
> +EOF
> +
> +	(cd $KBUILD_SRC; git archive --prefix=linux-upstream-${version}/ HEAD)|gzip -9 > ../linux-upstream_${version}.orig.tar.gz
> +	cp $KCONFIG_CONFIG debian/config
> +	tar caf ../linux-upstream_${packageversion}.debian.tar.gz debian/{config,copyright,rules,changelog,control}
> +	dpkg-source -cdebian/control -ldebian/changelog --format="3.0 (custom)" --target-format="3.0 (quilt)" \
> +		-b / ../linux-upstream_${version}.orig.tar.gz  ../linux-upstream_${packageversion}.debian.tar.gz
> +	mv linux-upstream_${packageversion}*dsc ..
> +	dpkg-genchanges > ../linux-upstream_${packageversion}_${debarch}.changes
> +else
> +	dpkg-genchanges -b > ../linux-upstream_${packageversion}_${debarch}.changes
> +fi
> +
> +
> +
>  exit 0
> -- 
> 2.1.4
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: https://lists.debian.org/34017611f8a0056a09d2c38412efd7828efe00fe.1428671643.git.riku.voipio@linaro.org
> 

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

* Re: [PATCH] deb-pkg: v2: move setting debarch for a separate function
  2015-04-22 14:45     ` Michal Marek
@ 2015-04-22 15:52       ` maximilian attems
  0 siblings, 0 replies; 13+ messages in thread
From: maximilian attems @ 2015-04-22 15:52 UTC (permalink / raw)
  To: Michal Marek; +Cc: riku.voipio, linux-kbuild, debian-kernel

On Wed, Apr 22, 2015 at 04:45:38PM +0200, Michal Marek wrote:
> On 2015-04-16 15:42, riku.voipio@linaro.org wrote:
> > From: Riku Voipio <riku.voipio@linaro.org>
> > 
> > create_package() function tries to resolve used architecture
> > for everry package. Split the setting the architecture to a
> > new function, set_debarch(), called once on startup.
> > 
> > This allows using debarch from other parts of script as
> > needed.
> > 
> > v2: Follow Michals suggestion on setting variables at
> > top scope and also setting the fallback $debarch in the
> > new function
> > 
> > Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
> 
> Thanks, applied to kbuild.git#misc. But please base your patches on
> Linus's or the maintainer's tree next time. Your patch had some
> conflicts, because it was based on some non-upstream patches.

thanks, acked.


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

* Re: [PATCH 2/2] deb-pkg: add source package
  2015-04-22 15:50   ` maximilian attems
@ 2015-04-23  9:01     ` Riku Voipio
  2015-04-23 10:43       ` maximilian attems
  0 siblings, 1 reply; 13+ messages in thread
From: Riku Voipio @ 2015-04-23  9:01 UTC (permalink / raw)
  To: maximilian attems; +Cc: linux-kbuild, mmarek, debian-kernel

On 22 April 2015 at 18:50, maximilian attems <maks@stro.at> wrote:
> On Fri, Apr 10, 2015 at 04:15:14PM +0300, riku.voipio@linaro.org wrote:
>> From: Riku Voipio <riku.voipio@linaro.org>
>>
>> By passing BUILD_SOURCE=y variable, make deb-pkg builds a debian source
>> package. It will generate a minimal debian/rules file that calls back
>> to make deb-pkg. Generated source package will build the same kernel
>> .config than what was available for make deb-pkg.
>>
>> The source package is useful for gpl compliance, or for feeding to a
>> automated debian package builder.
>>
>> Patch depends on the "deb-pkg: move setting debarch for a separate function"
>> for correct changelog filenames.
>>
>> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
>> ---
>
> great this is a much requested feature for wider adoption of make
> deb-pkg. In general acked-by me, just minor comment below.
>
> I do not like the BUILD_SOURCE=y variable,
> I think it should just be like the other scripts and do it by default.
>
> What we do need is a target that *only* compiles the linux image.

So a bin-debpkg target in scripts/package/Makefile ?

>>  scripts/package/builddeb | 42 ++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 42 insertions(+)
>>
>> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
>> index e397815..3d77fd3 100755
>> --- a/scripts/package/builddeb
>> +++ b/scripts/package/builddeb
>> @@ -272,12 +272,23 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public
>>  License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
>>  EOF
>>
>> +
>> +build_depends="bc, "
>> +if [ -n "$BUILD_TOOLS" ]

> why this dual stage?

That variable was introduced in "RFC: builddeb: add linux-tools
package with perf" [1]. Building perf
as part of deb-pkg was kind of the major motivation for these series.

>> +then
>> +     build_depends="$build_depends python-dev, libperl-dev, bison, flex, \
>> +libaudit-dev, libdw-dev, libelf-dev, libiberty-dev, libnewt-dev, autoconf, \
>> +automake, libtool, libglib2.0-dev, libudev-dev, libwrap0-dev, libiberty-dev, \
>> +libunwind8-dev [amd64 arm64 i386], libnuma-dev [amd64 arm64 i386 powerpc ppc64 ppc64el] "

> how did you generate this list, this seems bogus to me?!

> python-dev should probably be python
> why would you need automake?

These are build-depends of linux-tools (perf etc).

> plus I do seem to miss cpio, kmod.

I'll add kmod and cpio to the non-tools case.

[1] [1] https://lists.debian.org/debian-kernel/2015/04/msg00013.html

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

* Re: [PATCH 2/2] deb-pkg: add source package
  2015-04-23  9:01     ` Riku Voipio
@ 2015-04-23 10:43       ` maximilian attems
  0 siblings, 0 replies; 13+ messages in thread
From: maximilian attems @ 2015-04-23 10:43 UTC (permalink / raw)
  To: Riku Voipio; +Cc: linux-kbuild, mmarek, debian-kernel

On Thu, Apr 23, 2015 at 12:01:10PM +0300, Riku Voipio wrote:
> On 22 April 2015 at 18:50, maximilian attems <maks@stro.at> wrote:
> >
> > great this is a much requested feature for wider adoption of make
> > deb-pkg. In general acked-by me, just minor comment below.
> >
> > I do not like the BUILD_SOURCE=y variable,
> > I think it should just be like the other scripts and do it by default.
> >
> > What we do need is a target that *only* compiles the linux image.
> 
> So a bin-debpkg target in scripts/package/Makefile ?

yes, please.
 
> >>  scripts/package/builddeb | 42 ++++++++++++++++++++++++++++++++++++++++++
> >>  1 file changed, 42 insertions(+)
> >>
> >> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> >> index e397815..3d77fd3 100755
> >> --- a/scripts/package/builddeb
> >> +++ b/scripts/package/builddeb
> >> @@ -272,12 +272,23 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public
> >>  License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
> >>  EOF
> >>
> >> +
> >> +build_depends="bc, "
> >> +if [ -n "$BUILD_TOOLS" ]
> 
> > why this dual stage?
> 
> That variable was introduced in "RFC: builddeb: add linux-tools
> package with perf" [1]. Building perf
> as part of deb-pkg was kind of the major motivation for these series.

With adding the very specific image target, I don't think this variable
is needed.
 
> >> +then
> >> +     build_depends="$build_depends python-dev, libperl-dev, bison, flex, \
> >> +libaudit-dev, libdw-dev, libelf-dev, libiberty-dev, libnewt-dev, autoconf, \
> >> +automake, libtool, libglib2.0-dev, libudev-dev, libwrap0-dev, libiberty-dev, \
> >> +libunwind8-dev [amd64 arm64 i386], libnuma-dev [amd64 arm64 i386 powerpc ppc64 ppc64el] "
> 
> > how did you generate this list, this seems bogus to me?!
> 
> > python-dev should probably be python
> > why would you need automake?
> 
> These are build-depends of linux-tools (perf etc).

Hmm, ok.
 
> > plus I do seem to miss cpio, kmod.
> 
> I'll add kmod and cpio to the non-tools case.

good.

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

* Re: [PATCH 2/2] deb-pkg: add source package
  2015-06-01  8:35   ` Riku Voipio
@ 2015-06-01 12:03     ` Ben Hutchings
  0 siblings, 0 replies; 13+ messages in thread
From: Ben Hutchings @ 2015-06-01 12:03 UTC (permalink / raw)
  To: Riku Voipio; +Cc: linux-kbuild, mmarek, debian-kernel, maximilian attems

[-- Attachment #1: Type: text/plain, Size: 2372 bytes --]

On Mon, 2015-06-01 at 11:35 +0300, Riku Voipio wrote:
> On 31 May 2015 at 04:14, Ben Hutchings <ben@decadent.org.uk> wrote:
> > On Thu, 2015-05-28 at 12:11 +0300, riku.voipio@linaro.org wrote:
> >> From: Riku Voipio <riku.voipio@linaro.org>
> >>
> >> By passing BUILD_SOURCE=y variable, make deb-pkg builds a debian source
> >> package. It will generate a minimal debian/rules file that calls back
> >> to make deb-pkg. Generated source package will build the same kernel
> >> .config than what was available for make deb-pkg.
> >>
> >> The source package is useful for gpl compliance, or for feeding to a
> >> automated debian package builder.
> >>
> >> v2, address Maximilians comments
> >>
> >> - Isolate from my other patches, so it can be merged easier
> >> - Separate bindeb-pkg target for building just binary debs
> >> - Build source package in deb-pkg target to match rpm-pkg target
> > [...]
> >> --- a/scripts/package/builddeb
> >> +++ b/scripts/package/builddeb
> >> @@ -265,12 +265,16 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public
> >>  License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
> >>  EOF
> >>
> >> +
> >> +build_depends="bc, kmod, cpio, python "
> 
> > Why python?
> 
> I recall seeing python called sometimes in kernel build, and it's
> alsoin debian kernel build-depends. However, a quick git grep suggests
> this would be ia64 only.

Yes, the Debian source package has a bunch of Python scripts but not
upstream.

[...]
> >> +clean:
> >> +     \$(MAKE) clean
> >> +
> >> +binary: binary-arch
> >> +EOF
> >> +
> >> +     (cd $KBUILD_SRC; git archive --prefix=linux-upstream-${version}/ HEAD)|gzip -9 > ../linux-upstream_${version}.orig.tar.gz
> 
> > Not xz?  (Which would add a build-dependency, of course.)
> 
> I tried to keep this as universally usable as possible. Can we assume
> xz installed these days? In debian/ubuntu yes, but do we want to cater
> users of other distributions as well?

It would be surprising to have dpkg and not xz.  dpkg doesn't depend on
the xz command any more but it does use liblzma.

Still, I accept that gzip may make this slightly more portable.

Ben.

-- 
Ben Hutchings
Power corrupts.  Absolute power is kind of neat.
                           - John Lehman, Secretary of the US Navy 1981-1987

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re: [PATCH 2/2] deb-pkg: add source package
  2015-05-31  1:14 ` Ben Hutchings
@ 2015-06-01  8:35   ` Riku Voipio
  2015-06-01 12:03     ` Ben Hutchings
  0 siblings, 1 reply; 13+ messages in thread
From: Riku Voipio @ 2015-06-01  8:35 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-kbuild, mmarek, debian-kernel, maximilian attems

On 31 May 2015 at 04:14, Ben Hutchings <ben@decadent.org.uk> wrote:
> On Thu, 2015-05-28 at 12:11 +0300, riku.voipio@linaro.org wrote:
>> From: Riku Voipio <riku.voipio@linaro.org>
>>
>> By passing BUILD_SOURCE=y variable, make deb-pkg builds a debian source
>> package. It will generate a minimal debian/rules file that calls back
>> to make deb-pkg. Generated source package will build the same kernel
>> .config than what was available for make deb-pkg.
>>
>> The source package is useful for gpl compliance, or for feeding to a
>> automated debian package builder.
>>
>> v2, address Maximilians comments
>>
>> - Isolate from my other patches, so it can be merged easier
>> - Separate bindeb-pkg target for building just binary debs
>> - Build source package in deb-pkg target to match rpm-pkg target
> [...]
>> --- a/scripts/package/builddeb
>> +++ b/scripts/package/builddeb
>> @@ -265,12 +265,16 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public
>>  License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
>>  EOF
>>
>> +
>> +build_depends="bc, kmod, cpio, python "

> Why python?

I recall seeing python called sometimes in kernel build, and it's
alsoin debian kernel build-depends. However, a quick git grep suggests
this would be ia64 only.

>>  # Generate a control file
>>  cat <<EOF > debian/control
>>  Source: linux-upstream
>>  Section: kernel
>>  Priority: optional
>>  Maintainer: $maintainer
>> +Build-Depends: $build_depends
>>  Standards-Version: 3.8.4
>>  Homepage: http://www.kernel.org/
>>  EOF
>> @@ -391,4 +395,33 @@ EOF
>>       create_package "$dbg_packagename" "$dbg_dir"
>>  fi
>>
>> +if [ "x$1" = "xdeb-pkg" ]
>> +then
>> +    cat <<EOF > debian/rules
>> +#!/usr/bin/make -f
>> +
>> +build:
>> +     cp debian/config .config
>> +     \$(MAKE) oldconfig
>> +
>> +binary-arch:
>> +     \$(MAKE) KDEB_PKGVERSION=${packageversion} deb-pkg
>
> This should invoke the bindeb-pkg target.

good catch, will fix.

>> +clean:
>> +     \$(MAKE) clean
>> +
>> +binary: binary-arch
>> +EOF
>> +
>> +     (cd $KBUILD_SRC; git archive --prefix=linux-upstream-${version}/ HEAD)|gzip -9 > ../linux-upstream_${version}.orig.tar.gz

> Not xz?  (Which would add a build-dependency, of course.)

I tried to keep this as universally usable as possible. Can we assume
xz installed these days? In debian/ubuntu yes, but do we want to cater
users of other distributions as well?

> Ben.
>
>> +     cp $KCONFIG_CONFIG debian/config
>> +     tar caf ../linux-upstream_${packageversion}.debian.tar.gz debian/{config,copyright,rules,changelog,control}
>> +     dpkg-source -cdebian/control -ldebian/changelog --format="3.0 (custom)" --target-format="3.0 (quilt)" \
>> +             -b / ../linux-upstream_${version}.orig.tar.gz  ../linux-upstream_${packageversion}.debian.tar.gz
>> +     mv linux-upstream_${packageversion}*dsc ..
>> +     dpkg-genchanges > ../linux-upstream_${packageversion}_${debarch}.changes
>> +else
>> +     dpkg-genchanges -b > ../linux-upstream_${packageversion}_${debarch}.changes
>> +fi
>> +
>>  exit 0
>
> --
> Ben Hutchings
> Reality is just a crutch for people who can't handle science fiction.

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

* Re: [PATCH 2/2] deb-pkg: add source package
  2015-05-28  9:11 [PATCH 2/2] deb-pkg: add source package riku.voipio
@ 2015-05-31  1:14 ` Ben Hutchings
  2015-06-01  8:35   ` Riku Voipio
  0 siblings, 1 reply; 13+ messages in thread
From: Ben Hutchings @ 2015-05-31  1:14 UTC (permalink / raw)
  To: riku.voipio; +Cc: linux-kbuild, mmarek, debian-kernel, maximilian attems

[-- Attachment #1: Type: text/plain, Size: 2679 bytes --]

On Thu, 2015-05-28 at 12:11 +0300, riku.voipio@linaro.org wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
> 
> By passing BUILD_SOURCE=y variable, make deb-pkg builds a debian source
> package. It will generate a minimal debian/rules file that calls back
> to make deb-pkg. Generated source package will build the same kernel
> .config than what was available for make deb-pkg.
> 
> The source package is useful for gpl compliance, or for feeding to a
> automated debian package builder.
> 
> v2, address Maximilians comments
> 
> - Isolate from my other patches, so it can be merged easier
> - Separate bindeb-pkg target for building just binary debs
> - Build source package in deb-pkg target to match rpm-pkg target
[...]
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -265,12 +265,16 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public
>  License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
>  EOF
>  
> +
> +build_depends="bc, kmod, cpio, python "

Why python?

>  # Generate a control file
>  cat <<EOF > debian/control
>  Source: linux-upstream
>  Section: kernel
>  Priority: optional
>  Maintainer: $maintainer
> +Build-Depends: $build_depends
>  Standards-Version: 3.8.4
>  Homepage: http://www.kernel.org/
>  EOF
> @@ -391,4 +395,33 @@ EOF
>  	create_package "$dbg_packagename" "$dbg_dir"
>  fi
>  
> +if [ "x$1" = "xdeb-pkg" ]
> +then
> +    cat <<EOF > debian/rules
> +#!/usr/bin/make -f
> +
> +build:
> +	cp debian/config .config
> +	\$(MAKE) oldconfig
> +
> +binary-arch:
> +	\$(MAKE) KDEB_PKGVERSION=${packageversion} deb-pkg

This should invoke the bindeb-pkg target.

> +clean:
> +	\$(MAKE) clean
> +
> +binary: binary-arch
> +EOF
> +
> +	(cd $KBUILD_SRC; git archive --prefix=linux-upstream-${version}/ HEAD)|gzip -9 > ../linux-upstream_${version}.orig.tar.gz

Not xz?  (Which would add a build-dependency, of course.)

Ben.

> +	cp $KCONFIG_CONFIG debian/config
> +	tar caf ../linux-upstream_${packageversion}.debian.tar.gz debian/{config,copyright,rules,changelog,control}
> +	dpkg-source -cdebian/control -ldebian/changelog --format="3.0 (custom)" --target-format="3.0 (quilt)" \
> +		-b / ../linux-upstream_${version}.orig.tar.gz  ../linux-upstream_${packageversion}.debian.tar.gz
> +	mv linux-upstream_${packageversion}*dsc ..
> +	dpkg-genchanges > ../linux-upstream_${packageversion}_${debarch}.changes
> +else
> +	dpkg-genchanges -b > ../linux-upstream_${packageversion}_${debarch}.changes
> +fi
> +
>  exit 0

-- 
Ben Hutchings
Reality is just a crutch for people who can't handle science fiction.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 2/2] deb-pkg: add source package
@ 2015-05-28  9:11 riku.voipio
  2015-05-31  1:14 ` Ben Hutchings
  0 siblings, 1 reply; 13+ messages in thread
From: riku.voipio @ 2015-05-28  9:11 UTC (permalink / raw)
  To: linux-kbuild, mmarek, debian-kernel; +Cc: Riku Voipio, maximilian attems

From: Riku Voipio <riku.voipio@linaro.org>

By passing BUILD_SOURCE=y variable, make deb-pkg builds a debian source
package. It will generate a minimal debian/rules file that calls back
to make deb-pkg. Generated source package will build the same kernel
.config than what was available for make deb-pkg.

The source package is useful for gpl compliance, or for feeding to a
automated debian package builder.

v2, address Maximilians comments

- Isolate from my other patches, so it can be merged easier
- Separate bindeb-pkg target for building just binary debs
- Build source package in deb-pkg target to match rpm-pkg target

Cc: maximilian attems <maks@stro.at>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 scripts/package/Makefile | 11 ++++++++---
 scripts/package/builddeb | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 99ca6e7..7ec4dcc 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -84,12 +84,16 @@ quiet_cmd_builddeb = BUILDDEB
 	} && \
 	\
 	$$KBUILD_PKG_ROOTCMD $(CONFIG_SHELL) \
-		$(srctree)/scripts/package/builddeb
+		$(srctree)/scripts/package/builddeb $@
 
 deb-pkg: FORCE
 	$(MAKE) KBUILD_SRC=
 	$(call cmd,builddeb)
 
+bindeb-pkg: FORCE
+	$(MAKE) KBUILD_SRC=
+	$(call cmd,builddeb)
+
 clean-dirs += $(objtree)/debian/
 
 
@@ -133,8 +137,9 @@ perf-%pkg: FORCE
 # ---------------------------------------------------------------------------
 help: FORCE
 	@echo '  rpm-pkg             - Build both source and binary RPM kernel packages'
-	@echo '  binrpm-pkg          - Build only the binary kernel package'
-	@echo '  deb-pkg             - Build the kernel as a deb package'
+	@echo '  binrpm-pkg          - Build only the binary kernel RPM package'
+	@echo '  deb-pkg             - Build both source and binary deb kernel packages'
+	@echo '  bindeb-pkg          - Build only the binary kernel deb package'
 	@echo '  tar-pkg             - Build the kernel as an uncompressed tarball'
 	@echo '  targz-pkg           - Build the kernel as a gzip compressed tarball'
 	@echo '  tarbz2-pkg          - Build the kernel as a bzip2 compressed tarball'
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 0ccd7ee..1872d03 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -265,12 +265,16 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public
 License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
 EOF
 
+
+build_depends="bc, kmod, cpio, python "
+
 # Generate a control file
 cat <<EOF > debian/control
 Source: linux-upstream
 Section: kernel
 Priority: optional
 Maintainer: $maintainer
+Build-Depends: $build_depends
 Standards-Version: 3.8.4
 Homepage: http://www.kernel.org/
 EOF
@@ -391,4 +395,33 @@ EOF
 	create_package "$dbg_packagename" "$dbg_dir"
 fi
 
+if [ "x$1" = "xdeb-pkg" ]
+then
+    cat <<EOF > debian/rules
+#!/usr/bin/make -f
+
+build:
+	cp debian/config .config
+	\$(MAKE) oldconfig
+
+binary-arch:
+	\$(MAKE) KDEB_PKGVERSION=${packageversion} deb-pkg
+
+clean:
+	\$(MAKE) clean
+
+binary: binary-arch
+EOF
+
+	(cd $KBUILD_SRC; git archive --prefix=linux-upstream-${version}/ HEAD)|gzip -9 > ../linux-upstream_${version}.orig.tar.gz
+	cp $KCONFIG_CONFIG debian/config
+	tar caf ../linux-upstream_${packageversion}.debian.tar.gz debian/{config,copyright,rules,changelog,control}
+	dpkg-source -cdebian/control -ldebian/changelog --format="3.0 (custom)" --target-format="3.0 (quilt)" \
+		-b / ../linux-upstream_${version}.orig.tar.gz  ../linux-upstream_${packageversion}.debian.tar.gz
+	mv linux-upstream_${packageversion}*dsc ..
+	dpkg-genchanges > ../linux-upstream_${packageversion}_${debarch}.changes
+else
+	dpkg-genchanges -b > ../linux-upstream_${packageversion}_${debarch}.changes
+fi
+
 exit 0
-- 
2.1.4


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

end of thread, other threads:[~2015-06-01 12:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-10 13:15 [PATCH 1/2] deb-pkg: move setting debarch for a separate function riku.voipio
2015-04-10 13:15 ` [PATCH 2/2] deb-pkg: add source package riku.voipio
2015-04-22 15:50   ` maximilian attems
2015-04-23  9:01     ` Riku Voipio
2015-04-23 10:43       ` maximilian attems
2015-04-15 12:30 ` [PATCH 1/2] deb-pkg: move setting debarch for a separate function Michal Marek
2015-04-16 13:42   ` [PATCH] deb-pkg: v2: " riku.voipio
2015-04-22 14:45     ` Michal Marek
2015-04-22 15:52       ` maximilian attems
2015-05-28  9:11 [PATCH 2/2] deb-pkg: add source package riku.voipio
2015-05-31  1:14 ` Ben Hutchings
2015-06-01  8:35   ` Riku Voipio
2015-06-01 12:03     ` Ben Hutchings

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.