All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] BR2_TARGET_UBOOT_PATCH setting not working
@ 2022-04-13 10:58 Marko Stanisic
  2022-04-14 19:00 ` Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Marko Stanisic @ 2022-04-13 10:58 UTC (permalink / raw)
  To: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 1959 bytes --]


Hello,

With buildroot i try to build an uboot which should be patched before, 
Uboot ist build by buildroot, but there is no reaction on following setting

BR2_TARGET_UBOOT_PATCH="$(BR2_EXTERNAL_GINO_PATH)/patches/uboot"

Inside <BR2_EXTERNAL_GINO_PATH>/patches/uboot there is a .patch file 
named according to 
https://buildroot.org/downloads/manual/manual.html#patch-policy with

|<number>-uboot-<description>.patch|

|Patches inside directories can be executed according documentation.
|

|Uboot is used insied a submodul of my repo and buidlroot hass acces to 
it over UBOOT_OVERRIDE_SRCDIR.
|

|
|

|I have no clue why patching is not performed:|

 1. |checked with make -s printvars VARS='BR2_TARGET_UBOOT_PATCH'|
 2. checked make -s printvars VARS='UBOOT_PATCHES' , UBOOT_PATCHES is
    set inside boot.mk
 3. make -s printvars VARS='UBOOT_POST_PATCH_HOOKS'
    UBOOT_POST_PATCH_HOOKS=UBOOT_APPLY_LOCAL_PATCHES
    UBOOT_FIXUP_LIBFDT_INCLUDE
 4. BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_GINO_PATH)/patches is also set
 5. It seems that everything fine, maybe one thin is not very clear to me

I use *UBOOT_OVERRIDE_SRCDIR*and maybe thats make troubles here? because 
of the comment

|When Buildroot finds that for a given package, an 
+<pkg>_OVERRIDE_SRCDIR+ has been defined, it will no longer attempt to 
download, extract and patch the package. Instead, it will directly use 
the source code available in the specified directory and +make clean+ 
will not touch this directory.|


             5.1 If Point (5) makes the problem how can i solve it to 
apply a proper patch over buildroot, or do i have to put it inside the 
submodul directly and how?

        6. I didn't use the deprecated setting 
BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR

        7. Tried to build uboot package

|make uboot-dirclean make uboot-extract make uboot-patch ## nothing 
worked make uboot-build make uboot-install |

Maybe i forgot something?

thank you

||

[-- Attachment #1.2: Type: text/html, Size: 10486 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] BR2_TARGET_UBOOT_PATCH setting not working
  2022-04-13 10:58 [Buildroot] BR2_TARGET_UBOOT_PATCH setting not working Marko Stanisic
@ 2022-04-14 19:00 ` Arnout Vandecappelle
  2022-04-15 17:57   ` Marko Stanisic
  0 siblings, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2022-04-14 19:00 UTC (permalink / raw)
  To: Marko Stanisic, buildroot



On 13/04/2022 12:58, Marko Stanisic wrote:
> 
> Hello,
> 
> With buildroot i try to build an uboot which should be patched before, Uboot ist 
> build by buildroot, but there is no reaction on following setting
> 
> BR2_TARGET_UBOOT_PATCH="$(BR2_EXTERNAL_GINO_PATH)/patches/uboot"
> 
> Inside <BR2_EXTERNAL_GINO_PATH>/patches/uboot there is a .patch file named 
> according to https://buildroot.org/downloads/manual/manual.html#patch-policy with
> 
> |<number>-uboot-<description>.patch|
> 
> |Patches inside directories can be executed according documentation.
> |
> 
> |Uboot is used insied a submodul of my repo and buidlroot hass acces to it over 
> UBOOT_OVERRIDE_SRCDIR.
> |
> 
> |
> |
> 
> |I have no clue why patching is not performed:|
> 
>  1. |checked with make -s printvars VARS='BR2_TARGET_UBOOT_PATCH'|
>  2. checked make -s printvars VARS='UBOOT_PATCHES' , UBOOT_PATCHES is set inside
>     boot.mk
>  3. make -s printvars VARS='UBOOT_POST_PATCH_HOOKS'
>     UBOOT_POST_PATCH_HOOKS=UBOOT_APPLY_LOCAL_PATCHES UBOOT_FIXUP_LIBFDT_INCLUDE
>  4. BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_GINO_PATH)/patches is also set
>  5. It seems that everything fine, maybe one thin is not very clear to me
> 
> I use *UBOOT_OVERRIDE_SRCDIR*and maybe thats make troubles here? because of the 
> comment
> 
> |When Buildroot finds that for a given package, an +<pkg>_OVERRIDE_SRCDIR+ has 
> been defined, it will no longer attempt to download, extract and patch the 
> package. Instead, it will directly use the source code available in the 
> specified directory and +make clean+ will not touch this directory.|

  Indeed, as this text says: if you use OVERRIDE_SRCDIR, you can't use patches.


>              5.1 If Point (5) makes the problem how can i solve it to apply a 
> proper patch over buildroot, or do i have to put it inside the submodul directly 
> and how?

  If you have a local directory with the source, it's assumed that you are able 
to modify that source and apply the patches directly.

  If for whatever reason that's not an option, there are a few options:

- make a tarball and point BR2_TARGET_UBOOT_CUSTOM_TARBALL to it; or
- if it's a git repository, you can point BR2_TARGET_UBOOT_CUSTOM_GIT to it.


  Regards,
  Arnout


> 
>         6. I didn't use the deprecated setting BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR
> 
>         7. Tried to build uboot package
> 
> |make uboot-dirclean make uboot-extract make uboot-patch ## nothing worked make 
> uboot-build make uboot-install |
> 
> Maybe i forgot something?
> 
> thank you
> 
> ||
> 
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] BR2_TARGET_UBOOT_PATCH setting not working
  2022-04-14 19:00 ` Arnout Vandecappelle
@ 2022-04-15 17:57   ` Marko Stanisic
  2022-04-19 20:11     ` Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Marko Stanisic @ 2022-04-15 17:57 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: buildroot

Thank you Arnout for your answer, 

Yes I use a git repository , but I have to build two uboot for different situations  , 
1) one uboot with disabled console 
(release build )
2) and another uboot debug build with enabled console.
3) depending on which buildroot defconfig I use (release or build)

I wanted to orchestrate the builds over different defconfigs (buildroot) and in consequence different uboot defconfigs(one enables console, another has silent console) feature enabled. 
But it is also necessary to perform a patch on header and c file of a current uboot repo on the fly as preparation for a build. 
( environment setting for silent console ) 

There is another solution for sure , but a patch seems to me more elegant to solve this multi source problem cases:
Case A) console on (uboot defconfig A)
Case B) console off (uboot defconfig B with silent console feature)+changes in source code regarding uboot environment 

Maybe direct use of patches inside uboot would be more correct , but i saw no mechanisms for that. 
(Nothing in Readme, no hint to uboot patch directories or using patches before uboot build)
 
Is buildroot able to handle such situations?

Best regards,
Marko.

Sent from my iPhone

> On 14.04.2022, at 21:00, Arnout Vandecappelle <arnout@mind.be> wrote:
> 
> 
> 
>> On 13/04/2022 12:58, Marko Stanisic wrote:
>> Hello,
>> With buildroot i try to build an uboot which should be patched before, Uboot ist build by buildroot, but there is no reaction on following setting
>> BR2_TARGET_UBOOT_PATCH="$(BR2_EXTERNAL_GINO_PATH)/patches/uboot"
>> Inside <BR2_EXTERNAL_GINO_PATH>/patches/uboot there is a .patch file named according to https://buildroot.org/downloads/manual/manual.html#patch-policy with
>> |<number>-uboot-<description>.patch|
>> |Patches inside directories can be executed according documentation.
>> |
>> |Uboot is used insied a submodul of my repo and buidlroot hass acces to it over UBOOT_OVERRIDE_SRCDIR.
>> |
>> |
>> |
>> |I have no clue why patching is not performed:|
>> 1. |checked with make -s printvars VARS='BR2_TARGET_UBOOT_PATCH'|
>> 2. checked make -s printvars VARS='UBOOT_PATCHES' , UBOOT_PATCHES is set inside
>>    boot.mk
>> 3. make -s printvars VARS='UBOOT_POST_PATCH_HOOKS'
>>    UBOOT_POST_PATCH_HOOKS=UBOOT_APPLY_LOCAL_PATCHES UBOOT_FIXUP_LIBFDT_INCLUDE
>> 4. BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_GINO_PATH)/patches is also set
>> 5. It seems that everything fine, maybe one thin is not very clear to me
>> I use *UBOOT_OVERRIDE_SRCDIR*and maybe thats make troubles here? because of the comment
>> |When Buildroot finds that for a given package, an +<pkg>_OVERRIDE_SRCDIR+ has been defined, it will no longer attempt to download, extract and patch the package. Instead, it will directly use the source code available in the specified directory and +make clean+ will not touch this directory.|
> 
> Indeed, as this text says: if you use OVERRIDE_SRCDIR, you can't use patches.
> 
> 
>>             5.1 If Point (5) makes the problem how can i solve it to apply a proper patch over buildroot, or do i have to put it inside the submodul directly and how?
> 
> If you have a local directory with the source, it's assumed that you are able to modify that source and apply the patches directly.
> 
> If for whatever reason that's not an option, there are a few options:
> 
> - make a tarball and point BR2_TARGET_UBOOT_CUSTOM_TARBALL to it; or
> - if it's a git repository, you can point BR2_TARGET_UBOOT_CUSTOM_GIT to it.
> 
> 
> Regards,
> Arnout
> 
> 
>>        6. I didn't use the deprecated setting BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR
>>        7. Tried to build uboot package
>> |make uboot-dirclean make uboot-extract make uboot-patch ## nothing worked make uboot-build make uboot-install |
>> Maybe i forgot something?
>> thank you
>> ||
>> _______________________________________________
>> buildroot mailing list
>> buildroot@buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] BR2_TARGET_UBOOT_PATCH setting not working
  2022-04-15 17:57   ` Marko Stanisic
@ 2022-04-19 20:11     ` Arnout Vandecappelle
  0 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2022-04-19 20:11 UTC (permalink / raw)
  To: Marko Stanisic; +Cc: buildroot



On 15/04/2022 19:57, Marko Stanisic wrote:
> Thank you Arnout for your answer,
> 
> Yes I use a git repository , but I have to build two uboot for different situations  ,
> 1) one uboot with disabled console
> (release build )
> 2) and another uboot debug build with enabled console.
> 3) depending on which buildroot defconfig I use (release or build)
> 
> I wanted to orchestrate the builds over different defconfigs (buildroot) and in consequence different uboot defconfigs(one enables console, another has silent console) feature enabled.
> But it is also necessary to perform a patch on header and c file of a current uboot repo on the fly as preparation for a build.
> ( environment setting for silent console )
> 
> There is another solution for sure , but a patch seems to me more elegant to solve this multi source problem cases:
> Case A) console on (uboot defconfig A)
> Case B) console off (uboot defconfig B with silent console feature)+changes in source code regarding uboot environment
> 
> Maybe direct use of patches inside uboot would be more correct , but i saw no mechanisms for that.
> (Nothing in Readme, no hint to uboot patch directories or using patches before uboot build)
>   
> Is buildroot able to handle such situations?

  In short, no.

  However:

- you can set BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES to a config fragment that 
enables or disables the console;
- the change in the header you can handle with ifdef using the config symbol set 
by the above fragment.

This is IMHO a much cleaner solution than patching the source - you get to keep 
one source of truth.

  Regards,
  Arnout

> 
> Best regards,
> Marko.
> 
> Sent from my iPhone
> 
>> On 14.04.2022, at 21:00, Arnout Vandecappelle <arnout@mind.be> wrote:
>>
>> 
>>
>>> On 13/04/2022 12:58, Marko Stanisic wrote:
>>> Hello,
>>> With buildroot i try to build an uboot which should be patched before, Uboot ist build by buildroot, but there is no reaction on following setting
>>> BR2_TARGET_UBOOT_PATCH="$(BR2_EXTERNAL_GINO_PATH)/patches/uboot"
>>> Inside <BR2_EXTERNAL_GINO_PATH>/patches/uboot there is a .patch file named according to https://buildroot.org/downloads/manual/manual.html#patch-policy with
>>> |<number>-uboot-<description>.patch|
>>> |Patches inside directories can be executed according documentation.
>>> |
>>> |Uboot is used insied a submodul of my repo and buidlroot hass acces to it over UBOOT_OVERRIDE_SRCDIR.
>>> |
>>> |
>>> |
>>> |I have no clue why patching is not performed:|
>>> 1. |checked with make -s printvars VARS='BR2_TARGET_UBOOT_PATCH'|
>>> 2. checked make -s printvars VARS='UBOOT_PATCHES' , UBOOT_PATCHES is set inside
>>>     boot.mk
>>> 3. make -s printvars VARS='UBOOT_POST_PATCH_HOOKS'
>>>     UBOOT_POST_PATCH_HOOKS=UBOOT_APPLY_LOCAL_PATCHES UBOOT_FIXUP_LIBFDT_INCLUDE
>>> 4. BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_GINO_PATH)/patches is also set
>>> 5. It seems that everything fine, maybe one thin is not very clear to me
>>> I use *UBOOT_OVERRIDE_SRCDIR*and maybe thats make troubles here? because of the comment
>>> |When Buildroot finds that for a given package, an +<pkg>_OVERRIDE_SRCDIR+ has been defined, it will no longer attempt to download, extract and patch the package. Instead, it will directly use the source code available in the specified directory and +make clean+ will not touch this directory.|
>>
>> Indeed, as this text says: if you use OVERRIDE_SRCDIR, you can't use patches.
>>
>>
>>>              5.1 If Point (5) makes the problem how can i solve it to apply a proper patch over buildroot, or do i have to put it inside the submodul directly and how?
>>
>> If you have a local directory with the source, it's assumed that you are able to modify that source and apply the patches directly.
>>
>> If for whatever reason that's not an option, there are a few options:
>>
>> - make a tarball and point BR2_TARGET_UBOOT_CUSTOM_TARBALL to it; or
>> - if it's a git repository, you can point BR2_TARGET_UBOOT_CUSTOM_GIT to it.
>>
>>
>> Regards,
>> Arnout
>>
>>
>>>         6. I didn't use the deprecated setting BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR
>>>         7. Tried to build uboot package
>>> |make uboot-dirclean make uboot-extract make uboot-patch ## nothing worked make uboot-build make uboot-install |
>>> Maybe i forgot something?
>>> thank you
>>> ||
>>> _______________________________________________
>>> buildroot mailing list
>>> buildroot@buildroot.org
>>> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-04-19 20:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 10:58 [Buildroot] BR2_TARGET_UBOOT_PATCH setting not working Marko Stanisic
2022-04-14 19:00 ` Arnout Vandecappelle
2022-04-15 17:57   ` Marko Stanisic
2022-04-19 20:11     ` Arnout Vandecappelle

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.