Repository navigation
Conversation
saba8814
marked this pull request as draft
November 27, 2026 10:04
saba8814
force-pushed
the
factory-cfg-split
branch
2 times, most recently
from
November 27, 2026 12:42
ac626d1 to
f336fe1
Compare
gen-config already takes a gen-ifs-custom interface generator and a gen-cfg-custom overlay from PATH, which a br2-external builds into /usr/libexec/confd. An image that serves several products cannot do that, the product directory is copied to / at boot and only reaches /etc. Add /etc/product/bin to the PATH in confdrc, so a product can ship the two generators and lose its complete static factory-config. Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
The per-product factory-config.cfg files were complete static copies, so NACM, services and LLDP were duplicated in every one of them and any change to the defaults had to be repeated per board. Most had already drifted: no NETCONF server, an older keystore and motd. Each product now ships a gen-ifs-custom with its interfaces and a gen-cfg-custom with the rest that differs from the defaults, i.e., hardware, DHCP server, firewall, hostname, NTP and update schedule. Both print a static document. With no static configs left in board/, config-version.sh has nothing to check and goes. Prepares for the NACM default changes in #1658, which become a change to one file. Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
The product generators carry no version for make migrate-configs to act on, so a model change that breaks one would only show on the board itself, as a boot into the failure-config. The new repo check collates the factory.d defaults with the output of each product's generators the way gen-config does and validates the result with yanglint, against all modules in the srload .inc files with their features. The NETCONF server and keystore models come from the libnetconf2 and netopeer2 sources, so the check needs a built tree and is skipped without one. Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
saba8814
force-pushed
the
factory-cfg-split
branch
from
November 30, 2026 09:42
f336fe1 to
c436d8a
Compare
saba8814
marked this pull request as ready for review
November 30, 2026 12:16
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Banana Pi, NanoPi R2S, Raspberry Pi and Acer Connect Vero W boards
each shipped a complete static
factory-config.cfg. A static fileskips
gen-config, so any change to the defaults had to be made in 14files, and the copies had already drifted apart. Only the interfaces,
hardware, DHCP server and firewall differ between boards.
This moves those parts out of the static files, as asked for in the
review of #1740. A change to
the defaults, the NACM for example would then be one file.
gen-ifs-customandgen-cfg-custominetc/product/bin/. Both print a static JSON document.gen-configalready runs them and is left as it is
/etc/product/binis added to thePATHin/etc/confdrcconfig-version.shwith themagainst the YANG models with
yanglintThe generated configs differ from the old files in two places, both
where the old files had drifted: the keystore gets the self-signed
certificate, and the motd and meta version are generated.
Two things to be aware of:
/etc/confdrchas to add/etc/product/bintoits
PATH, seedoc/branding.mdskips without one, so it skips in CI
I ran
make test-unit, which covers the defaults and all 14 products.On hardware I tested a Raspberry Pi 4, where the config was generated
and applied and DHCP and SSH work, and a Banana Pi BPI-R64, where the
config was generated and merged correctly.
Checklist
Tick relevant boxes, this PR is-a or has-a: