[Buildroot] [PATCH] linux: add option to create kernel tarball

Yann E. MORIN yann.morin.1998 at free.fr
Sat Nov 8 16:39:42 UTC 2014


Yegor, All,

On 2014-11-08 17:32 +0100, Yegor Yefremov spake thusly:
> This option will invoke "make tar-pkg" in kernel's build directory
> and the resulting linux-*.tar will be copied to images folder.

Why would we want that only for the kernel?

If we were to add such a command, we would want to have it for all
packages, done in a generic way, unless there is a *really* *compelling*
reason to have such a linux-specific command.

Regards,
Yann E. MORIN.

> Signed-off-by: Yegor Yefremov <yegorslists at googlemail.com>
> ---
>  linux/Config.in |  5 +++++
>  linux/linux.mk  | 11 +++++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/linux/Config.in b/linux/Config.in
> index e0d123c..b222bbf 100644
> --- a/linux/Config.in
> +++ b/linux/Config.in
> @@ -345,6 +345,11 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET
>  	  /boot if DTBs have been generated by the kernel build
>  	  process.
>  
> +config BR2_LINUX_KERNEL_BUILD_AS_TARBALL
> +	bool "Build kernel as a tarball"
> +	help
> +	  Execute "make tar-pkg" and copy resulting tarball to images folder.
> +
>  # Linux extensions
>  source "linux/Config.ext.in"
>  
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 6740d01..e09fc5c 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -215,6 +215,15 @@ define LINUX_CONFIGURE_CMDS
>  	yes '' | $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) oldconfig
>  endef
>  
> +ifeq ($(BR2_LINUX_KERNEL_BUILD_AS_TARBALL),y)
> +define LINUX_MAKE_KERNEL_PKG
> +	$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) tar-pkg
> +endef
> +define LINUX_INSTALL_KERNEL_PKG
> +	cp $(@D)/*.tar $(BINARIES_DIR)
> +endef
> +endif
> +
>  ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y)
>  ifeq ($(BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT),)
>  define LINUX_BUILD_DTB
> @@ -271,6 +280,7 @@ define LINUX_BUILD_CMDS
>  	fi
>  	$(LINUX_BUILD_DTB)
>  	$(LINUX_APPEND_DTB)
> +	$(LINUX_MAKE_KERNEL_PKG)
>  endef
>  
>  
> @@ -293,6 +303,7 @@ endef
>  define LINUX_INSTALL_IMAGES_CMDS
>  	cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
>  	$(LINUX_INSTALL_DTB)
> +	$(LINUX_INSTALL_KERNEL_PKG)
>  endef
>  
>  define LINUX_INSTALL_TARGET_CMDS
> -- 
> 1.8.3.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



More information about the buildroot mailing list