nerves-project / nerves_system_rpi4

Base Nerves system configuration for the Raspberry Pi 4
Apache License 2.0
91 stars 49 forks source link

fwup: Consolodate duplicate metadata into fwup_include/fwup-common.conf #223

Closed ringlej closed 3 months ago

ringlej commented 10 months ago

There is duplication of a set of defined variables between the fwup.conf and fwup-ops.conf. This PR eliminate this duplication by putting the common variable definitions into a file: fwup_include/fwup-common.conf and then includes it in fwup.conf and fwup-ops.conf with:

include("${NERVES_SDK_IMAGES:-.}/fwup_include/fwup-common.conf")

This allows the file to be found correctly in all the build environments where it is referenced. In one, the ${NERVES_SDK_IMAGES} variable exists and will be used and in the other it doesn't exist and the default value of . works there too

ConnorRigby commented 5 months ago

i made a new project with and without this change. Two firmware files named

$ unzip -p hello_fwup_common-current.fw meta.conf >current.txt
$ unzip -p hello_fwup_common-nextt.fw meta.conf >next.txt
$ diff current.txt next.txt 
109c109
< blake2b-256="48f4572e0ab32146d5ae9908bb696958403c42ed881636f9340c8a22f7c7cb66"
---
> blake2b-256="43d39f3b9b281c54021b51fe422462e5a040a8ab4db9408d81d0ebc416a1b642"

Which i believe should mean the meta.conf file is exactly the same, except the hash.

fhunleth commented 5 months ago

@ConnorRigby That's perfect. Thanks for verifying.