Skip to contentSkip to conversation

BR2_TARGET_UBOOT_PATCH setting not working

Buildroot Marko Stanisic 2 participants 4 messages Apr 13, 2022 – Apr 19, 2022

lore
Share & tools
lore
#0 lore raw

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

||

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#1 lore raw
Quoted 30 lines · Marko Stanisic

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

Quoted 3 lines

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.

Quoted 2 lines

            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

Quoted 11 lines

       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

Quoted 7 lines

||

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

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

Quoted 34 lines · Arnout Vandecappelle



Quoted 14 lines · Marko Stanisic

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'|
Quoted 8 lines

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.

Quoted 1 line

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.

Quoted 20 lines

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

Quoted 10 lines

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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
Quoted 12 lines · Marko Stanisic

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 )

Quoted 8 lines

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

Quoted 60 lines

Best regards,
Marko.

Sent from my iPhone

Quoted 54 lines · Arnout Vandecappelle



Quoted 14 lines · Marko Stanisic

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'|
Quoted 8 lines

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.

Quoted 1 line

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

Quoted 10 lines

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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot