Skip to contentSkip to conversation

linux: add option to create kernel tarball

PATCH New Yegor Yefremov 4 participants 7 messages Nov 8, 2014 – Nov 9, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: add option to create kernel tarball

This option will invoke "make tar-pkg" in kernel's build directory and the resulting linux-*.tar will be copied to images folder.

---
 linux/Config.in |  5 +++++
 linux/linux.mk  | 11 +++++++++++
 2 files changed, 16 insertions(+)
linux/Config.in +5 -0
index e0d123c..b222bbf 100644
@@ -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"
 
linux/linux.mk +11 -0
index 6740d01..e09fc5c 100644
@@ -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
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 linux: add option to create kernel tarball

Yegor, All,

On 2014-11-08 17:32 +0100, Yegor Yefremov spake thusly:

Quoted 2 lines

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.

Quoted 65 lines
---
 linux/Config.in |  5 +++++
 linux/linux.mk  | 11 +++++++++++
 2 files changed, 16 insertions(+)
linux/Config.in +5 -0
index e0d123c..b222bbf 100644
@@ -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"
 
linux/linux.mk +11 -0
index 6740d01..e09fc5c 100644
@@ -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
Signature · 6 lines
1.8.3.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 linux: add option to create kernel tarball

Yann, Yegor,

Quoted 11 lines · Yann E. MORIN

Yegor, All,

On 2014-11-08 17:32 +0100, Yegor Yefremov spake thusly:

Quoted 2 lines

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.

Well, the kernel has this "tar-pkg" target that other packages typically don't have. However, I'm curious to know what is the use case for "make tar-pkg" in the kernel in the context of Buildroot.

Yegor?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/1 linux: add option to create kernel tarball

Quoted 15 lines · Thomas Petazzoni

Yann, Yegor,

Quoted 11 lines · Yann E. MORIN

Yegor, All,

On 2014-11-08 17:32 +0100, Yegor Yefremov spake thusly:

Quoted 2 lines

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.

Quoted 5 lines

Well, the kernel has this "tar-pkg" target that other packages typically don't have. However, I'm curious to know what is the use case for "make tar-pkg" in the kernel in the context of Buildroot.

Yegor?

Image, you have a system/rootfs, that you've made via BR or it is Debian etc. Now you just want to update the kernel and modules. Kernel is simple, as BR compiles and copies it to output/images folder. But to install kernel modules you first need to invoke one of the make *-pkg commands, to do this you need to first export ARCH, CROSS_COMPILE etc. First then you can copy resulting image to target device and via "tar xf linux-*.tar -C /" install new kernel modules. Am I missing something and such option already exists in BR? The only one I see would be to tar output/target/lib/modules. But it still need to be made manually. I wanted to have an option to have both kernel image and modules ready for installation in output/images.

Yegor

#4 lore raw

PATCH 1/1 linux: add option to create kernel tarball

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yegor" == Yegor Yefremov <[email protected]> writes:

Hi,

Quoted 6 lines
Quoted 5 lines

Well, the kernel has this "tar-pkg" target that other packages typically don't have. However, I'm curious to know what is the use case for "make tar-pkg" in the kernel in the context of Buildroot.

Yegor?

Quoted 11 lines

Image, you have a system/rootfs, that you've made via BR or it is Debian etc. Now you just want to update the kernel and modules. Kernel is simple, as BR compiles and copies it to output/images folder. But to install kernel modules you first need to invoke one of the make *-pkg commands, to do this you need to first export ARCH, CROSS_COMPILE etc. First then you can copy resulting image to target device and via "tar xf linux-*.tar -C /" install new kernel modules. Am I missing something and such option already exists in BR? The only one I see would be to tar output/target/lib/modules. But it still need to be made manually. I wanted to have an option to have both kernel image and modules ready for installation in output/images.

That imho sounds like a quite special setup and something that could easily be implemented in a custom post-buid / post-image script.

So I prefer to NOT add this patch.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 1/1 linux: add option to create kernel tarball

In reply to Yegor Yefremov

Yegor,

Quoted 11 lines · Yegor Yefremov

Image, you have a system/rootfs, that you've made via BR or it is Debian etc. Now you just want to update the kernel and modules. Kernel is simple, as BR compiles and copies it to output/images folder. But to install kernel modules you first need to invoke one of the make *-pkg commands, to do this you need to first export ARCH, CROSS_COMPILE etc. First then you can copy resulting image to target device and via "tar xf linux-*.tar -C /" install new kernel modules. Am I missing something and such option already exists in BR? The only one I see would be to tar output/target/lib/modules. But it still need to be made manually. I wanted to have an option to have both kernel image and modules ready for installation in output/images.

This really seems like you're looking for a build system that produces binary packages. With your patch, you're doing something for the kernel specifically, but what if someone has the same need for some other library or application built by Buildroot?

So like Peter, I don't think this is something we want to merge in Buildroot.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#6 lore raw

PATCH 1/1 linux: add option to create kernel tarball

Quoted 16 lines · Thomas Petazzoni

Yegor,

Quoted 11 lines · Yegor Yefremov

Image, you have a system/rootfs, that you've made via BR or it is Debian etc. Now you just want to update the kernel and modules. Kernel is simple, as BR compiles and copies it to output/images folder. But to install kernel modules you first need to invoke one of the make *-pkg commands, to do this you need to first export ARCH, CROSS_COMPILE etc. First then you can copy resulting image to target device and via "tar xf linux-*.tar -C /" install new kernel modules. Am I missing something and such option already exists in BR? The only one I see would be to tar output/target/lib/modules. But it still need to be made manually. I wanted to have an option to have both kernel image and modules ready for installation in output/images.

Quoted 7 lines

This really seems like you're looking for a build system that produces binary packages. With your patch, you're doing something for the kernel specifically, but what if someone has the same need for some other library or application built by Buildroot?

So like Peter, I don't think this is something we want to merge in Buildroot.

OK. I think, it won't be a problem to make this via post-build script.

Yegor