From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Robert Hancock <robert.hancock@calian.com>
Cc: Andreas Ehmanns <universeiii@gmx.de>,
"buildroot@buildroot.org" <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH] boot/arm-trusted-firmware: add config option for custom patches
Date: Fri, 28 Jan 2022 18:16:55 +0100 [thread overview]
Message-ID: <20220128171655.GS457876@scaer> (raw)
In-Reply-To: <24f645845a855b039cfa19432c2417e9cedce104.camel@calian.com>
Robert, Andreas, All,
On 2022-01-28 16:25 +0000, Robert Hancock via buildroot spake thusly:
> On Fri, 2022-01-28 at 15:51 +0100, Andreas Ehmanns wrote:
> > Many embedded board manufacturer provide their BSP as patches to
> > linux kernel and u-boot. They can simply be applied by setting the
> > corresponding buildroot config (custom patches).
> > Nowadays patches for the arm trusted firmware (ATF) are also part of
> > BSP deliveries but there is no config option in buildroot for ATF
> > to apply custom patches.
> > This patch adds (similar to linux kernel and u-boot) an option to
> > apply custom patches to ATF.
> You shouldn't need a custom option to add patches for each package. If you add
> patches to $(BR2_EXTERNAL)/patches/arm-trusted-firmware then they will get
> applied automatically, we are using this mechanism already.
I think you forgot a part to this:
... as long as you set BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL)/patches"
in your Buildroot configuration.
BR2_GLOBAL_PATCH_DIR is the generic solution to apply custom patches to
any package in Buildroot. BR2_GLOBAL_PATCH_DIR can even be a
space-separated list of directories. And it can also use a 'series' file
rather than just globing *.patch.
> I think the specific patch options for the kernel and U-Boot may predate that
> mechanism but don't need to be used anymore either.
Indeed. We're keeping them just because of inertia...
Regards,
Yann E. MORIN.
> > Signed-off-by: Andreas Ehmanns <universeiii@gmx.de>
> > ---
> > boot/arm-trusted-firmware/Config.in | 8 +++++++
> > .../arm-trusted-firmware.mk | 21 +++++++++++++++++++
> > 2 files changed, 29 insertions(+)
> >
> > diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-
> > firmware/Config.in
> > index b1fc03e10b..786a3083a2 100644
> > --- a/boot/arm-trusted-firmware/Config.in
> > +++ b/boot/arm-trusted-firmware/Config.in
> > @@ -63,6 +63,14 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION
> >
> > endif
> >
> > +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_PATCH
> > + string "Custom ATF patches"
> > + help
> > + A space-separated list of patches to apply to ATF.
> > + Each patch can be described as an URL, a local file path,
> > + or a directory. In the case of a directory, all files
> > + matching *.patch in the directory will be applied.
> > +
> > config BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM
> > string "ATF platform"
> > help
> > diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-
> > trusted-firmware/arm-trusted-firmware.mk
> > index 03fa83b7b5..d329bdbfc3 100644
> > --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> > +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> > @@ -29,6 +29,27 @@ ifeq
> > ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE)$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST
> > BR_NO_CHECK_HASH_FOR += $(ARM_TRUSTED_FIRMWARE_SOURCE)
> > endif
> >
> > +# Analogous code exists in linux/linux.mk. Basically, the generic
> > +# package infrastructure handles downloading and applying remote
> > +# patches. Local patches are handled depending on whether they are
> > +# directories or files.
> > +ARM_TRUSTED_FIRMWARE_PATCHES = $(call
> > qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PATCH))
> > +ARM_TRUSTED_FIRMWARE_PATCH = $(filter
> > https://urldefense.com/v3/__ftp://*__;JQ!!IOGos0k!zefK7OglGeltoASai_ZVP128fh66I9s3_Ij-rcq9bSBMIxBB8jTXDxe6jH78mYZP6cg$
> > https://urldefense.com/v3/__http://*__;JQ!!IOGos0k!zefK7OglGeltoASai_ZVP128
> > fh66I9s3_Ij-
> > rcq9bSBMIxBB8jTXDxe6jH78b3MIP3A$ https://urldefense.com/v3/__https://*,$(ARM
> > _TRUSTED_FIRMWARE_PATCHES)__;JQ!!IOGos0k!zefK7OglGeltoASai_ZVP128fh66I9s3_Ij-
> > rcq9bSBMIxBB8jTXDxe6jH78N2PO7_g$ )
> > +
> > +define ARM_TRUSTED_FIRMWARE_APPLY_LOCAL_PATCHES
> > + for p in $(filter-out
> > https://urldefense.com/v3/__ftp://*__;JQ!!IOGos0k!zefK7OglGeltoASai_ZVP128fh66I9s3_Ij-rcq9bSBMIxBB8jTXDxe6jH78mYZP6cg$
> > https://urldefense.com/v3/__http://*__;JQ!!IOGos0k!zefK7OglGeltoASai_ZVP128
> > fh66I9s3_Ij-
> > rcq9bSBMIxBB8jTXDxe6jH78b3MIP3A$ https://urldefense.com/v3/__https://*,$(ARM
> > _TRUSTED_FIRMWARE_PATCHES)__;JQ!!IOGos0k!zefK7OglGeltoASai_ZVP128fh66I9s3_Ij-
> > rcq9bSBMIxBB8jTXDxe6jH78N2PO7_g$ ) ; do \
> > + if test -d $$p ; then \
> > + $(APPLY_PATCHES) $(@D) $$p \*.patch || exit 1 ; \
> > + else \
> > + $(APPLY_PATCHES) $(@D) `dirname $$p` `basename $$p` ||
> > exit 1; \
> > + fi \
> > + done
> > +endef
> > +ARM_TRUSTED_FIRMWARE_POST_PATCH_HOOKS +=
> > ARM_TRUSTED_FIRMWARE_APPLY_LOCAL_PATCHES
> > +
> > +# We have no way to know the hashes for user-supplied patches.
> > +BR_NO_CHECK_HASH_FOR += $(notdir $(ARM_TRUSTED_FIRMWARE_PATCHES))
> > +
> > ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES = YES
> >
> > ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC),y)
> > --
> > 2.26.2
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://urldefense.com/v3/__https://lists.buildroot.org/mailman/listinfo/buildroot__;!!IOGos0k!zefK7OglGeltoASai_ZVP128fh66I9s3_Ij-rcq9bSBMIxBB8jTXDxe6jH78CXtWZJI$
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-01-28 17:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 14:51 [Buildroot] [PATCH] boot/arm-trusted-firmware: add config option for custom patches Andreas Ehmanns
2022-01-28 16:25 ` Robert Hancock via buildroot
2022-01-28 17:16 ` Yann E. MORIN [this message]
2022-01-28 20:27 ` Andreas Ehmanns
2022-04-25 15:40 ` [Buildroot] Enable missing security options for ISC dhcp server Andreas Ehmanns
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220128171655.GS457876@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=robert.hancock@calian.com \
--cc=universeiii@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox