|
On 7/24/26 8:52 AM, David Bracey via
Tech-talk wrote:
And with all the substitutions done at build time - none at run
time via dbLoadRecords, etc.
Personally, I like having one final substitution appear in
st.cmd. One .db file per logical device. Ideally with just two
arguments. A macro to prefix all records, and one for hardware
address (IP address, PCI B:D.F, etc.). The two variables which
must change with each IOC instance. This keeps all instance
specific configuration in the one st.cmd file.
A recent example I did, of moderate complexity, is the linStat
driver.
https ://github.com/mdavidsaver/linStat/tree/master/statApp/Db
The output of the build process is 4 standalone .db files. The
substutions build on a mix of single record templates, and larger
"logic" templates. eg. one is:
dbLoadRecords("../../db/linStatHost.db","IOC=$(IOC)")
linStatHost.db is built from linStatHost.substitutions. Which
includes many instances of single record templates like
tblGetI64.template, followed by a couple of more complex files
like logicHost.template . It also includes netStat.db which is an
expansion of netStat.substitutions. "nesting" substitution files
like this needs a couple of special lines in Makefile.
|