Skip to contentSkip to conversation

kbuild: Add make dir-pkg build option

PATCH Superseded Matteo Croce 2 participants 3 messages Oct 9, 2019 – Nov 4, 2019 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: Add make dir-pkg build option

Add a 'dir-pkg' target which just creates the same directory structures as in tar-pkg, but doesn't package anything.
Useful when the user wants to copy the kernel tree on a machine using ssh, rsync or whatever.

---
 scripts/Makefile.package | 3 ++-
 scripts/package/buildtar | 9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)
scripts/Makefile.package +2 -1
index 56eadcc48d46..36600ad1d5e6 100644
@@ -103,7 +103,7 @@ snap-pkg:
 
 # tarball targets
 # ---------------------------------------------------------------------------
-tar-pkgs := tar-pkg targz-pkg tarbz2-pkg tarxz-pkg
+tar-pkgs := dir-pkg tar-pkg targz-pkg tarbz2-pkg tarxz-pkg
 PHONY += $(tar-pkgs)
 $(tar-pkgs):
 	$(MAKE) -f $(srctree)/Makefile
@@ -147,6 +147,7 @@ help:
 	@echo '  deb-pkg             - Build both source and binary deb kernel packages'
 	@echo '  bindeb-pkg          - Build only the binary kernel deb package'
 	@echo '  snap-pkg            - Build only the binary kernel snap package (will connect to external hosts)'
+	@echo '  dir-pkg             - Build the kernel as a plain directory structure'
 	@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'
scripts/package/buildtar +7 -2
index 2f66c81e4021..ca283079f652 100755
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 #
-# buildtar 0.0.4
+# buildtar 0.0.5
 #
 # (C) 2004-2006 by Jan-Benedict Glaw <[email protected]>
 #
@@ -24,7 +24,7 @@ tarball="${objtree}/linux-${KERNELRELEASE}-${ARCH}.tar"
 # Figure out how to compress, if requested at all
 #
 case "${1}" in
-	tar-pkg)
+	dir-pkg|tar-pkg)
 		opts=
 		;;
 	targz-pkg)
@@ -133,6 +133,11 @@ if tar --owner=root --group=root --help >/dev/null 2>&1; then
 	opts="$opts --owner=root --group=root"
 fi
 
+if [ "${1}" = dir-pkg ]; then
+	echo "Kernel tree successfully created in $tmpdir"
+	exit 0
+fi
+
 tar cf $tarball -C $tmpdir $opts $dirs
 
 echo "Tarball successfully created in $tarball"
Signature · 1 line
2.21.0
#1 lore raw
Quoted 7 lines · Matteo Croce

Add a 'dir-pkg' target which just creates the same directory structures as in tar-pkg, but doesn't package anything.
Useful when the user wants to copy the kernel tree on a machine using ssh, rsync or whatever.

Hi,

any comment on this?

Signature · 2 lines
Matteo Croce
per aspera ad upstream
#2 lore raw
Quoted 8 lines · Matteo Croce
Quoted 6 lines · Matteo Croce

Add a 'dir-pkg' target which just creates the same directory structures as in tar-pkg, but doesn't package anything.
Useful when the user wants to copy the kernel tree on a machine using ssh, rsync or whatever.

Quoted 6 lines
Quoted 1 line

Hi,

any comment on this?

Sorry for the late reply.
One nit.

scripts/package/buildtar if tar --owner=root --group=root --help >/dev/null 2>&1; then · line 140

Quoted 9 lines
scripts/package/buildtar +5 -0
@@ -133,6 +133,11 @@ if tar --owner=root --group=root --help >/dev/null 2>&1; then
        opts="$opts --owner=root --group=root"
 fi
 
+if [ "${1}" = dir-pkg ]; then
+       echo "Kernel tree successfully created in $tmpdir"
+       exit 0
+fi
+

The 'opts' assignment is unneeded for dir-pkg.
You can exit before the "# Create the tarball" comment line.

Signature · 2 lines
Best Regards
Masahiro Yamada