Skip to contentSkip to conversation

Kernel patches in Buildroot

Buildroot Joao Pinto 5 participants 10 messages Nov 11, 2015 – Nov 18, 2015

lore
Share & tools
lore

Joao Pinto

author
#0 lore raw

Hi,
We are designing the procedure to release our software stack based on buildroot. Could you please tell what is the advised method for including a kernel patch set in buildroot? I typically use BR2_LINUX_KERNEL_PATCH where I indicate each patch file. Is there a easier way like using BR2_GLOBAL_PATCH_DIR for example?

Thanks for your help!

Joao

#1 lore raw
Quoted 5 lines · Joao Pinto

Hi,
We are designing the procedure to release our software stack based on buildroot. Could you please tell what is the advised method for including a kernel patch set in buildroot? I typically use BR2_LINUX_KERNEL_PATCH where I indicate each patch file. Is there a easier way like using BR2_GLOBAL_PATCH_DIR for example?

I personally prefer to use a git repository that includes the patches. During
development, I make a local checkout specified with LINUX_OVERRIDE_SRCDIR; for release, I point to the repository (often on gitlab) and specify a tag.

BR2_GLOBAL_PATCH_DIR and BR2_LINUX_KERNEL_PATCH are basically equivalent, you
can specify a directory with the latter as well.

Regards,
Arnout

Quoted 9 lines

Thanks for your help!

Joao
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 6 lines
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
#2 lore raw
Quoted 7 lines · Arnout Vandecappelle
Quoted 5 lines · Joao Pinto

Hi,
We are designing the procedure to release our software stack based on buildroot. Could you please tell what is the advised method for including a kernel patch set in buildroot? I typically use BR2_LINUX_KERNEL_PATCH where I indicate each patch file. Is there a easier way like using BR2_GLOBAL_PATCH_DIR for example?

Quoted 6 lines

I personally prefer to use a git repository that includes the patches. During
development, I make a local checkout specified with LINUX_OVERRIDE_SRCDIR; for release, I point to the repository (often on gitlab) and specify a tag.

BR2_GLOBAL_PATCH_DIR and BR2_LINUX_KERNEL_PATCH are basically equivalent, you
can specify a directory with the latter as well.

You can also create a BSP repository containing patches, configs and so on and just instruct customers to use BR2_EXTERNAL feature
(http://nightly.buildroot.org/manual.html#outside-br-custom).

Yegor

author
#3 lore raw
In reply to Arnout Vandecappelle

Thanks for your help!

Quoted 29 lines · Arnout Vandecappelle
Quoted 5 lines · Joao Pinto

Hi,
We are designing the procedure to release our software stack based on buildroot. Could you please tell what is the advised method for including a kernel patch set in buildroot? I typically use BR2_LINUX_KERNEL_PATCH where I indicate each patch file. Is there a easier way like using BR2_GLOBAL_PATCH_DIR for example?

I personally prefer to use a git repository that includes the patches. During
development, I make a local checkout specified with LINUX_OVERRIDE_SRCDIR; for release, I point to the repository (often on gitlab) and specify a tag.

BR2_GLOBAL_PATCH_DIR and BR2_LINUX_KERNEL_PATCH are basically equivalent, you
can specify a directory with the latter as well.

Regards,
Arnout

Quoted 9 lines

Thanks for your help!

Joao
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

author
#4 lore raw

Hi!
I am trying to use BR2_GLOBAL_PATCH_DIR to indicate the global patch directory, which has the following value:

BR2_GLOBAL_PATCH_DIR="snps-custom/packages"

I have a "snps-custom" folder which has a "packages" folder inside. Inside the "packages" folder we have a folder for each package we need to patch, in this example mplayer and the linux kernel.

--snps-custom
--packages

    --linux-arc-axs101-20141021-3.13
	0001-XXXX.patch
	0002-YYYY.patch
    --mplayer
	0001-mplayer.patch
    --<packagename>
	000x-xxxxx.patch

The linux kernel patching system does not recognizes the packages/linux-arc-axs101-20141021-3.13 patch folder. Could you give me a help on this?

Thanks!

BR,
Joao Pinto

Quoted 33 lines · Joao Pinto

Thanks for your help!

Quoted 29 lines · Arnout Vandecappelle
Quoted 5 lines · Joao Pinto

Hi,
We are designing the procedure to release our software stack based on buildroot. Could you please tell what is the advised method for including a kernel patch set in buildroot? I typically use BR2_LINUX_KERNEL_PATCH where I indicate each patch file. Is there a easier way like using BR2_GLOBAL_PATCH_DIR for example?

I personally prefer to use a git repository that includes the patches. During
development, I make a local checkout specified with LINUX_OVERRIDE_SRCDIR; for release, I point to the repository (often on gitlab) and specify a tag.

BR2_GLOBAL_PATCH_DIR and BR2_LINUX_KERNEL_PATCH are basically equivalent, you
can specify a directory with the latter as well.

Regards,
Arnout

Quoted 9 lines

Thanks for your help!

Joao
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#5 lore raw
Quoted 21 lines · Joao Pinto

Hi!
I am trying to use BR2_GLOBAL_PATCH_DIR to indicate the global patch directory, which has the following value:

BR2_GLOBAL_PATCH_DIR="snps-custom/packages"

I have a "snps-custom" folder which has a "packages" folder inside. Inside the "packages" folder we have a folder for each package we need to patch, in this example mplayer and the linux kernel.

--snps-custom
--packages

     --linux-arc-axs101-20141021-3.13
	0001-XXXX.patch
	0002-YYYY.patch
     --mplayer
	0001-mplayer.patch
     --<packagename>
	000x-xxxxx.patch
Quoted 3 lines

The linux kernel patching system does not recognizes the packages/linux-arc-axs101-20141021-3.13 patch folder. Could you give me a help on this?

I haven't done this myself, so I'm not completely sure if this is correct, but there's an option to add custom kernel patches under menuconfig -> Kernel -> Custom kernel patches. I think to patch the kernel you would need to set that value to the snps-custom/packages/linux-arc-axs... path.

David

Quoted 48 lines

Thanks!

BR,
Joao Pinto

Quoted 33 lines · Joao Pinto

Thanks for your help!

Quoted 29 lines · Arnout Vandecappelle
Quoted 5 lines · Joao Pinto

Hi,
We are designing the procedure to release our software stack based on buildroot. Could you please tell what is the advised method for including a kernel patch set in buildroot? I typically use BR2_LINUX_KERNEL_PATCH where I indicate each patch file. Is there a easier way like using BR2_GLOBAL_PATCH_DIR for example?

I personally prefer to use a git repository that includes the patches. During
development, I make a local checkout specified with LINUX_OVERRIDE_SRCDIR; for release, I point to the repository (often on gitlab) and specify a tag.

BR2_GLOBAL_PATCH_DIR and BR2_LINUX_KERNEL_PATCH are basically equivalent, you
can specify a directory with the latter as well.

Regards,
Arnout

Quoted 9 lines

Thanks for your help!

Joao
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 2 lines
Thanks,
David
#6 lore raw

Dear David Van Arnem,

Quoted 11 lines · David Van Arnem
Quoted 3 lines · Joao Pinto

The linux kernel patching system does not recognizes the packages/linux-arc-axs101-20141021-3.13 patch folder. Could you give me a help on this?

I haven't done this myself, so I'm not completely sure if this is correct, but there's an option to add custom kernel patches under menuconfig -> Kernel -> Custom kernel patches. I think to patch the kernel you would need to set that value to the snps-custom/packages/linux-arc-axs... path.

This is indeed another solution. But Joao was trying to use the BR2_GLOBAL_PATCH_DIR mechanism, which allows to provide custom patches for *any* package, and not only specifically for the Linux kernel.

Essentially, the "Custom kernel patches" mechanism you points to predates the BR2_GLOBAL_PATCH_DIR mechanism. We keep it for compatibility reasons, but generally consider BR2_GLOBAL_PATCH_DIR to be the "better way".

Best regards,

Thomas

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

Dear David Van Arnem,

Quoted 11 lines · David Van Arnem
Quoted 3 lines · Joao Pinto

The linux kernel patching system does not recognizes the packages/linux-arc-axs101-20141021-3.13 patch folder. Could you give me a help on this?

I haven't done this myself, so I'm not completely sure if this is correct, but there's an option to add custom kernel patches under menuconfig -> Kernel -> Custom kernel patches. I think to patch the kernel you would need to set that value to the snps-custom/packages/linux-arc-axs... path.

Quoted 8 lines

This is indeed another solution. But Joao was trying to use the BR2_GLOBAL_PATCH_DIR mechanism, which allows to provide custom patches for *any* package, and not only specifically for the Linux kernel.

Essentially, the "Custom kernel patches" mechanism you points to predates the BR2_GLOBAL_PATCH_DIR mechanism. We keep it for compatibility reasons, but generally consider BR2_GLOBAL_PATCH_DIR to be the "better way".

Good to know, thank you!

David

Quoted 5 lines

Best regards,

Thomas

Signature · 2 lines
Thanks,
David
#8 lore raw
In reply to Joao Pinto

Dear Joao Pinto,

Quoted 9 lines · Joao Pinto

BR2_GLOBAL_PATCH_DIR="snps-custom/packages"

I have a "snps-custom" folder which has a "packages" folder inside. Inside the "packages" folder we have a folder for each package we need to patch, in this example mplayer and the linux kernel.

--snps-custom
--packages

    --linux-arc-axs101-20141021-3.13

Call this folder just "linux". The folder must be named after the package name, and not contains some additional version information. If you want to store patches for several versions of the same package, you must use the same organization as in Buildroot itself:

<package-name>/<package-version>/*.patch

Best regards,

Thomas

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

Dear Thomas,
Thanks, worked fine!

BR
Joao Pinto

Quoted 25 lines · Thomas Petazzoni

Dear Joao Pinto,

Quoted 9 lines · Joao Pinto

BR2_GLOBAL_PATCH_DIR="snps-custom/packages"

I have a "snps-custom" folder which has a "packages" folder inside. Inside the "packages" folder we have a folder for each package we need to patch, in this example mplayer and the linux kernel.

--snps-custom
--packages

    --linux-arc-axs101-20141021-3.13

Call this folder just "linux". The folder must be named after the package name, and not contains some additional version information. If you want to store patches for several versions of the same package, you must use the same organization as in Buildroot itself:

<package-name>/<package-version>/*.patch

Best regards,

Thomas