[PATCH 01/10] build: Generate build hash

Joel Sherrill joel at rtems.org
Wed Feb 24 18:37:11 UTC 2021


I'm missing an operational view of this even from all the pieces and parts.
It looks like there's a hash for some characteristics of the RTEMS build
and another related to the bsp. But I don't see any documentation about
what the intent of this from a system viewpoint and how a systems
integrator would use this in any way.

What's the use case?

How would this improve the robustness or integrity of a system?

Is this for configuration management?

I know this has to have a useful purpose and likely multiple ones but I
can't tell what they are from anything that I have seen so far.

On Wed, Feb 24, 2021, 12:01 PM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> On 24/02/2021 18:55, Gedare Bloom wrote:
>
> > On Wed, Feb 24, 2021 at 6:57 AM Sebastian Huber
> > <sebastian.huber at embedded-brains.de>  wrote:
> >> Update #4265.
> >> ---
> >>   wscript | 27 ++++++++++++++++++++++++++-
> >>   1 file changed, 26 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/wscript b/wscript
> >> index 6626fafb74..83c7c446bb 100755
> >> --- a/wscript
> >> +++ b/wscript
> >> @@ -1359,6 +1359,30 @@ def get_compiler(conf, cp, variant):
> >>       return value
> >>
> >>
> >> +def _generate_build_hash(conf):
> >> +    import hashlib
> >> +    import base64
> >> +
> >> +    build_hash = ""
> >> +    for key in sorted(conf.env):
> >> +        build_hash = build_hash + key + str(conf.env[key])
> >> +    for discard in [
> >> +        conf.env.PREFIX,
> >> +        conf.bldnode.make_node(conf.env.VARIANT).abspath(),
> >> +        conf.path.abspath(),
> >> +    ]:
> >> +        build_hash = build_hash.replace(discard, "")
> >> +    state = hashlib.sha256()
> >> +    state.update(build_hash.encode("utf-8"))
> >> +    conf.define(
> >> +        "RTEMS_BUILD_HASH",
> >> +        base64.urlsafe_b64encode(state.digest()).decode("utf-8"),
> >> +    )
> >> +    conf.write_config_header(
> >> +        conf.env.VARIANT + "/cpukit/include/rtems/build-hash.h"
> > Is this injecting a file in the source tree?
> >
> No, it is in the build tree, for example:
>
> build/arm/realview_pbx_a9_qemu/cpukit/include/rtems/build-hash.h
>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.huber at embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210224/99b4617a/attachment-0001.html>


More information about the devel mailing list