linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package
@ 2020-01-15 16:25 Masahiro Yamada
  2020-01-15 16:25 ` [PATCH v2 2/7] builddeb: match temporary directory name to the package name Masahiro Yamada
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Masahiro Yamada @ 2020-01-15 16:25 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Ben Hutchings, Riku Voipio, Masahiro Yamada, Michal Marek, linux-kernel

 - We do not need tools/objtool/fixdep or tools/objtool/sync-check.sh
   for building external modules. Including tools/objtool/objtool is
   enough.

 - gcc-common.h is a check-in file. I do not see any point to search
   for it in objtree.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

Changes in v2: None

 scripts/package/builddeb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index b60388051c7f..eb067d6f1370 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -170,11 +170,11 @@ done
 (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
-	(cd $objtree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrobjfiles"
+	echo tools/objtool/objtool >> "$objtree/debian/hdrobjfiles"
 fi
 (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
 if is_enabled CONFIG_GCC_PLUGINS; then
-	(cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles"
+	(cd $objtree; find scripts/gcc-plugins -name \*.so) >> "$objtree/debian/hdrobjfiles"
 fi
 destdir=$kernel_headers_dir/usr/src/linux-headers-$version
 mkdir -p "$destdir"
-- 
2.17.1


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

* [PATCH v2 2/7] builddeb: match temporary directory name to the package name
  2020-01-15 16:25 [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package Masahiro Yamada
@ 2020-01-15 16:25 ` Masahiro Yamada
  2020-01-15 16:25 ` [PATCH v2 3/7] builddeb: remove redundant $objtree/ Masahiro Yamada
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2020-01-15 16:25 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Ben Hutchings, Riku Voipio, Masahiro Yamada, Michal Marek, linux-kernel

The temporary directory names, debian/hdrtmp (linux-headers package)
vs debian/headertmp (linux-libc-dev package), are confusing.

Matching the directory name to the package name is clearer, IMHO.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

Changes in v2: None

 scripts/package/builddeb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index eb067d6f1370..0a0a7c1447f4 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -47,10 +47,10 @@ create_package() {
 }
 
 version=$KERNELRELEASE
-tmpdir="$objtree/debian/tmp"
-kernel_headers_dir="$objtree/debian/hdrtmp"
-libc_headers_dir="$objtree/debian/headertmp"
-dbg_dir="$objtree/debian/dbgtmp"
+tmpdir="$objtree/debian/linux-image"
+kernel_headers_dir="$objtree/debian/linux-headers"
+libc_headers_dir="$objtree/debian/linux-libc-dev"
+dbg_dir="$objtree/debian/linux-image-dbg"
 packagename=linux-image-$version
 kernel_headers_packagename=linux-headers-$version
 libc_headers_packagename=linux-libc-dev
-- 
2.17.1


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

* [PATCH v2 3/7] builddeb: remove redundant $objtree/
  2020-01-15 16:25 [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package Masahiro Yamada
  2020-01-15 16:25 ` [PATCH v2 2/7] builddeb: match temporary directory name to the package name Masahiro Yamada
@ 2020-01-15 16:25 ` Masahiro Yamada
  2020-01-15 16:25 ` [PATCH v2 4/7] builddeb: avoid invoking sub-shells where possible Masahiro Yamada
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2020-01-15 16:25 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Ben Hutchings, Riku Voipio, Masahiro Yamada, Michal Marek, linux-kernel

This script works only when it is invoked in the $objtree, that is,
it is already relying on $objtree is '.'

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

Changes in v2: None

 scripts/package/builddeb | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 0a0a7c1447f4..9b92745bf13a 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -47,10 +47,10 @@ create_package() {
 }
 
 version=$KERNELRELEASE
-tmpdir="$objtree/debian/linux-image"
-kernel_headers_dir="$objtree/debian/linux-headers"
-libc_headers_dir="$objtree/debian/linux-libc-dev"
-dbg_dir="$objtree/debian/linux-image-dbg"
+tmpdir=debian/linux-image
+kernel_headers_dir=debian/linux-headers
+libc_headers_dir=debian/linux-libc-dev
+dbg_dir=debian/linux-image-dbg
 packagename=linux-image-$version
 kernel_headers_packagename=linux-headers-$version
 libc_headers_packagename=linux-libc-dev
@@ -77,7 +77,7 @@ esac
 BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes)
 
 # Setup the directory structure
-rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files
+rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" debian/files
 mkdir -m 755 -p "$tmpdir/DEBIAN"
 mkdir -p "$tmpdir/lib" "$tmpdir/boot"
 mkdir -p "$kernel_headers_dir/lib/modules/$version/"
@@ -165,24 +165,24 @@ EOF
 done
 
 # Build kernel header package
-(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"
+(cd $srctree; find . arch/$SRCARCH -maxdepth 1 -name Makefile\*) > debian/hdrsrcfiles
+(cd $srctree; find include scripts -type f -o -type l) >> debian/hdrsrcfiles
+(cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> debian/hdrsrcfiles
+(cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> debian/hdrsrcfiles
 if is_enabled CONFIG_STACK_VALIDATION; then
-	echo tools/objtool/objtool >> "$objtree/debian/hdrobjfiles"
+	echo tools/objtool/objtool >> debian/hdrobjfiles
 fi
-(cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
+find arch/$SRCARCH/include Module.symvers include scripts -type f >> debian/hdrobjfiles
 if is_enabled CONFIG_GCC_PLUGINS; then
-	(cd $objtree; find scripts/gcc-plugins -name \*.so) >> "$objtree/debian/hdrobjfiles"
+	find scripts/gcc-plugins -name \*.so >> 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
+(cd $srctree; tar -c -f - -T -) < debian/hdrsrcfiles | (cd $destdir; tar -xf -)
+tar -c -f - -T - < debian/hdrobjfiles | (cd $destdir; tar -xf -)
+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"
+rm -f debian/hdrsrcfiles debian/hdrobjfiles
 
 if [ "$ARCH" != "um" ]; then
 	create_package "$kernel_headers_packagename" "$kernel_headers_dir"
-- 
2.17.1


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

* [PATCH v2 4/7] builddeb: avoid invoking sub-shells where possible
  2020-01-15 16:25 [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package Masahiro Yamada
  2020-01-15 16:25 ` [PATCH v2 2/7] builddeb: match temporary directory name to the package name Masahiro Yamada
  2020-01-15 16:25 ` [PATCH v2 3/7] builddeb: remove redundant $objtree/ Masahiro Yamada
@ 2020-01-15 16:25 ` Masahiro Yamada
  2020-01-21 19:21   ` Ben Hutchings
  2020-01-21 19:24   ` Ben Hutchings
  2020-01-15 16:25 ` [PATCH v2 5/7] builddeb: remove redundant make for ARCH=um Masahiro Yamada
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 12+ messages in thread
From: Masahiro Yamada @ 2020-01-15 16:25 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Ben Hutchings, Riku Voipio, Masahiro Yamada, Michal Marek, linux-kernel

The commands surrounded by ( ... ) is run in a sub-shell, but you do
not have to spawn a sub-shell for every single line.

Use just one ( ... ) for creating debian/hdrsrcfiles.

For tar, use -C option instead.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

Changes in v2:
 - fix misconversion pointed out by Ben

 scripts/package/builddeb | 39 ++++++++++++++++++++++++++-------------
 1 file changed, 26 insertions(+), 13 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 9b92745bf13a..7d7e0abe62b6 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -165,21 +165,34 @@ EOF
 done
 
 # Build kernel header package
-(cd $srctree; find . arch/$SRCARCH -maxdepth 1 -name Makefile\*) > debian/hdrsrcfiles
-(cd $srctree; find include scripts -type f -o -type l) >> debian/hdrsrcfiles
-(cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> debian/hdrsrcfiles
-(cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> debian/hdrsrcfiles
-if is_enabled CONFIG_STACK_VALIDATION; then
-	echo tools/objtool/objtool >> debian/hdrobjfiles
-fi
-find arch/$SRCARCH/include Module.symvers include scripts -type f >> debian/hdrobjfiles
-if is_enabled CONFIG_GCC_PLUGINS; then
-	find scripts/gcc-plugins -name \*.so >> debian/hdrobjfiles
-fi
+(
+	cd $srctree
+	find . arch/$SRCARCH -maxdepth 1 -name Makefile\*
+	find include scripts -type f -o -type l
+	find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform
+	find arch/$SRCARCH/include -type f
+
+	if [ -d arch/$SRCARCH/scripts ]; then
+		find arch/$SRCARCH/scripts -type f
+	fi
+) > debian/hdrsrcfiles
+
+{
+	if is_enabled CONFIG_STACK_VALIDATION; then
+		find tools/objtool -type f -executable
+	fi
+
+	find arch/$SRCARCH/include Module.symvers include scripts -type f
+
+	if is_enabled CONFIG_GCC_PLUGINS; then
+		find scripts/gcc-plugins -name \*.so
+	fi
+} > debian/hdrobjfiles
+
 destdir=$kernel_headers_dir/usr/src/linux-headers-$version
 mkdir -p "$destdir"
-(cd $srctree; tar -c -f - -T -) < debian/hdrsrcfiles | (cd $destdir; tar -xf -)
-tar -c -f - -T - < debian/hdrobjfiles | (cd $destdir; tar -xf -)
+tar -c -f - -C $srctree -T debian/hdrsrcfiles | tar -xf - -C $destdir
+tar -c -f - -T debian/hdrobjfiles | tar -xf - -C $destdir
 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 debian/hdrsrcfiles debian/hdrobjfiles
-- 
2.17.1


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

* [PATCH v2 5/7] builddeb: remove redundant make for ARCH=um
  2020-01-15 16:25 [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package Masahiro Yamada
                   ` (2 preceding siblings ...)
  2020-01-15 16:25 ` [PATCH v2 4/7] builddeb: avoid invoking sub-shells where possible Masahiro Yamada
@ 2020-01-15 16:25 ` Masahiro Yamada
  2020-01-15 16:25 ` [PATCH v2 6/7] builddeb: split kernel headers deployment out into a function Masahiro Yamada
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2020-01-15 16:25 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Ben Hutchings, Riku Voipio, Masahiro Yamada, Michal Marek, linux-kernel

The kernel build has already been done before builddeb is invoked.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

Changes in v2: None

 scripts/package/builddeb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 7d7e0abe62b6..650572497811 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -82,10 +82,9 @@ mkdir -m 755 -p "$tmpdir/DEBIAN"
 mkdir -p "$tmpdir/lib" "$tmpdir/boot"
 mkdir -p "$kernel_headers_dir/lib/modules/$version/"
 
-# Build and install the kernel
+# Install the kernel
 if [ "$ARCH" = "um" ] ; then
 	mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin" "$tmpdir/usr/share/doc/$packagename"
-	$MAKE linux
 	cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"
 	cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config"
 	gzip "$tmpdir/usr/share/doc/$packagename/config"
-- 
2.17.1


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

* [PATCH v2 6/7] builddeb: split kernel headers deployment out into a function
  2020-01-15 16:25 [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package Masahiro Yamada
                   ` (3 preceding siblings ...)
  2020-01-15 16:25 ` [PATCH v2 5/7] builddeb: remove redundant make for ARCH=um Masahiro Yamada
@ 2020-01-15 16:25 ` Masahiro Yamada
  2020-01-15 16:25 ` [PATCH v2 7/7] builddeb: split libc " Masahiro Yamada
  2020-01-21 15:48 ` [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package Masahiro Yamada
  6 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2020-01-15 16:25 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Ben Hutchings, Riku Voipio, Masahiro Yamada, Michal Marek, linux-kernel

Deploy kernel headers (linux-headers package) in a separate function
for readability.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

Changes in v2: None

 scripts/package/builddeb | 84 ++++++++++++++++++++++------------------
 1 file changed, 46 insertions(+), 38 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 650572497811..d149452692da 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -46,13 +46,53 @@ create_package() {
 	dpkg --build "$pdir" ..
 }
 
+deploy_kernel_headers () {
+	pdir=$1
+
+	rm -rf $pdir
+
+	(
+		cd $srctree
+		find . arch/$SRCARCH -maxdepth 1 -name Makefile\*
+		find include scripts -type f -o -type l
+		find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform
+		find arch/$SRCARCH/include -type f
+
+		if [ -d arch/$SRCARCH/scripts ]; then
+			find arch/$SRCARCH/scripts -type f
+		fi
+	) > debian/hdrsrcfiles
+
+	{
+		if is_enabled CONFIG_STACK_VALIDATION; then
+			find tools/objtool -type f -executable
+		fi
+
+		find arch/$SRCARCH/include Module.symvers include scripts -type f
+
+		if is_enabled CONFIG_GCC_PLUGINS; then
+			find scripts/gcc-plugins -name \*.so
+		fi
+	} > debian/hdrobjfiles
+
+	destdir=$pdir/usr/src/linux-headers-$version
+	mkdir -p $destdir
+	tar -c -f - -C $srctree -T debian/hdrsrcfiles | tar -xf - -C $destdir
+	tar -c -f - -T debian/hdrobjfiles | tar -xf - -C $destdir
+	rm -f debian/hdrsrcfiles debian/hdrobjfiles
+
+	# copy .config manually to be where it's expected to be
+	cp $KCONFIG_CONFIG $destdir/.config
+
+	mkdir -p $pdir/lib/modules/$version/
+	ln -s /usr/src/linux-headers-$version $pdir/lib/modules/$version/build
+}
+
 version=$KERNELRELEASE
 tmpdir=debian/linux-image
-kernel_headers_dir=debian/linux-headers
 libc_headers_dir=debian/linux-libc-dev
 dbg_dir=debian/linux-image-dbg
 packagename=linux-image-$version
-kernel_headers_packagename=linux-headers-$version
 libc_headers_packagename=linux-libc-dev
 dbg_packagename=$packagename-dbg
 
@@ -77,10 +117,9 @@ esac
 BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes)
 
 # Setup the directory structure
-rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" debian/files
+rm -rf "$tmpdir" "$libc_headers_dir" "$dbg_dir" debian/files
 mkdir -m 755 -p "$tmpdir/DEBIAN"
 mkdir -p "$tmpdir/lib" "$tmpdir/boot"
-mkdir -p "$kernel_headers_dir/lib/modules/$version/"
 
 # Install the kernel
 if [ "$ARCH" = "um" ] ; then
@@ -163,41 +202,10 @@ EOF
 	chmod 755 "$tmpdir/DEBIAN/$script"
 done
 
-# Build kernel header package
-(
-	cd $srctree
-	find . arch/$SRCARCH -maxdepth 1 -name Makefile\*
-	find include scripts -type f -o -type l
-	find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform
-	find arch/$SRCARCH/include -type f
-
-	if [ -d arch/$SRCARCH/scripts ]; then
-		find arch/$SRCARCH/scripts -type f
-	fi
-) > debian/hdrsrcfiles
-
-{
-	if is_enabled CONFIG_STACK_VALIDATION; then
-		find tools/objtool -type f -executable
-	fi
-
-	find arch/$SRCARCH/include Module.symvers include scripts -type f
-
-	if is_enabled CONFIG_GCC_PLUGINS; then
-		find scripts/gcc-plugins -name \*.so
-	fi
-} > debian/hdrobjfiles
-
-destdir=$kernel_headers_dir/usr/src/linux-headers-$version
-mkdir -p "$destdir"
-tar -c -f - -C $srctree -T debian/hdrsrcfiles | tar -xf - -C $destdir
-tar -c -f - -T debian/hdrobjfiles | tar -xf - -C $destdir
-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 debian/hdrsrcfiles debian/hdrobjfiles
-
 if [ "$ARCH" != "um" ]; then
-	create_package "$kernel_headers_packagename" "$kernel_headers_dir"
+	deploy_kernel_headers debian/linux-headers
+	create_package linux-headers-$version debian/linux-headers
+
 	create_package "$libc_headers_packagename" "$libc_headers_dir"
 fi
 
-- 
2.17.1


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

* [PATCH v2 7/7] builddeb: split libc headers deployment out into a function
  2020-01-15 16:25 [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package Masahiro Yamada
                   ` (4 preceding siblings ...)
  2020-01-15 16:25 ` [PATCH v2 6/7] builddeb: split kernel headers deployment out into a function Masahiro Yamada
@ 2020-01-15 16:25 ` Masahiro Yamada
  2020-01-21 15:48 ` [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package Masahiro Yamada
  6 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2020-01-15 16:25 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Ben Hutchings, Riku Voipio, Masahiro Yamada, Michal Marek, linux-kernel

Deploy user-space headers (linux-libc-dev package) in a separate
function for readability.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

Changes in v2: None

 scripts/package/builddeb | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index d149452692da..f49f41fd4c95 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -88,12 +88,25 @@ deploy_kernel_headers () {
 	ln -s /usr/src/linux-headers-$version $pdir/lib/modules/$version/build
 }
 
+deploy_libc_headers () {
+	pdir=$1
+
+	rm -rf $pdir
+
+	$MAKE -f $srctree/Makefile headers
+	$MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH=$pdir/usr
+
+	# move asm headers to /usr/include/<libc-machine>/asm to match the structure
+	# used by Debian-based distros (to support multi-arch)
+	host_arch=$(dpkg-architecture -a$(cat debian/arch) -qDEB_HOST_MULTIARCH)
+	mkdir $pdir/usr/include/$host_arch
+	mv $pdir/usr/include/asm $pdir/usr/include/$host_arch/
+}
+
 version=$KERNELRELEASE
 tmpdir=debian/linux-image
-libc_headers_dir=debian/linux-libc-dev
 dbg_dir=debian/linux-image-dbg
 packagename=linux-image-$version
-libc_headers_packagename=linux-libc-dev
 dbg_packagename=$packagename-dbg
 
 if [ "$ARCH" = "um" ] ; then
@@ -117,7 +130,7 @@ esac
 BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes)
 
 # Setup the directory structure
-rm -rf "$tmpdir" "$libc_headers_dir" "$dbg_dir" debian/files
+rm -rf "$tmpdir" "$dbg_dir" debian/files
 mkdir -m 755 -p "$tmpdir/DEBIAN"
 mkdir -p "$tmpdir/lib" "$tmpdir/boot"
 
@@ -167,16 +180,6 @@ if is_enabled CONFIG_MODULES; then
 	fi
 fi
 
-if [ "$ARCH" != "um" ]; then
-	$MAKE -f $srctree/Makefile headers
-	$MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr"
-	# move asm headers to /usr/include/<libc-machine>/asm to match the structure
-	# used by Debian-based distros (to support multi-arch)
-	host_arch=$(dpkg-architecture -a$(cat debian/arch) -qDEB_HOST_MULTIARCH)
-	mkdir $libc_headers_dir/usr/include/$host_arch
-	mv $libc_headers_dir/usr/include/asm $libc_headers_dir/usr/include/$host_arch/
-fi
-
 # Install the maintainer scripts
 # Note: hook scripts under /etc/kernel are also executed by official Debian
 # kernel packages, as well as kernel packages built using make-kpkg.
@@ -206,7 +209,8 @@ if [ "$ARCH" != "um" ]; then
 	deploy_kernel_headers debian/linux-headers
 	create_package linux-headers-$version debian/linux-headers
 
-	create_package "$libc_headers_packagename" "$libc_headers_dir"
+	deploy_libc_headers debian/linux-libc-dev
+	create_package linux-libc-dev debian/linux-libc-dev
 fi
 
 create_package "$packagename" "$tmpdir"
-- 
2.17.1


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

* Re: [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package
  2020-01-15 16:25 [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package Masahiro Yamada
                   ` (5 preceding siblings ...)
  2020-01-15 16:25 ` [PATCH v2 7/7] builddeb: split libc " Masahiro Yamada
@ 2020-01-21 15:48 ` Masahiro Yamada
  6 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2020-01-21 15:48 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: Ben Hutchings, Riku Voipio, Michal Marek, Linux Kernel Mailing List

On Thu, Jan 16, 2020 at 1:26 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
>  - We do not need tools/objtool/fixdep or tools/objtool/sync-check.sh
>    for building external modules. Including tools/objtool/objtool is
>    enough.
>
>  - gcc-common.h is a check-in file. I do not see any point to search
>    for it in objtree.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> Changes in v2: None


Series, applied to linux-kbuild.


>
>  scripts/package/builddeb | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index b60388051c7f..eb067d6f1370 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -170,11 +170,11 @@ done
>  (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
> -       (cd $objtree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrobjfiles"
> +       echo tools/objtool/objtool >> "$objtree/debian/hdrobjfiles"
>  fi
>  (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
>  if is_enabled CONFIG_GCC_PLUGINS; then
> -       (cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles"
> +       (cd $objtree; find scripts/gcc-plugins -name \*.so) >> "$objtree/debian/hdrobjfiles"
>  fi
>  destdir=$kernel_headers_dir/usr/src/linux-headers-$version
>  mkdir -p "$destdir"
> --
> 2.17.1
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH v2 4/7] builddeb: avoid invoking sub-shells where possible
  2020-01-15 16:25 ` [PATCH v2 4/7] builddeb: avoid invoking sub-shells where possible Masahiro Yamada
@ 2020-01-21 19:21   ` Ben Hutchings
  2020-01-25  4:05     ` Masahiro Yamada
  2020-01-21 19:24   ` Ben Hutchings
  1 sibling, 1 reply; 12+ messages in thread
From: Ben Hutchings @ 2020-01-21 19:21 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: Riku Voipio, Michal Marek, linux-kernel

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

On Thu, 2020-01-16 at 01:25 +0900, Masahiro Yamada wrote:
> The commands surrounded by ( ... ) is run in a sub-shell, but you do
> not have to spawn a sub-shell for every single line.
> 
> Use just one ( ... ) for creating debian/hdrsrcfiles.
> 
> For tar, use -C option instead.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
> Changes in v2:
>  - fix misconversion pointed out by Ben
> 
>  scripts/package/builddeb | 39 ++++++++++++++++++++++++++-------------
>  1 file changed, 26 insertions(+), 13 deletions(-)
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 9b92745bf13a..7d7e0abe62b6 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -165,21 +165,34 @@ EOF
>  done
>  
>  # Build kernel header package
> -(cd $srctree; find . arch/$SRCARCH -maxdepth 1 -name Makefile\*) > debian/hdrsrcfiles
> -(cd $srctree; find include scripts -type f -o -type l) >> debian/hdrsrcfiles
> -(cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> debian/hdrsrcfiles
> -(cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> debian/hdrsrcfiles
> -if is_enabled CONFIG_STACK_VALIDATION; then
> -	echo tools/objtool/objtool >> debian/hdrobjfiles
> -fi
> -find arch/$SRCARCH/include Module.symvers include scripts -type f >> debian/hdrobjfiles
> -if is_enabled CONFIG_GCC_PLUGINS; then
> -	find scripts/gcc-plugins -name \*.so >> debian/hdrobjfiles
> -fi
> +(
> +	cd $srctree
> +	find . arch/$SRCARCH -maxdepth 1 -name Makefile\*
> +	find include scripts -type f -o -type l
> +	find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform
> +	find arch/$SRCARCH/include -type f
[...]

This last command is still wrong as I commented on v1.  I think it
should be:

	find $(find arch/$SRCARCH -name include -type d) -type f

Ben.

-- 
Ben Hutchings
If God had intended Man to program,
we'd have been born with serial I/O ports.


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

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

* Re: [PATCH v2 4/7] builddeb: avoid invoking sub-shells where possible
  2020-01-15 16:25 ` [PATCH v2 4/7] builddeb: avoid invoking sub-shells where possible Masahiro Yamada
  2020-01-21 19:21   ` Ben Hutchings
@ 2020-01-21 19:24   ` Ben Hutchings
  2020-01-25  4:06     ` Masahiro Yamada
  1 sibling, 1 reply; 12+ messages in thread
From: Ben Hutchings @ 2020-01-21 19:24 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: Riku Voipio, Michal Marek, linux-kernel

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

On Thu, 2020-01-16 at 01:25 +0900, Masahiro Yamada wrote:
[...]
> -if is_enabled CONFIG_STACK_VALIDATION; then
> -	echo tools/objtool/objtool >> debian/hdrobjfiles
> -fi
[...]
> +{
> +	if is_enabled CONFIG_STACK_VALIDATION; then
> +		find tools/objtool -type f -executable
> +	fi
[...]

And this is still undoing part of patch 1.

Ben.

-- 
Ben Hutchings
If God had intended Man to program,
we'd have been born with serial I/O ports.



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

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

* Re: [PATCH v2 4/7] builddeb: avoid invoking sub-shells where possible
  2020-01-21 19:21   ` Ben Hutchings
@ 2020-01-25  4:05     ` Masahiro Yamada
  0 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2020-01-25  4:05 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Linux Kbuild mailing list, Riku Voipio, Michal Marek,
	Linux Kernel Mailing List

Hi Ben,

On Wed, Jan 22, 2020 at 4:21 AM Ben Hutchings <ben@decadent.org.uk> wrote:
>
> On Thu, 2020-01-16 at 01:25 +0900, Masahiro Yamada wrote:
> > The commands surrounded by ( ... ) is run in a sub-shell, but you do
> > not have to spawn a sub-shell for every single line.
> >
> > Use just one ( ... ) for creating debian/hdrsrcfiles.
> >
> > For tar, use -C option instead.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> > Changes in v2:
> >  - fix misconversion pointed out by Ben
> >
> >  scripts/package/builddeb | 39 ++++++++++++++++++++++++++-------------
> >  1 file changed, 26 insertions(+), 13 deletions(-)
> >
> > diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> > index 9b92745bf13a..7d7e0abe62b6 100755
> > --- a/scripts/package/builddeb
> > +++ b/scripts/package/builddeb
> > @@ -165,21 +165,34 @@ EOF
> >  done
> >
> >  # Build kernel header package
> > -(cd $srctree; find . arch/$SRCARCH -maxdepth 1 -name Makefile\*) > debian/hdrsrcfiles
> > -(cd $srctree; find include scripts -type f -o -type l) >> debian/hdrsrcfiles
> > -(cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> debian/hdrsrcfiles
> > -(cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> debian/hdrsrcfiles
> > -if is_enabled CONFIG_STACK_VALIDATION; then
> > -     echo tools/objtool/objtool >> debian/hdrobjfiles
> > -fi
> > -find arch/$SRCARCH/include Module.symvers include scripts -type f >> debian/hdrobjfiles
> > -if is_enabled CONFIG_GCC_PLUGINS; then
> > -     find scripts/gcc-plugins -name \*.so >> debian/hdrobjfiles
> > -fi
> > +(
> > +     cd $srctree
> > +     find . arch/$SRCARCH -maxdepth 1 -name Makefile\*
> > +     find include scripts -type f -o -type l
> > +     find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform
> > +     find arch/$SRCARCH/include -type f
> [...]
>
> This last command is still wrong as I commented on v1.  I think it
> should be:
>
>         find $(find arch/$SRCARCH -name include -type d) -type f
>
> Ben.


Sorry, I missed your comment in v1.

I will keep the original code here.



-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH v2 4/7] builddeb: avoid invoking sub-shells where possible
  2020-01-21 19:24   ` Ben Hutchings
@ 2020-01-25  4:06     ` Masahiro Yamada
  0 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2020-01-25  4:06 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Linux Kbuild mailing list, Riku Voipio, Michal Marek,
	Linux Kernel Mailing List

Hi Ben,

On Wed, Jan 22, 2020 at 4:24 AM Ben Hutchings <ben@decadent.org.uk> wrote:
>
> On Thu, 2020-01-16 at 01:25 +0900, Masahiro Yamada wrote:
> [...]
> > -if is_enabled CONFIG_STACK_VALIDATION; then
> > -     echo tools/objtool/objtool >> debian/hdrobjfiles
> > -fi
> [...]
> > +{
> > +     if is_enabled CONFIG_STACK_VALIDATION; then
> > +             find tools/objtool -type f -executable
> > +     fi
> [...]
>
> And this is still undoing part of patch 1.
>

You are right. I will fix it.



-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2020-01-25  4:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 16:25 [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package Masahiro Yamada
2020-01-15 16:25 ` [PATCH v2 2/7] builddeb: match temporary directory name to the package name Masahiro Yamada
2020-01-15 16:25 ` [PATCH v2 3/7] builddeb: remove redundant $objtree/ Masahiro Yamada
2020-01-15 16:25 ` [PATCH v2 4/7] builddeb: avoid invoking sub-shells where possible Masahiro Yamada
2020-01-21 19:21   ` Ben Hutchings
2020-01-25  4:05     ` Masahiro Yamada
2020-01-21 19:24   ` Ben Hutchings
2020-01-25  4:06     ` Masahiro Yamada
2020-01-15 16:25 ` [PATCH v2 5/7] builddeb: remove redundant make for ARCH=um Masahiro Yamada
2020-01-15 16:25 ` [PATCH v2 6/7] builddeb: split kernel headers deployment out into a function Masahiro Yamada
2020-01-15 16:25 ` [PATCH v2 7/7] builddeb: split libc " Masahiro Yamada
2020-01-21 15:48 ` [PATCH v2 1/7] builddeb: remove unneeded files in hdrobjfiles for headers package 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).