All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] BR2_LINUX_KERNEL_PATCH for linux-headers
@ 2018-07-11 14:32 Serj Kalichev
  2018-07-11 21:02 ` Arnout Vandecappelle
  0 siblings, 1 reply; 5+ messages in thread
From: Serj Kalichev @ 2018-07-11 14:32 UTC (permalink / raw)
  To: buildroot

Hello.

Both linux and linux-headers package use BR2_LINUX_KERNEL_PATCH. But 
BR2_LINUX_KERNEL_PATCH is available if BR2_LINUX_KERNEL is selected. I 
want to build toolchain only. And don't want to build linux kernel. So I 
deselect BR2_LINUX_KERNEL and lose BR2_LINUX_KERNEL_PATCH for linux-headers.

I think BR2_LINUX_KERNEL_PATCH must not depend on BR2_LINUX_KERNEL.

Thanks

Serj Kalichev

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

* [Buildroot] BR2_LINUX_KERNEL_PATCH for linux-headers
  2018-07-11 14:32 [Buildroot] BR2_LINUX_KERNEL_PATCH for linux-headers Serj Kalichev
@ 2018-07-11 21:02 ` Arnout Vandecappelle
  2018-07-12 12:33   ` Serj Kalichev
  0 siblings, 1 reply; 5+ messages in thread
From: Arnout Vandecappelle @ 2018-07-11 21:02 UTC (permalink / raw)
  To: buildroot



On 11-07-18 16:32, Serj Kalichev wrote:
> Hello.
> 
> Both linux and linux-headers package use BR2_LINUX_KERNEL_PATCH. But
> BR2_LINUX_KERNEL_PATCH is available if BR2_LINUX_KERNEL is selected. I want to
> build toolchain only. And don't want to build linux kernel. So I deselect
> BR2_LINUX_KERNEL and lose BR2_LINUX_KERNEL_PATCH for linux-headers.
> 
> I think BR2_LINUX_KERNEL_PATCH must not depend on BR2_LINUX_KERNEL.

 It's not easy to do that properly, because you'd still need to go to the kernel
menu to set the kernel patch list.

 Anyway, we consider BR2_LINUX_KERNEL_PATCH as deprecated. Use
BR2_GLOBAL_PATCH_DIR instead, and add your patches in the linux-headers
subdirectory of that directory.

 Regards,
 Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] BR2_LINUX_KERNEL_PATCH for linux-headers
  2018-07-11 21:02 ` Arnout Vandecappelle
@ 2018-07-12 12:33   ` Serj Kalichev
  2018-07-13 10:01     ` Arnout Vandecappelle
  0 siblings, 1 reply; 5+ messages in thread
From: Serj Kalichev @ 2018-07-12 12:33 UTC (permalink / raw)
  To: buildroot

Thanks for the answer.
I will use BR2_GLOBAL_PATCH_DIR but with enhancement.
It's not suitable for linux and linux-headers to create dirs like 
linux/4.9.80. Minor version number is not useful for kernel patches. The 
dirs like linux/4.0.x is better.
So I create a file in my external tree:

LINUX_VERSION_S := $(subst ., , $(strip $(LINUX_VERSION)))
LINUX_VERSION_X := $(word 1, $(LINUX_VERSION_S)).$(word 2, 
$(LINUX_VERSION_S)).x

define LINUX_APPLY_MAJOR_PATCHES
<------>$(Q)( \
<------>for D in $(PATCH_BASE_DIRS); do \
<------>? if test -d $${D}/$($(PKG)_VERSION_X); then \
<------>??? $(APPLY_PATCHES) $(@D) $${D}/$($(PKG)_VERSION_X) \*.patch 
\*.patch.$(ARCH) || exit 1; \
<------>? fi; \
<------>done; \
<------>)
endef

LINUX_POST_PATCH_HOOKS += LINUX_APPLY_MAJOR_PATCHES

The file for linux-headers is the same.
So buildroot will use dirs like "4.9.x" to patch linux and 
linux-headers. Maybe it will be useful for someone.

12.07.2018 00:02, Arnout Vandecappelle ?????:
>
> On 11-07-18 16:32, Serj Kalichev wrote:
>> Hello.
>>
>> Both linux and linux-headers package use BR2_LINUX_KERNEL_PATCH. But
>> BR2_LINUX_KERNEL_PATCH is available if BR2_LINUX_KERNEL is selected. I want to
>> build toolchain only. And don't want to build linux kernel. So I deselect
>> BR2_LINUX_KERNEL and lose BR2_LINUX_KERNEL_PATCH for linux-headers.
>>
>> I think BR2_LINUX_KERNEL_PATCH must not depend on BR2_LINUX_KERNEL.
>   It's not easy to do that properly, because you'd still need to go to the kernel
> menu to set the kernel patch list.
>
>   Anyway, we consider BR2_LINUX_KERNEL_PATCH as deprecated. Use
> BR2_GLOBAL_PATCH_DIR instead, and add your patches in the linux-headers
> subdirectory of that directory.
>
>   Regards,
>   Arnout
>

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

* [Buildroot] BR2_LINUX_KERNEL_PATCH for linux-headers
  2018-07-12 12:33   ` Serj Kalichev
@ 2018-07-13 10:01     ` Arnout Vandecappelle
  2018-07-13 12:24       ` Serj Kalichev
  0 siblings, 1 reply; 5+ messages in thread
From: Arnout Vandecappelle @ 2018-07-13 10:01 UTC (permalink / raw)
  To: buildroot



On 12-07-18 14:33, Serj Kalichev wrote:
> Thanks for the answer.
> I will use BR2_GLOBAL_PATCH_DIR but with enhancement.
> It's not suitable for linux and linux-headers to create dirs like linux/4.9.80.

 Well, you don't need to create a version-specific directory at all, just put
your patches under linux/. Except if you want to use the same GLOBAL_PATCH_DIR
for different configurations with different kernel versions. But even then, you
can just have different patch directories. I typically have something like:

board/project-foo/common/patches/busybox/....patch
                  board1/patches/linux/.....patch
                                 linux-headers -> linux
                  board2/patches/linux/.....patch
                                 ubuut/.....patch

BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_FOO_PATH)/board/project-foo/common/patches
$(BR2_EXTERNAL_FOO_PATH)/board/project-foo/board1/patches"


 Regards,
 Arnout

> Minor version number is not useful for kernel patches. The dirs like linux/4.0.x
> is better.
> So I create a file in my external tree:
> 
> LINUX_VERSION_S := $(subst ., , $(strip $(LINUX_VERSION)))
> LINUX_VERSION_X := $(word 1, $(LINUX_VERSION_S)).$(word 2, $(LINUX_VERSION_S)).x
> 
> define LINUX_APPLY_MAJOR_PATCHES
> <------>$(Q)( \
> <------>for D in $(PATCH_BASE_DIRS); do \
> <------>? if test -d $${D}/$($(PKG)_VERSION_X); then \
> <------>??? $(APPLY_PATCHES) $(@D) $${D}/$($(PKG)_VERSION_X) \*.patch
> \*.patch.$(ARCH) || exit 1; \
> <------>? fi; \
> <------>done; \
> <------>)
> endef
> 
> LINUX_POST_PATCH_HOOKS += LINUX_APPLY_MAJOR_PATCHES
> 
> The file for linux-headers is the same.
> So buildroot will use dirs like "4.9.x" to patch linux and linux-headers. Maybe
> it will be useful for someone.
> 
> 12.07.2018 00:02, Arnout Vandecappelle ?????:
>>
>> On 11-07-18 16:32, Serj Kalichev wrote:
>>> Hello.
>>>
>>> Both linux and linux-headers package use BR2_LINUX_KERNEL_PATCH. But
>>> BR2_LINUX_KERNEL_PATCH is available if BR2_LINUX_KERNEL is selected. I want to
>>> build toolchain only. And don't want to build linux kernel. So I deselect
>>> BR2_LINUX_KERNEL and lose BR2_LINUX_KERNEL_PATCH for linux-headers.
>>>
>>> I think BR2_LINUX_KERNEL_PATCH must not depend on BR2_LINUX_KERNEL.
>> ? It's not easy to do that properly, because you'd still need to go to the kernel
>> menu to set the kernel patch list.
>>
>> ? Anyway, we consider BR2_LINUX_KERNEL_PATCH as deprecated. Use
>> BR2_GLOBAL_PATCH_DIR instead, and add your patches in the linux-headers
>> subdirectory of that directory.
>>
>> ? Regards,
>> ? Arnout
>>
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] BR2_LINUX_KERNEL_PATCH for linux-headers
  2018-07-13 10:01     ` Arnout Vandecappelle
@ 2018-07-13 12:24       ` Serj Kalichev
  0 siblings, 0 replies; 5+ messages in thread
From: Serj Kalichev @ 2018-07-13 12:24 UTC (permalink / raw)
  To: buildroot

Yes, you are right. I have a several kernel versions in project and can 
store patches for different versions in different dirs. But additionally 
I have a conditional patches. For example - for kernel on virtual 
machine and for kernel on real hardware. And these patches are different 
for different kernel versions. I mean in my case it will be a 
directories mess if each variant have their own "patches/linux" structure.

My structure is:

..patches/linux/3.10.x
..patches/linux/4.9.x
etc.

I think this structure is better for complex projects with different 
kernel versions.
What do you think about it?
I can prepare a patch for linux and linux-headers packages to add 
patching dirs like 4.9.x to POST_PATCH_HOOKS. Is it useful for busybox 
project?

13.07.2018 13:01, Arnout Vandecappelle ?????:
>
> On 12-07-18 14:33, Serj Kalichev wrote:
>> Thanks for the answer.
>> I will use BR2_GLOBAL_PATCH_DIR but with enhancement.
>> It's not suitable for linux and linux-headers to create dirs like linux/4.9.80.
>   Well, you don't need to create a version-specific directory at all, just put
> your patches under linux/. Except if you want to use the same GLOBAL_PATCH_DIR
> for different configurations with different kernel versions. But even then, you
> can just have different patch directories. I typically have something like:
>
> board/project-foo/common/patches/busybox/....patch
>                    board1/patches/linux/.....patch
>                                   linux-headers -> linux
>                    board2/patches/linux/.....patch
>                                   ubuut/.....patch
>
> BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_FOO_PATH)/board/project-foo/common/patches
> $(BR2_EXTERNAL_FOO_PATH)/board/project-foo/board1/patches"
>
>
>   Regards,
>   Arnout
>
>> Minor version number is not useful for kernel patches. The dirs like linux/4.0.x
>> is better.
>> So I create a file in my external tree:
>>
>> LINUX_VERSION_S := $(subst ., , $(strip $(LINUX_VERSION)))
>> LINUX_VERSION_X := $(word 1, $(LINUX_VERSION_S)).$(word 2, $(LINUX_VERSION_S)).x
>>
>> define LINUX_APPLY_MAJOR_PATCHES
>> <------>$(Q)( \
>> <------>for D in $(PATCH_BASE_DIRS); do \
>> <------>? if test -d $${D}/$($(PKG)_VERSION_X); then \
>> <------>??? $(APPLY_PATCHES) $(@D) $${D}/$($(PKG)_VERSION_X) \*.patch
>> \*.patch.$(ARCH) || exit 1; \
>> <------>? fi; \
>> <------>done; \
>> <------>)
>> endef
>>
>> LINUX_POST_PATCH_HOOKS += LINUX_APPLY_MAJOR_PATCHES
>>
>> The file for linux-headers is the same.
>> So buildroot will use dirs like "4.9.x" to patch linux and linux-headers. Maybe
>> it will be useful for someone.
>>
>> 12.07.2018 00:02, Arnout Vandecappelle ?????:
>>> On 11-07-18 16:32, Serj Kalichev wrote:
>>>> Hello.
>>>>
>>>> Both linux and linux-headers package use BR2_LINUX_KERNEL_PATCH. But
>>>> BR2_LINUX_KERNEL_PATCH is available if BR2_LINUX_KERNEL is selected. I want to
>>>> build toolchain only. And don't want to build linux kernel. So I deselect
>>>> BR2_LINUX_KERNEL and lose BR2_LINUX_KERNEL_PATCH for linux-headers.
>>>>
>>>> I think BR2_LINUX_KERNEL_PATCH must not depend on BR2_LINUX_KERNEL.
>>>  ? It's not easy to do that properly, because you'd still need to go to the kernel
>>> menu to set the kernel patch list.
>>>
>>>  ? Anyway, we consider BR2_LINUX_KERNEL_PATCH as deprecated. Use
>>> BR2_GLOBAL_PATCH_DIR instead, and add your patches in the linux-headers
>>> subdirectory of that directory.
>>>
>>>  ? Regards,
>>>  ? Arnout
>>>

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

end of thread, other threads:[~2018-07-13 12:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 14:32 [Buildroot] BR2_LINUX_KERNEL_PATCH for linux-headers Serj Kalichev
2018-07-11 21:02 ` Arnout Vandecappelle
2018-07-12 12:33   ` Serj Kalichev
2018-07-13 10:01     ` Arnout Vandecappelle
2018-07-13 12:24       ` Serj Kalichev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.