All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] builddeb: fix typo
@ 2016-08-26  8:17 Andrew Donnellan
  2016-08-26  8:17 ` [PATCH 2/2] builddeb: allow building without headers/firmware packages Andrew Donnellan
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Donnellan @ 2016-08-26  8:17 UTC (permalink / raw)
  To: mmarek, linux-kbuild; +Cc: linux-kernel

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
---
 scripts/package/builddeb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 8ea9fd2..d600fd0 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -69,7 +69,7 @@ set_debarch() {
 		echo "" >&2
 		echo "** ** **  WARNING  ** ** **" >&2
 		echo "" >&2
-		echo "Your architecture doesn't have it's equivalent" >&2
+		echo "Your architecture doesn't have its equivalent" >&2
 		echo "Debian userspace architecture defined!" >&2
 		echo "Falling back to using your current userspace instead!" >&2
 		echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited

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

* [PATCH 2/2] builddeb: allow building without headers/firmware packages
  2016-08-26  8:17 [PATCH 1/2] builddeb: fix typo Andrew Donnellan
@ 2016-08-26  8:17 ` Andrew Donnellan
  2016-10-18  2:12   ` Andrew Donnellan
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Donnellan @ 2016-08-26  8:17 UTC (permalink / raw)
  To: mmarek, linux-kbuild; +Cc: linux-kernel

Currently, the deb-pkg and bindeb-pkg targets create multiple packages for
the kernel binaries, headers, userspace headers and firmware.

For developers who generate Debian packages as part of their development
workflows, it's often not necessary to generate all these packages.

Allow the creation of the linux-headers, linux-libc-dev and linux-firmware
packages to be disabled if the environment variables KDEB_NO_HEADERS,
KDEB_NO_LIBC_HEADERS or KDEB_NO_FIRMWARE are non-empty.

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

---

On top of d3e2773c4ede5c62d2a92dae20e3a09b1ca55b6e in kbuild#rc-fixes
---
 Documentation/kbuild/kbuild.txt |  7 +++++
 scripts/package/builddeb        | 67 ++++++++++++++++++++++++-----------------
 2 files changed, 46 insertions(+), 28 deletions(-)

diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt
index 0ff6a46..cef4f7f 100644
--- a/Documentation/kbuild/kbuild.txt
+++ b/Documentation/kbuild/kbuild.txt
@@ -238,3 +238,10 @@ KBUILD_VMLINUX_MAIN
 All object files for the main part of vmlinux.
 KBUILD_VMLINUX_INIT and KBUILD_VMLINUX_MAIN together specify
 all the object files used to link vmlinux.
+
+KDEB_NO_HEADERS, KDEB_NO_LIBC_HEADERS, KDEB_NO_FIRMWARE
+-------------------------------------------------------
+If these variables are set, the deb-pkg and bindeb-pkg targets won't create
+linux-headers, linux-libc-dev and linux-firmware packages respectively. This
+may be useful for developers who use the deb-pkg targets in their workflow
+but don't need the full set of packages.
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index d600fd0..da595da 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -187,7 +187,9 @@ fi
 
 if [ "$ARCH" != "um" ]; then
 	$MAKE headers_check KBUILD_SRC=
-	$MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr"
+	if [ -z "$KDEB_NO_LIBC_HEADERS" ]; then
+		$MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr"
+	fi
 fi
 
 # Install the maintainer scripts
@@ -324,26 +326,27 @@ EOF
 fi
 
 # 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) >> "$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 grep -q '^CONFIG_STACK_VALIDATION=y' $KCONFIG_CONFIG ; then
-	(cd $objtree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrobjfiles"
-fi
-(cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
-if grep -q '^CONFIG_GCC_PLUGINS=y' $KCONFIG_CONFIG ; then
-	(cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles"
-fi
-destdir=$kernel_headers_dir/usr/src/linux-headers-$version
-mkdir -p "$destdir"
-(cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -)
-(cd $objtree; tar -c -f - -T -) < "$objtree/debian/hdrobjfiles" | (cd $destdir; tar -xf -)
-(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
-ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
-rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
+if [ -z "$KDEB_NO_HEADERS" ]; then
+	(cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) > "$objtree/debian/hdrsrcfiles"
+	(cd $srctree; find arch/*/include include scripts -type f) >> "$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 grep -q '^CONFIG_STACK_VALIDATION=y' $KCONFIG_CONFIG ; then
+		(cd $objtree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrobjfiles"
+	fi
+	(cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
+	if grep -q '^CONFIG_GCC_PLUGINS=y' $KCONFIG_CONFIG ; then
+		(cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles"
+	fi
+	destdir=$kernel_headers_dir/usr/src/linux-headers-$version
+	mkdir -p "$destdir"
+	(cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -)
+	(cd $objtree; tar -c -f - -T -) < "$objtree/debian/hdrobjfiles" | (cd $destdir; tar -xf -)
+	(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
+	ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
+	rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
 
-cat <<EOF >> debian/control
+	cat <<EOF >> debian/control
 
 Package: $kernel_headers_packagename
 Provides: linux-headers, linux-headers-2.6
@@ -353,13 +356,13 @@ Description: Linux kernel headers for $KERNELRELEASE on \${kernel:debarch}
  .
  This is useful for people who need to build external modules
 EOF
+fi
 
 # Do we have firmware? Move it out of the way and build it into a package.
 if [ -e "$tmpdir/lib/firmware" ]; then
-	mv "$tmpdir/lib/firmware"/* "$fwdir/lib/firmware/$version/"
-	rmdir "$tmpdir/lib/firmware"
-
-	cat <<EOF >> debian/control
+	if [ -z "$KDEB_NO_FIRMWARE" ]; then
+		mv "$tmpdir/lib/firmware"/* "$fwdir/lib/firmware/$version/"
+		cat <<EOF >> debian/control
 
 Package: $fwpackagename
 Architecture: all
@@ -367,10 +370,13 @@ Description: Linux kernel firmware, version $version
  This package contains firmware from the Linux kernel, version $version.
 EOF
 
-	create_package "$fwpackagename" "$fwdir"
+		create_package "$fwpackagename" "$fwdir"
+	fi
+	rm -r "$tmpdir/lib/firmware"
 fi
 
-cat <<EOF >> debian/control
+if [ -z "$KDEB_NO_LIBC_HEADERS" ]; then
+	cat <<EOF >> debian/control
 
 Package: $libc_headers_packagename
 Section: devel
@@ -380,10 +386,15 @@ Description: Linux support headers for userspace development
  This package provides userspaces headers from the Linux kernel.  These headers
  are used by the installed headers for GNU glibc and other system libraries.
 EOF
+fi
 
 if [ "$ARCH" != "um" ]; then
-	create_package "$kernel_headers_packagename" "$kernel_headers_dir"
-	create_package "$libc_headers_packagename" "$libc_headers_dir"
+	if [ -z "$KDEB_NO_HEADERS" ]; then
+		create_package "$kernel_headers_packagename" "$kernel_headers_dir"
+	fi
+	if [ -z "$KDEB_NO_LIBC_HEADERS" ]; then
+		create_package "$libc_headers_packagename" "$libc_headers_dir"
+	fi
 fi
 
 create_package "$packagename" "$tmpdir"
-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited

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

* Re: [PATCH 2/2] builddeb: allow building without headers/firmware packages
  2016-08-26  8:17 ` [PATCH 2/2] builddeb: allow building without headers/firmware packages Andrew Donnellan
@ 2016-10-18  2:12   ` Andrew Donnellan
  2016-11-25 12:24     ` Riku Voipio
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Donnellan @ 2016-10-18  2:12 UTC (permalink / raw)
  To: mmarek, linux-kbuild; +Cc: linux-kernel

On 26/08/16 18:17, Andrew Donnellan wrote:
> Currently, the deb-pkg and bindeb-pkg targets create multiple packages for
> the kernel binaries, headers, userspace headers and firmware.
>
> For developers who generate Debian packages as part of their development
> workflows, it's often not necessary to generate all these packages.
>
> Allow the creation of the linux-headers, linux-libc-dev and linux-firmware
> packages to be disabled if the environment variables KDEB_NO_HEADERS,
> KDEB_NO_LIBC_HEADERS or KDEB_NO_FIRMWARE are non-empty.
>
> Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

Ping :)

> On top of d3e2773c4ede5c62d2a92dae20e3a09b1ca55b6e in kbuild#rc-fixes

This of course is now in mainline.

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited

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

* Re: [PATCH 2/2] builddeb: allow building without headers/firmware packages
  2016-10-18  2:12   ` Andrew Donnellan
@ 2016-11-25 12:24     ` Riku Voipio
  2016-11-29  0:06       ` Andrew Donnellan
  0 siblings, 1 reply; 5+ messages in thread
From: Riku Voipio @ 2016-11-25 12:24 UTC (permalink / raw)
  To: Andrew Donnellan; +Cc: Michal Marek, linux-kbuild, LKML

On 18 October 2016 at 05:12, Andrew Donnellan
<andrew.donnellan@au1.ibm.com> wrote:
> On 26/08/16 18:17, Andrew Donnellan wrote:
>>
>> Currently, the deb-pkg and bindeb-pkg targets create multiple packages for
>> the kernel binaries, headers, userspace headers and firmware.
>>
>> For developers who generate Debian packages as part of their development
>> workflows, it's often not necessary to generate all these packages.
>>
>> Allow the creation of the linux-headers, linux-libc-dev and linux-firmware
>> packages to be disabled if the environment variables KDEB_NO_HEADERS,
>> KDEB_NO_LIBC_HEADERS or KDEB_NO_FIRMWARE are non-empty.
>>
>> Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

> Ping :)

I'm not a big fan of this patch. It adds some complexity as evident by
extra indent
level it adds. On practice developers would end up passing a long command line
with all KDEB_NO* variables.

Riku

>> On top of d3e2773c4ede5c62d2a92dae20e3a09b1ca55b6e in kbuild#rc-fixes
>
>
> This of course is now in mainline.
>
>
> --
> Andrew Donnellan              OzLabs, ADL Canberra
> andrew.donnellan@au1.ibm.com  IBM Australia Limited
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 2/2] builddeb: allow building without headers/firmware packages
  2016-11-25 12:24     ` Riku Voipio
@ 2016-11-29  0:06       ` Andrew Donnellan
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Donnellan @ 2016-11-29  0:06 UTC (permalink / raw)
  To: Riku Voipio; +Cc: Michal Marek, linux-kbuild, LKML

On 25/11/16 23:24, Riku Voipio wrote:
> I'm not a big fan of this patch. It adds some complexity as evident by
> extra indent
> level it adds. On practice developers would end up passing a long command line
> with all KDEB_NO* variables.

That's fair! I think the approach in your new patch is probably better, 
I'll review that.

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited

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

end of thread, other threads:[~2016-11-29  0:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-26  8:17 [PATCH 1/2] builddeb: fix typo Andrew Donnellan
2016-08-26  8:17 ` [PATCH 2/2] builddeb: allow building without headers/firmware packages Andrew Donnellan
2016-10-18  2:12   ` Andrew Donnellan
2016-11-25 12:24     ` Riku Voipio
2016-11-29  0:06       ` Andrew Donnellan

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.