Oh mercy me. Yocto isn't designed for this; everything is assuming that SRCREV, SRC_URI and PV are static and set in the recipe.
So I would rather implement the logic to determine what they are in an external script, and run that prior to bitbake. The script would write the dynamic values into an .inc file, which in turn is included into the recipe. You can place the .inc into a layer, and make automated git commits/pushes every time the content changes. Alex On Wed, 28 Feb 2024 at 18:37, <patrick.huesm...@desy.de> wrote: > > Hi Alex, > > We have Yocto running on FPGA boards; the Linux images and package feeds > include bitstream files to download into the FPGA. > These bitstreams cannot be built within the Yocto/BitBake system, because > they require special (closed source) build tools, take ages to build, etc. > > So they are built somewhere outside BitBake (either on the local machine or > on a build server) and provided as binaries via file:// or http://. But there > are a bunch of complications: > > - The version information (version string, git hash) has to be extracted from > the filename. The files are named like "foobar_1.2.3-g12345678.xsa" and from > that we derive the version 1.2.3 and SRCREV 12345678. The recipe doesn't know > the filename in advance; in case of the local filesystem it is globbed and in > case of the build server it is retrieved via Jenkins REST API. > > - For some systems we need to bundle multiple bitstreams (variants), then at > runtime an application specific script chooses one of them based on CPU ID, > EEPROM contents, config files, etc. Hence the sub-packages. > > - Some metadata (file basenames, versions, etc.) has to be passed to > dependent recipes that extract further stuff from the original files. > > See our bbappend and the original bb (from Xilinx) below. > > This has already grown into quite a monstrosity, so I wouldn't be averse to > rewrite/refactor it, especially if you happen to have a better idea how to > implement it. > > Thanks! > Patrick > > https://github.com/MicroTCA-Tech-Lab/meta-techlab-utils/blob/rel-v2021.2/recipes-bsp/device-tree-from-bd/external-hdf.bbappend > https://github.com/Xilinx/meta-xilinx-tools/blob/rel-v2021.2/recipes-bsp/hdf/external-hdf.bb
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#62640): https://lists.yoctoproject.org/g/yocto/message/62640 Mute This Topic: https://lists.yoctoproject.org/mt/104621339/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-