Issue
I'm playing around with patches in Buildroot (version 2017.02), but when I override the package sources in local.mk
:
PACKAGENAME_OVERRIDE_SRCDIR = /...path_to_local_checkout
I see that the Buildroot patches are not applied for this package.
They are applied only if the package is not overriden in local.mk.
Is this expected behavior?
Notes:
- I didn't find the answer to my question in the Buildroot manual: https://buildroot.org/downloads/manual/manual.html#patch-apply-order
- The package I'm testing is the Linux kernel, but I guess it's unrelated.
- I put my patches in the global patch dir
board/company_name/common/patches/...
Solution
Yes, this is expected behavior. If you use <pkg>_OVERRIDE_SRCDIR
, then the source tree for the package is available locally, so you should apply the patches to your source tree. Buildroot cannot know which version of the package you're using, and therefore the patches it has in package/<pkg>
may not apply, which is why the behavior is as you've seen that patches are not applied to overridden packages.
Essentially, the flow for a regular package is: download -> extract -> patch -> configure -> build -> install.
The flow for an overridden package is: rsync -> configure -> build -> install.
Answered By - Thomas Petazzoni Answer Checked By - Candace Johnson (WPSolving Volunteer)