[v2] kbuild: Add make dir-pkg build option
diff mbox series

Message ID 20191104131144.14333-1-mcroce@redhat.com
State New
Headers show
Series
  • [v2] kbuild: Add make dir-pkg build option
Related show

Commit Message

Matteo Croce Nov. 4, 2019, 1:11 p.m. UTC
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.

Signed-off-by: Matteo Croce <mcroce@redhat.com>
---
 scripts/Makefile.package | 3 ++-
 scripts/package/buildtar | 8 ++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

Comments

Matteo Croce Nov. 5, 2019, 7:24 p.m. UTC | #1
On Mon, Nov 4, 2019 at 2:11 PM Matteo Croce <mcroce@redhat.com> wrote:
>
> 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.
>
> Signed-off-by: Matteo Croce <mcroce@redhat.com>

Hi Masahiro,

here there is the v2 with that nit addressed :)

Regards,
Masahiro Yamada Nov. 6, 2019, 2:13 a.m. UTC | #2
On Mon, Nov 4, 2019 at 10:12 PM Matteo Croce <mcroce@redhat.com> wrote:
>
> 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.
>
> Signed-off-by: Matteo Croce <mcroce@redhat.com>
> ---

Applied to linux-kbuild.
Thanks.


>  scripts/Makefile.package | 3 ++-
>  scripts/package/buildtar | 8 ++++++--
>  2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/Makefile.package b/scripts/Makefile.package
> index 56eadcc48d46..36600ad1d5e6 100644
> --- a/scripts/Makefile.package
> +++ b/scripts/Makefile.package
> @@ -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'
> diff --git a/scripts/package/buildtar b/scripts/package/buildtar
> index 2f66c81e4021..77c7caefede1 100755
> --- a/scripts/package/buildtar
> +++ b/scripts/package/buildtar
> @@ -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 <jbglaw@lug-owl.de>
>  #
> @@ -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)
> @@ -125,6 +125,10 @@ case "${ARCH}" in
>                 ;;
>  esac
>
> +if [ "${1}" = dir-pkg ]; then
> +       echo "Kernel tree successfully created in $tmpdir"
> +       exit 0
> +fi
>
>  #
>  # Create the tarball
> --
> 2.23.0
>

Patch
diff mbox series

diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index 56eadcc48d46..36600ad1d5e6 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -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'
diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index 2f66c81e4021..77c7caefede1 100755
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -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 <jbglaw@lug-owl.de>
 #
@@ -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)
@@ -125,6 +125,10 @@  case "${ARCH}" in
 		;;
 esac
 
+if [ "${1}" = dir-pkg ]; then
+	echo "Kernel tree successfully created in $tmpdir"
+	exit 0
+fi
 
 #
 # Create the tarball