Compare commits

...
633 Commits
Author SHA1 Message Date
Mattias WalströmandGitHub 5e89d8ef3e Merge pull request #887 from kernelkit/dhcp-server
Add basic DHCP server support
2025-01-31 15:11:07 +01:00
Joachim Wiberg 028fc578b1 doc: update changelog, dhcp server support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg 52e957d47f doc: add documentation for DHCPv4 server
Fixes #798

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg 95cfcaa2fe confd: refactor dhcp server counters
Counters should follow the format from ieee802-ethernet-interface
model, which use:

 - in/out for Rx/Tx
 - plural from

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg 340330b75b confd: refactor dhcp client/server modeling of client-id
Instead of encoding hex data in regular strings, using an 'id:' prefix,
or guessing based on pattern in C code, we have decided for a breaking
change in the DHCP client model.

This commit introduces string and hex values for client-id in the models
for both DHCP client and server.  The *breaking* part of the changes are
strictly related to how a user pass binary data as colon-separated hex
digits.  The dedicated leaf node `client-id` is now reserved for string
values and the generic `list option` can be used to input user defined
string or hex values.  Even non-conformant client-id options can now be
encoded.  All described in detail in infix-dhcp-client.yang

The server model has been updated to be able to send generic options in
hex format, and the static host lease matcher for client-id now require
a 'str' or 'hex' modifier.

Note: dnsmasq is RFC compliant and will not match non-conforming option
      61 (client-id) even though the client can send such payload.

To increase test coverage, the server_host test has been updated to
check both string and hex client-id.  Matching on hostname is already
covered by other test(s).

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg af8a90d651 confd: remap legacy dhcp client options to consolidated options
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg ee44da6272 confd: consolidate dhcp options between client and server
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg a5aba02ddd cli: handle case when dhcp server is not active
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg cb73ddf6bf test: update unit test with DNS resolver operational data
With support for dns resolver in place, the ietf-system output needs to
be complemented with additional data collected from both the dnsmasq and
openresolv subsystems.

System date taken from 'client3' in the Infix DHCP server-subnets test.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg e45fcfca41 test: new test, verify DHCP server with multiple subnets
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg 27dae1edf0 Add support for DNS resolver operational data
Example status output:

    "infix-system:dns-resolver": {
      "options": {
        "timeout": 3,
        "attempts": 5
      },
      "search": [
        "example.com",
        "foo.com"
      ],
      "server": [
        {
          "address": "1.2.3.4",
          "origin": "static"
        },
        {
          "address": "192.168.2.1",
          "origin": "dhcp",
          "interface": "e5"
        }
      ]
    }

Fixes #510

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg d1e1c9ad33 test: new test, verify static dhcp host leases
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg d28fff67f2 confd: work around limited client-id handling in udhcpc
Fixes #899

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg 62d539c424 test: new test, verify basic dhcp server
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:40 +01:00
Joachim Wiberg 3c1e9f3199 confd: reduce dhcp-server to minimal scope
- dnsmasq:
   - allow listening to all interfaces again to serve DHCP leases
   - disable most of the default DHCP options, keep broadcast and
     netmask because when dnsmasq can infer these they are better
     than breaking networking for clients -- note, they can still
     be overridden from global/subnet/host scope -- and for relay
     setups they need to be supplied anyway
 - confd:
   - drop per-interface dnsmasq, although practical for many use-cases,
     having a per-subnet focused server means improved integration with
     future stand-alone dhcp relay setup
   - implement suggested, simplified, yang model

Fixes #703

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:56:28 +01:00
Joachim Wiberg b196194e5f test: rename dhcp client tests dhcp_ -> client_
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Joachim Wiberg 5ee78e28ad confd: add support for setting fqdn hostnames
The hostname leaf in ietf-system.yang defines it as an fqdn.  This patch
adds support for splitting the host and domain parts to set them in
Linux according to hosts(5).

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Joachim Wiberg bcfd3d4a5b confd: dhcp-client hostname option fixes
A DHCP client should be able to request a DHCP server assigned hostname,
*and* advertise its current hostname (as a client-id).  This change lets
the client do either, instead of always assuming the latter.

Alt 1)
     option id:hostname                        => request hostname

Alt 2)
     option id:hostname, value:<STRING | auto> => advertise hostname

This also fixes a bug where the hostname sent to the server could be the
old hostname.  The fix picks up any new hostname directly from sysrepo.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Joachim Wiberg f86f184783 confd: rename dhcp-client option name -> id
For consistency with the new dhcp-server model, which has an option
value 'name', options are now referred to as id's or identifiers.

This means bumping the confd syntax version 1.3 -> 1.4 and adding a
migration script for existing dhcp-client configuration files.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Stefan SchlosserandJoachim Wiberg 60f459687c Add support for DHCP server/relay
This patch introduces a new yang yang model for DHCP server and relay,
using dnsmasq to provide the functionality on a per-interface basis.

Available DHCP options will be queried by confd on startup and can
then be configured in a flexible manner.

The DHCP option 82 feature has been realized by patching dnsmasq
(see patches/dnsmasq/2.90/0000-relay-agent-info.patch).

Signed-off-by: Stefan Schlosser <sgs@grmmbl.org>
2025-01-31 13:55:35 +01:00
Joachim Wiberg 455c384164 confd: initial yang model for dhcp server
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Joachim Wiberg 1fef35f77c confd: silence lldpcli errors in log when lldpd is disabled
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Joachim Wiberg 8bc389987c confd: skip password node in operational data if locked/empty pwd
Skip the password node in operational data for entries that have locked
or empty password, otherwise the YANG validation (regexp) will fail.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Joachim Wiberg ee56ebc205 libsrx: replace sr_get_item() with sr_get_node()
The sr_get_item() function logs an error: "No data found for ..." in
case the referenced XPatjh does not exist, causing unnecessarily scary
log message about missing genkey elements in /ietf-keystore:keystore/

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Joachim Wiberg 9198383742 test: spec: for new tests a Readme.adoc does not exist
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Joachim Wiberg b010ad04bf cli: fix "show ntp" command when ntp is not enabled
Instead of 'show ntp' =>

    Error, top level "ietf-system:system-state" missing

Try something nicer:

    NTP client not enabled.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Joachim Wiberg 4458e03cd2 utils: add update operation and support multiple args for uninstall
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Joachim Wiberg 4a37369750 yanger: add HOST.read_multiline() methods + missing file encoding
Similar to the run_multiline() method, sometimes files contain more than
one line and a common read_multiline() quickly becomes useful.  This is
currently only used by ietf-system for reading /etc/resolv.conf.head.

Also, fix pylint warning for missing encoding to all open() calls.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
Joachim Wiberg 7af75c0786 yanger: fix, no such argument 'file' to LOG.warning()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-31 13:55:35 +01:00
ael-botandGitHub 0fbe225b05 Merge pull request #922 from kernelkit/bump-frr
Bump FRR to 9.1.3
2025-01-31 13:55:20 +01:00
Mattias Walström 2405c002e4 Bump FRR to 9.1.3
This is only a bugfix release.

Full changelog since 9.1.2: https://github.com/FRRouting/frr/releases/tag/frr-9.1.3
2025-01-31 13:13:01 +01:00
Mattias WalströmandGitHub 1cc9e3c9c8 Merge pull request #920 from kernelkit/fix-storing-to-startup
Fix issue with storing authorized SSH key to startup
2025-01-30 18:26:18 +01:00
Mattias Walström a64c9695cc Fix issue with storing authorized SSH key to startup
The problem was that the sysrepo callback was never called,
except on update (not availible on startup)

This fix #777
2025-01-30 15:32:59 +01:00
Tobias WaldekranzandGitHub d9be0b3a64 Merge pull request #918 from kernelkit/changelog-869
Update ChangeLog.md
2025-01-30 13:39:58 +01:00
Tobias Waldekranz 8b4682ac8b Update ChangeLog.md
[skip ci]
2025-01-30 13:39:22 +01:00
Jon-Olov VatnandGitHub a975da2159 Merge pull request #916 from kernelkit/doc-console
Doc console and other management interfaces
2025-01-29 13:18:42 +01:00
Jon-Olov Vatn e483ddb487 Update support info, company name change
Company "Addiva Elektronik" is now named "Wires"
2025-01-29 12:32:48 +01:00
Jon-Olov Vatn 267c8e0103 Fix #787 Add doc on Mgmt via Console (and SSH and Web)
- Updating SSH information
- Adding Web services information (general, RESTCONF and Web Console)
- Adding Console information
  Generic info, and some updates w.r.t specific boards (baudrate, etc)
2025-01-29 12:27:48 +01:00
Ahmed KaricandGitHub 25f0d8ca2e Merge pull request #912 from kernelkit/various-test-updates
Various test updates
2025-01-28 15:17:15 +01:00
Tobias WaldekranzandGitHub be0edc00cc Merge pull request #913 from kernelkit/fix-bug-in-test-mode
Fix error when running 251+ reconfigurations (in test-mode)
2025-01-27 20:34:17 +01:00
Ahmed Karic dc393946ce test: split infix_services test into mdns and lldp
mDNS and LLDP tests should run independently to avoid interference.
Previously, mDNS tests were blocked due to LLDP's transmit interval
limitations. Moreover, mDNS operates at Layer 3, while LLDP operates
at Layer 2, making IP configuration unnecessary for LLDP tests.
2025-01-27 15:48:44 +01:00
Ahmed Karic 80a522ce08 test: update forgotten .adoc files 2025-01-27 15:48:44 +01:00
Ahmed Karic b3ad9e5693 test/infamy: add option to set interface up by default
Introduce a parameter in IsolatedMacVlans to set interfaces up by
default. This removes the need to manually bring the interface up
inside the addip function.
2025-01-27 15:48:44 +01:00
Mattias WalströmandGitHub cc8c917de1 Merge pull request #911 from kernelkit/update-doc
Update doc
2025-01-27 15:19:55 +01:00
Mattias Walström 2a3fcbacd0 Fix error when running 251+ reconfigurations (in test-mode)
The context was aquired but never released, this caused a lockup
in sysrepo.

This fix #861
2025-01-27 15:12:11 +01:00
Mattias Walström 5c9cf276df infix-services: ssh: add must expression on listen
Both address and port is required.
2025-01-27 14:14:24 +01:00
Mattias Walström 76203b392a infix-system.yang: Add proper documentation about SSH listen command 2025-01-27 14:14:24 +01:00
Mattias Walström 18913770fe Update Changlog 2025-01-27 13:17:24 +01:00
Tobias WaldekranzandGitHub 2f23baf745 Merge pull request #909 from kernelkit/update-kernel
Update kernel to latest LTS (6.12.11)
2025-01-24 22:20:49 +01:00
Tobias WaldekranzandGitHub a7ce8c2ab4 Merge pull request #910 from kernelkit/stp-operational
Operational data support for STP
2025-01-24 21:53:05 +01:00
Mattias Walström d7ac84cf99 Update changelog with kernel and buildroot changes 2025-01-24 21:35:16 +01:00
Mattias Walström 04b739b0bd Remove old (6.6.52) linux patches 2025-01-24 21:35:16 +01:00
Mattias Walström 131c0b1d4b Update kernel to latest LTS (6.12.11) 2025-01-24 21:35:16 +01:00
Mattias Walström f42c35d8ab kernel-refresh: Update defconfigs as well 2025-01-24 21:35:16 +01:00
Tobias Waldekranz 0187d62246 test: bridge_stp_basic: Add explicit prioritiy test 2025-01-24 16:48:16 +01:00
Tobias Waldekranz 01201708e3 test: statd: Update test data after moving STP port state 2025-01-24 15:17:13 +01:00
Tobias Waldekranz 986a28c891 confd: Avoid managing a finit user condition to start/stop mstpd
By declaring the service as manually configured, we can control it
from dagger (confd) without the indirection via a condition.

This has the benefit of mstpd being in the "stopped", rather than the
somewhat confusing "waiting", state when not running.

Fixes #890
2025-01-24 14:52:25 +01:00
Tobias Waldekranz 0bbcd7ec43 board/common: show: Add show stp 2025-01-24 14:52:25 +01:00
Tobias Waldekranz f9dacaa0ff klish-plugin-infix: Add show bridge stp 2025-01-24 14:52:25 +01:00
Tobias Waldekranz 8f6a75806f yang: Add STP hello-time
This was an oversight in the original model, but was noticed in
review.
2025-01-24 14:52:25 +01:00
Tobias Waldekranz 05cb07c0ec cli_pretty: Add per-port status to show bridge stp 2025-01-24 14:52:25 +01:00
Tobias Waldekranz d6ace7cc73 cli_pretty: Add bridge-wide status to show bridge stp 2025-01-24 14:52:25 +01:00
Tobias Waldekranz 9ef6d2d038 yang: Remove old STP port state from operational 2025-01-24 14:52:25 +01:00
Tobias Waldekranz c1e6f0c53b yanger: Provide per-port STP state 2025-01-24 14:52:25 +01:00
Tobias Waldekranz 0e82c108bc yanger: Provide bridge-wide STP state 2025-01-24 14:52:25 +01:00
Tobias Waldekranz 9427b6a655 yanger: Generalize converting time deltas to YANG dates
Make sure that we have one way of getting from Python's native
datetime to a YANG compatible format.
2025-01-24 14:52:25 +01:00
Tobias Waldekranz 6a09e2c797 yang: Define operational data model for per-port STP state 2025-01-24 14:52:25 +01:00
Tobias Waldekranz 3b0b38360c yang: Define operational data model for bridge-wide STP state 2025-01-24 14:52:25 +01:00
Tobias WaldekranzandGitHub 3b3fe18f9d Merge pull request #907 from kernelkit/provides-requires
Match on Edge Attributes when Mapping Topologies
2025-01-24 12:43:08 +01:00
Mattias WalströmandGitHub dedab8c2a2 Merge pull request #906 from kernelkit/fix-yanger
Yanger and CLI pretty fixes
2025-01-24 12:29:34 +01:00
Ahmed Karic 3e0b816351 test: Match on edge attributes when mapping topologies
Implemented logic to check if the system supports required services.
Logical edges with 'requires' fields are mapped only if physical edges
provide corresponding services. If not, the test is skipped.
This ensures that tests only run when the required services are available
in the test system configuration.

Fixes #654
2025-01-24 11:51:55 +01:00
Mattias Walström 3f8fae2f16 cli-pretty: show-interfaces: Refactor protocol type
now will *only* ethernet interfaces be protocol ethernet,
gretap will be protocol gretap and so on.
2025-01-24 10:56:58 +01:00
Mattias Walström 70bcebc451 yanger: Add oprational information about vxlan interfaces 2025-01-24 10:56:58 +01:00
Mattias Walström 6a384bf48b test: update verify_all_interface_types for collecting data
To collect vxlan interfaces and add some addresses to some interfaces
to increase coverage of unit_test (show interface)
2025-01-24 10:56:58 +01:00
Mattias Walström 10add98d90 yanger: Fix bug when collecting data 2025-01-24 10:56:58 +01:00
Mattias WalströmandGitHub a2257731ca Merge pull request #908 from kernelkit/update-buildroot
Update buildroot LTS to 2024.02.10
2025-01-24 10:23:05 +01:00
Mattias Walström 6be990f1bb Update buildroot LTS to 2024.02.10 2025-01-24 08:45:54 +01:00
Ahmed KaricandGitHub 370920e931 Merge pull request #882 from kernelkit/lldp-tx-interval
confd: Enable config for lldp tx interval
2025-01-23 14:45:48 +01:00
Ahmed Karic ee441e172d confd: LLDP upgrade to support per-port admin-status
This update enhances the LLDP configuration by enabling per-port
administration through the `admin-status` parameter. Users can now
individually enable or disable LLDP operation on specific ports.

Fixes #578
2025-01-23 13:16:40 +01:00
Tobias WaldekranzandGitHub 5e90bde8b9 Merge pull request #903 from kernelkit/yanger-missing-container-iface-fix
yanger: Handle the case when a container interface can not be found
2025-01-22 21:55:05 +01:00
Tobias Waldekranz 0b2f53e3b4 test: ssh_*: Wait for server start before further testing commences
On slow systems, we don't want test steps involving tools like scp or
ssh-keyscan to fail because the server had not come up yet.

Therefore, make sure that the server is ready to accept connections
before moving on to subsequent test steps.
2025-01-22 20:32:33 +01:00
Tobias Waldekranz 1fd55c484a test: ssh_key_authentication: Consolidate and mark static data
Use CAPTIALIZED names for static data and collect them at the top.

Make a note about for future readers about why a test called
ssh_key_authentication suspiciously does not enable the SSH service :)
2025-01-22 20:32:17 +01:00
Tobias Waldekranz 1d13c5ea9e test: infamy: Generalize netconf_syn() to test for any TCP service
Being able to check for a TCP based service is generally useful, not
only for NETCONF. Therefore, break it out to a separate function that
allows any port to be queried.
2025-01-22 20:16:47 +01:00
Mattias WalströmandGitHub 26303f5168 Merge pull request #901 from kernelkit/fix-memory-leaks
Fix memory leaks
2025-01-22 16:17:20 +01:00
Tobias Waldekranz 19c1f49fd3 test: Whitespace cleanup 2025-01-22 15:53:41 +01:00
Mattias Walström 5b8b1eec57 test: syslog: Convert from put_config_dict to put_config_dicts 2025-01-22 15:05:48 +01:00
Mattias Walström d83c333b2d generate-defconfig: Fix typo in script
Should not call merge_config.sh with -n parameter, this will result
in an invalid defconfig.
2025-01-22 15:05:48 +01:00
Mattias Walström 4598585d4a confd: Fix memory leaks in ietf-keystore and ietf-syslog 2025-01-22 15:05:48 +01:00
Tobias Waldekranz c2959cf41e yanger: Handle the case when a container interface can not be found
Due to #902 (which has not been root caused at this time), podman may
indicate the existance of an interface that yanger is not able to
locate in any namespace. Therefore, make sure that we verify that the
interface was actually found before trying to create the operational
data for it.
2025-01-22 14:11:37 +01:00
Tobias WaldekranzandGitHub a640460baf Merge pull request #895 from kernelkit/yanger
Yanger Interfaces Refactor
2025-01-22 10:27:44 +01:00
Tobias Waldekranz 5d6180a395 yanger: Improve option names and validation after review
Break up the --test parameter into either:

--capture: Write system command output to a local directory for later
           consumption by...
--replay:  Which can replay a previous capture

Rename --wrap-commands => --cmd-prefix
2025-01-22 09:44:52 +01:00
Ahmed Karic 28c0cee4e3 confd: Enable configuring LLDP tx interval
This change introduces the configuration of the tx-interval parameter
for the LLDP service, allowing control over the frequency of LLDP hello
messages. This improvement eliminates the need to toggle the interface
down and up to force the emission of LLDP packets in the test
environment.
2025-01-21 22:44:59 +01:00
Richard AlpeandGitHub 27bba2c47c Merge pull request #865 from rical/ci-generate-test-report
Generate 9pm Test Report
2025-01-21 20:35:09 +01:00
Richard Alpe 4753e35d7f test: add project topdoc to 9pm project config
Used when generating test specifications.

Signed-off-by: Richard Alpe <richard@bit42.se>
2025-01-21 15:02:12 +01:00
Richard Alpe 28f67ff608 test: add topdoc dir to all test specifications
This should be a non functional change. The idea is to use the topdoc
dir from 9pm when generating the test report.

Signed-off-by: Richard Alpe <richard@bit42.se>
2025-01-21 15:02:11 +01:00
Richard Alpe e1a033b97d test: add 9pm project config
Signed-off-by: Richard Alpe <richard@bit42.se>
2025-01-21 15:02:10 +01:00
Richard Alpe 2b7d2b4005 test: add verbose flag to 9pm execution
Signed-off-by: Richard Alpe <richard@bit42.se>
2025-01-21 15:02:09 +01:00
Richard Alpe 39de797b10 test: specify test specification in top suite
Signed-off-by: Richard Alpe <richard@bit42.se>
2025-01-21 15:02:08 +01:00
Richard Alpe de9b1cdd2d CI: Generate and publish 9pm test report
Signed-off-by: Richard Alpe <richard@bit42.se>
2025-01-21 15:02:07 +01:00
Richard Alpe f0c57da4ab test: bump 9pm submodule
Signed-off-by: Richard Alpe <richard@bit42.se>
2025-01-21 15:02:05 +01:00
Mattias WalströmandGitHub b5218f7149 Merge pull request #893 from kernelkit/add-merge-script
Add script for merging defconfigs
2025-01-21 14:39:01 +01:00
Mattias WalströmandGitHub 7cb311b5bc Merge pull request #900 from rical/test-add-git-to-docker
test: add git to docker container
2025-01-21 14:21:52 +01:00
Richard Alpe 254c922254 test: add git to docker container
Intended to be used when fetching version information for the test
report.

Signed-off-by: Richard Alpe <richard@bit42.se>
2025-01-21 14:00:12 +01:00
Mattias Walström 4fb26b1119 Add script to merge defconfigs
Useful to only create a new image with only small diff with for example
aarch64_defconfig.

example:
If the only diff is the VENDOR, instead of KernelKit you want 'foobar'.
create a file with the change:
INFIX_VENDOR="foobar"

and call ./utils/generate-defconfig.sh -b aarch64_defconfig -c foobar-diff.conf -o configs/foobar_defconfig
2025-01-21 13:59:39 +01:00
Mattias WalströmandGitHub ad262459b7 Merge pull request #894 from kernelkit/upgrade-netopeer2
Bump sysrepo, netopeer,libyang and libnetconf2
2025-01-21 11:16:39 +01:00
Mattias WalströmandGitHub 71b89d06d7 Merge pull request #898 from kernelkit/fix-memory-leaks
confd: Fix memory leaks in ietf-system.c
2025-01-21 11:16:22 +01:00
Mattias Walström 72b3058774 confd: Fix memory leaks in ietf-system.c 2025-01-21 10:12:20 +01:00
Tobias Waldekranz 57c8d0cf1b test: statd: Add unittest for bridge-mdb 2025-01-20 13:44:14 +01:00
Tobias Waldekranz f4c9a57bb5 test: statd: Add unittest for ietf-{hardware,system} 2025-01-20 13:44:14 +01:00
Tobias Waldekranz 9879e8b685 test: statd: Add unittest for containers 2025-01-20 13:44:14 +01:00
Tobias Waldekranz beecff2acf test: statd: Refactor cli and yanger testing
Existing tests relied on manually captured system data from various
points in Infix's history, making them hard to extend as we add new
features.

Move to a new model where we:

To update a unit test:
1. Use Infamy tests to setup a DUT in a known state
2. Use yanger's wrapper mode to capture the system state needed to
   produce operational data for a set of YANG models
3. Use cli-pretty to create the expected output for a set of show
   commands

When running unit tests, we can then use the captured data to verify
that yanger and cli-pretty works as expected without the need for a
running Infix system - just like before.  The difference is that it is
now much easier to capture a new snapshot when the system evolves.
2025-01-20 13:44:14 +01:00
Tobias Waldekranz 6f2face898 test: verify_all_interface_types: Add GRE tunnels
Ensure that all flavors of GRE tunnels can be configured. In addition
to the increased test coverage, it will also be useful as a basis for
collecting representative system state for CLI testing.
2025-01-20 13:44:14 +01:00
Tobias Waldekranz ddc8282dd7 test: verify_all_interface_types: Add IP addresses
Having addresses configured is useful when using this test to collect
representative system state for CLI testing.
2025-01-20 13:44:14 +01:00
Tobias Waldekranz c244042e55 test: verify_all_interface_types: Add bridge VLANs
Ensure that VLANs can be configured on VLAN filtering bridges. In
addition to the increased test coverage, it will also be useful as a
basis for collecting representative system state for CLI testing.
2025-01-20 13:44:14 +01:00
Tobias Waldekranz 78b7b34799 yanger: Break up ietf-interfaces implementation into modules 2025-01-20 10:56:56 +01:00
Tobias Waldekranz e397012394 yanger: Add support for connecting to remote hosts
Allow all host commands to be run with a prefix (e.g. `ssh
user@remotehost sudo`), such that yanger can be tested against the
current state of a remote system.

If a command wrapper _and_ a test directory is specified, the output
of all commands and files are recorded for use by a future test
execution.

Example:

1. Launch a `make run` instance and setup some config for which we
   want to test yanger and cli-pretty

2. Capture the output of all commands needed to produce the data for
   some YANG model:
   `yanger -t /tmp/ifs -w "ixll -A ssh qtap1 sudo" ietf-interfaces`

3. Kill the instance (we do not need it any more)

4. Test cli-pretty using the captured state:
   `yanger -t /tmp/ifs ietf-interfaces | cli-pretty show-interfaces
`
2025-01-20 10:56:56 +01:00
Mattias Walström 5cc73ab97c Bump sysrepo, netopeer,libyang and libnetconf2
A lot of changes in sysrepo, required to add extra patches (bugfixes) to sysrepo,
sysrepo-cpp and rousette.
2025-01-20 09:18:09 +01:00
Tobias Waldekranz be1b7cdf45 confd: Enable remote SSH access via IPv6 in {factory,failure}-config
The default was set to only accept connections from localhost when
connecting via IPv6. This was not caught in testing since the
test-config accepts connections from all hosts (::).

Accept connections from all hosts in all builtin configs. Inherit
test-config's service definition from factory-config, since we want
testing to be done as close as possible to what are users are running.
2025-01-17 14:33:41 +01:00
Tobias Waldekranz 41f3fe15a6 confd: Drop unsupported default-priority bridge port option 2025-01-17 14:33:41 +01:00
Tobias Waldekranz df3a55d6a0 ixll: Disable key checking for admin:admin sessions
This is a shorthand for the common case when we're attaching to a
random Infix device during testing, so don't bother with key checking.
2025-01-17 14:33:41 +01:00
Tobias Waldekranz 4e83520b0e ixll: Fix ping(8)s that require all options precede address
The default ping(8) shipped with alpine does not support `ping <addr>
-c1`, but happily executes `ping -c1 <addr>`. Therefore, make sure
that the address is always the last argument.
2025-01-17 14:33:41 +01:00
Tobias WaldekranzandGitHub 94cd526772 Merge pull request #888 from kernelkit/vxlan
Add simple VXLAN support
2025-01-15 10:36:00 +01:00
Mattias Walström 4782cee201 Add support for simple VXLAN tunnels
This is just a first step to add VXLAN tunnels, much more remains.
Implemented right now is as GRE, local, remote and a VNI.

Also refactor gre_basic and gre_bridged to generic tunnel tests,
the same test now tests VXLAN as well.
2025-01-14 14:31:21 +01:00
Mattias Walström 907401f6f2 generate_spec: Allow to run script manually and show all output 2025-01-14 13:43:59 +01:00
Mattias Walström 9a831217e4 test-specification: Add support for python f-strings in step and description
This is only availible for tests that require paramters. If the test have a
parameter --data the description and test steps can contain {data} which will
be replaced with tha actual data of the parameter data in the test specification.
2025-01-14 10:54:05 +01:00
Joachim WibergandMattias Walström 1aab75d86a test: spec: remove .tmp files when done
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-13 20:16:37 +01:00
Tobias WaldekranzandGitHub 147cb713ed Merge pull request #884 from kernelkit/test-spec-ng
Test specification refactor
2025-01-11 23:40:06 +01:00
Mattias Walström 12b6146551 Add new generated specification files 2025-01-10 21:42:10 +01:00
Mattias Walström 29031be4e9 test-specification: Generate test specification from suite file
The suite can also contain meta data for the test specification,
One meta data that is implemented is title, which is used when the
same test code is used twice with parameters.

Also if a test case should not be present in the test specification
for some case. You can add specification: False as meta data.
2025-01-10 21:42:10 +01:00
Mattias Walström b2db59f3bc infamy: Add support for parameters to tests
All test added parameters is required and no default behaviour is allowed.
2025-01-10 21:40:42 +01:00
Tobias WaldekranzandGitHub cf129d1f9c Merge pull request #883 from kernelkit/yanger
Yanger Modularization
2025-01-10 11:21:35 +01:00
Tobias Waldekranz 41b96e8a01 utils/ixyang: Simplify linting of infix YANG models
Usage examples:

Run yanglint on all infix models:

    ixyang check

Lint a single model:

    ixyang lint infix-interfaces

Dump a tree of ietf-interfaces with all infix augments:

    ixyang lint infix-interfaces ietf-interfaces -- -f tree
2025-01-10 10:12:22 +01:00
Tobias Waldekranz 805ddf6c92 utils: Make srop's output directory resolution reusable 2025-01-10 10:12:22 +01:00
Tobias Waldekranz 547a9cd632 yanger: Remove dead code remaining after modularization 2025-01-10 10:12:22 +01:00
Tobias Waldekranz 2ec226640e yanger: Move ietf-{interfaces,routing} implementations to separate modules
Should this have been two commits: yes.

Should we spend time on splitting them after the fact because yours
truly dropped the ball: no.
2025-01-10 10:12:22 +01:00
Tobias Waldekranz a0e4e813dd yanger: Move ietf-ospf implementation to separate module 2025-01-10 09:57:40 +01:00
Tobias Waldekranz 8812ae7052 yanger: Move ietf-hardware implementation to separate module 2025-01-10 09:57:40 +01:00
Tobias Waldekranz 28bf2d6c3c yanger: Move infix-containers implementation to separate module 2025-01-09 23:59:20 +01:00
Tobias Waldekranz dadf0e2d16 yanger: Start the modularization process with ietf-system
The yanger source grown significantly, code is disorganized, the
namespace is all over the place, etc.

Take a stab at remedying the situation by splitting out the individual
YANG models in separate Python modules, starting with ietf-system.
2025-01-09 23:59:20 +01:00
Tobias Waldekranz c4a79766b7 statd: Make sure subpackages in python packages are distributed
Rather than explicitly defining the sources, specify the package names
and let poetry figure out the details. Otherwise, subpackages are not
included, which we want to start using in yanger.
2025-01-09 16:23:26 +01:00
Tobias Waldekranz 385eab2016 statd: Ignore generated Python byte code files
When interactively running, for exampe, yanger interactively from the
source tree, we end up with compiled files in our working tree. Make
sure to ignore these.
2025-01-09 16:02:43 +01:00
Tobias Waldekranz bc33d8bc8a confd: Reactivate supported interface counter in-total-frames
This was always supported, but was accendentally marked as
not-supported.
2025-01-09 16:02:36 +01:00
Tobias Waldekranz 061fa5fc72 confd: Add missing module dependencies
These are also provided by other packages (sysrepo, netopeer, etc.)
but having them in here allows us to lint all of our own models
without the need for a build tree.
2025-01-09 16:02:36 +01:00
Tobias WaldekranzandGitHub ac0acfe7c1 Merge pull request #867 from kernelkit/stp
STP
2025-01-08 11:25:14 +01:00
Tobias Waldekranz f3f313bb98 infamy: Fix default transport selection
Using `sys.argv[0]` does not quite achieve the effect we want, namely
that any (test-case, $PYTHONHASHSEED) tuple should always default to
the same transport.

For example, the following two examples should always use the same
transport:

    $ make PYTHONHASHSEED=1337 test-sh
    infamy0:test$ ./case/ietf_system/hostname/test.py

    $ make PYTHONHASHSEED=1337 test-sh
    infamy0:test$ cd ./case/ietf_system/hostname
    infamy0:hostname$ ./test.py

But, since their argv[0]'s are different, they don't.

Therefore use the _last two components_ of argv[0]'s full path
instead. This should:

- Spread the allocation over an entire suite run, since the
  penultimate component is usually the test name.

- Keep the allocation stable when test code is modified (which is
  common during debugging of failing tests)

- Avoid instabilities stemming from the local storage location (i.e.,
  home directory names etc.)
2025-01-08 10:14:46 +01:00
Tobias Waldekranz 3ef40031dd test: bridge_stp_basic: Add 2025-01-08 10:14:46 +01:00
Tobias Waldekranz 44b60956a8 test: upgrade: Add .gitignore for package symlink 2025-01-08 10:14:46 +01:00
Tobias Waldekranz e4535aa856 test: infamy: Make it easier to resolve mapped port names
The somewhat clumsy construct of resolving a logical port name to its
physical counterpart has been with us from Infamy's inception:

    _, physical_port = env.ltop.xlate(logical_node, logical_port)

This is needlessly verbose. Since devices already have access to the
mappings which applies to it, make them easy to access:

    target = env.attach("target")

    # Get physical port names via the subscript operator
    target["data0"]
2025-01-08 10:14:46 +01:00
Tobias Waldekranz 343400c5fe test: infamy: Default to attaching to DUTs via the "mgmt" port
This convention is now well established, so it seems silly to have to
repeat it in every test.
2025-01-08 10:14:46 +01:00
Tobias Waldekranz bfeeade43b confd: bridge: Add STP/RSTP support 2025-01-08 10:14:46 +01:00
Tobias Waldekranz b425edffce libsrx: Add lyx versions of lyd_find_xpath
- Helper to get a set of nodes, using a formatted path
- Helper to get a single node, using a formatted path
2025-01-08 09:57:55 +01:00
Tobias Waldekranz f041d009b5 defconfig: all: Build mstpd 2025-01-08 09:57:55 +01:00
Tobias Waldekranz 26d06bd13b skeleton: mstpd: Let /sbin/bridge-stp add/remove bridges 2025-01-08 09:57:55 +01:00
Joachim WibergandTobias Waldekranz 9d51470ee2 utils: add srop, for operating on target sysrepo db
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-01-08 09:57:55 +01:00
Tobias WaldekranzandGitHub 49a003088b Merge pull request #881 from kernelkit/gre-tunnels
GRE tunnels
2025-01-07 17:02:37 +01:00
Joachim WibergandMattias Walström c099d887af Add support for GRE tunnels
Basic support GRE and GRETAP tunnels both for IPv4 and IPv6.
Limited support right now, only possible to configure local
ip address and remote ip address.
2025-01-07 15:33:37 +01:00
Mattias Walström 08990556e2 confd: Fix typo in veth code
Should check if any node under veth is changed instead
of peer (does not exist).
2024-12-20 19:47:18 +01:00
Mattias WalströmandGitHub cd5b076751 Merge pull request #879 from kernelkit/update-buildroot
Update buildroot to 2024.02.9
2024-12-20 19:46:23 +01:00
Mattias Walström 081f8e8412 Update buildroot to 2024.02.9 2024-12-20 14:28:02 +01:00
Mattias WalströmandGitHub 465d8cbc82 Merge pull request #838 from kernelkit/add-ssh-config
Add ssh config
2024-12-20 10:44:12 +01:00
Mattias Walström 323c77b702 Update branding document for the new behaviour with SSH hostkeys 2024-12-19 14:42:17 +01:00
Mattias Walström 780077e729 Document SSH configuration 2024-12-19 14:42:17 +01:00
Mattias Walström 324bcb2533 Update changelog for configurable SSH server 2024-12-19 14:42:17 +01:00
Ahmed KaricandMattias Walström e29a721571 test: move ssh_key_authentication to infix_services 2024-12-19 14:42:17 +01:00
Mattias Walström 389fc96794 test: Verify ssh server config
Fixes #441
2024-12-19 14:42:17 +01:00
Mattias Walström da260fabf9 infamy: restconf: Add support to delete individual entries in leaf-lists 2024-12-19 14:42:17 +01:00
Mattias Walström 79bec6877c Bump confd to 1.3
This since there is breaking changes.
2024-12-19 14:42:17 +01:00
Mattias Walström 37b97d9e4c Add support for configurable SSH server 2024-12-19 14:42:17 +01:00
Mattias Walström 2e81e99224 Generate any (SSH) key without content
This also makes it possible to remove the key 'genkey' if the
user wants.
2024-12-19 14:42:17 +01:00
Mattias Walström bea18c2fa9 Add new helper function rmrf
for recursive delete of directories
2024-12-19 14:42:17 +01:00
Tobias WaldekranzandGitHub 0233fdbf35 Merge pull request #878 from kernelkit/fix-build-id
build: Source build id from the correct repo, fix #872
2024-12-19 12:54:10 +01:00
Tobias Waldekranz 23ca94ea42 build: Source build id from the correct repo, fix #872
INFIX_OEM_PATH is `""` by default (i.e., not empty in `make`'s
eyes). So we called `git` with `-C ""`, which it interpreted as "from
the current directory" and thus we sourced the autogenerated build id
from _buildroot_ instead of Infix.

Therefore, make sure to strip any quotes from the OEM path before
determining the top directory.
2024-12-19 11:37:07 +01:00
Mattias WalströmandGitHub a8545e3369 Merge pull request #876 from kernelkit/change-boot-order
Change boot order
2024-12-19 11:23:45 +01:00
Tobias WaldekranzandGitHub 1f2973d93f Merge pull request #874 from kernelkit/br-refactor
Bridge refactor
2024-12-19 10:29:05 +01:00
Mattias Walström e00737ef78 test: Refactor upgrade test
* Use new cleanup in infamy to ensure the boot order gets restored
* Use new boot order in operational and use RPC to set boot order
  to remove all SSH commands.
2024-12-19 10:14:15 +01:00
Mattias Walström a90294fe08 test: infamy: Add optional test cleanup
If a test need to clean up itself disregarding test status,
it can add an optional test-cleanup phase.

This is useful if the test in some circomstances leave the device in a
bad state. This can be used to restore the unit to its ordinary state.
2024-12-19 10:14:15 +01:00
Tobias Waldekranz 77215aeb87 infamy: furl: Handle connection resets
Furl answers the question "is this URL serving the content I expect?"

Sometimes, we might be asking a server that in the middle of being
reconfigured, is crashing, is buggy, etc. - in which case it might RST
the connection. In that case the answer to the question is "False" and
not "BURN IT ALL DOWN!!"
2024-12-19 09:33:45 +01:00
Tobias Waldekranz 7dfb1f131e board/common: container: Use syslog log backend for containers
Now that conmon can do it, make use of it.
2024-12-18 23:25:07 +01:00
Tobias Waldekranz 7fecac2973 package/podman: Add syslog support
The only reliable way of getting logs from the container at all times
is to let conmon be the logging agent.

Unfortunately, the k8s-file format does not handle multiline output
very well, which is something we often see on the stdout/stderr of
containers.

Therefore, add proper syslog support to conmon instead, and make sure
that podman knows enough about it to pass the information along to
conmon.
2024-12-18 23:25:07 +01:00
Tobias Waldekranz bb939ccdff confd: Avoid initctl reload after exiting previous generation
Instead of running initctl reload, which also prematurely enables
services which are not supposed to be started until we have run
through the netdag and evolved to the next generation.

Handle the original use-case of disabling zeroconf is managed by
asking finit to stop the service immediately in the exit action, and
deferring the cleanup of the service until we call `initctl reload`
after the init action of the new generation.
2024-12-18 23:25:07 +01:00
Mattias Walström 8e38b34c55 doc: Add new boot order to the Changelog 2024-12-18 17:44:40 +01:00
Mattias Walström ff8669e735 Add support to set configure with RPC and read it from operational datastore 2024-12-18 17:44:40 +01:00
Ahmed KaricandGitHub 6a4c8f738e Merge pull request #875 from kernelkit/verify-mac-mcast
Verify MAC Multicast
2024-12-18 15:45:07 +01:00
Ahmed Karic 03cab6d1e4 Verify MAC multicast
Fixes #649
2024-12-18 14:55:00 +01:00
Tobias Waldekranz 96779c2620 confd: bridge: Simplify function names after review
Agreement: Avoid abbreviations in exported functions. Use short,
prefix-less, names for local functions.
2024-12-17 22:59:39 +01:00
Tobias Waldekranz e9a71ec3f7 confd: dagger: Define the script order on init/exit actions
In ye olde confd, we basically had `50-init.ip` - and that was fine.

Then came containers, VLANs, bridges, etc.; and with it: a whole
forest of setup/teardown scripts - and it was not fine anymore.

For example: if found an init script running at 61, you would have to
grep the source tree and look at _all_ other call sites to get a sense
of what runs before and/or after it.

Therefore: create enums for the init/exit actions where the order is
explicitly stated, and use those for all interface scripts.
2024-12-17 22:59:39 +01:00
Tobias Waldekranz b3da4c50fc confd: bridge: Refactor port setup
Clean up bridge-port config generation to align with the bridge upper
code.

- Remove lots of unnecessary guards that we model guaratees are always
  met (existance of containers and leafs).  This reduces indentation
  depth and increases readability, IMHO.

- Split the generation into smaller pieces, each with a clear purpose.

- Try  to include  all edge  cases around the  tricky subject  of PVID
  migrations,  with the  actions running  in either  exit or  init, as
  appropriate.
2024-12-17 22:59:39 +01:00
Tobias Waldekranz eb9ae5e4dd confd: bridge: Use confd god object to access dagger
Now that we have a god object, we might as well use it to make our
functions signatures a bit more readable.
2024-12-17 22:59:31 +01:00
Tobias Waldekranz 9591093379 confd: bridge: Refactor setup
TL;DR:
> New code, all bugs removed ;)

Incremental reconfiguration of bridge related settings had lots of
ordering issues.

This change tries to remedy that by:

- Introducing the concept of "snippets": Instead of having to run C
  code in the correct order (which is doomed to fail since teardowns
  typically need to run in reverse), collect related settings in a
  snippet.  Later on, we can then concatenate snippets into a larger
  file in the proper order.

- Refactoring the bridge setup to take advantage of snippets.  Now we
  can call out to functions that _both_ generate the VLAN config _and_
  sets some bridge global options, for example.  This gets us out of
  having to pass back settings to the main generation function.

- Ensuring that deleted objects are always removed - in the proper
  order - in the exit action of the previous generation.  This was
  previously not true for VLANs, fix #869.

- Generating `mcd`:s config orthogonally from the bridge setup.  Since
  we need to keep track of _all_ bridges, figure out when VLAN uppers
  exist etc., it becomes _very_ messy to generate the configuration
  from the diff of a single interface. There were lots of cases here
  where disabling the querier service on one bridge would disable the
  whole daemon, thereby disabling the service for other bridges that
  still had it enabled.
2024-12-17 22:59:31 +01:00
Tobias Waldekranz 68d8c19b53 confd: dagger: Fix archive naming
One `.tar.gz` extension ought to be enough for everyone.
2024-12-17 16:51:37 +01:00
Ahmed Karic dc2ced8e09 test/docker: Add scapy for verifying MAC multicast
'msend' only supports IP multicast
2024-12-16 16:31:40 +01:00
Mattias WalströmandGitHub 02a8c3d78d Merge pull request #871 from kernelkit/move-operational-from-confd
Move operational data about software state from confd => yanger
2024-12-16 08:36:07 +01:00
Mattias Walström a4ef38fbee test: upgrade: Add some debug print to see whats happen over time 2024-12-13 20:32:07 +01:00
Mattias Walström 5608e9457d Move operational data about software state from confd => yanger
Statd is now responsible for operational, move last big part
(infix-system-software) to yanger.
2024-12-13 20:32:07 +01:00
Tobias WaldekranzandGitHub 34f0c5a462 Merge pull request #870 from kernelkit/confd-ifaces-split
confd: Split up ietf-interfaces.c
2024-12-13 13:08:38 +01:00
Tobias Waldekranz 5675f89d37 confd: Split up ietf-interfaces.c
Fact: ietf-interface.c has become too unwieldy.

Therefore, split it, roughly based on the YANG structure, into
multiple files.

There is much more to do here, like cleaning up the naming (which is
all over the place), moving more system commands into dagger, etc. But
I wanted to keep this change to a strict code reshuffle.
2024-12-13 10:32:03 +01:00
Joachim WibergandGitHub 6d6f4e6dd9 Merge pull request #868 from kernelkit/remove-duplicates 2024-12-12 14:58:39 +01:00
Mattias Walström f06a42987a srx: helpers: Remove duplicate functions that has been moved to libite
Instead use the libite functions.
2024-12-12 09:11:54 +01:00
Mattias WalströmandGitHub 76ab0fe07a Merge pull request #866 from kernelkit/update-rousette
Add upstream patches for rousette
2024-12-11 13:29:56 +01:00
Mattias Walström 734958b89d test: restconf: Remove extra / when delete xpath 2024-12-11 12:23:02 +01:00
Mattias Walström 397568f1c8 infamy: restconf: Do not percent encode ':' 2024-12-11 10:13:52 +01:00
Mattias Walström a2c3919c0f test: restconf: Remove extra / when getting datastore 2024-12-11 10:13:52 +01:00
Mattias Walström e08576b008 RESTCONF: Update rousette to upstream
This fix #781
2024-12-11 10:13:50 +01:00
Joachim WibergandGitHub 83238aad7e Merge pull request #864 from kernelkit/iproute2-6.12
Bump iproute2 to 6.12
2024-12-10 15:15:21 +01:00
Tobias Waldekranz 1863297b5a package/iproute2: Remove patches for outdated versions 2024-12-10 14:33:23 +01:00
Tobias Waldekranz 9cd9440515 buildroot: Bump to latest 2024.02.x-kkit for iproute2 6.12.0 2024-12-10 14:19:52 +01:00
Tobias WaldekranzandGitHub ec64c1585c Merge pull request #862 from kernelkit/dagger-mem-usage
Dagger memory usage
2024-12-10 10:42:54 +01:00
Tobias Waldekranz 429c4f1573 confd: dagger: Always increment generation number
Previously, the generation number was only increased for successful
evolutions. This led to a confusing state in /run/net where multiple
<N>-ABANDONED-<date> directories could exist, with the same value of
N.

Move to a scheme where the generation increments every time we evolve,
even if the evolution fails. If multiple consecutive evolutions fail,
we can now unabiguously determine the order in which they were
executed.
2024-12-10 09:46:20 +01:00
Tobias Waldekranz 28ae8fca42 confd: dagger: Get rid of some code duplication 2024-12-09 13:35:24 +01:00
Tobias Waldekranz c076f0a770 confd: dagger: Reduce memory usage
When reconfiguring the system many times (seen during regression
testing), the RAM usage of keeping all generations around starts to
add up.

A tmpfs file, no matter how small, will always consume at least one
full page (4k). So one generation of tiny setup scripts and log files
can end up locking a 1 MB (!) of memory.

Therefore: Once we're done with a generation, archive it in a
compressed tarball, which typically fits inside a single 4k
page. Limit the total number of archives to 10. This should give full
visibility into the history of a system in all normal situations,
while still allowing hammering systems with reconfig cycles in testing
scenarios.
2024-12-09 13:35:17 +01:00
Tobias WaldekranzandGitHub 219c61081d Merge pull request #860 from kernelkit/linux-6.12.3
linux: Upgrade to 6.12.3
2024-12-06 09:06:57 +01:00
Tobias Waldekranz ad32129a13 linux: Upgrade to 6.12.3 2024-12-06 08:22:10 +01:00
Mattias WalströmandGitHub 1db039d6b4 Merge pull request #846 from kernelkit/fix-upgrade-test
Update upgrade test
2024-12-06 00:30:22 +01:00
Mattias Walström f023304823 Update upgrade test to not mess up boot order
Works on both virtual and physical target
2024-12-05 21:24:52 +01:00
Mattias Walström 85603eb53d Refactor file_server to run in a netns 2024-12-05 21:24:52 +01:00
Tobias WaldekranzandGitHub 1f231c2b2a Merge pull request #854 from kernelkit/pr-build-version
.github: Set usable version strings on PR builds
2024-12-05 14:54:18 +01:00
Tobias Waldekranz 967388395f test: netns: Avoid infinite hangs on exceptions in .call()s
If the callable threw an exception, then the process running inside
the netns would exit before sending back a value on the tx pipe, which
meant that `rx.recv()` would hang in the original process.

Make sure that we catch any exceptions, and send that instead of the
result over the pipe in those scenarios. Then in the original process,
re-raise the exception.
2024-12-05 13:10:42 +01:00
Tobias Waldekranz 94cffd2c48 doc: Mention kernel 6.12 update in the ChangeLog 2024-12-05 13:10:42 +01:00
Tobias Waldekranz 89c5b67a13 .github: Set more informative build id on PR builds 2024-12-05 13:10:42 +01:00
Tobias Waldekranz 3436cd68ac doc: branding: Update documentation around version variables 2024-12-05 11:02:47 +01:00
Tobias Waldekranz d16ad7eedc build: Define build id and version in one place
Before this change, setting `GIT_VERSION` in `make`'s environment was
intended to allow the user to specify a custom build id.  As it turns
out, `test/test.mk` had duplicated the logic from
`board/common/post-build.sh` to unconditionally override any value set
in it.  Because of the way `make` handles variables, where assignments
to variables inherited from the environment are exported back to
it[^1], this would mean that `test.mk` would always clobber any value
set by the user.  Furthermore, there is also this file called
`buildroot/package/git/git.mk`, which also (reasonably) has opinions
about what the proper value of `GIT_VERSION` should be.  In summary,
this was a bit of a mess.

Therefore: Make sure that there is one single place where we determine
the build id and version, and make sure that those variables are
scoped under the `INFIX_` prefix to avoid clashing with any other
component.

[^1]: https://www.gnu.org/software/make/manual/html_node/Environment.html
2024-12-05 10:29:21 +01:00
Tobias Waldekranz e635e3e720 test: Remove dead code 2024-12-04 23:00:19 +01:00
Tobias WaldekranzandGitHub 42b7cf9f94 Merge pull request #833 from kernelkit/mdns-settings
Expand mDNS settings
2024-12-04 15:01:47 +01:00
Tobias WaldekranzandGitHub 7d9211a3ba Merge pull request #848 from kernelkit/linux-6.12
Linux 6.12
2024-12-04 14:37:39 +01:00
Joachim Wiberg 1895e161d2 doc: update ChangeLog with mDNS and sysctl changes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-12-04 14:25:43 +01:00
Joachim Wiberg 7804787201 doc: update discovery document
Overhaul text and grammar.  Simplify, correct, and add information about
the new mDNS settings.  Replace 'unit' with 'device', which is the more
common term for hardware.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-12-04 14:25:04 +01:00
Joachim Wiberg 3576450982 test: verify mDNS allow/deny interfaces
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-12-04 12:57:04 +01:00
Joachim Wiberg bb987cfe9e test: minor, spelling
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-12-04 12:57:04 +01:00
Joachim Wiberg 997310f9a2 test: fix xpath_delete() over NETCONF
Fixes the following issue when deleting /infix-services:mdns/interfaces,
which works fine over RESTCONF:

Traceback (most recent call last):
  File "/home/jocke/src/infix/test/./case/infix_services/mdns_allow_deny/test.py", line 142, in <module>
    dut.delete_xpath("/infix-services:mdns/interfaces")
  File "/home/jocke/src/infix/test/infamy/netconf.py", line 418, in delete_xpath
    oldd = mod.parse_data_dict(old, no_state=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/schema.py", line 215, in parse_data_dict
    return dict_to_dnode(
           ^^^^^^^^^^^^^^
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/data.py", line 1277, in dict_to_dnode
    result.root().validate(
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/data.py", line 430, in validate
    self.validate_all(no_state, validate_present)
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/data.py", line 449, in validate_all
    raise self.context.error("validation failed")
libyang.util.LibyangError: validation failed:
    Invalid leafref value "e3" - no target instance "/if:interfaces/if:interface/if:name" with the same value.

The patch skips validation of the diff in favor of checking the result
of libyang.xpath_del().

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-12-04 12:57:04 +01:00
Joachim Wiberg bf23f53770 test: minor, pep8 fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-12-04 12:57:04 +01:00
Joachim Wiberg e8f9032339 package/skeleton-init-finit: avahi needs to be restarted
The Avahi daemon needs to be restarted when changing its configuration
file in /etc/avahi/avahi-daemon.conf, not sufficient to SIGHUP.

Also, minor reformatting for new style.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-12-04 12:57:04 +01:00
Joachim Wiberg 80e4018b20 confd: expose more avahi-daemon settings in mdns service context
Use container for interface allow/deny and for reflector settings.
Hopefully there will be more settings in the future, e.g., control
reflector interfaces independently.

Fix #678

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-12-04 12:57:04 +01:00
Tobias Waldekranz 27b7d831d0 styx-dcp-sc-28p: Move board specific overlay files to package
This way, we only install these files if the board is enabled.
2024-12-04 11:27:03 +01:00
Tobias Waldekranz f0ae1aa835 package/board: Rsync overlay directory, if available 2024-12-04 11:27:03 +01:00
Tobias Waldekranz 88f7c6070a package/board: Let the user select the set of boards to support
Introduce a new approach to dtb-building:

Old way: `rsync` an overlay containing our dt source to the kernel,
and then build via buildroot's `_INTREE_DTS_NAME`. This does not work
in recent kernels (at least since 6.12), which requires all dtb's to
be explicitly listed in a `Makefile`.

New way: Create a separate package for every board, and build the
device trees via the kernel's standard interface for building external
modules. This has two main advantages:

1. We can easily interpose a patched version of an upstream device
   tree. E.g., we can easily set the factory password.

2. It is much easier to get an overview of which boards are enabled,
   rather than scrolling back and forth in the `_INTREE_DTS_NAME` list.

Enable all fully supported boards in the defconfigs.
2024-12-04 11:27:03 +01:00
Tobias Waldekranz a3f85a3872 linux: Upgrade to 6.12.1
Exploratory change to smoke out any regressions that this might
introduce.
2024-12-04 11:27:03 +01:00
Joachim Wiberg 7467b2fcf4 board/common: review sysctl defaults
These changes are based on the sysctl recommendations by Frr [1].

Not all recommendations have been incorporated, e.g., ip forwarding is
not enabled per interface, because in Infix this is an opt-in feature.

A readme.txt has been added, documenting the various settings.

New for IPv4:
 - Adjust IGMP max memberships: 20 -> 1000
 - Use neighbor information on nexthop selection
 - Use inbound interface address on ICMP errors
 - Ignore routes with link down
 - Disable rp_filter

ARP settings have been changed to better fit routers, i.e., systems
with multiple interfaces:

 - Always use best local address when sending ARP
 - Only reply to ARP if target IP is on the inbound interface
 - Generate ARP requests when device is brought up or HW address changes

New for IPv6:
 - Keep static global addresses on link down
 - Ignore routes with link down

Fixes #829

[1]: https://github.com/FRRouting/frr/blob/master/doc/user/Useful_Sysctl_Settings.md

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-12-04 11:26:42 +01:00
Joachim Wiberg 3e387d74c2 doc: minor grammar and clarification
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-12-04 11:26:42 +01:00
Tobias WaldekranzandGitHub f961bcfe86 Merge pull request #840 from kernelkit/ntp-status
Ntp status
2024-12-04 10:38:32 +01:00
Mattias Walström ce05139452 Document NTP client status 2024-12-03 22:45:18 +01:00
Mattias Walström a74eb58000 test: Add unit test for 'show cli' 2024-12-03 16:29:28 +01:00
Mattias Walström 5cafd18b79 CLI: Add as 'show ntp' that normal persons understand 2024-12-03 16:29:28 +01:00
Mattias Walström 7334d0e54b test: add test for ntp client 2024-12-03 16:29:28 +01:00
Mattias Walström fffe427497 Implement NTP client status 2024-12-03 16:29:28 +01:00
Ahmed KaricandGitHub 168647ace9 Merge pull request #849 from kernelkit/deviate-address-family-ospf
Deviate address-family in OSPF
2024-12-03 13:03:50 +01:00
Tobias WaldekranzandGitHub 0e14e05ae5 Merge pull request #847 from kernelkit/test-log-sw
test: reproducible: Log software versions
2024-12-03 12:51:19 +01:00
Ahmed Karic 3ab7a7d531 confd: Deviate address-family in OSPF
In the OSPF(v2) context, there is an "address-family" setting available.
However, since only IPv4 routes are supported in OSPF, currently
this setting is not relevant.

Fixes #813
2024-12-02 21:40:51 +01:00
Tobias Waldekranz fcef1ead3a utils: kernel-refresh.sh: Only remove old patches if they exist
E.g., when upgrading to a new version, there are no previous patches
to remove.
2024-12-02 16:52:35 +01:00
Tobias Waldekranz 784b391467 test: reproducible: Log software versions
Make sure that we keep a record of the versions and boot source used
by all devices under test when running the full suite - in case we
ever suspect that there is a mismatch between the intended test image
and the actual one.

Since this test now needs to communicate with the devices, make sure
that we run the wait test first.
2024-12-02 12:42:28 +01:00
Tobias Waldekranz 6d18ba4c39 test: infamy: Unify {NET,REST}CONF operational data formatting
Replace the existing remove-module-names-pass in the RESTCONF
transport -- which only worked for top-level containers -- with
libyang's standard `.print_dict()` used by the NETCONF transport
implementation.

As a bouns, the implementation of `.get_iface()` is now transport
agnostic.
2024-12-02 12:42:28 +01:00
Tobias WaldekranzandGitHub fbe18a4ae0 Merge pull request #844 from kernelkit/releng
Final ChangeLog updates for v24.11.1
2024-11-29 08:05:29 +01:00
Joachim Wiberg 020f0d0980 doc: final ChangeLog updates for v24.11.1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-28 20:56:05 +01:00
Joachim WibergandGitHub 3fd4f2c72f Merge pull request #843 from kernelkit/drop-execd
Redesign and simplify container creation/removal
2024-11-28 17:48:00 +01:00
Joachim Wiberg fbabf0e857 doc: update ChangeLog for v24.11.1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-28 16:36:56 +01:00
Joachim Wiberg a23dc89592 confd: disabling a container should not delete volumes
When disabling a container in the configuration we should not remove it,
because then any volumes used by it may be lost.  Instead, we now simply
disable the service to prevent it from starting, or stopping it, if it
was running.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-28 16:36:56 +01:00
Tobias WaldekranzandJoachim Wiberg 36d9056e8f board/common: Use finit's log: to capture output from containers
Since `conmon` only logs the output from the monitored container's
`stdout`/`stderr`, we might as well get rid of `k8s-logger`, and let
the output pass through to finit, which will then pipe the messages to
syslog.

Fix #836
2024-11-28 16:36:56 +01:00
Joachim Wiberg ca0e54b50b configs: drop execd from defconfigs, not needed anymore
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-28 16:36:56 +01:00
Joachim Wiberg bb1a656a05 confd: drop fragile asynchronous container create/delete using execd
This is a complete redesign of how the system creates/deletes containers
from the running-config.  Containers are now removed synchronously from
confd before any interfaces they may be using are removed, and created
in parallel, using a Finit task, well after confd has finished setting
up interfaces.

The logic previously provided by execd to retry container create on any
route/address changes, or periodically every 60 seconds, is now handled
by a new 'setup' command in the container wrapper script.

Additionally, container create is now split in wget/curl/podman pull of
the image and 'podman create'.  This to both consolidate image fetching
and improve user feedback since most of the retry logic (above) revolves
around the image download.

Fixes #835

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-28 16:36:56 +01:00
Joachim Wiberg 7483a6f454 confd: make sure to stop zeroconf agent on interface removal
When deleting interfaces we skip a lot of steps in netdag_gen_iface(),
this patch ensures we at least call netdag_gen_ipv4_autoconf() to drop
any running zeroconf agent in the same generation.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-28 15:11:26 +01:00
Joachim Wiberg 6072ec45b3 patches: add support for adjusting avahi-daemon log level
The mDNS daemon, Avahi, is very verbose in its syslog output.  So much
that it often overshadows other subsystems, and on switches and routers
with more than the "normal" amount of ports and interfaces, it quickly
becomes unbearable.

The patches consist of:

 - Add -l LEVEL support to avahi-daemon
 - Add missing casll to setlogmask() in libdaemon:daemon_set_verbosity()

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-28 15:11:26 +01:00
Joachim Wiberg 1ac07b5a7b board/common: drop less -S from pager
The -S switch to less seemed at the time a good idea -- chop off too
long lines and allow horizontal scrolling -- however, the -F option, to
skip pager for content that fit the first screen is overridden by the -S
switch.  This makes commands like "show containers", and similar that
normally have waaaaay too few lines for a pager to always page.

So let's drop -S to regain the original behavior.  This will cause lines
to be wrapped, but with the new raw mode in the CLI this seems to work
without any weird screen artifacts.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-28 15:11:21 +01:00
Joachim Wiberg ad9c432ff9 cli: jump to end of 'show log' commands automatically
Instead of having to scroll to the end (Shift G, or page down til end),
let's instead start at the end now that we have control over paging in
the CLI ourselves.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-28 15:10:48 +01:00
Joachim Wiberg af0e24adf8 package/finit: backport fix to prevent restaring template siblings
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-28 15:10:48 +01:00
Tobias WaldekranzandGitHub e39ef89150 Merge pull request #832 from kernelkit/rocker
Initial support for Qemu Rocker switch
2024-11-28 15:07:44 +01:00
Tobias WaldekranzandGitHub 877e3f3d81 Merge pull request #837 from kernelkit/vlan-iface-termination
Prevent traffic assigned to locally terminated VLANs from being forwarded
2024-11-28 15:07:22 +01:00
Tobias Waldekranz ddfdcb40bb test: vlan_iface_termination: Fix test spec issues
- Use standard topology
- Include test case specification in parent README
2024-11-28 14:23:53 +01:00
Tobias Waldekranz f4557ff8ab doc: update ChangeLog
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
2024-11-28 12:53:19 +01:00
Joachim WibergandTobias Waldekranz b6f9b6d967 test: safe setup of Infamy swN bridges
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-28 12:53:19 +01:00
Tobias Waldekranz 6c2ab33028 test: ospf_container: Enable VLAN filtering on br0
As it turns out, the setup with a 802.1D bridge in combination with
VLAN uppers stacked on the bridge ports is not possible to support
on mv88e6xxx ports.

Enable VLAN filtering to ensure proper isolation of the locally
terminated VLANs.
2024-11-28 12:52:09 +01:00
Tobias Waldekranz 63e1ff1fe9 test: vlan_iface_termination: Add test
This will fail on a system running a vanilla kernel, where the dut's
ports are backed by mv88e6xxx, because:

1. The ports are attached to the same bridge, and are thus in the same
   PVT group.

2. Creation of the VLAN uppers causes the DSA layer to add both ports
   to the same VTU entry.

As a result, hardware behaves as if both ports had been configured as
tagged members of VLAN 10, instead of just terminating incoming
traffic locally.

Add this test to catch hardware which behaves in this way.
2024-11-28 12:52:09 +01:00
Tobias Waldekranz 0c88c464f1 statd: Support reporting PVID on bridges
Now that PVID can be configured on bridges, make sure that we reflect
that in the operational database.
2024-11-28 12:52:09 +01:00
Tobias Waldekranz 70e8895478 confd: Support PVID configuration on bridges 2024-11-28 12:52:09 +01:00
Mattias WalströmandGitHub 371db579ea Merge pull request #839 from kernelkit/ospf-tests
Add a new test for default-route-advertise
2024-11-28 12:20:00 +01:00
Mattias Walström 591397d3c7 test: ospf: add new test for testing 'default-route-advertise' 2024-11-28 11:13:56 +01:00
Mattias Walström 88ab2a6f43 test: ospf-basic: Test redistribute static as well 2024-11-28 11:13:56 +01:00
Mattias WalströmandGitHub f6bd2094f0 Merge pull request #842 from kernelkit/update-vlan-separation-test
test: bridge_vlan_separation: Make test more robust
2024-11-28 11:13:03 +01:00
Mattias Walström b36e55e642 test: bridge_vlan_separation: Make test more robust
Only check for the broadcast sent.

And add more test specification steps
2024-11-28 10:31:54 +01:00
Ahmed KaricandGitHub eabf79c7c4 Merge pull request #824 from kernelkit/add-routing-pref-tests
Add Routing Preference Tests
2024-11-27 14:42:23 +01:00
Joachim Wiberg 963364d4e9 confd: allow setting IP address directly on dot1Q bridges
This patch drops a needless restriction of IP addresses on VLAN filtering
bridges from 2024-03-06.  The obvious use-case is when the bridge is an
untagged member of a VLAN and only ony management VLAN is required.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-27 11:25:21 +01:00
Tobias Waldekranz bc9c6a4871 patches/linux: net: dsa: mv88e6xxx: Trap locally terminated VLANs 2024-11-26 22:14:16 +01:00
Ahmed Karic d9eae887a0 test: Verify routing preference 255 is inactive
Fixes #784
2024-11-26 15:29:32 +01:00
Ahmed Karic e9efd224f7 test: Verify route preference (OSPF vs Static) 2024-11-25 18:05:51 +01:00
Ahmed Karic e9fc62b365 test: Verify route preference (DHCP vs Static) 2024-11-25 18:05:51 +01:00
Ahmed Karic 03a2cf7b3b test/infamy: Initialize DHCP server interface parameter 2024-11-25 18:05:51 +01:00
Ahmed Karic 289534e0d5 test/infamy: Fix adding ip address inside IsolatedMacVlans 2024-11-25 18:05:51 +01:00
Ahmed Karic d81b20ca0b test/infamy: Enhance route verification
- Ensure _exist_route function performs complete checks without early
    returns.
  - Add support for verifying 'active' state in route checks.
2024-11-25 18:05:51 +01:00
Mattias WalströmandGitHub 68c86c8a89 Merge pull request #820 from kernelkit/ospf-container
Ospf container
2024-11-25 15:08:01 +01:00
Mattias Walström de50179b3b test-spec: Remove autogenerated file
Add it to gitignore to not be added again.
2024-11-25 14:44:32 +01:00
Mattias Walström 66ae02363e infamy: Stability fix for getting OSPF status
Always return {} if fail to get OSPF status, it may not have started
yet.
2024-11-25 14:25:26 +01:00
Joachim WibergandMattias Walström 866b9de779 test: factor out file server from upgrade test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-25 14:25:26 +01:00
Joachim WibergandMattias Walström 77df9a327d test: add drawio original and update images in use-case test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-25 14:25:26 +01:00
Mattias Walström 1cfbf9bc11 test: case: ospf_container: Update test
Add "VLAN switches" between each Router, to only pass the tagged traffic
between the routers.

Add test specification and add to test suite
2024-11-25 14:25:26 +01:00
Mattias Walström 81f80bd307 ospf_containers: Convert to use put_config_dicts 2024-11-25 14:04:07 +01:00
Joachim WibergandMattias Walström f381977e7b test/case: minor, grammar and formatting
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-25 14:04:07 +01:00
Joachim WibergandMattias Walström 6d6a788749 test/case: update use-case internal network description
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-25 14:04:07 +01:00
Mattias Walström 7a642f9f8c test: use_case: Update test with HTTP container and ABR
Add ABR configuration and a HTTP Container
2024-11-25 14:04:07 +01:00
Joachim WibergandMattias Walström c0ee09047b test/case: add description for ospf container use-case
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-25 14:04:07 +01:00
Joachim WibergandMattias Walström 14dea0ca97 README: minor, grammar.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-25 14:04:07 +01:00
Mattias Walström bbc9a55c1e Add new test: ospf_container
Aims to test a complex setup with multiple containers, OSPF and NAT
2024-11-25 14:04:07 +01:00
Mattias Walström 82fd4bdb68 infamy: Expose the new IsolatedMacVlans for tests 2024-11-25 14:03:03 +01:00
Mattias Walström c7db71d095 test-spec: Add support for images in description 2024-11-25 14:03:03 +01:00
Mattias Walström 5264a1c32b infamy: Update template topologies to use the correct font 2024-11-25 14:03:03 +01:00
Tobias WaldekranzandMattias Walström fabb28b5df yanger: Tolerate missing DR/BDR IDs in OSPF neighbor info
With the FRR upgrade to 9.1.2, OSPF sometimes reports neighbors
without reporting the routerDesignatedId and routerDesignatedBackupId
attributes. Ensure that these attributes are available before trying
to copy them to the output.
2024-11-25 14:03:03 +01:00
Tobias WaldekranzandMattias Walström de47caec38 buildroot: Bump to latest 2024.02.x-kkit for FRR 9.1.2
During development of the upcoming ospf_container test, an issue was
discovered where zebra's view of the system drifted from the kernel's
ditto. Specifically: when transitioning from test-config to one with
many virtual interfaces (VLANs VETH pairs etc.), zebra would not
process events for all interfaces, which meant OSPF would not pick
them up.

Our experience matches very well with a bug reported upstream in:

https://github.com/FRRouting/frr/issues/13630

> If we delete kernel interface and create it and set its ip in a
> short time, in rare cases, interface ip will be lost in zebra which
> can be confirmed by vtysh show interface brirf command. This will
> lead to abnormal behavior of other protocol daemons, for example,
> bgpd does not announce the route corresponding to interface ip even
> it was specified by network command.

The issue was marked as fixed by PR 13396, which was merged in the 9.0
cycle:

https://github.com/FRRouting/frr/pull/13396

Therefore, upgrade FRR to the latest patch release from that major.
2024-11-25 14:03:03 +01:00
Tobias WaldekranzandMattias Walström d99b6fd557 confd: Abort if callback tracking ever fails
During debugging of a reconfiguration issue, one hypothesis was that
the tracking of callbacks used to determine when a transaction has
completed (as sysrepo has no hooks for this) was out of sync, causing
us to call `initctl reload` prematurely. This was not the case, but if
it ever occurs in the future, make sure that it is a fatal error that
won't go unnoticed.
2024-11-25 14:03:03 +01:00
Tobias WaldekranzandMattias Walström a3af3f9be4 x86_64: Enable kprobes and ftrace in kernel
This avoids full recompiles every time we want to use things like ply.
2024-11-25 14:03:03 +01:00
Ahmed KaricandGitHub 260d9615ec Merge pull request #828 from kernelkit/update-br-vlan-sep
Verify that bridge vlan separation works properly for broadcast packets
2024-11-25 09:35:40 +01:00
Ahmed Karic 798194b64a test: update bridge vlan separation test
- Verify that broadcast packets are also properly moved accross the
  bridge, i.e. the broadcast packets sent from vlan interface VLAN10
  do not reach VLAN20

Fixes #773
2024-11-25 08:46:20 +01:00
Joachim Wiberg 0160fd539e package/skeleton-init-finit: ensure zebra+ospfd log to syslog
Fix lack of syslog messages from Zebra and add support to easily enable
debug logs for common Zebra subsystems.

Same change made to ospfd for symmetry.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-24 20:50:12 +01:00
Joachim Wiberg df2689ca34 board/common: minor fixes to udhcpc.script
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-24 20:50:12 +01:00
Joachim Wiberg f9d21e5839 board/common: trick pager into using line drawing charachters
This fixes a regression in v24.11.0, introduced in 46dd0c7, where line
drawing characters are not properly displayed in the CLI anymore.

admin@infix:/> show interfaces
INTERFACE       PROTOCOL   STATE       DATA
lo              ethernet   UP          00:00:00:00:00:00
                ipv4                   127.0.0.1/8 (static)
                ipv6                   ::1/128 (static)
br0             bridge
<E2><94><82>               ethernet   UP          02:00:00:00:00:00
<E2><94><82>               ipv4                   169.254.1.3/16 (random)
<E2><94><82>               ipv6                   fe80::ff:fe00:0/64 (link-layer)
<E2><94><9C> swp1          bridge     FORWARDING
<E2><94><9C> swp2          bridge     FORWARDING
<E2><94><9C> swp3          bridge     FORWARDING
<E2><94><9C> swp4          bridge     FORWARDING
<E2><94><9C> swp5          bridge     FORWARDING
<E2><94><9C> swp6          bridge     FORWARDING
<E2><94><9C> swp7          bridge     FORWARDING
<E2><94><9C> swp8          bridge     FORWARDING
<E2><94><9C> swp9          bridge     FORWARDING
<E2><94><94> swp10         bridge     FORWARDING

This is because the raw tty from klish disables IUTF8 and the fact that
it does not source any environment, e.g., /etc/profile.  (We do not have
any locale settings in the enviornment either, but that's a discussion
for another day.)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-24 20:50:12 +01:00
Joachim Wiberg c8046bfbda board/common: add '-k' to keep new qemu.run script after session
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-24 20:50:12 +01:00
Joachim Wiberg 74a12b3e31 board/common: initial rocker switch support
Fix #540

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-24 20:49:34 +01:00
Joachim Wiberg efaad3c5b8 board/common: misc shellcheck fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-23 20:52:36 +01:00
Tobias WaldekranzandGitHub 3d189d8ec6 Merge pull request #831 from kernelkit/boot-wait-slow-devs
Wait for slow devices before continuing boot
2024-11-22 15:36:41 +01:00
Tobias Waldekranz 06721a17b3 board/common: Address review feedback on hw-wait
- Fix various shellcheck warnings
- Use idiomatic formatting of multiline finit stanzas
2024-11-22 15:00:40 +01:00
Tobias Waldekranz d7c7c33e72 doc: Document #685 fix in ChangeLog
[skip ci]
2024-11-22 14:19:04 +01:00
Tobias Waldekranz 47bb54254c Revert "Make detection of DSA interface more robust"
This reverts commit 0ee973b2b2.

Turns out that this workaround simply reduced the size of the window
where this issue can occur.

The previous change now ensures that the DSA tree is always fully
setup by the time nameif runs.
2024-11-22 11:10:02 +01:00
Tobias Waldekranz 30028f36a9 board/common: Wait for slow devices before continuing boot
Before this change, we relied on `udevadm settle` to act as a barrier
which we could only cross after all devices had been probed. As it
turns out, when drivers defer probing due to missing dependencies,
`udevadm settle` may exit (as no events are generated for a period of
time) before all devices are set up. This was the root cause behind
issue #685, for which #752 was the initial attempt at a fix.

As we know that systems using mv88e6xxx will always have a device link
referencing the conduit interface, add a script to finit's system
runparts directory, which will block while any device link consumers
are still probing.

As a consequence of this, we can no longer rely on the sysklogd.conf
shipped with finit. Therefore, install an Infix specific one, which
will make sure that the aforementioned script has run before launching
the syslog daemon, which most other things depend on.

Fixes #685
2024-11-22 11:08:20 +01:00
Tobias WaldekranzandGitHub 131d9e99b3 Merge pull request #826 from kernelkit/container-fixes
Container fixes
2024-11-20 11:36:13 +01:00
Joachim Wiberg 1ed8ad1233 doc: update ChangeLog for v24.11
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 09:19:53 +01:00
Joachim Wiberg 8d32a525f3 doc: add ghfm note highlights
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 09:19:53 +01:00
Joachim Wiberg 3bbe9a9a9d doc: update container doucmentation
- No more default writable layer
 - Don't mention read-only (deprecated, and always on now)
 - Use ghfm note highlights

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 09:19:53 +01:00
Joachim Wiberg ee0adce2a3 package/curios-nftables: bump to v24.11.0
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:54:11 +01:00
Joachim Wiberg 09077c6122 package/curios-httpd: bump to v24.11.0
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:54:11 +01:00
Joachim Wiberg 4c78613c4c package/curios-*: add latest symlinks for easy upgrades
This patch adds latest symlinks to the curiOS containers to make system
upgrades easier.  I.e., a user can now reference the bundled image with:

    set image oci-archive:/lib/oci/curios-httpd-latest.tar.gz

So that when they upgrade to the latest Infix, which might include an
update of curiOS httpd, they will get a seamless upgrade also of the
container(s) running.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:54:11 +01:00
Joachim Wiberg 7ec37a7efb board/common: new shell tool 'cfg [edit] arg', replaces alias
This commit replaces the 'cfg' alias for 'sysrepocfg -f json' with a
small shell script.  Currently only an 'edit' command, similar to the
CLI 'text-editor' command for modifying base64 encoded YANG nodes.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:51:09 +01:00
Joachim Wiberg 904040098a board/common: refactor error logging and clean up on error
- Refactor logging to simplify code and get proper log level
 - Clean up lingering directories from any extracted tarball on error

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:50:45 +01:00
Joachim Wiberg 8838efaf9d board/common: enable/disable Finit service for container
This patch allows running the configure script manually to create and
delete containers.  The normal flow via confd has additional handling
to ensure containers are started/stopped on inictl reload.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:50:29 +01:00
Joachim Wiberg 2d37e4be2c board/common: extract OCI archives in /var/tmp
Instead of using $HOME, which may be a ramdisk, use /var/tmp which
podman also uses by default.  Also, make sure to clean up after
ourselves.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:50:26 +01:00
Joachim Wiberg e480e26065 board/common: workaround missing --retry=NUM flag to podman
Disable the default "podman pull" retry value.  We use execd to retry
"podman create" on failure.  Wihtout this change, a single container
can block start of other containers by 3 * 20 seconds.  Now we only
block max 20 seconds before we try starting the next container.

Modern versions of podman (>= 5.0) have this --retry option, but it
does not have CNI, so this is a temporary workaround.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:50:03 +01:00
Joachim Wiberg 2aea461e7e execd: add retry timer for pending jobs
When an Infix device is connected to a LAN where the gateway has yet to
connect to the Internet, the container script will fail pulling images
from any remote server.

    Nov 16 12:48:13 infix container[3490]: Error: initializing source docker://ghcr.io/kernelkit/curios:edge: pinging container registry ghcr.io: Get "https://ghcr.io/v2/": dial tcp: lookup ghcr.io on 127.0.0.1:53: read udp 127.0.0.1:55422->127.0.0.1:53: i/o timeout
    Nov 16 12:48:13 infix container[3641]: Error: failed creating container fw, please check the configuration.
    Nov 16 12:48:13 infix execd[3490]: /run/containers/queue/S01-fw.sh failed, exit code: 1

Since execd until now only retries on netlink/inotify events, or manual
SIGUSR1, jobs would get stuck even though Internet connectivity had been
established.  This patch fixes that with the addition of a retry timer
which runs while there are pending jobs in the queue.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:50:03 +01:00
Joachim Wiberg 7b389f6d0a confd: quiet container script log messages
Should be inverted to a --verbose or --debug flag instead.  After this
change we still see the full 'podman create ...' command, with all the
optionas and arguments.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:50:03 +01:00
Joachim Wiberg 43635c2727 confd: fix pyang linter errors
Issue #815 detail issues found running the Clixon Controllar and
Cisco Yangsuite.  The errors and warnings listed are very similar
to pyang, which the undersigned has, the following changes fixes
the pyang errors:

 - relocate 'feature containers' to submodule
 - drop already deviated ospf:database deviations
 - drop unused imports

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:49:56 +01:00
Joachim Wiberg c79e198615 confd: add support for fetching container images over ftp/http/https
- Anonymous FTP, or URL encoded ftp://user:hostname@addr/oci.tar.gz
 - HTTP/HTTPS fetched with curl, optional credentials support
 - Verify download against an optional sha256 checksum

Ensure the unpacked directory name does not contain a ':', it is a
restricted character and cannot be part of the file name.  If this
syntax is used we retain it as the name and retag it after load.

Fix #801

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:49:27 +01:00
Joachim Wiberg 021767c903 confd: refactor and refine container creation
- Reduce the amount of queues: 3 -> 1
 - Simplify post hook
 - Refine execd

The resulting simplification of infix_containers_post_hook(), and
touching execd, also ensure container environment variable changes
are propagated.

Fixes #822

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:48:27 +01:00
Joachim Wiberg 449fd46ea7 package/execd: clean up any lingering containers at boot
To be able to handle container restarts, incl. restart policy, at
runtime, most of the container data lives in /var/lib/containers,
which on most systems is backed by a persistent store.

As of issue #823 we no longer keep a writable layer for containers,
nor should we cache container state across reboots, all containers
are recreated at boot.  This task cleans up any lingering state.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:48:27 +01:00
Joachim Wiberg 4a9d977682 board/common: revert parts of 8353963
Running 'shred' on files stored on eMMC is pointless since the writes
are spread out over other sectors rather than overwriting the content
of the files as it was supposed to on old rotating media.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:48:27 +01:00
Joachim Wiberg 5ace3afa5f board/common: clean up stale files in /var/tmp/frr on boot
On unclean shutdowns Frr leaves a lot of per-thread message buffers in
/var/tmp/frr/<daemon>[-<instance>].<pid>/*

See https://docs.frrouting.org/en/latest/setup.html

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:48:27 +01:00
Joachim Wiberg 1347080b4a confd: major behavior change, run container --read-only always
Container support in Infix was released with v24.02, so this change may
unfortunately break a few use-cases out there.  Regrettable as this is,
the default behavior, including how containers are started after boot,
break other use-cases that were considered more important.

As of this commit:

 - all containers in Infix run in read-only mode, use volumes and
   mounts for persistence across reboot/stop/start/upgrade
 - all containers are now "recreated" at boot or related config changes,
   this ensures an OCI image embedded in the Infix image, /lib/oci/, is
   always used as the base for a running container

Fixes #823

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:48:27 +01:00
Joachim Wiberg db447712f7 board/common: ensure containers are handled as sysv scripts
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:48:27 +01:00
Joachim Wiberg 2922b909af confd: add validation of min/max interface name length
A sane interface name is at least two characters long, and in Linux the
interface name (using ip link) is at most 15 characthers long.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-20 08:48:20 +01:00
Joachim WibergandGitHub 28c5f5e56f Merge pull request #827 from kernelkit/cli-fixes
CLI pager fixes
2024-11-18 14:34:10 +01:00
Joachim Wiberg 46dd0c7467 src/klish-plugin-infix: use shell pager instead of klish pager
With interactive mode (out="tty") klish puts the tty in raw mode which
fixes all weird issues reported around paged output in the CLI.

Fixes #659

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-17 16:18:02 +01:00
Joachim Wiberg aa538820de board/common: replace pager symlink with a tiny shell script
These are basically the same flags as was passed to klish, but now we
use -R instead of -r to make sure only ANSI coloŕ escapes can affect
the behavior of less.

This change will make it posslbe to shop off too long lines and scroll
vertically on really long lines instead for them breaking output.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-17 16:15:30 +01:00
Joachim Wiberg 7670f23805 src/klish-plugin-infix: adapt to new klish plugin path
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-17 14:38:36 +01:00
Joachim Wiberg c55b534005 package/klish-plugin-sysrepo: bump for new library and plugin paths
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-17 14:37:47 +01:00
Joachim Wiberg cbcd39cdd6 package/klish: bump for raw mode fixes, alternate quotes, etc.
This update include more backports from Klish 3.1.0, including, but not
limited to:

 - Syslog fixes
 - Return code fixes
 - Changed library and plugin paths (!)
 - TTY raw mode fixes
 - Use raw mode for interactive commands
 - Allow single quotes (') as alternative to regular quotes for commands

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-17 14:31:18 +01:00
Joachim WibergandGitHub 032a51b9fc Merge pull request #821 from rical/rauc-add-install-output
rauc: improve upgrade output
2024-11-12 16:38:21 +01:00
Richard Alpe f4bf72de85 rauc: improve installation output
The first patch 0003.. is sent upstream but not reviewed yet.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-11-12 15:21:27 +01:00
Joachim WibergandGitHub deee48d36a Merge pull request #817 from kernelkit/rel
Minor release engineering fixes
2024-11-08 19:37:58 +01:00
Joachim Wiberg 23e24635fe .github: create new discussion only on GA releases
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 18:51:09 +01:00
Joachim Wiberg eb38d4538f .github: remember to sync tags
The gh repo sync, used by our internal cronjob, does not sync tags, for
details see <https://github.com/cli/cli/issues/5023>.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 18:38:50 +01:00
Joachim WibergandGitHub 2910d8b9bf Merge pull request #811 from kernelkit/bootstrap-refactor
Early bootstrap refactor

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 15:20:39 +01:00
Joachim Wiberg 6bdfdbe164 doc: update ChangeLog for v24.10.2 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg ceb78d66a2 board/common: convert tc error message to useful information
When we opportunistically set up mqprio on all interfaces, we pass over
interfaces without offloading support.  Catch that error message and log
an informational message about which interfaces are skipped.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg 9ac77be9eb confd: fix scary error message on systems without USB ports
Check if the "usb-ports" key exists in /run/system.json before calling jq,
otherise we get the following error message:

Nov  8 05:11:45 ix bootstrap[3349]: jq: error (at <stdin>:0): Cannot iterate over null (null)

Also, minor whitespace cleanup and bashisms fixes.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg d692a3d745 board/common: enable syslog for rauc
In 0f410eb a patch was added to RAUC to allow native logging to syslog,
it was however never enabled.  This patch enables logging to syslog.

Fix #809

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg 597da90b05 board/commoon: use dbus machine-id as /etc/machine-id
Bootstrapping a system with D-Bus using Finit will create the machine-id
file /var/lib/dbus/machine-id, this can be used as the unique machine-id
for services like RAUC, so let's set that as /etc/machine-id to reduce
the log spam we get otherwise:

Nov  7 06:18:08 test-05-25-f8 rauc[5512]: Failed to get machine-id: Failed to open file <E2>M-^@M-^\/etc/machine-id<E2>M-^@M-^]: No such file or directory

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg 5d524006a3 board/aarch64: styx: led setup using a plain script at boot
After the initial probe, set up all port leds:

 - Disable all LEDs
 - Enable netdev trigger for all green LEDs (tp + sfp)
 - Enable link statux and rx/tx activity
 - Skip all aux LEDs

Also in script, a neat little flash function that can be used both for a
production test, to verify all LEDs work, and at runtime to locate the
device in a rack of devicess.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg 4c1de659cb board/aarch64: styx: rename second green led and drop second sfp led
On Rev. B, the second LED on the copper ports is green instead of yellow.
This patch renames them from yellow -> aux => <device>:aux:tp

Also on Rev. B, the second LED for SFP ports do not work at all.  This
patch drops them from the device tree to avoid confusion.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg 3b01f2d806 Revert "board/aarch64: styx: Remove unconnected LED"
This reverts commit 7d1a708274.  Turns out
the second LED is actually connected.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg 4e2458e18a board/common: introduce conditions for bootstrap services
Some services launched at bootstrap must be possible to override per
product.  One such service is iitod, which manages the LEDs in Infix.

This change makes allows a product specific init script to clear the
led condtion, preventing Finit from lauching iitod.  Also, rename the
ixinit-done condition to match the nomenclature used already.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg dc741bb567 board/common: use compatible string to install and run overrides
This patch use the new compatible array in /run/system.json, installing
in order, least to most significant product overrides.

We also introduce a new way to run product specific scripts at init, to
override default behavior in Infix, e.g., LED control.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg d5d487070f board/common: probe: add compatible array to /run/system.json
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg 7052c54165 board/common: probe: minor, pep8 fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 14:30:04 +01:00
Joachim Wiberg e25eb1966e patches/linux: minor fix to 6393X led handling
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 09:13:33 +01:00
Joachim Wiberg fe1c47e107 .github: allow release job to create new discussions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 09:13:33 +01:00
Jon-Olov VatnandGitHub 57b66ec6d3 Merge pull request #810 from kernelkit/doc-ieee-group-forward
Documentation of forwarding IEEE reserved group addresses
2024-11-08 09:04:28 +01:00
Jon-Olov Vatn 9103d31950 Minor formulation change in ieee group forwarding documentation
Fix #788

[skip ci]
2024-11-08 09:03:34 +01:00
Jon-Olov Vatn 32ec9887b9 Adding documentation on forwarding ieee reserved group addresses
Fix #788

[skip ci]
2024-11-08 09:02:49 +01:00
Joachim WibergandGitHub e0458ca079 Merge pull request #814 from kernelkit/doc-ospf-redistribute
Add rudimentary documentation on global OSPF settings

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-08 08:58:24 +01:00
Jon-Olov Vatn e9aefc517f Add rudimentary documenation on global OSPF settings
Fix #812

Doc covering
- redistribute static/connected
- distribute-default-route [always]
- explicit-router-id

[skip ci]
2024-11-08 08:21:02 +01:00
Mattias WalströmandGitHub 20295b08b5 Merge pull request #808 from kernelkit/set-hostname
Set hostname in infamy
2024-11-07 11:14:11 +01:00
Joachim WibergandGitHub 7a9f1c1d7a Merge pull request #786 from kernelkit/update-discovery-md
Update discovery.md on mDNS Information

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-07 10:43:12 +01:00
Mattias Walström 7e08555013 tests: Convert to put_config_dicts
Convert from put_config_dict to put_config_dicts
2024-11-07 10:13:05 +01:00
Mattias Walström 82ff83c50d infamy: Set hostname from logical topology
If no hostname is specified, set it to the dut-name in
logical topology
2024-11-07 09:47:36 +01:00
Jon-Olov Vatn d277f5a860 Updated Changelog wrt to changes in Discovery documentation
[skip ci]
2024-11-07 09:07:10 +01:00
Jon-Olov Vatn f537e2fc13 Update description of netbrowse service
Use proposal from review.

[skip ci]
2024-11-07 09:00:14 +01:00
Jon-Olov Vatn 73070f40c4 Minor updates to discovery doc
Changing title on the section on netbrowse service

[skip ci]
2024-11-07 09:00:14 +01:00
Jon-Olov Vatn a0fb42e46d Minor updates to discovery documentation
- Adding info on how to disable LLDP
- Avoiding clickable URL to https://network.local

[skip ci]
2024-11-07 09:00:14 +01:00
Jon-Olov Vatn a820beebfa Updates to discovery documentation
Use infix-c0-ff-ee (or similar) rather than infix-00-00-00
Adapting picture and text for netbrowse function to use more than on unit

[skip ci]
2024-11-07 09:00:14 +01:00
Ahmed KaricandJon-Olov Vatn 204672779b doc: Update discovery.md
Add information about:
  - mDNS alias
  - https://network.local

[skip ci]

Fixes #738
2024-11-07 09:00:14 +01:00
Mattias WalströmandGitHub 6a9f9fd3cc Merge pull request #806 from kernelkit/put-config-dicts
Put config dicts
2024-11-06 20:54:55 +01:00
Mattias Walström a78fd3da0a test: ospf_bfd: Wait for correct route before continue
This to make the test to be more stable.
2024-11-06 20:23:53 +01:00
Mattias Walström 8721255554 test: ospf_multiarea: Set static router-id
This is to workaround #807. To test automatic router id selection
a new test is required, which sets interfaces and activate ospf in
separete NETCONF/RESTCONF query.
2024-11-06 14:59:00 +01:00
Mattias Walström 5079691201 test: Convert ospf_multiarea to use put_config_dicts 2024-11-06 12:06:19 +01:00
Mattias Walström a23634dd7e test: Implement put_config_dicts
Add all configuration in one command.
Also update the test igmp_vlan to use
put_config_dicts instead of put_config_dict
2024-11-06 12:06:19 +01:00
Tobias WaldekranzandGitHub 3840ebc9fe Merge pull request #799 from kernelkit/ospf-bfd
test: Multi-Port Network Namespaces
2024-11-05 15:46:30 +01:00
Tobias Waldekranz 56abfde8ec test: netns: Add missing class documentation to describe TPMRs
[skip-ci]
2024-11-05 15:45:00 +01:00
Joachim WibergandGitHub c81b03e1ca Merge pull request #796 from kernelkit/rtc
Support for save/restore system clock from file
2024-11-05 13:05:59 +01:00
Tobias Waldekranz 96d200fe70 test: vlan_ping: Improve test step description and structure
Initially done as a workaround for the MACVLAN create/remove race. But
even though the old version of this test now works, this refactor
provides better test step descriptions, making it easier to follow for
anyone looking to manually verify the functionality.
2024-11-04 14:42:31 +01:00
Tobias Waldekranz 7f2f3768db test: ospf_bfd: Verify fast fail-over using BFD 2024-11-04 14:42:31 +01:00
Tobias Waldekranz dc92db4e9f test: netns: Add Two-Port MAC Relay (TPMR)
This is a specialized namespace, containing two ports,
which (hopefully) acts as completely transparent "bump-on-the-wire"
bridge.

Useful in scenarios where you want to test what happens when the flow
of packets between two nodes is disrupted. E.g., for testing fail-over
behavior in dynamic routing protocols, L2 redundancy, VRRP etc.
2024-11-04 14:42:31 +01:00
Tobias Waldekranz be828d46c9 test: netns: Poll for MACVLAN removal completion
Now that we're using the `passthru` mode of MACVLANs, it seems we can
rely on the parent interface's promiscuity going down to 0 as an
indication that the kernel has completed the removal of the interface,
and will accept the creation of a new one.
2024-11-04 14:42:31 +01:00
Tobias Waldekranz a4a4a49eae test: netns: Guard against "double free" when failing to setup netns
When used as a context manager, __exit__ will be called even though
__enter__ might throw an exception half way through. So there is no
guarantee that the instance is on the cleanup list when we get to
stop().
2024-11-04 14:42:31 +01:00
Tobias Waldekranz 2a6e4402f8 test: netns: Clean up lingering namespaces on test exit
This gets rid of annoying "Address already in use" errors when running
tests repeatedly from a test-sh.
2024-11-04 14:42:31 +01:00
Tobias Waldekranz 3031bba047 test: netns: Use passthru mode for MACVLANs
This mode let's us receive all packets from the parent device, which
is automatically set in promiscuous mode, and let's the MACVLAN
transmit packets with any SA, which we need to implement a TPMR (or a
bridge or anything else we might dream up)
2024-11-04 14:42:31 +01:00
Tobias Waldekranz f9e430e41d test: netns: Generalize IsolatedMacVlan to support multiple interfaces
This is needed to create namespaces with MACVLANs from different
parent interfaces. The first consumer will be a Two-Port Mac
Relay (TPMR), so that we can control the flow of packets between two
nodes.
2024-11-04 14:42:31 +01:00
Tobias Waldekranz 17403afeb4 test: pcap: Avoid creating dumpcap zombies
Story time:

In the days of yore, we generated PCAPs using tcpdump, which will
flush any buffered packets to its output file on reception of
SIGUSR2. Therefore we sent a USR2 before terminating the capture.

At some point, we switched over to use tshark to capture packets for
us, but the SIGUSR2 sayed in place.

It turns out, tshark will just die on USR2, abandoning the dumpcap
child it has created, which means the enclosing network namespace
can't be properly torn down.

Therefore:

Remove skip sending USR2 and just send TERM directly.
2024-11-04 14:42:31 +01:00
Joachim WibergandGitHub bca13137a3 Merge pull request #800 from kernelkit/jovatn-test-arch-doc-fix
Update test-arch.md
2024-11-04 14:25:48 +01:00
Jon-Olov VatnandGitHub 6ba13776df Update test-arch.md
Fixing typo

[skip ci]
2024-11-04 14:19:29 +01:00
Joachim Wiberg 1323d2f266 doc: update ChangeLog
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-04 11:33:51 +01:00
Joachim Wiberg 79d7e8bbab configs: allow aarch64 targets to save system clock to a file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-04 11:10:53 +01:00
Joachim Wiberg 5a38e8768b package/finit: backport upstream v4.9-pre patches
Backport support for saving and restoring system time from a file on
systems with broken RTC that reset to the future.

With this support a system can be sure time only ever moves forward.

Fix #794

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-04 11:10:53 +01:00
Joachim Wiberg c23b9c2dc4 package/finit: fix missing default hostname
The string variable handling in configuring Finit did not follow the
Buildroot best practises.  This patch adds stripping quotes from all
string variables before adding them as configure arguments.

This fixes issue with, e.g., this sneaky bastard:

    configure --with-rtc-date=""2024-10-12 12:34:56""

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg 5261e4f66f board/common: add support for tweaking RTC behavior
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg a6b7b3d2c0 board/common: fix issue with grub menu being misaligned
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg b4d6c787d5 board/common: allow more logging to stdout before starting qemu
Creating/Recreating the qcow2 image now logs to stdout, as does the check
using qemu-img, which looks funny in raw mode.  So let's delay the start
of raw mode until just before starting qemu.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg 58b2ade1e6 board/common: don't regenerate disk image when starting qemu
This fixes an annoying problem with `make run` when set to boot with a
qcow2 disk image.  By default the disk image was recreated every time
the qemu.sh script was called.

Also, add image check to enforce regen if broken.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg 228c93e430 board/common: hide /var option when booting disk image
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg 2938efc8a4 board/common: proper string check in /var/lib bind mount
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg ae82f7fdcf board/aarch64: disable rtc on styx, all revs
The RTC in the CN913x series does not have any "valid" bit, and this
board (all revs) does not have any backup power connected, so it will
return garbage values after every vold boot.

It was therefore decided to disable the RTC completely and set system
time manually, or using an NTP client.  This way any time skips would
only ever be forward, never backwards.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Jon-Olov VatnandGitHub fbddedb51b Merge pull request #792 from kernelkit/jovatn/doc-fixes
Minor doc fixes
2024-11-01 09:21:39 +01:00
Jon-Olov VatnandGitHub 43e2201dd1 Merge branch 'main' into jovatn/doc-fixes 2024-11-01 08:58:12 +01:00
Jon-Olov Vatn b8b0cd3377 Addressing feedback on doc fixes
[skip ci]
2024-11-01 08:54:47 +01:00
Jon-Olov Vatn 6b63b2f9b4 Minor doc fixes
[skip ci]
2024-11-01 08:27:13 +01:00
Joachim WibergandGitHub 142eda81d5 Merge pull request #783 from rical/cli-add-show-iface-cont-sup 2024-10-31 20:22:04 +01:00
Joachim WibergandGitHub fb3c026288 Merge pull request #791 from kernelkit/reboot-on-error 2024-10-31 20:21:33 +01:00
Mattias Walström b0f4192f24 kernel: Reboot device if kernel panics
The worst way of handling a kernel crash is to do nothing at all.
2024-10-31 15:55:47 +01:00
Richard Alpe b9492c7bee cli: add container support to show interfaces
Make show interfaces container aware. This is done by looking though
all podman containers for interfaces and looking up there info from
network namespaces on the main system / hypervisor.

Interfaces controlled by containers are clearly marked in the "show
interfaces" output, with a single gray row. Telling the user that they
belong to one or more named containers. The user can then run "show
interface name NAME" on interfaces owned by containers, which provided
some additional info, such as mac address and stat counters.

The patch also add support for printing veth peers which are owned by
containers.

Lastly, the patch also adds test cases for this functionality.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-29 17:23:30 +01:00
Richard Alpe 31061fcc10 yanger: simplify setting of admin-status
There should be no functional change.
2024-10-29 17:22:59 +01:00
Joachim WibergandGitHub 3e8ead6f92 Merge pull request #778 from kernelkit/r2s-libssh-openssl 2024-10-29 09:14:21 +01:00
Jon-Olov VatnandGitHub b00b6cd6ea Merge pull request #766 from kernelkit/update-bridging-doc
Update bridging doc
2024-10-29 08:33:03 +01:00
Joachim Wiberg ba60b8b494 configs: re-enable OpenSSL backend for libssh/libssh2 also on R2S
Fixes issue with netopeer2-server failing to load its host certificate.

Follow-up to 8b75022 for the NanoPi R2S.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-29 05:47:57 +01:00
Mattias WalströmandGitHub 1e5d4612c9 Merge pull request #767 from addiva-elektronik/update-make-test-spec
Minor Update in Generating Test Spec
2024-10-28 15:16:36 +01:00
Ahmed Karic b359ac794d test: update make-test-spec to escape '/'
It has been identified that the sed command fails to process INFIX_NAME
when it contains an unescaped '/' character.
2024-10-28 13:18:46 +01:00
Ahmed Karic 3b00a376b1 test: regenerate .svg for dhcp_basic test
In the recent work, the generation and commit of topology.svg for the
dhcp_basic test was unintentionally overlooked.
2024-10-28 13:18:21 +01:00
Joachim WibergandGitHub 00cdff1d2d Merge pull request #761 from kernelkit/misc-interface-dhcp
Misc interface dhcp

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 12:38:25 +01:00
Joachim Wiberg 3e5e89b328 package/finit: backport fix to clear background color from GRUB menu
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg 56d1964559 doc: sync dev-guide and contributing guidelines
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg 0112113028 doc: add description of description setting and update ChangeLog
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg 967bfc1e67 test: new test, verify ifAlias
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg 0284e2ca58 confd: allow interface description as ifAlias
This patch adds support for setting the free form description string as
the interface alias.  This can be read from /sys/class/net/*/ifalias, or
using the 'ip link show' command.  The ifalias is reported by SNMP and
LLDP by default, and now also in the operational datastore.

Linux supports 250 characters in ifalias, but the IF-MIB is restricted
to 64 characters, so we add a local deviation to limit the type.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg 710616f8c4 doc,test: clarify relationship between DHCP option 3 and 121
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg dbf0fd2514 board/common: fix rauc compatible regression
The new variable INFIX_COMPATIBLE, used for the RAUC compatible string,
is not properly evaluated on defconfigs where it is composed of another
variable, e.g.

    INFIX_COMPATIBLE="${INFIX_IMAGE_ID}"

Unfortunately, this is the default value for INFIX_COMPATIBLE, and so it
breaks all tier one defconfigs on the mainline branch since a1771ff.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Jon-Olov Vatn aefb90f8f3 Doc: Updating pictures in bridging examples
[skip ci]
2024-10-25 15:31:59 +02:00
Jon-Olov Vatn 49660b7771 Fixing #748 by updating doc on MAC bridging
- Introduce the term MAC bridge in the networking documentation
- List the limitation to one MAC bridge on Marvell Linkstree
- Adding lego pictures for the MAC bridge and VLAN bridge examples

[skip ci]
2024-10-25 15:21:00 +02:00
Ahmed KaricandGitHub 55a20bb4c7 Merge pull request #764 from addiva-elektronik/update-infix-test
Simplify Running Infix Tests from External Projects
2024-10-25 10:29:13 +02:00
Ahmed Karic 3b2bdbf93c test: simplify running infix tests from external
This will facilitate running infix tests from external projects:
  - eliminate the need for an external topology.dot.in file
  - eliminate the requirement to manually provide external image name

Fixes #763
2024-10-25 09:57:08 +02:00
Ahmed KaricandGitHub 04c843e095 Merge pull request #760 from kernelkit/update-dhcp-tests
test: update dhcp test topologies
2024-10-24 13:57:27 +02:00
Tobias WaldekranzandGitHub 1aa5169641 Merge pull request #757 from kernelkit/rauc-compatible2
Use INFIX_COMPATIBLE also for aux partition's rauc.status
2024-10-24 12:26:45 +02:00
Ahmed Karic 594d074f7a test: update dhcp test topologies
Fixes #746
2024-10-24 09:59:56 +02:00
jovatnandGitHub b81407e7d9 Merge pull request #759 from kernelkit/jovatn/doc-vlan-iface-qos
Update QoS documentation (VLAN interface ingress/egress priority)
2024-10-24 09:33:34 +02:00
Mattias WalströmandGitHub 8fc0ab9b2f Merge pull request #758 from kernelkit/update-test-spec
Update test spec
2024-10-23 14:50:47 +02:00
Mattias Walström 3b3656c8f5 test: spec: change image format from PNG to SVG
SVG is a plain text file, better to see why it changed
than binary PNG. Also fix #744 by adding infix/OEM hash
to test specification

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-10-23 14:21:26 +02:00
Jon-Olov Vatn 0eb1fe0ab0 Add QoS doc change to Changelog
[skip ci]
2024-10-23 13:55:28 +02:00
Jon-Olov Vatn 9be43ed0bb Updating colors in QoS complex example picture
[skip ci]
2024-10-23 13:47:30 +02:00
Jon-Olov Vatn 604f22e315 Updating QoS documentation
- More information on Software Forwarding, and its settings.
- Pictures added

[skip ci]
2024-10-23 13:47:30 +02:00
Mattias Walström 76f0c8e3e6 test:spec: Add version of Infix/OEM build
Show the version of the infix build, for traceability

This fix #744

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-10-23 13:45:30 +02:00
Joachim WibergandGitHub d36296da42 Merge pull request #754 from kernelkit/firewall-test
Container firewall test
2024-10-23 13:42:53 +02:00
Joachim WibergandGitHub 9f33658127 Merge pull request #756 from kernelkit/r2s-factory
Update r2s factory-config
2024-10-23 12:46:55 +02:00
Joachim WibergandGitHub 767a1f194b .github: create discussion for new releases
[skip ci]
2024-10-23 12:45:24 +02:00
Joachim Wiberg c7760a68cb test: update infix-containers group README
This is a proposal to how a test section/group overview could look.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 12:27:42 +02:00
Joachim Wiberg 933613e6a3 test: new basic firewall container test
Fix #598

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 12:27:42 +02:00
Joachim Wiberg 14fde1bf90 test: new util method to_binary()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 10:08:10 +02:00
Joachim Wiberg 64c20d96ad test: minor, cleanup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 10:08:10 +02:00
Joachim Wiberg a1771ff5c6 board/common: use INFIX_COMPATIBLE also in rauc.status
Follow-up to cedb654, issue #755.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 10:03:22 +02:00
Joachim Wiberg a7e7b75a97 board/aarch64: update r2s factory-config
- add default-deny-all rule from 2341e07
 - enable iburst for the ntp client (quicker initial sync)
 - bump meta version (to skip .cfg migration at boot)

Fix #750 [skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 08:04:31 +02:00
Joachim WibergandGitHub 822cb93265 Merge pull request #755 from kernelkit/rauc-compatible
Add support for overriding the compatible string

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-22 19:36:31 +02:00
Joachim Wiberg cedb654643 Add support for overriding the compatible string
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-22 18:32:55 +02:00
Ahmed KaricandGitHub 52eafa70a8 Merge pull request #749 from kernelkit/disable-ntpd
Disable BusyBox Related NTP Services
2024-10-22 17:03:47 +02:00
Ahmed Karic 6ba8e3bf55 busybox: disable ntpd from defconfig 2024-10-22 13:28:39 +02:00
Joachim WibergandGitHub f119138107 Update SUPPORT.md
[skip ci]
2024-10-22 12:08:43 +02:00
Ahmed KaricandGitHub 5c822efa6f Merge pull request #742 from kernelkit/add-docs-ntp
Update system.md by adding NTP details
2024-10-22 09:50:03 +02:00
Mattias WalströmandGitHub 19d5f1db1c Merge pull request #752 from kernelkit/dsa-interface
Make detection of DSA interface more robust
2024-10-22 09:37:37 +02:00
Ahmed Karic 438e39d2fe doc: update system.md with ntp information
Fixes #733
2024-10-22 08:58:19 +02:00
Mattias Walström 0ee973b2b2 Make detection of DSA interface more robust
Sometimes the interface creation are done, but
the sysfs is not, this gap we sometimes finds
in the nameif script. Wait out the sysfs creation
if running a DSA switch.

Fix #685

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-10-22 08:50:54 +02:00
Joachim WibergandGitHub c0e68579c1 Merge pull request #737 from kernelkit/checklist
Checklist for code review and releases

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-21 10:10:25 +02:00
Joachim Wiberg 5b61ccd960 .github: update pull request template
For some documentation changes, e.g., the recent change in the QoS
documentation, see de76b97, it is highly relevant to also mention
this change in the release notes.

In fact, any change that would make it worthwhile for a user to
update their knowledge on a topic should probably be documented
in the release notes.

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-21 10:09:39 +02:00
Joachim Wiberg 1dd761560d .github: add checklist for pull requests and releases
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-21 10:07:15 +02:00
Joachim Wiberg 076d174579 Update ChangeLog for v24.10.1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 15:32:29 +02:00
Tobias WaldekranzandGitHub 1470c473f6 Merge pull request #736 from kernelkit/fix-missing-copy-command
Add missing copy and erase commands to CLI
2024-10-18 15:08:48 +02:00
Joachim Wiberg 9ae7115bbf doc: update ChangeLog for upcoming v24.10.1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 14:16:51 +02:00
Joachim Wiberg f9a0c71b1f package/klish: make sure to select bin tools (copy, erase)
Fix #735

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 14:13:45 +02:00
Joachim Wiberg aad5bcd4e6 doc: update ChangeLog for v24.10.0
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 12:43:14 +02:00
Ahmed KaricandGitHub e875239639 Merge pull request #732 from kernelkit/fix-admin-perm
Allow admin to run 'show ntp'
2024-10-18 10:45:12 +02:00
Joachim WibergandGitHub 3bcc058969 Merge pull request #717 from kernelkit/copy-timeout
Fix too small timeout for copy command

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 09:44:16 +02:00
Ahmed Karic 3fa820b41e klish-plugin-infix: allow admin to run 'show ntp'
Fixes #730
2024-10-18 09:35:43 +02:00
Mattias WalströmandGitHub baec6cb35f Merge pull request #731 from kernelkit/minor-cli-fixes
Minor CLI fixes
2024-10-18 09:33:30 +02:00
Joachim Wiberg 903960f6a0 package/klish-plugin-sysrepo: add units to help text, hide obsolete
Fixes the following CLI issues:

 - kernelkit/klish-plugin-sysrepo#5 : hide obsolete nodes, e.g., meta/version
 - kernelkit/klish-plugin-sysrepo#6 : add units to online help text

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 08:55:44 +02:00
Joachim Wiberg 44727b9a47 confd: mark entire meta container obsolete
Mark meta data as obsolete to hide from CLI and other frontends.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 08:52:58 +02:00
Tobias WaldekranzandGitHub eac60b1883 Merge pull request #729 from kernelkit/led-fixes
Disable software LED control of port LEDs
2024-10-18 08:37:26 +02:00
Joachim WibergandGitHub b5abadd52a Merge pull request #728 from kernelkit/uboot-http-netboot-fixes
U-Boot HTTP Netboot Fixes

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-17 16:31:24 +02:00
Joachim Wiberg 4603649145 doc: software led control disabled on styx
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-17 16:02:14 +02:00
jovatnandGitHub c1f552a8dc Merge pull request #726 from kernelkit/jovatn/test-cases-minor-updates
Formatting fixes for test specification and topologies
2024-10-17 15:52:14 +02:00
Tobias Waldekranz c1dfdd92b0 uboot: Fix repeated calls to boot_net in combination with HTTP
Previously, when the `proto://path` format of `bootfile` was used, the
transformed argument sent to either tftp or wget would also be stored
in `bootfile` overriding the original value set by the user.

If the first boot attempt failed for some reason, the protocol
information was stripped from `bootfile` and the second attempt would
then default to TFTP, even if the user had originally specified
`http://...`.

Therefore, store the transformed value in a separate variable.

For some reason, setexpr's parsing of regex escapes changes when this
mode is used, so we need double backslashes to fetch match groups
instead of 1. Yikes.

Fixes #724
2024-10-17 15:38:47 +02:00
Jon-Olov Vatn d3b28339c1 Updating test specs to have consistent formatting 2024-10-17 15:11:19 +02:00
Tobias Waldekranz 563b4a743b uboot: Settle for only ipaddr being set to skip DHCP
This puts the responsibility on the user to set the appropriate static
parameters. On the plus side, we avoid requiring redundant information
when the `proto://path` format is used in `bootfile`
2024-10-17 15:11:12 +02:00
Jon-Olov Vatn 272a7c1e69 Formatting fixes for test specification and topologies
Also including some existing test to test specification, from ietf_system
and ietf_interfaces directories.
2024-10-17 15:11:12 +02:00
Joachim Wiberg 01e91a2fce package/finit: backport upstream rdeps patch
This patch fixes a upstream issue troglobit/finit#415, greatly reducing
the amount of service restarts, needlessly affecting, e.g., iitod when
services like syslogd¹ is reloaded.

____
¹) Traditional UNIX services that properly support SIGHUP.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-17 14:37:02 +02:00
Joachim Wiberg d7abe46768 board/aarch64: disable port led control on styx, for now
For details, see discussion in #670

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-17 13:03:29 +02:00
Ahmed KaricandGitHub 484dc940dc Merge pull request #723 from kernelkit/verify-iface-status
Verify Interface Status
2024-10-17 10:27:10 +02:00
Ahmed Karic 420f6a0556 test: verify interface status (enable/disable)
Fixes #694
2024-10-17 09:50:01 +02:00
Ahmed Karic 4d4a4c68e7 test: refactor iface.py 2024-10-16 19:01:40 +02:00
Joachim WibergandGitHub eb79adce13 Merge pull request #722 from kernelkit/use-specific-secret-add-to-project 2024-10-16 17:24:43 +02:00
Mattias Walström 9fd92252ea CI: Use specific token when calling add to project
[skip ci]
2024-10-16 11:25:03 +02:00
Mattias WalströmandGitHub 90bda1b584 Merge pull request #710 from kernelkit/fix-test-texts
test: Update topologies and test texts
2024-10-16 11:24:44 +02:00
Ahmed KaricandGitHub 15830714f0 Merge pull request #721 from kernelkit/add-admin-status-to-yanger
Statd: Add 'admin-status' to Interface Operational Data
2024-10-16 11:02:36 +02:00
Mattias Walström 34cb229965 test: Update topologies and test texts
All mgmt links should be lightgrey, all mgmt ports should be named mgmt
links between duts should be named link.
2024-10-16 10:51:01 +02:00
Ahmed Karic 3f0b85aad9 statd: Add 'admin-status' to yanger
The interface operational data was missing the 'admin-status' parameter,
which indicates whether an interface is administratively enabled or
disabled. To resolve this, the 'admin-status' was added to the yanger

Fixes #700
2024-10-16 10:33:09 +02:00
Tobias WaldekranzandGitHub 7de94b996a Merge pull request #718 from kernelkit/container-fixups
Container fixups
2024-10-16 09:14:14 +02:00
Joachim WibergandGitHub 09c019b236 Merge pull request #720 from kernelkit/jovatn/changelog-fixes
Doc fixes in ChangeLog v24.10.0 related to OSPF
2024-10-16 08:47:22 +02:00
Joachim Wiberg 526d3356c7 board/common: add example to erase partition table
[skip ci]

Related to: #671

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 08:37:16 +02:00
jovatnandGitHub 358852aa4f Doc fixes in ChangeLog v24.10.0 related to OSPF
Updating existing formulations for changes and fixes for OSPF.

[skip ci]
2024-10-16 08:32:57 +02:00
jovatnandGitHub 18640a78d5 Merge pull request #719 from kernelkit/jovatn/qos-doc-fix
Doc fix on QoS. PCP takes priority over DSCP for tagged IP packets
2024-10-16 08:03:06 +02:00
Jon-Olov Vatn de76b97c94 Doc fix on QoS. PCP takes priority over DSCP for tagged IP packets
This is how it works and how we want it to be by default.
No code change, just doc change.

[skip ci]
2024-10-16 07:49:30 +02:00
Joachim Wiberg 99e0a2ee1c confd: refactor hostnamefmt()
This refactor, and massive code simplification, is a follow-up to the
double free discovery in 3b4d2b3.

Beacuse a hostname in Linux can never be more than 64 chars, we can
safely use a stack buffer instead of calloc(), reducing complexity
and simplifying the code further with the use of strlcat().

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 07:36:35 +02:00
Joachim Wiberg 0d0e2b168a doc: update container notes
- Expand on Docker Hello World
 - Add more pictures to help break up the content a bit

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 07:31:41 +02:00
Joachim WibergandGitHub 08348c43c2 Merge pull request #716 from rical/fix-confd-cont-double-free
confd: fix double free of container hostname
2024-10-16 06:43:29 +02:00
Joachim Wiberg 343b453c74 bin: use CONFD_TIMEOUT for all copy operations
Fixes #701

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 06:10:39 +02:00
Joachim Wiberg 464e0bcb92 bin: factor out copy, erase, and files from klish-plugin-infix
Relocate C code from klish-plugin-infix to stand-alone binaries we can
use also from Bash.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 06:10:39 +02:00
Joachim Wiberg 886d83933f keyack: minor, whitespace and constification
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 06:05:22 +02:00
Joachim Wiberg ef1b1b1d1a statd: add missing dependency
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 06:02:49 +02:00
Richard Alpe 3b4d2b38d7 confd: fix double free of container hostname
Fix a double free in the memory minefield surrounding container
hostname provisioning. The hostnamefmt() function already does free()
on success.

This caused all sorts of mayhem when working with multiple containers.
However it mainly manifested itself by some containers not starting
due to there activation script being polluted with gibberish
name data. Your symptom might be different..

Example of polluted activation script:
container --hostname foobar --net veth0k -r always \
  create ^S@`M-}^G docker://ghcr.io/kernelkit/curios:edge

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-15 20:06:45 +02:00
Mattias WalströmandGitHub 0e276a97b8 Merge pull request #711 from kernelkit/minor-test-formating
test: minor code formating
2024-10-15 11:26:54 +02:00
Joachim WibergandGitHub afc40ac2bd Merge pull request #715 from kernelkit/update-pull-request-template
Update pull request template
2024-10-15 11:24:45 +02:00
Mattias Walström 5ea65aea0d Update pull request template
Add information about test changes

Also remove "Other information" since I think that
should also go under Description and to lower the amount of
text in the template, to increase its use.

[skip ci]
2024-10-15 11:21:58 +02:00
Ahmed Karic 614b7efd42 test: update test cases (refactor)
- change topology colors
- add ascii charts
- apply new naming conventions (indexing)
2024-10-15 10:32:25 +02:00
Joachim WibergandGitHub 024acb184d Merge pull request #714 from kernelkit/jovatn/container-doc-fixes
Doc: minor fixes to container doc
2024-10-15 09:53:36 +02:00
Jon-Olov Vatn e11008c7d2 Doc: minor fixes to container doc
[skip ci]
2024-10-15 09:24:35 +02:00
Joachim WibergandGitHub e2e947629c Merge pull request #713 from kernelkit/deviate-link-up-down-trap-enable 2024-10-14 22:10:52 +02:00
Mattias Walström 754426f7ed confd: deviate link-up-down-trap-enable not-supported
This fix #709
2024-10-14 21:14:10 +02:00
Joachim WibergandGitHub 31552bfc48 Merge pull request #712 from kernelkit/container-ifname 2024-10-14 21:01:38 +02:00
Joachim Wiberg de27d1c7e6 doc: update changelog with latest fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-14 19:41:01 +02:00
Joachim Wiberg 24b93074c5 doc: update container documentation a bit, more images
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-14 19:18:34 +02:00
Joachim Wiberg a14fada0ee confd: add support for container hostname format specifiers
This patch makes it possible to use format specifiers to "uniqiefy" a
container's hostname in the same way as with ietf-system hostname.

The following specifiers are currently supported:

 - %h default hostname from /etc/os-release
 - %i value of ID from /etc/os-release
 - %m last three octets of base MAC, e.g., c0-ff-ee

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-14 18:00:00 +02:00
Joachim Wiberg 7346f122fd confd: allow all container networks to set interface name
Unlock setting a custom interface name inside the container.  This aids
se-cases where this is needed and provide a better user experience, for
example when upgrading containers.  Not having to reboot the host just
to activate an upgrated container.

Fixes #708

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-14 18:00:00 +02:00
jovatnandGitHub 227b3a92a0 Merge pull request #702 from kernelkit/jovatn/test-spec-minor-fixes
Jovatn/test spec minor fixes
2024-10-14 08:12:20 +02:00
Jon-Olov Vatn 6d1ac9aad2 Minior fixes to Test Specs
Updating after comments from Axkar (thx!)

[skip ci]
2024-10-14 08:07:36 +02:00
Mattias WalströmandGitHub 53d90ae45a Merge pull request #707 from kernelkit/misc
Bump Finit and add support for dummy interfaces
2024-10-14 05:56:04 +02:00
Joachim Wiberg 411626a8b7 package/finit: bump to v4.8
Full ChangeLog at <https://github.com/troglobit/finit/releases/tag/4.8>

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-13 20:01:10 +02:00
Joachim Wiberg a4e6e4422b confd: add support for dummy interfaces
Dummy interfaces are useful for configuring routes and testing network
services without having to allocate physical or virtual interfaces.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-13 18:08:20 +02:00
Joachim WibergandGitHub 3358687c39 Merge pull request #695 from kernelkit/custom-phys-address 2024-10-11 18:30:36 +02:00
Joachim Wiberg 26180859bb doc: update changelog
Add issue #680, and all others that's gone in during the last week.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg 025c3ab7f6 doc: new setting on general interface settings
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg 026236390b doc: add picture to show stacking direction
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg 284f79242a doc: add missing VLAN block to overview svg
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg f79ad4d2d8 confd: handle static factory-config syntax error
For products with a static factory-config, or customers generating with
an older syntax, attempt migration in case of bootstrap failure.

Refactor logging to drop '-s'.  This prevents duplicate log messages
since bootstrap always runs after syslogd has started and all stdout
is always logged.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg 1852d12e7f confd: refactor 30-cfg-migrate for stand-alone use
This patch relocates the 30-cfg-migrate init script to confd, where it
belongs, renaming it migrate and installing into /usr/sbin.

The script has been heavily modified to be more user friendly, as well
as useful for automated restore operations, to be able to refresh old
backups to modern .cfg file syntax.

Example (injected phys-address error):

    admin@example:~$ migrate -c /etc/factory-config.cfg
    /etc/factory-config.cfg: has syntax error, requires migrating.

Since backups are created with the old confd sytanx version in the name,
the backup functionality has been kept in the script.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg 98ff33113a confd: bump version for phys-address .cfg migration
See issue #680

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg cc165c5bb9 confd: replace phys-address deviation with new setting
This commit replaces the ietf-interfaces deviation for phys-address,
used to set custom MAC address on interfaces, with a more flexible
approach which can calculate the new MAC address based on the device's
chassi MAC, with or without an added offset.

The regression test has been updated to test all variants.

Resolves: #680

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Tobias WaldekranzandGitHub 6e8f91ef3c Merge pull request #704 from kernelkit/defconfig-regression-fixes
Defconfig regression fixes
2024-10-11 16:37:44 +02:00
Joachim Wiberg 60b8f97ad6 package/test-mode: rename to confd-test-mode
Declare that confd-test-mode depends on confd, otherwise with 'select',
a call to `make update-defconfig` will remove BR2_PACKAGE_CONFD=y, which
we feel is very confusing -- in particular when comparing any defconfig
that does not have test-mode package.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 15:02:49 +02:00
Joachim Wiberg 8b75022696 configs: re-enable OpenSSL backend for libssh/libssh2
NETOPEER2 requries the OpenSSL backend of libssh.  By default, except on
minimal builds, is to use GCrypt backend.  Gcrypt is selected because of
Podman, which is not in the minimal builds.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 14:23:34 +02:00
Jon-Olov Vatn d74e7f1458 Fixing typos and other minor issues on test spec
[skip ci]
2024-10-11 13:53:41 +02:00
Jon-Olov Vatn 9baa3ac674 Add missing Readme.adoc files in test specs 2024-10-11 13:28:45 +02:00
Tobias WaldekranzandGitHub e8035f42fa Merge pull request #699 from kernelkit/r2s-fixes
Minor fixes for the R2S and similar boards
2024-10-11 08:47:28 +02:00
Joachim Wiberg 9a3f7d44c4 statd: allow ethtool rmon counters readout to fail
In e373398 we restored statd suport for checking for faults in yanger at
runtime.  This in turn broke CLI "show interfaces" support on the little
NanoPi R2S because ethtool cannot read counters in JSON format on it.

This patch catches the subprocess exception, allowing this particular
call to ethtool to fail with empty result.  The only difference from
before e373398 is that run_json_cmd() will log an error that ethtool
failed, for every interface it is called on.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-10 23:55:13 +02:00
Joachim Wiberg 374d24a547 configs: update and add LIBMNL to x86_64 targets
- Sync (make update-defconfig)
   - test-mode selects confd
   - gencert seclets openssl which in turn selects LIBSSH*_OPENSSL
   - rest is relocaations according to Config.in
 - Add LIBMNL to x86_64 targets, otherwise iproute2 does not install devlink

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-10 23:55:13 +02:00
Mattias WalströmandGitHub dc0a68a9eb Merge pull request #692 from kernelkit/update-tests
Update some tests
2024-10-10 11:26:11 +02:00
Mattias Walström f1d730447d confd: ietf-system: Add missing endspent() when getting operational data
This fix #697
2024-10-10 10:56:47 +02:00
Mattias Walström c0d5bfa71d test: add_delete_user: Test yescrypt 2024-10-10 10:56:47 +02:00
Mattias Walström 02100ef1f8 test: ospf_multiarea: Test interface type point-to-point and router-id
Test point-to-point on /30-links, verify the interface type
set explicit-router-id and verify that it gets set and sent
over OSPF.
2024-10-10 10:56:47 +02:00
Mattias Walström 00b103d3d2 tests: Update some typos in test steps
Also add missing ipv4_autoconf test from specification
2024-10-10 10:56:47 +02:00
Ahmed KaricandGitHub c44621b8be Merge pull request #693 from kernelkit/verify-ssh-key
Verify fetching data using ssh public key
2024-10-10 10:04:15 +02:00
Ahmed Karic b1bc7b42b4 test: Verify fetching data using ssh public key
Add a test case to verify that a new (guest) user can retrieve data
(i.e. syslog data) using ssh public key

Fixes #304
2024-10-09 19:21:01 +02:00
Joachim WibergandGitHub 6a036ec671 Merge pull request #691 from rical/cli-fix-iface-tabcompl 2024-10-08 18:01:07 +02:00
Richard Alpe 49c47e4732 cli: hide internal interfaces in tabcomplete
Don't show "internal" interfaces in "show interface name"
tab completion.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-08 16:23:01 +02:00
Richard AlpeandGitHub 719fe709aa Merge pull request #690 from rical/fix-long-frr-uptime
yanger: handle all frr uptime formats
2024-10-08 13:43:45 +02:00
Richard Alpe 03245f3631 cli: print FRR uptime on same format as FRR
Use the same uptime representation as FRR does.

Example output:
DESTINATION            PREF NEXT-HOP   PROTO   UPTIME
>* 10.0.23.0/30        0/0 e6          direct  20:10:05
192.168.3.0/24         110/1 e2        ospfv2  5d13h05m
>* 192.168.3.0/24      0/0 e2          direct  01w1d13h

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-08 10:54:36 +02:00
Richard Alpe 950e868eb3 yanger: handle all frr uptime formats
FRR prints uptime different based on how long it is. Prior to this
commit yanger expected uptime to be on the format HH:MM:SS which it is
as long as it's shorter than a day. If it's longer the format changes,
this commit handles this.

The commit also adds unit test data triggering the different formats
(<day, <week, >week).

Side note:
cli-pretty could be made to represent the data on "FRR format" again,
which is perhaps more human friendly.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-08 10:06:32 +02:00
Joachim WibergandGitHub 3e8e8a2e99 Merge pull request #689 from kernelkit/container-nftables 2024-10-07 21:04:57 +02:00
Mattias WalströmandGitHub d8655ef70d Merge pull request #688 from kernelkit/vlan-move-ports
Do not delete VLAN when change a port from tagged to untagged
2024-10-07 17:16:15 +02:00
Joachim Wiberg 458c1f8795 configs: include nftables container image in default builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-07 17:09:30 +02:00
Joachim Wiberg 5cbe92f9ec package/curios-nftables: new package
Allow bundling dedicated nftables container in Infix images.  With this
container, the /etc/nftables.conf can be kept as part of the device's
startup-config (base-64 coded binary format).  Highly useful in advanced
setups, either with dedicated interfaces in the container, or when run
in host network mode.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-07 17:09:30 +02:00
Mattias Walström 2a5ed84898 Do not delete VLAN when change a port from tagged to untagged
Dagger did delete of the VLAN after it had configured it.
Resulting in that the new VLAN configuration was lost.

This will first delete all untagged/tagged ports that should be removed,
when they are removed, add the new or changed ports.
2024-10-07 16:19:38 +02:00
Joachim Wiberg 6743223b29 package/curios-httpd: install unmodified OCI tarball in image
Before:

    $ ls -lah output/target/lib/oci
    drwxr-xr-x  2 jacky users 4,0K Oct  7 12:26 .
    drwxr-xr-x 27 jacky users  20K Aug 29 06:45 ..
    -rw-r--r--  1 jacky users 1,8M Oct  7 12:19 curios-httpd-v24.05.0.tar.gz

After:

    $ ls -lah output/target/lib/oci
    drwxr-xr-x  2 jacky users 4,0K Oct  7 12:26 .
    drwxr-xr-x 27 jacky users  20K Aug 29 06:45 ..
    -rw-r--r--  1 jacky users 281K Oct  7 12:28 curios-httpd-v24.05.0.tar.gz

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-07 14:01:18 +02:00
Mattias WalströmandGitHub a66d1d3771 Merge pull request #684 from kernelkit/fix-test-texts
Update last tests for first version of test specification
2024-10-04 13:12:44 +02:00
Mattias Walström 65e5ab81f1 test: ietf-system: Update topology images 2024-10-04 11:22:58 +02:00
Mattias Walström 6cceecccda test: Update infix-dhcp for test specification 2024-10-04 11:22:58 +02:00
Mattias Walström a5e4e016e4 test: Update infix-services for test-specification 2024-10-04 11:22:58 +02:00
Mattias Walström 883123ecdd test: Update misc/operational_all for test specification 2024-10-04 11:22:58 +02:00
Mattias Walström 69ba9110fc test: Update infix-container for test specification 2024-10-04 11:22:58 +02:00
Mattias Walström 5a28a5611a test-specification: Make possible to add ASCII art
The ASCII art over the topology must be surrounded by .... and
is codeblock in ASCIIdoc. Since this is only used for ASCII arts
to help describe tests, border and background are white.
2024-10-04 11:22:58 +02:00
Ahmed KaricandGitHub 571f4a6b9c Merge pull request #683 from kernelkit/upgrade-netconf-client
Upgrade NETCONF Client from 2.2.0 to 3.1.1
2024-10-03 18:38:56 +02:00
Ahmed Karic 4bed63d310 test/infamy: update get_data
Refactor NETCONF functions (get_data) to accommodate the upgrade
in the netconf_client library within the Docker container image.

Fixes #390
2024-10-03 17:23:18 +02:00
Ahmed Karic 093a17234f test/docker: upgrade netconf-client in docker image 2024-10-03 17:23:18 +02:00
Joachim Wiberg a50edc7bcb .github: fix internal Markdown link
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 11:51:47 +02:00
Joachim WibergandGitHub b946ea937c Merge pull request #682 from kernelkit/drop-sync-job
Drop sync job in favor of local cronjob

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 10:51:20 +02:00
Joachim WibergandGitHub 515f1e60f9 Merge pull request #681 from kernelkit/contrib
Major update of CONTRIBUTING.md

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 10:30:50 +02:00
Joachim Wiberg 39da7f4509 .github: update support resources document
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 10:21:55 +02:00
Joachim Wiberg f2c60f2e16 .github: drop sync job in favor of local cronjob
[skip ci]

Resolves: #572

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 10:01:06 +02:00
Joachim WibergandTobias Waldekranz fb3bd858e1 .github: major overhaul of CONTRIBUTING.md
This major overhaul of the Contributing to Infix document is made both
for internal (scaling the core team) reasons and to make it easier for
external contributors to undertand what is expected:

 - For bug reporting
 - For feature requests
 - When submitting a patch
 - When adding a complete new subsystem
 - Etc.

Resolves: #672

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Co-authored-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 08:57:54 +02:00
Joachim Wiberg ba84c36878 doc: add separate png for Jack
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 08:40:11 +02:00
Mattias WalströmandGitHub 3b17dd013b Merge pull request #679 from kernelkit/fix-test-texts
Misc fixes
2024-10-03 08:10:27 +02:00
Mattias Walström 9fb2b57dd6 Add all issues to project Infix&co when new issue is opened 2024-10-03 07:28:33 +02:00
Mattias Walström 363516ce58 Update changelog for upcoming 2024.10.0 release 2024-10-03 07:28:33 +02:00
Mattias Walström 673ce2767f Do not allow to configure a loopback interface in multiple areas 2024-10-03 07:28:33 +02:00
Mattias Walström b88c3c3a0c ospf: Do not enable BFD on all interfaces when enable on one interface 2024-10-03 07:28:33 +02:00
Mattias Walström ff6c63a3bd test: ospf: Remove loopback from multiple areas
This is not allowed in FRR.

Fix #586
2024-10-03 07:28:33 +02:00
Mattias Walström 6c2e5542ca confd:yang: Refactor infix YANG file names and location
Instead of renaming the yang-file instead we keep the yang file
with the actual content linear, easier to review and easier to
follow changes. This only applies on all infix models,deviations
and auguments.

The actual infix-system@2038-01-19.yang is just a symlink to
ietf-system.yang which contains all the code.
2024-10-03 07:28:33 +02:00
Mattias Walström ca122ea093 test:case:usb: Update test documentation 2024-10-02 23:31:14 +02:00
Mattias Walström 2341e076a8 factory-config: Add default NACM deny rule for reading password hash
This fix #499
2024-10-02 23:31:14 +02:00
Mattias Walström 0d98ee5716 test-spec: Fail build on failed test specification build
This can fail on two ways:
* Generate topology files
  Unfortunatly the python-graphwiz has no way of detect faults
  it just show 'Warning' on stderr, catch it and if != empty, exit 1

* Generate pdf
  Here the default error level was FATAL, but for example a file
  that is included does not exist it just show an error on stdout.
  the error level is now INFO, it should always be silent.
2024-10-02 23:31:14 +02:00
Mattias Walström 7871bdb9f4 veth_delete: Update for test specification 2024-10-02 22:58:06 +02:00
Mattias Walström 64c51c7c94 test: verify_all_interface_types: Update to generate correct test specification 2024-10-02 22:58:06 +02:00
Mattias Walström 19d40af20a syslog: Update test texts for test specification 2024-10-02 22:58:06 +02:00
Tobias WaldekranzandGitHub b21945f38a Merge pull request #674 from rical/yanger-hide-internal-interfaces
yanger: hide internal interfaces
2024-10-01 22:20:31 +02:00
Tobias WaldekranzandGitHub 712780fd5a Merge pull request #675 from rical/fix-flaky-routing-test
test: use static time in ietf-routing unit tests
2024-10-01 21:57:21 +02:00
Mattias WalströmandGitHub 48722e551e Merge branch 'main' into fix-flaky-routing-test 2024-10-01 20:12:51 +02:00
Tobias WaldekranzandGitHub 14234a9a77 Merge pull request #677 from kernelkit/uboot-improvements
Uboot improvements
2024-10-01 16:42:55 +02:00
Richard Alpe f932f98ad2 test: use static time in ietf-routing unit tests
Fix flaky ietf-routing unit tests.

Prior to this patch, there was a unit-test race between Yanger
(sysrepo emulator) and cli-pretty, where the local system time could
change between crafting the data and printing it. This caused the CLI
output to change and the ietf-routing unit test to fail.

Fixes #668

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-01 16:34:58 +02:00
Tobias Waldekranz a127925d9e uboot: Add leading slash to path when using HTTP
RFC 7230, section 5.3.1 specifies that the path must start with a
slash.

...and nginx is not amused by its absence.
2024-10-01 16:00:38 +02:00
Joachim Wiberg 63c1f36005 doc: minor, fix syntax in example
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-01 14:47:39 +02:00
Richard Alpe 707e7d1a29 yanger: skip internal interfaces
In "14128047e18d statd: remove nl code and improve speed" the handling
of all interfaces where moved from statd to Yanger. This means statd no
longer tracks interfaces using Netlink, but instead relies on Yanger
to recognise and list all interfaces in the system. In the midst of
this change the ignoring of "internal" interfaces where lost.

In this commit we reintroduce this logic in Yanger and add a test case
that ensures internal interfaces isn't listed.

Fixes: 14128047e1 statd: remove nl code and improve speed

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-01 14:28:31 +02:00
Richard Alpe 240a292725 test: remove explicit iface list from sysrepo emulator
Yanger now has the ability to loop all interfaces (based on ip link),
this means we can run once for all interfaces.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-01 14:28:30 +02:00
Richard Alpe e2fed7c9de yanger: redesign ip interface data collection
Run ip link and ip addr once and handle the interface selection in
Yanger. This should be faster on systems with many ports and it
simplifies the CLI test files.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-01 14:28:26 +02:00
Joachim WibergandGitHub 19563c00f4 Merge pull request #669 from kernelkit/doc-updates
doc: expand on static vs dynamic factory-config
2024-10-01 11:44:50 +02:00
Joachim Wiberg d37656e347 doc: expand on static vs dynamic factory-config
Infix now supports static /etc/factory-config.cfg from a rootfs overlay
or /usr/share/product/<VPD.PRODUCT>/etc/factory-config.cfg in addition
to the autogenerated /run/confd/*-config.gen files.

Update the Branding & Releases document with a bit more information on
this rather complex topic.

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-01 11:43:45 +02:00
Tobias Waldekranz 69b93507a9 uboot: Honor static network settings
If the user has manually configured all required network parameters,
honor that setup, by skipping DHCP, and directly fetch the image.
2024-10-01 09:53:37 +02:00
Tobias Waldekranz e3e6477d47 uboot: Skip bootmenu when in developer mode
When a device is in developer mode, drop the user directly into the
shell instead of having to go via the bootmenu, since this is usually
what you want in that case. Emit a note about how to access the menu,
for the rare cases when that is needed.
2024-10-01 09:53:37 +02:00
Joachim WibergandGitHub 808a04f125 Merge pull request #667 from kernelkit/gh-dl-artifact-fixes
Support downloading artifacts from release builds
2024-09-30 17:02:05 +02:00
Tobias Waldekranz fb8ac2aca1 utils/gh-dl-artifact.sh: Support extracting release tarballs
Release tarball names contain the version information. Make sure we
find these files when extracting them from the artifact ZIP.
2024-09-30 13:34:36 +02:00
Tobias Waldekranz 6dadbd9176 utils/gh-dl-artifact.sh: Look for artifacts in all runs
Previously, the assumption was that the artifact could be found in the
first run of "Bob the Builder". This does not hold in the case when:

1. An initial run is aborted, and is re-run at a later date
2. When a release is built (by "Release General")
2024-09-30 13:19:54 +02:00
Ahmed KaricandGitHub 3c1dc9be53 Merge pull request #666 from kernelkit/update-qeneth-submodule
test/qeneth: Update submodule
2024-09-30 13:12:24 +02:00
Ahmed KaricandAhmed Karic 1531688ac4 test/qeneth: Update submodule
Fixes #660
2024-09-30 13:11:59 +02:00
Joachim Wiberg a4d4d7e4ae doc: update release date for v24.09
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-30 10:30:25 +02:00
Tobias WaldekranzandGitHub 1adace8acb Merge pull request #664 from kernelkit/styx-rename
board/aarch64: styx: Update board name
2024-09-30 10:24:06 +02:00
Tobias Waldekranz 059e22c85f board/aarch64: styx: Update board name
Now that the name question has been settled, call the board by its
proper name. Provide symlinks to keep older bootloaders happy.
2024-09-30 09:28:08 +02:00
Joachim WibergandGitHub 58edaf371c Merge pull request #657 from addiva-elektronik/verify_all_interface_types 2024-09-28 09:11:41 +02:00
Ahmed Karic d2ff58a170 test: add a test to verify all interfaces
The test ensures that all interface types can be successfully created
and retrieved from the operational datastore. It also functions as a
regression test for issue #618 and will apply to all future interface
variants.

Fixes #622
2024-09-27 17:53:48 +02:00
Joachim WibergandGitHub 40e4b168ff Merge pull request #661 from kernelkit/veth-delete
Fix test issues after adding veth-delete test

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 17:40:30 +02:00
Joachim Wiberg bac957d1bf cli: minor, fix tcpdump permissions from exec as admin
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 16:55:24 +02:00
Joachim Wiberg 015946219b confd: fix possible NULL ptr deref
Introduced in 35eeae55.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 16:43:42 +02:00
Joachim Wiberg 6521de28e7 confd: check for control-plane-protocol before migration
Refactor 0f9d429 to first check if the .cfg file has any routing
protocol active before converting the type's value.

This fixes a regression in the release cycle that otherwise would
cause a fresh startup-config, created from a plain factory-config
from v24.08, to be converted to an empty file.

Inspired by this fix, the same mitigation, albeit highyl unlikely,
has been applied to the v1.0 user shell type migration.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 16:37:16 +02:00
Joachim Wiberg c0a79c3e00 test: return None instead of 404 Exception for missing XPaths
Fixes to following exception calling iface.interface_exist(target, veth0): requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://[fe80::2a0:85ff:fe00:201%d2a]:443/restconf/ds/ietf-datastores%3Aoperational/ietf-interfaces%3Ainterfaces/interface=veth0a/name

Removing interface veth0a, and then checking operational if it has been
properly removed, should not cause an exception.  Better to return None
object instead.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 16:37:16 +02:00
Joachim Wiberg acb844336f doc: update ChangeLog
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 13:22:38 +02:00
Joachim Wiberg c8437f040a test: verify VETH pairs can be removed
Verify a VETH pair can be removed after a couple of dummy operations to
step the dagger generation past the initial where the pair is created.

NOTE: Infamy currenly lacks support for removing chunks of configuraion
      e.g., a dut.del_config_dict(), or similar, and delete_xpath() is
      not valid for configurations with dependencies like VETH pairs.

Issue #658

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 13:08:26 +02:00
Joachim Wiberg 54a046afb4 test: check if JSON data before searching it
Fix None.get() value assertion for missing data.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 13:02:59 +02:00
Joachim Wiberg 35eeae55f4 confd: skip veth peer also when deleting interfaces
When adding interfaces over NETCONF/RESTCONF, confd has a check to
ensure the peer end is skipped, since creating one end also create
the other.

This patch adds the corresponding skip when deleting a VETH pair.

Fixes #658

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 13:00:02 +02:00
Joachim Wiberg a06436a8c8 .github: fix missing arch + version in legal-info tarball
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 08:44:36 +02:00
Joachim Wiberg ecc1e24ba9 board/common: bundle helpful README in release tarballs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 07:54:45 +02:00
1113 changed files with 55080 additions and 15260 deletions
+36
View File
@@ -0,0 +1,36 @@
Checklists for Pull Requests and Releases
=========================================
Maintainer checklists for reviewing pull requests and doing releases.
Pull Requests
-------------
- If applicable, is there a readable ChangeLog entry?
- If any LICENSE file has been updated, has the `.hash` file been updated?
- If any change to a Finit `.svc` file, does any run/task linger?
I.e., is there a runlevel and/or condition defined to prevent them
from running outside of their intended runlevel?
- If any change to grub or qemu/qeneth setup, has it been tested in GNS3?
- If any change to u-boot/buildroot, has it been tested with `<booloader>_defconfig`
- If any change to logging, have the resulting logs been audited?
- Check for duplicate entries, misspellings
- Check for sneaky severity changes, e.g., error vs note, error vs warning
- If new subsystem, or major changes to a subsystem, have the docs been updated?
- If change to mDNS, has it been tested with netbrowse?
- If change to `_defconfig`, verify `local.mk` and sync with other archs
- Test manually as well, e.g., CLI changes do not have ha regression tests
- Build from distclean, or use artifacts built by build servers, for manual tests
Releases
--------
- Make at least one -betaN release to verify the GitHub workflow well in time release day
- Stuff happens, remember kernelkit/infix#735
- Make at least one -rcN to flush out any issues in customer repos
- Easy to forget adaptations/hacks in customer repos -- may need Infix change/support
- Ensure the markdown link for the release diff is updated
- Ensure subrepos are tagged (can be automated, see kernelkit/infix#393)
- Sync tags for all repo. sync activities
+126 -29
View File
@@ -1,25 +1,49 @@
Contributing to Infix
=====================
Contributing Guidelines
=======================
We welcome any and all help in the form of bug reports, fixes, patches
to add new features -- *preferably as GitHub pull requests*.
Thank :heart: you for taking the time to read this!
If you are unsure of what to do, or how to implement an idea or bug fix,
open an issue with `"[RFC]: Unsure if this is a bug ... ?"`, or use the
[GitHub discussions forum](https://github.com/orgs/kernelkit/discussions).
Talking about code and problems first is often the best way to get started
before submitting a pull request.
We welcome any help in the form of bug reports, fixes, or patches to add
new features. We *prefer* GitHub pull requests, but are open to other
forms of collaboration as well. [Let's talk!][support] :handshake:
When submitting a bug report, patch, or pull request, please start by
stating the version the change is made against, what it does, *and why*.
If you are unsure how to start implementing an idea or fix:
- :bug: open an issue, there are human friendly templates for _bugs_
and _feature requests_ at <https://github.com/kernelkit/infix/issues>
- :speech_balloon: use the [Q&A Forum][discuss]
- :technologist: The [Developer's Guide][devguide] is also a useful start
> _Talking about code and problems first is often the best way to get
> started before submitting a pull request. We have found it always
> saves time, yours and ours._
:sparkles: General Guidelines
-----------------------------
When submitting bug reports or patches to bugs, please state which
version the change is made against, what it does, and, more importantly
*why* -- from your perspective, why is it a bug, why does the code need
changing in this way. Start with why.
- :bug: Bug reports need metadata like Infix version or commit hash
- :adhesive_bandage: Bug fixes also need version, and (preferably) a
corresponding issue number for the ChangeLog
- :new: New features, you need to get approval of the YANG model first!
:speech_balloon: Please use the [Forum][discuss], e.g., category:
*Ideas*, or open a :pray: feature request issue
- :white_check_mark: New features also need new regression tests, this
can be basic tests or more complex use-case tests comprising multiple
subsystems, see [Testing Changes](#test_tube-testing-changes), below
Please take care to ensure you follow the project coding style and the
commit message format. If you follow these recommendations you help
the maintainer(s) and make it easier for them to include your code.
the maintainers and make it easier for them to include your code.
Coding Style
------------
:woman_technologist: Coding Style
---------------------------------
Before jumping into code, remember to **document new features** and bug
fixes. Both the manual and ChangeLog are in the `doc/` sub-directory
@@ -40,23 +64,58 @@ We expect code contributions for:
> code! Legacy takes precedence, and remember, we read code a lot more
> than write it, so legibility is important.
As a final note, lines are allowed to be longer than 72 characters these
days. There is no enforced maximum, but the team usually keep it around
100 characters for both C and Python.
The ChangeLog deserves a separate mention:
- Releases are listed in reverse chronological order order, so the
latest/next release is at the beginning of the file
- Only *user-facing bugs and features* are detailed, so code refactor,
new tests, etc. are not listed.
- Add your changes/features to the Changes section
- Add your Fix line in the Fixes section, in numeric order
- Changes and fixes without an issue number are listed after all
numbered ones
- YANG model changes are documented in their respective model, for
standard models, e.g., for `ietf-interfaces.yang`, the corresponding
`infix-interfaces.yang` detail augments/deviations as revisions.
A final note, lines of code are allowed to be longer than 72 characters
these days, unless you live by PEP-8 (see above). There is no enforced
maximum, but the team usually keep it around 100 characters for both C
and Python.
Commit Messages
---------------
:test_tube: Testing Changes
---------------------------
Please test your changes, no matter how trivial or obviously correct
they may seem. Nobody is infallible, making mistakes is only human.
It is also the best insurance policy for your feature, it ensures your
use-case will remain functional as the source base evolves.
For new functionality we expect new regression tests to be added in
the same pull request.
For help getting started with testing, see the following resources:
- [Developer's Guide][devguide]
- [Regression Testing][testing]
:memo: Commit Messages
----------------------
Commit messages exist to track *why* a change was made. Try to be as
clear and concise as possible in your commit messages, and always, be
proud of your work and set up a proper GIT identity for your commits:
<img src="../doc/jack.png" width=70 align="right">
$ git config --global user.name "Jacky Linker"
$ git config --global user.email jacky.linker@example.com
Example commit message from the [Pro Git][gitbook] online book, notice
how `git commit -s` is used to automatically add a `Signed-off-by`:
Example commit message from one of many [online guides][cbeams]. Use
`git commit -s` to automatically add a `Signed-off-by` for proof of
origin, see [DCO][] for more info.
subsystem: brief, but clear and concise summary of changes
@@ -73,20 +132,58 @@ how `git commit -s` is used to automatically add a `Signed-off-by`:
- Typically a hyphen or asterisk is used for the bullet, preceded
by a single space, with blank lines in between, but conventions
vary here
If you use an issue tracker, put references to them at the bottom,
like this:
Resolves: #123
See also: #456, #789
Signed-off-by: Jacky Linker <jacky.linker@example.com>
This is an example of how to [automatically close][closing] an issue
when the commit is merged to mainline. Several keywords are available.
Code of Conduct
---------------
:twisted_rightwards_arrows: Pull Requests
-----------------------------------------
> _The git repository is the canonical location for information._
A pull request should preferably address a single issue or change. This
may of course include multiple related changes, but what is important to
remember is the bandwidth of the maintainers. A smaller well documented
PR is more likely to get attention quicker in some reviewer's busy day.
Well documented here means that each commit message stands on its own,
telling the complete story of the change. In fact each commit should,
as much as possible, be independent of other changes. This is very
important, not only when digging though logs to understand why a piece
of code exists, but also when bisecting a problem -- each single commit
should also compile and be possible to run.
If you've worked on projects that send patches, like the Linux kernel or
Buildroot, consider the pull request message body similar to the cover
letter for a series of patches -- it's a summary of changes, and it is
lost when the changes are merged to the mainline branch.
:balance_scale: Code of Conduct
-------------------------------
It is expected of everyone to respect the [Code of Conduct][conduct].
The *"maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, discussion forum threads, issues, and
other contributions that are not aligned to this Code of Conduct."*
[Linux]: https://www.kernel.org/doc/html/v6.9/process/coding-style.html
[PEP-8]: https://peps.python.org/pep-0008/
[RDD]: https://tom.preston-werner.com/2010/08/23/readme-driven-development
[gitbook]: https://git-scm.com/book/ch5-2.html
[conduct]: CODE-OF-CONDUCT.md
[support]: https://github.com/kernelkit/infix/blob/main/.github/SUPPORT.md
[discuss]: https://github.com/orgs/kernelkit/discussions
[testing]: https://github.com/kernelkit/infix/blob/main/doc/testing.md
[devguide]: https://github.com/kernelkit/infix/blob/main/doc/developers-guide.md
[Linux]: https://www.kernel.org/doc/html/v6.9/process/coding-style.html
[PEP-8]: https://peps.python.org/pep-0008/
[RDD]: https://tom.preston-werner.com/2010/08/23/readme-driven-development
[cbeams]: https://cbea.ms/git-commit/#seven-rules
[conduct]: CODE-OF-CONDUCT.md
[DCO]: https://developercertificate.org/
[closing]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests
+12 -1
View File
@@ -1 +1,12 @@
Paid support and development provided by Addiva Elektronik <https://addiva.se>
Limited free support is only available using the online resources of the
project on GitHub, and Discord, see <https://github.com/kernelkit>:
&nbsp;&nbsp; :speech_balloon: <https://github.com/orgs/kernelkit/discussions>
&nbsp;&nbsp; :bug: <https://github.com/kernelkit/infix/issues>
Support contracts, development of new features, fast-tracking of reviews
and contributions, customer branding of Infix, and even customer specific
features for dedicated products is provided by _Wires_.
&nbsp;&nbsp; :globe_with_meridians: <https://www.wires.se>
&nbsp;&nbsp; :e-mail: <mailto:infix@wires.se>
+4 -7
View File
@@ -5,12 +5,6 @@
-- Remember: assign a reviewer, or use @mentions if org. member.
-->
## Other information
<!-- Other relevant info, e.g., before/after screenshots -->
## Checklist
Tick *relevant* boxes, this PR is-a or has-a:
@@ -23,9 +17,12 @@ Tick *relevant* boxes, this PR is-a or has-a:
- [ ] Regression tests added?
- [ ] ChangeLog updates (for next release)
- [ ] Documentation added?
- [ ] Test changes
- [ ] Checked in changed Readme.adoc (make test-spec)
- [ ] Added new test to group Readme.adoc and yaml file
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (please detail in commit messages)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] ChangeLog updated (for major changes)
- [ ] Other (please describe):
@@ -0,0 +1,16 @@
name: Adds all issues to project Infix & C:o
on:
issues:
types:
- opened
jobs:
add-to-project:
name: Add issue to project Infix&co
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/kernelkit/projects/3
github-token: ${{ secrets.ADD_TO_PROJECT }}
+33
View File
@@ -22,6 +22,8 @@ jobs:
matrix:
target: [aarch64, x86_64]
fail-fast: false
outputs:
build_id: ${{ steps.vars.outputs.INFIX_BUILD_ID }}
steps:
- name: Cleanup Build Folder
run: |
@@ -38,6 +40,16 @@ jobs:
- name: Set Build Variables
id: vars
run: |
if [ -n "${{ github.event.pull_request.head.sha }}" ]; then
# Since PRs are built from an internally generated merge
# commit, reverse lookups of PRs and/or commits from
# image version information are cumbersome. Therefore:
# explicitly set a build id that references both the PR
# and the commit.
printf "INFIX_BUILD_ID=pr%d.%.7s\n" \
"${{ github.event.number }}" "${{ github.event.pull_request.head.sha }}" \
| tee -a $GITHUB_OUTPUT $GITHUB_ENV
fi
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ "${{ github.event.inputs.minimal }}" == "true" ]; then
flavor="_minimal"
@@ -132,6 +144,11 @@ jobs:
- name: Set Build Variables
id: vars
run: |
if [ -n "${{ needs.build.outputs.build_id }}" ]; then
echo "INFIX_BUILD_ID=${{ needs.build.outputs.build_id }}" \
>>$GITHUB_ENV
fi
if [ "$GITHUB_REF_NAME" != "main" ]; then
flavor="_minimal"
else
@@ -166,6 +183,22 @@ jobs:
if: always()
run: cat test/.log/last/result-gh.md >> $GITHUB_STEP_SUMMARY
- name: Generate Test Report for x86_64${{ steps.vars.outputs.flv }}
# Ensure this runs even if Regression Test fails
if: always()
run: |
asciidoctor-pdf \
--theme test/9pm/report/theme.yml \
-a pdf-fontsdir=test/9pm/report/fonts \
test/.log/last/report.adoc \
-o test/.log/last/report.pdf
- name: Upload Test Report as Artifact
uses: actions/upload-artifact@v4
with:
name: test-report
path: test/.log/last/report.pdf
release:
if: ${{github.repository_owner == 'kernelkit' && github.ref_name == 'main'}}
name: Upload Latest Build
+6 -2
View File
@@ -87,8 +87,8 @@ jobs:
ln -s ${{ steps.vars.outputs.dir }} images
tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
mv legal-info legal-info-$target
tar chfz legal-info-$target.tar.gz legal-info-$target
mv legal-info legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}
tar chfz legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}.tar.gz legal-info-${{ matrix.target }}-${{ steps.vars.outputs.ver }}
- uses: actions/upload-artifact@v4
with:
@@ -101,6 +101,7 @@ jobs:
runs-on: [ self-hosted, release ]
permissions:
contents: write
discussions: write
steps:
- uses: actions/checkout@v4
with:
@@ -115,12 +116,14 @@ jobs:
ver=${GITHUB_REF#refs/tags/}
fi
echo "ver=${ver}" >> $GITHUB_OUTPUT
echo "cat=" >> $GITHUB_OUTPUT
if echo $ver | grep -qE 'v[0-9.]+(-alpha|-beta|-rc)[0-9]*'; then
echo "pre=true" >> $GITHUB_OUTPUT
echo "latest=false" >> $GITHUB_OUTPUT
elif echo $ver | grep -qE '^v[0-9.]+\.[0-9.]+(\.[0-9]+)?$'; then
echo "pre=false" >> $GITHUB_OUTPUT
echo "latest=true" >> $GITHUB_OUTPUT
echo "cat=Releases" >> $GITHUB_OUTPUT
else
echo "pre=false" >> $GITHUB_OUTPUT
echo "latest=false" >> $GITHUB_OUTPUT
@@ -150,6 +153,7 @@ jobs:
name: Infix ${{ github.ref_name }}
prerelease: ${{ steps.rel.outputs.pre }}
makeLatest: ${{ steps.rel.outputs.latest }}
discussionCategory: ${{ steps.rel.outputs.cat }}
bodyFile: release.md
artifacts: "*.tar.gz*"
-28
View File
@@ -1,28 +0,0 @@
# To enable automatic sync of your Infix fork every day, or on dispatch,
# set the repoistory or organisation variable (not secret):
#
# SYNC_FORK = true
#
# You also need a GH_SYNC_REPO token allowed to update workflows. For
# more information on variables and secrets, see the GitHub docs.
# See https://docs.github.com/en/actions/learn-github-actions/variables
name: Synchronize your fork of Infix with upstream
on:
schedule:
- cron: 42 2 * * *
workflow_dispatch:
jobs:
sync_fork:
if: ${{github.repository_owner != 'kernelkit' && vars.SYNC_FORK == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: TobKed/github-forks-sync-action@master
with:
github_token: ${{ secrets.GH_SYNC_REPO }}
upstream_repository: KernelKit/infix
upstream_branch: main
target_branch: main
force: false
tags: true
+1
View File
@@ -8,3 +8,4 @@
/test/.venv
/test/.log
/local.mk
/test/spec/Readme.adoc
+11
View File
@@ -52,6 +52,17 @@ config INFIX_IMAGE_ID
Mandatory. When INFIX_RELEASE is set, this string is appended to
the IMAGE_ID with a '-' separator.
config INFIX_COMPATIBLE
string "Operating system compatible string"
default "${INFIX_IMAGE_ID}"
help
A lower-case string (no spaces or other characters outside of 09,
az, ".", "_" and "-"), used for image identification at upgrade.
E.g., the RAUC [system] compatible string.
Mandatory. Defaults to $INFIX_IMAGE_ID, which in turn is composed
of $INFIX_ID-$BR2_ARCH.
config INFIX_TAGLINE
string "Operating system tagline"
default "Infix -- a Network Operating System"
+7 -7
View File
@@ -27,13 +27,13 @@ it maintenance-free. Configuration and data, e.g, containers, is stored
on separate partitions to ensure complete separation from system files
and allow for seamless backup, restore, and provisioning.
In itself Infix is perfectly suited for dedicated networking tasks and
native support for Docker containers provides a versatile platform that
can easily be adapted to any customer need. Be it legacy applications,
network protocols, process monitoring, or edge data analysis, it can run
close to end equipment. Either directly connected on dedicated Ethernet
ports or indirectly using virtual network cables to exist on the same
LAN as other connected equipment.
In itself, Infix is perfectly suited for dedicated networking tasks, and
with native support for Docker containers, the operating system provides
a versatile platform that can easily be adapted to any customer need.
Be it legacy applications, network protocols, process monitoring, or
edge data analysis, it can run close to end equipment. Either directly
connected on dedicated Ethernet ports or indirectly using virtual
network cables to exist on the same LAN as other connected equipment.
The simple design of Infix provides complete control over both system
and data, minimal cognitive burden, and makes it incredibly easy to get
+4
View File
@@ -128,5 +128,9 @@ SD-card partition.
> If possible, serve `infix-aarch64.pkg` over HTTP instead, as
> libcurl's TFTP implementation is quite slow.
## Console Port
The console port runs at 115200 baud, 8N1.
[release]: https://github.com/kernelkit/infix/releases
[mvebu64boot]: https://github.com/addiva-elektronik/mvebu64boot
+13 -3
View File
@@ -34,6 +34,10 @@ CONFIG_PROFILING=y
CONFIG_ARCH_SPARX5=y
CONFIG_ARCH_MVEBU=y
CONFIG_ARCH_VEXPRESS=y
CONFIG_ARM64_ERRATUM_2441007=y
CONFIG_ARM64_ERRATUM_1286807=y
CONFIG_ARM64_ERRATUM_1542419=y
CONFIG_ARM64_ERRATUM_2441009=y
CONFIG_ARM64_VA_BITS_48=y
CONFIG_SCHED_MC=y
CONFIG_NR_CPUS=64
@@ -57,6 +61,7 @@ CONFIG_MODULE_UNLOAD=y
CONFIG_KSM=y
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_CMA=y
CONFIG_CMA_AREAS=7
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_XDP_SOCKETS=y
@@ -165,7 +170,6 @@ CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
CONFIG_BPFILTER=y
CONFIG_BRIDGE=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
@@ -227,6 +231,7 @@ CONFIG_SCSI_SAS_ATA=y
CONFIG_SCSI_VIRTIO=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_SATA_MOBILE_LPM_POLICY=0
CONFIG_SATA_AHCI_PLATFORM=y
CONFIG_AHCI_MVEBU=y
CONFIG_PATA_OF_PLATFORM=y
@@ -282,6 +287,7 @@ CONFIG_NET_DSA_MV88E6XXX_PTP=y
CONFIG_MVNETA=m
CONFIG_MVPP2=m
# CONFIG_NET_VENDOR_MELLANOX is not set
# CONFIG_NET_VENDOR_META is not set
# CONFIG_NET_VENDOR_MICREL is not set
CONFIG_SPARX5_SWITCH=y
# CONFIG_NET_VENDOR_MICROSEMI is not set
@@ -353,13 +359,14 @@ CONFIG_SERIAL_XILINX_PS_UART=y
CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
CONFIG_SERIAL_MVEBU_UART=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_CN10K=m
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_GPIO=y
CONFIG_I2C_MUX_PCA954x=y
CONFIG_I2C_MUX_PINCTRL=y
CONFIG_I2C_DESIGNWARE_PLATFORM=y
CONFIG_I2C_DESIGNWARE_CORE=y
CONFIG_I2C_MV64XXX=y
CONFIG_I2C_SLAVE=y
CONFIG_SPI=y
@@ -495,6 +502,7 @@ CONFIG_EXTCON_USB_GPIO=y
CONFIG_IIO=y
CONFIG_TI_ADC081C=y
CONFIG_PWM=y
CONFIG_RESET_GPIO=y
CONFIG_PHY_MVEBU_CP110_COMPHY=y
CONFIG_PHY_MVEBU_CP110_UTMI=y
CONFIG_PHY_SAMSUNG_USB2=y
@@ -523,13 +531,13 @@ CONFIG_9P_FS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_SECURITY=y
CONFIG_LSM="landlock,lockdown,yama,loadpin,safesetid,bpf"
CONFIG_CRYPTO_CCM=m
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y
CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=0
@@ -539,6 +547,8 @@ CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_TIMEOUT=20
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_RCU_TRACE is not set
+8 -1
View File
@@ -101,6 +101,13 @@ Worth noting, unlike many other boards, the Rockchip family of chipsets
runs the UART at 1500000 bps (1.5 Mbps) 8N1.
Console Port
------------
Unlike many other boards, the NanoPi R2S console, and in fact all
Rockchip family chipsets, runs at 1500000 bps (1.5 Mbps) 8N1.
Secure Boot
-----------
@@ -128,7 +135,7 @@ what provides a default, the same default MAC addresses to Linux:
This is important in case you want to run multiple R2S devices on the
same LAN. Meaning you either have to change the MAC address in the
U-Boot environment (below), or modify your `phys-address` setting in
U-Boot environment (below), or use the `custom-phys-address` setting in
Infix for the interface(s).
Break into U-Boot using Ctrl-C at power-on, preferably when the text
@@ -58,6 +58,7 @@
}
},
"ietf-netconf-acm:nacm": {
"enable-nacm": true,
"groups": {
"group": [
{
@@ -83,6 +84,21 @@
"comment": "Allow 'admin' group complete access to all operations and data."
}
]
},
{
"name": "default-deny-all",
"group": [
"*"
],
"rule": [
{
"name": "deny-password-read",
"module-name": "ietf-system",
"path": "/ietf-system:system/authentication/user/password",
"access-operations": "*",
"action": "deny"
}
]
}
]
},
@@ -123,7 +139,8 @@
"name": "ntp.org",
"udp": {
"address": "pool.ntp.org"
}
},
"iburst": true
}
]
},
@@ -169,7 +186,7 @@
]
},
"infix-meta:meta": {
"infix-meta:version": "1.0"
"infix-meta:version": "1.2"
},
"infix-services:mdns": {
"enabled": true
-1
View File
@@ -1 +0,0 @@
styx-a.dtb
+130
View File
@@ -0,0 +1,130 @@
Welcome to Infix!
=================
Nice to meet ❤️ you! If you are reading this then you have possibly
just downloaded and unpacked a release build and are curious about how
to proceed from here.
To test Infix You need a Linux 🐧 system with Qemu or GNS3 installed.
We recommend Debian based systems, like Ubuntu and Linux Mint.
> For a pain-free experience we recommend enabling CPU virtualization in
> your BIOS/UEFI, which for many computers is disabled by default.
From this point we assume you have your x86_64/AMD64 based Linux system
up and running. Time to start your favorite terminal application! 😃
Installing Qemu
---------------
This README focus on getting you started with Qemu. From a terminal,
install (at least) the x86/x86_64 emulator. The 'virt-manager' is a
package that helps pull in other dependencies you may need:
$ sudo apt install qemu-system-x86 virt-manager
That's it.
Running Infix in Qemu
---------------------
Depending on how your Linux installation is set up, the following may
require being run with superuser privileges, i.e., you may need to
repend the command with 'sudo'.
$ ./qemu.sh
You should now see the Infix init system booting up. When the final
"Please press Enter to activate this console." is shown, press Enter
and the login: prompt is displayed.
The default credentials for the demo builds is
login: admin
password: admin
Infix -- a Network Operating System v24.09.0-rc1 (hvc0)
infix-00-00-00 login: admin
Password:
.-------.
| . . | Infix -- a Network Operating System
|-. v .-| https://kernelkit.org
'-'---'-'
Run the command 'cli' for interactive OAM
admin@infix-00-00-00:~$
You're in! Play around in your sandbox as much as you like, if you
run into problems or have questions, please see the documentation,
and don't hesitate to get in touch with us! 😃
- https://github.com/kernelkit/infix/tree/main/doc
Customizing your "Hardware"
---------------------------
For more Ethernet ports in your emulated system you need to change the
Qemu configuration used for Infix. This can be done using a menuconfig
interface, which requires the following extra package:
$ sudo apt install kconfig-frontends
We can now enter the configuration:
$ ./qemu.sh -c
Go down to *Networking*, select *TAP*, now you can change the *Number of
TAPs*, e.g. to 10. Exit and save the configuration, then you can start
Qemu again:
./qemu.sh
> Make sure to do a factory reset from the CLI, otherwise you will be
> stuck with that single interface from before.
Errors on Console
-----------------
If you see the following line printed one or more times, don't panic.
LABEL=var: Can't lookup blockdev
See the Customizing section above. To silence the error you need to
create another writable partition for Infix to store logs, container
images, etc. Look for the 'var' keyword, you can adjust the size of
the partition.
Graphical Network Simulator 3 (GNS3)
------------------------------------
GNS3 is a very powerful front-end to Qemu which takes care of creating
virtual links between network devices running in Qemu. This README is
only link to the material you need. This directory holds the appliance
file, .gns3a, that references image files also in this directory, that
you need to load into GNS3.
The necessary extra packages are available through the offical PPA. If
you don't know what a PPA is, read up on that first:
- https://launchpad.net/~gns3/+archive/ubuntu/ppa
There's a lot of tutorials and guides online, start here:
- https://docs.gns3.com/docs/
About
-----
Infix is a free, Linux based, immutable Network Operating System (NOS)
built on Buildroot, and sysrepo. A powerful mix that ease porting to
different platforms, simplify long-term maintenance, and provide easy
management using NETCONF, RESTCONF, or the built-in command line
interface (CLI) from a console or SSH login.
+6 -6
View File
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.36.0
# Thu Feb 8 08:22:32 2024
# Busybox version: 1.36.1
# Tue Oct 22 13:12:02 2024
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -957,10 +957,10 @@ CONFIG_FEATURE_NETSTAT_PRG=y
CONFIG_NSLOOKUP=y
CONFIG_FEATURE_NSLOOKUP_BIG=y
CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y
CONFIG_NTPD=y
CONFIG_FEATURE_NTPD_SERVER=y
CONFIG_FEATURE_NTPD_CONF=y
CONFIG_FEATURE_NTP_AUTH=y
# CONFIG_NTPD is not set
# CONFIG_FEATURE_NTPD_SERVER is not set
# CONFIG_FEATURE_NTPD_CONF is not set
# CONFIG_FEATURE_NTP_AUTH is not set
CONFIG_PING=y
CONFIG_PING6=y
CONFIG_FEATURE_FANCY_PING=y
+11 -2
View File
@@ -16,13 +16,22 @@ die()
# DISK_IMAGE_SIZE="512"
# etc.
#
# Nested variables, like INFIX_COMPATIBLE="${INFIX_IMAGE_ID}"
# are handled by sourcing the file in a subshell.
#
# shellcheck disable=SC1090
load_cfg()
{
tmp=$(mktemp -p /tmp)
(
. "$BR2_CONFIG" 2>/dev/null
# Set *all* matching variables
set | grep -E "^${1}[^=]*=" | while IFS= read -r line; do
echo "$line"
done
) > "$tmp"
grep -E "${1}.*=" "$BR2_CONFIG" >"$tmp"
. "$tmp"
rm "$tmp"
}
+1 -3
View File
@@ -2,8 +2,6 @@
set -e
GIT_VERSION=$(git -C "$BR2_EXTERNAL_INFIX_PATH" describe --always --dirty --tags)
name=$1
compat=$2
sign=$3
@@ -26,7 +24,7 @@ cp -f "$BINARIES_DIR/rootfs.itbh" "$work/rootfs.itbh"
cat >"$work/manifest.raucm" <<EOF
[update]
compatible=${compat}
version=${GIT_VERSION}
version=${INFIX_VERSION}
[bundle]
format=verity
+6 -22
View File
@@ -39,22 +39,6 @@ if [ -n "${ID_LIKE}" ]; then
ID="${ID} ${ID_LIKE}"
fi
if [ -z "$GIT_VERSION" ]; then
infix_path="$BR2_EXTERNAL_INFIX_PATH"
if [ -n "$INFIX_OEM_PATH" ]; then
# Use version from br2-external OEM:ing Infix
infix_path="$INFIX_OEM_PATH"
fi
GIT_VERSION=$(git -C "$infix_path" describe --always --dirty --tags)
fi
# Override VERSION in /etc/os-release and filenames for release builds
if [ -n "$INFIX_RELEASE" ]; then
VERSION="$INFIX_RELEASE"
else
VERSION=$GIT_VERSION
fi
if [ -n "$INFIX_IMAGE_ID" ]; then
NAME="$INFIX_IMAGE_ID"
else
@@ -62,7 +46,7 @@ else
fi
if [ -f "$TARGET_DIR/etc/rauc/system.conf" ]; then
sed -i "s/compatible=.*/compatible=$NAME/" "$TARGET_DIR/etc/rauc/system.conf"
sed -i "s/compatible=.*/compatible=$INFIX_COMPATIBLE/" "$TARGET_DIR/etc/rauc/system.conf"
fi
# This is a symlink to /usr/lib/os-release, so we remove this to keep
@@ -71,12 +55,12 @@ rm -f "$TARGET_DIR/etc/os-release"
{
echo "NAME=\"$INFIX_NAME\""
echo "ID=$INFIX_ID"
echo "PRETTY_NAME=\"$INFIX_TAGLINE $VERSION\""
echo "PRETTY_NAME=\"$INFIX_TAGLINE $INFIX_VERSION\""
echo "ID_LIKE=\"${ID}\""
echo "DEFAULT_HOSTNAME=$BR2_TARGET_GENERIC_HOSTNAME"
echo "VERSION=\"${VERSION}\""
echo "VERSION_ID=${VERSION}"
echo "BUILD_ID=\"${GIT_VERSION}\""
echo "VERSION=\"${INFIX_VERSION}\""
echo "VERSION_ID=${INFIX_VERSION}"
echo "BUILD_ID=\"${INFIX_BUILD_ID}\""
if [ -n "$INFIX_IMAGE_ID" ]; then
echo "IMAGE_ID=\"$INFIX_IMAGE_ID\""
fi
@@ -102,7 +86,7 @@ rm -f "$TARGET_DIR/etc/os-release"
fi
} > "$TARGET_DIR/etc/os-release"
echo "$INFIX_TAGLINE $VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version"
echo "$INFIX_TAGLINE $INFIX_VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version"
# In case of ambguities, this is what the image was built from
cp "$BR2_CONFIG" "$TARGET_DIR/usr/share/infix/config"
+8 -2
View File
@@ -7,11 +7,14 @@ common=$(dirname "$(readlink -f "$0")")
# shellcheck disable=SC1091
. "$TARGET_DIR/etc/os-release"
load_cfg INFIX_ID
# The INFIX_* variables may be composed from BR2_* variables,
# so we source them last.
load_cfg BR2_ARCH
load_cfg BR2_DEFCONFIG
load_cfg BR2_EXTERNAL_INFIX_PATH
load_cfg BR2_TARGET_ROOTFS
load_cfg INFIX_ID
load_cfg INFIX_COMPATIBLE
# The default IMAGE_ID is infix-$BR2_ARCH but can be overridden
# for imaage names, and compat strings, like infix-r2s
@@ -39,7 +42,7 @@ if [ "$SIGN_ENABLED" = "y" ]; then
$common/sign.sh $BR2_ARCH $SIGN_KEY
ixmsg "Creating RAUC Update Bundle"
$common/mkrauc.sh "$NAME$(ver)" $NAME $SIGN_KEY
$common/mkrauc.sh "$NAME$(ver)" $INFIX_COMPATIBLE $SIGN_KEY
fi
load_cfg DISK_IMAGE
@@ -102,3 +105,6 @@ rm -f "$BINARIES_DIR/qemu.cfg"
CONFIG_="CONFIG_" BR2_CONFIG="$BINARIES_DIR/qemu.cfg" \
"$O/build/buildroot-config/conf" --olddefconfig "$BINARIES_DIR/Config.in"
rm -f "$BINARIES_DIR/qemu.cfg.old" "$BINARIES_DIR/.config.old"
# Quick intro for beginners, with links to more information
cp "$BR2_EXTERNAL_INFIX_PATH/board/common/README.txt" "$BINARIES_DIR/"
+58 -1
View File
@@ -106,6 +106,8 @@ config QEMU_DTB_EXTEND
depends on QEMU_LOADER_UBOOT
default y if QEMU_aarch64
if QEMU_ROOTFS_INITRD
config QEMU_RW
string "Writable /cfg layer"
depends on QEMU_ROOTFS_INITRD
@@ -123,6 +125,8 @@ config QEMU_RW_VAR
default "var.ext4"
endif
endif
config QEMU_VPD
bool "Emulate a Vital Product Data (VPD) Memory"
@@ -137,10 +141,55 @@ config QEMU_APPEND
config QEMU_EXTRA
string "Extra QEMU options"
comment "RTC"
choice
prompt "Mode"
default QEMU_RTC_UTC
config QEMU_RTC_UTC
bool "UTC"
config QEMU_RTC_LOCAL
bool "Local time"
config QEMU_RTC_RANDOM
bool "Random"
endchoice
choice
prompt "Clock"
default QEMU_CLOCK_HOST
config QEMU_CLOCK_HOST
bool "Host clock"
config QEMU_CLOCK_RT
bool "Independent (monotonic)"
config QEMU_CLOCK_VM
bool "Virtual"
endchoice
config QEMU_RTC
string
default "utc" if QEMU_RTC_UTC
default "localtime" if QEMU_RTC_LOCAL
default "random" if QEMU_RTC_RANDOM
config QEMU_CLOCK
string
default "host" if QEMU_CLOCK_HOST
default "rt" if QEMU_CLOCK_RT
default "vm" if QEMU_CLOCK_VM
comment "Networking"
choice
prompt "Mode"
prompt "Network Mode"
default QEMU_NET_USER
config QEMU_NET_NONE
@@ -155,6 +204,9 @@ config QEMU_NET_USER
config QEMU_NET_TAP
bool "TAP"
config QEMU_NET_ROCKER
bool "Rocker"
endchoice
config QEMU_NET_MODEL
@@ -180,3 +232,8 @@ config QEMU_NET_TAP_N
int "Number of TAPs"
depends on QEMU_NET_TAP
default 1
config QEMU_NET_PORTS
int "Number of Rocker switch ports"
depends on QEMU_NET_ROCKER
default 10
+95 -28
View File
@@ -17,9 +17,10 @@
#
# ./qemu.sh -h
#
# shellcheck disable=SC3037
# Local variables
imgdir=$(readlink -f $(dirname "$0"))
imgdir=$(readlink -f "$(dirname "$0")")
prognm=$(basename "$0")
usage()
@@ -30,6 +31,7 @@ usage()
echo "Options:"
echo " -c Run menuconfig to change Qemu settings"
echo " -h This help text"
echo " -k Keep generated qemu.run script (name shown at end)"
echo
echo "Arguments:"
echo " ARGS1 Args before the '--' separator are for kernel space"
@@ -54,19 +56,20 @@ die()
load_qemucfg()
{
local tmp=$(mktemp -p /tmp)
tmp=$(mktemp -p /tmp)
grep ^CONFIG_QEMU_ $1 >$tmp
. $tmp
rm $tmp
grep ^CONFIG_QEMU_ "$1" >"$tmp"
# shellcheck disable=SC1090
. "$tmp"
rm "$tmp"
[ "$CONFIG_QEMU_MACHINE" ] || die "Missing QEMU_MACHINE"
[ "$CONFIG_QEMU_ROOTFS" ] || die "Missing QEMU_ROOTFS"
[ "$CONFIG_QEMU_KERNEL" -a "$CONFIG_QEMU_BIOS" ] \
[ -n "$CONFIG_QEMU_KERNEL" ] && [ -n "$CONFIG_QEMU_BIOS" ] \
&& die "QEMU_KERNEL conflicts with QEMU_BIOS"
[ ! "$CONFIG_QEMU_KERNEL" -a ! "$CONFIG_QEMU_BIOS" ] \
[ -z "$CONFIG_QEMU_KERNEL" ] && [ -z "$CONFIG_QEMU_BIOS" ] \
&& die "QEMU_KERNEL or QEMU_BIOS must be set"
}
@@ -93,7 +96,7 @@ append_args()
if [ "$CONFIG_QEMU_ROOTFS_INITRD" = "y" ]; then
# Size of initrd, rounded up to nearest kb
local size=$((($(stat -c %s $CONFIG_QEMU_ROOTFS) + 1023) >> 10))
size=$((($(stat -c %s "$CONFIG_QEMU_ROOTFS") + 1023) >> 10))
echo -n "root=/dev/ram0 ramdisk_size=${size} "
elif [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
echo -n "root=PARTLABEL=primary "
@@ -198,13 +201,24 @@ host_args()
net_dev_args()
{
local name="e$1"
local mac=$(printf "02:00:00:00:00:%02x" $1)
name="e$1"
mac=$(printf "02:00:00:00:00:%02x" "$1")
echo -n "-device $CONFIG_QEMU_NET_MODEL,netdev=$name,mac=$mac "
echo "$name $mac" >>"$mactab"
}
rocker_port_args()
{
sw=$1
port=$2
name="sw${sw}p${port}"
mac=$(printf "02:00:00:00:%02x:%02x" "$sw" "$port")
echo -n "-netdev tap,id=$name,ifname=$name,script=no,downscript=no "
echo "$name $mac" >> "$mactab"
}
net_args()
{
# Infix will pick up this file via fwcfg and install it to /etc
@@ -216,14 +230,25 @@ net_args()
echo -n "-netdev bridge,id=e1,br=$CONFIG_QEMU_NET_BRIDGE_DEV "
net_dev_args 1
elif [ "$CONFIG_QEMU_NET_TAP" = "y" ]; then
for i in $(seq 1 $(($CONFIG_QEMU_NET_TAP_N))); do
for i in $(seq 1 "$CONFIG_QEMU_NET_TAP_N"); do
echo -n "-netdev tap,id=e$i,ifname=qtap$i "
net_dev_args $i
net_dev_args "$i"
done
elif [ "$CONFIG_QEMU_NET_ROCKER" = "y" ]; then
sw=sw0 # Only single switch support atm.
echo -n "-device '{\"driver\":\"rocker\", \"name\":\"${sw}\", "
echo -n "\"fp_start_macaddr\":\"02:00:00:00:00:01\", "
echo -n "\"ports\":["
for i in $(seq 1 "$CONFIG_QEMU_NET_PORTS"); do
[ "$i" -gt 1 ] && echo -n ", "
echo -n "\"${sw}p${i}\""
done
echo -n "]}' "
for i in $(seq 1 "$CONFIG_QEMU_NET_PORTS"); do
rocker_port_args 0 "$i"
done
elif [ "$CONFIG_QEMU_NET_USER" = "y" ]; then
local useropts=
[ "$CONFIG_QEMU_NET_USER_OPTS" ] && useropts=",$CONFIG_QEMU_NET_USER_OPTS"
echo -n "-netdev user,id=e1${useropts} "
net_dev_args 1
else
@@ -261,7 +286,25 @@ EOF
wdt_args()
{
echo -n "-device i6300esb -rtc clock=host"
echo -n "-device i6300esb "
}
random_date()
{
rand=$(($(date +%_s) * $$ + $(date +%N | sed 's/^0*//')))
when=$((rand % 7258118400)) # 1970 - 2200
date -d "@$when" +"%Y-%m-%dT%H:%M:%S"
}
rtc_args()
{
rtc="${CONFIG_QEMU_RTC:-utc}"
clock="${CONFIG_QEMU_CLOCK:-host}"
if [ "$rtc" = "random" ]; then
rtc=$(random_date)
fi
echo -n "-rtc base=$rtc,clock=$clock"
}
gdb_args()
@@ -273,11 +316,18 @@ gdb_args()
run_qemu()
{
if [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
qemu-img create -f qcow2 -o backing_file=$CONFIG_QEMU_ROOTFS -F raw $CONFIG_QEMU_ROOTFS.qcow2 > /dev/null
if ! qemu-img check "${CONFIG_QEMU_ROOTFS}.qcow2"; then
rm -f "${CONFIG_QEMU_ROOTFS}.qcow2"
fi
if [ ! -f "${CONFIG_QEMU_ROOTFS}.qcow2" ]; then
echo "Creating qcow2 disk image for Qemu ..."
qemu-img create -f qcow2 -o backing_file="$CONFIG_QEMU_ROOTFS" \
-F raw "${CONFIG_QEMU_ROOTFS}.qcow2" > /dev/null
fi
fi
local qemu
read qemu <<EOF
$CONFIG_QEMU_MACHINE -m $CONFIG_QEMU_MACHINE_RAM \
read -r qemu <<EOF
$CONFIG_QEMU_MACHINE -nodefaults -m $CONFIG_QEMU_MACHINE_RAM \
$(loader_args) \
$(rootfs_args) \
$(serial_args) \
@@ -286,15 +336,32 @@ run_qemu()
$(host_args) \
$(net_args) \
$(wdt_args) \
$(rtc_args) \
$(vpd_args) \
$(gdb_args) \
$CONFIG_QEMU_EXTRA
EOF
# Save resulting command to a script, because I cannot for the life
# of me figure out how to embed the JSON snippet for Rocker and run
# it here without issues, spent way too much time on it -- Joachim
run=$(mktemp -t run.qemu.XXX)
echo "#!/bin/sh" > "$run"
if [ "$CONFIG_QEMU_KERNEL" ]; then
$qemu -append "$(append_args)" "$@"
echo "$qemu -append \"$(append_args)\" $*" >> "$run"
else
$qemu "$@"
echo "$qemu $*" >> "$run"
fi
chmod +x "$run"
echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
line=$(stty -g)
stty raw
$run
stty "$line"
if [ -n "$keep" ]; then
echo "Keeping generated qemu.run script: $run"
else
rm "$run"
fi
}
@@ -331,7 +398,7 @@ generate_dot()
hostports="<qtap1> qtap1"
targetports="<e1> e1"
edges="host:qtap1 -- target:e1 [kind=mgmt];"
for tap in $(seq 2 $(($CONFIG_QEMU_NET_TAP_N - 1))); do
for tap in $(seq 2 $((CONFIG_QEMU_NET_TAP_N - 1))); do
hostports="$hostports | <qtap$tap> qtap$tap "
targetports="$targetports | <e$tap> e$tap "
edges="$edges host:qtap$tap -- target:e$tap;"
@@ -371,7 +438,8 @@ menuconfig()
exec kconfig-mconf Config.in
}
cd $(dirname $(readlink -f "$0"))
scriptdir=$(dirname "$(readlink -f "$0")")
cd "$scriptdir" || (echo "Failed cd to $scriptdir"; exit 1)
while [ "$1" != "" ]; do
case $1 in
@@ -381,6 +449,9 @@ while [ "$1" != "" ]; do
-h)
usage
;;
-k)
keep=true
;;
*)
break
esac
@@ -401,8 +472,4 @@ fi
generate_dot
echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
line=$(stty -g)
stty raw
run_qemu $(dtb_args)
stty "$line"
+2
View File
@@ -0,0 +1,2 @@
# --log-level debug
OSPFD_ARGS="-A 127.0.0.1 -u frr -g frr -f /etc/frr/ospfd.conf --log syslog"
+1
View File
@@ -0,0 +1 @@
RAUC_ARGS="-s"
+2
View File
@@ -0,0 +1,2 @@
# --log-level debug
ZEBRA_ARGS="-A 127.0.0.1 -u frr -g frr --log syslog "
+9 -6
View File
@@ -3,16 +3,19 @@
# and similar events feed servers and configuration to dnsmasq.
domain-needed
# Only listen to loopback (local system)
interface=lo
bind-dynamic
#listen-address=127.0.0.1,::1
# Allow configuration and cache clear over D-Bus
enable-dbus
# Disable the following dnsmasq default DHCP options
#dhcp-option=option:netmask
#dhcp-option=28 # option:broadcast
#dhcp-option=option:domain-name
dhcp-option=option:router
dhcp-option=option:dns-server
dhcp-option=12 # option:hostname
# Generated by openresolv
resolv-file=/var/lib/misc/resolv.conf
# Include all files in a directory which end in .conf
conf-dir=/etc/dnsmasq.d/,*.conf
@@ -1,4 +1,4 @@
service :%i pid:!/run/k8s-logger-%i.pid <usr/container:%i> \
[2345] k8s-logger -cni %i -f local1 /run/containers/%i.fifo -- Logger for container %i
sysv :%i pid:!/run/container:%i.pid <pid/k8s-logger:%i> log kill:10 \
task name:container-%i :setup \
[2345] container -n %i setup -- Setup container %i
sysv <!usr/container:%i> :%i pid:!/run/container:%i.pid log:prio:local1,tag:%i kill:10 \
[2345] container -n %i -- container %i
@@ -0,0 +1,9 @@
# A single mstpd instance can manage multiple bridges, which are
# dynamically added/removed by the kernel via the /sbin/bridge-stp
# usermode helper. We use a manual service so that confd can
# enable/disable it without an initctl barrier, since it needs to
# already be running when a bridge interface with spanning tree
# enabled is created.
service env:-/etc/default/mstpd manual:yes \
[S0123456789] mstpd $MSTPD_ARGS -- Spanning Tree daemon
@@ -0,0 +1,4 @@
# Use <pid/syslogd> as barrier for other system tasks and service that
# rely on modules, firmware, and device nodes to be ready.
service if:udevd nowarn env:-/etc/default/sysklogd <run/udevadm:post/success> \
[S0123456789] syslogd -F $SYSLOGD_ARGS -- System log daemon
+1
View File
@@ -0,0 +1 @@
../available/mstpd.conf
+1
View File
@@ -0,0 +1 @@
/var/lib/dbus/machine-id
@@ -1,2 +1 @@
alias cli='clish'
alias cfg='sysrepocfg -f json'
@@ -1,3 +0,0 @@
HostKey /var/lib/ssh/ssh_host_rsa_key
HostKey /var/lib/ssh/ssh_host_ecdsa_key
HostKey /var/lib/ssh/ssh_host_ed25519_key
@@ -1,3 +0,0 @@
net.ipv4.ip_forward=1
net.ipv4.ip_forward_update_priority=0
net.ipv6.conf.all.forwarding=1
@@ -1 +1,32 @@
# Router defaults
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.lo.rp_filter=0
net.ipv4.icmp_errors_use_inbound_ifaddr=1
net.ipv4.conf.all.ignore_routes_with_linkdown=1
# Use neigh information on selection of nexthop for multipath hops
net.ipv4.fib_multipath_use_neigh=1
# Sane ARP defaults for a switch/router
net.ipv4.conf.default.arp_announce=2
net.ipv4.conf.all.arp_announce=2
net.ipv4.conf.default.arp_notify=1
net.ipv4.conf.all.arp_notify=1
net.ipv4.conf.default.arp_ignore=1
net.ipv4.conf.all.arp_ignore=1
# IP Routing
net.ipv4.ip_forward=1
net.ipv4.ip_forward_update_priority=0
net.ipv4.conf.all.forwarding=0
net.ipv4.conf.default.forwarding=0
# Multicast group subscriptions
net.ipv4.igmp_max_memberships=1000
net.ipv4.neigh.default.mcast_solicit=10
@@ -1,5 +1,18 @@
# Router defaults
net.ipv6.route.max_size=131072
net.ipv6.conf.all.ignore_routes_with_linkdown=1
# IP Routing
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.default.forwarding=0
# IPv6 SLAAC
net.ipv6.conf.all.autoconf=0
net.ipv6.conf.default.autoconf=0
# Keep permanent addresses on an admin down
net.ipv6.conf.all.keep_addr_on_down=1
net.ipv6.conf.default.keep_addr_on_down=1
# Multicast group subscriptions
net.ipv6.mld_max_msf=512
+145
View File
@@ -0,0 +1,145 @@
Many of the defaults here are are taken from the Frr recommendations [1].
Below are relevant excerpts from the kernel documentation.
accept_ra, accept Router Advertisements; autoconfigure using them, also
determines whether or not to transmit Router Solicitations.
If and only if the functional setting is to accept Router
Advertisements, Router Solicitations will be transmitted.
0 - Do not accept Router Advertisements.
1 - Accept Router Advertisements if forwarding is disabled.
2 - Overrule forwarding behaviour. Accept Router Advertisements even
if forwarding is enabled.
Default:
- enabled if local forwarding is disabled
- disabled if local forwarding is enabled
accept_ra_pinfo, learn Prefix Information in Router Advertisement.
Default:
- enabled if accept_ra is enabled
- disabled if accept_ra is disabled
autoconf, autoconfigure IPv6 addresses using Prefix Information in
Router Advertisements.
Default:
- enabled if accept_ra_pinfo is enabled
- disabled if accept_ra_pinfo is disabled
arp_announce, define restriction level for announcing the local source
address from IP packets in ARP requests sent on interface:
0 - (default) Use any local address, configured on any interface
1 - Try to avoid local addresses that are not in the targets subnet
for this interface. Useful when target hosts reachable via this
interface require the source IP address in ARP requests to be part
of their logical network configured on the receiving interface.
When we generate the request we will check all our subnets that
include the target IP and will preserve the source address if it
is from such subnet. If there is no such subnet we select source
address according to the rules for level 2.
2 - Always use the best local address for this target. In this mode we
ignore the source address in the IP packet and try to select local
address that we prefer for talks with the target host. Such local
address is selected by looking for primary IP addresses on all our
subnets on the outgoing interface that include the target address.
If no suitable local address is found we select the first local
address we have on the outgoing interface or on all other
interfaces, with the hope we will receive reply for our request
and even sometimes no matter the source IP address we announce.
arp_notify, define mode for notification of address and device changes.
0 - (default): do nothing
1 - generate gratuitous arp requests when device is brought up or
hardware address changes.
arp_ignore, define different modes for sending replies in response to
received ARP requests that resolve local target addresses:
0 - (default): reply for any local target IP address, configured on
any interface
1 - reply only if the target IP address is a local address configured
on the incoming interface
2 - reply only if the target IP address is local address configured on
the incoming interface and both with the senders IP address are part
from same subnet on this interface
3 - do not reply for local addresses configured with scope host, only
resolutions for global and link addresses are replied
4-7 - reserved
8 - do not reply for all local addresses
arp_accept, define behavior for accepting gratuitous ARP (garp) frames
from devices that are not already present in the ARP table:
0 - dont create new entries in the ARP table
1 - create new entries in the ARP table
2 - create new entries only if the source IP address is in the same
subnet as an address configured on the interface that received
the garp message.
Both replies and requests type gratuitous arp will trigger the ARP
table to be updated, if this setting is on. If the ARP table already
contains the IP address of the gratuitous arp frame, the arp table
will be updated regardless if this setting is on or off.
icmp_errors_use_inbound_ifaddr
0 - (default): icmp error messages are sent with the primary address
of the exiting interface.
1 - the message will be sent with the primary address of the interface
that received the packet that caused the icmp error. This is the
behaviour many network administrators will expect from a router.
And it can make debugging complicated network layouts much easier.
Note, if no primary address exists for the interface selected, then
the primary address of the first non-loopback interface that has one
will be used regardless of this setting.
rp_filter, reverse path source filtering:
0 - (default): no source validation.
1 - Strict mode as defined in RFC3704, 'Strict Reverse Path'. Each
incoming packet is tested against the FIB and if the interface is
not the best reverse path the packet check will fail. By default
failed packets are discarded.
2 - Loose mode as defined in RFC3704, 'Loose Reverse Path'. Each
incoming packets source address is also tested against the FIB
and if the source address is not reachable via any interface the
packet check will fail.
Current recommended practice in RFC3704 is to enable strict mode to
prevent IP spoofing from DDos attacks. If using asymmetric routing or
other complicated routing, then loose mode is recommended.
The max value from conf/{all,interface}/rp_filter is used when doing
source validation on the {interface}.
[1]: https://github.com/FRRouting/frr/blob/master/doc/user/Useful_Sysctl_Settings.md
+58
View File
@@ -0,0 +1,58 @@
#!/bin/sh
# User-friendly wrapper for sysrepocfg
# TODO: add import/export, copy, ...
# Edit YANG binary types using sysrepo, base64, and duct tape.
edit()
{
xpath=$1
if [ -z "$xpath" ]; then
echo "Usage: cfg edit \"/full/xpath/to/binary/leaf\""
exit 1
fi
if tmp=$(sysrepocfg -G "$xpath"); then
file=$(mktemp)
echo "$tmp" | base64 -d > "$file"
if /usr/bin/editor "$file"; then
tmp=$(base64 -w0 < "$file")
sysrepocfg -S "$xpath" -u "$tmp"
fi
rm -f "$file"
else
echo "Failed to retrieve value for $xpath"
exit 1
fi
}
usage()
{
echo "Usage:"
echo " cfg CMD [ARG]"
echo
echo "Command:"
echo " edit XPATH Edit YANG binary type"
echo " help This help text"
echo
echo "As a backwards compatible fallback, this script forwards"
echo "all other commands as options to sysrepocfg."
echo
exit 0
}
cmd=$1; shift
case $cmd in
edit)
edit "$1"
;;
help)
usage
;;
*)
set -- "$cmd" "$@"
exec sysrepocfg -f json "$@"
;;
esac
-1
View File
@@ -1 +0,0 @@
less
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
# -d ;; suppress error message "the terminal is dumb"
# -F :: exit if the entire file can be displayed on the first screen
# -I :: Ignore case, even for patterns
# -K :: exit immediately when an interrupt character (usually ^C) is typed
# -R :: Almost raw control charachters, only ANSI color escape sequences and
# OSC 8 hyperlink sequences are output. Allows veritcal scrolling
# -X :: No termcap initialization and deinitialization set to the terminal.
# This is what leaves the contents of the output on screen.
export LESS="-P %f (press h for help or q to quit)"
export LANG=en_US.UTF-8
less -RIKd -FX "$@"
+49
View File
@@ -70,12 +70,14 @@ options:
-p Show plain output, no bells or whistles
commands:
dhcp Show DHCP server
port PORT Show port configuration and link information
ports Show ports available for bridging
vlans Show port groups in bridge
ifaces Show interfaces and their addresses
fdb Show forwarding database (unicast)
mdb Show multicast forwarding database
stp Show spanning tree status
ip addr Show IPv4 addresses
route Show routing table
ipv6 addr Show IPv6 addresses
@@ -87,6 +89,41 @@ commands:
EOF
}
is_dhcp_running()
{
sysrepocfg -X -f json -m infix-dhcp-server | jq -r '
."infix-dhcp-server:dhcp-server".enabled as $global |
if ."infix-dhcp-server:dhcp-server".subnet? then
(."infix-dhcp-server:dhcp-server".subnet[] |
select(.enabled != false)) |
if $global != false and . then "true" else "false" end
else "false" end
' 2>/dev/null | grep -q true
}
dhcp()
{
if ! is_dhcp_running; then
echo "DHCP server not enabled."
exit 0
fi
case $1 in
detail)
sysrepocfg -f json -X -d operational -m infix-dhcp-server | \
jq -C .
;;
stat*)
sysrepocfg -f json -X -d operational -m infix-dhcp-server | \
/usr/libexec/statd/cli-pretty "show-dhcp-server" -s
;;
*)
sysrepocfg -f json -X -d operational -m infix-dhcp-server | \
/usr/libexec/statd/cli-pretty "show-dhcp-server"
;;
esac
}
# Usage 1: show port eth0
# Usage 2: show port
# Usage 3: show ports
@@ -188,6 +225,12 @@ rstp()
mstpctl showport br0
}
stp()
{
sysrepocfg -f json -X -d operational -m ietf-interfaces | \
/usr/libexec/statd/cli-pretty "show-bridge-stp"
}
fdb()
{
bridge $bopt fdb show
@@ -288,6 +331,9 @@ case $cmd in
help)
usage
;;
dhcp | dhcp-server)
dhcp $*
;;
port*)
ports $*
;;
@@ -353,6 +399,9 @@ case $cmd in
span*)
rstp
;;
stp*)
stp
;;
sys*)
system
;;
@@ -0,0 +1,9 @@
# Extend finit's default udevadm settle synchronization for situations
# where device are very slow to probe (see #685)
run nowarn if:udevd cgroup.init <service/udevd/ready> log \
[S] /usr/libexec/infix/hw-wait -- Probing hardware
# Now that everything should be probed, do a final pass over the
# uevent queue before starting syslogd and everything else
run nowarn if:udevd cgroup.init :post <service/udevd/ready> log \
[S] udevadm settle -t 30 --
@@ -0,0 +1,6 @@
d /run/containers/args 0700 - -
d /run/containers/files 0700 - -
d /var/lib/containers 0700 - -
d /var/lib/containers/oci 0700 - -
d /run/cni 0755 - -
L+ /var/lib/cni - - - - /run/cni
@@ -1 +1,2 @@
d /var/run/frr 0755 frr frr -
R /var/tmp/frr - - - -
+41
View File
@@ -0,0 +1,41 @@
#!/bin/sh
# (Ab)use the kernel's device link subsystem to detect consumer side
# devices that may be very slow to probe (looking at you, mv88e6xxx!).
ident=$(basename "$0")
report()
{
if [ -r "/tmp/$ident" ]; then
logger -k -p "user.$1" -t "$ident" "Waited for slow devices:"
sort "/tmp/$ident" | uniq -c | logger -k -p "user.$1" -t "$ident"
fi
rm -f "/tmp/$ident"
}
for _ in $(seq 50); do
again=
for dl in /sys/class/devlink/*; do
[ -r "$dl/status" ] || continue
status=$(cat "$dl/status")
if [ "$status" = "consumer probing" ]; then
basename "$(readlink "$dl/consumer")" >>"/tmp/$ident"
again=yes
fi
done
if [ -z "$again" ]; then
report notice
exit 0
fi
sleep .2
done
logger -k -p user.error -t "$ident" "Timeout waiting for devices to come online"
report error
exit 1
@@ -8,10 +8,11 @@ import struct
import subprocess
import sys
onieprom = importlib.machinery.SourceFileLoader("onieprom","/bin/onieprom").load_module()
SYSTEM_JSON = "/run/system.json"
onieprom = importlib.machinery.SourceFileLoader("onieprom", "/bin/onieprom").load_module()
SYSTEM_JSON = "/run/system.json"
KKIT_IANA_PEM = 61046
class DTSystem:
BASE = "/sys/firmware/devicetree/base"
INFIX = BASE + "/chosen/infix"
@@ -28,7 +29,9 @@ class DTSystem:
if not os.path.exists(phandle):
continue
ph, = struct.unpack(">L", open(phandle, "rb").read())
with open(phandle, "rb") as f:
data = f.read()
ph, = struct.unpack(">L", data)
dt[ph] = root
sys = {}
@@ -40,14 +43,18 @@ class DTSystem:
if not os.path.exists(phandle):
continue
ph, = struct.unpack(">L", open(phandle, "rb").read())
with open(phandle, "rb") as f:
data = f.read()
ph, = struct.unpack(">L", data)
if ph not in sys:
sys[ph] = []
sys[ph].append(root)
phs = set(list(dt.keys()) + list(sys.keys()))
self.devs = { ph: [Device(ph, dt.get(ph), s if s is not None else "") for s in (sys.get(ph) or []) if ph is not None] for ph in phs }
self.devs = {ph: [Device(ph, dt.get(ph), s if s is not None else "")
for s in (sys.get(ph) or []) if ph is not None]
for ph in phs}
self.base = Device(0, None, DTSystem.BASE)
self.infix = Device(0, None, DTSystem.INFIX)
@@ -56,7 +63,8 @@ class DTSystem:
if not os.path.exists(path):
return ()
data = open(path, "rb").read()
with open(path, "rb") as f:
data = f.read()
elems = len(data) // struct.calcsize(">L")
return struct.unpack(">" + elems * "L", data)
@@ -69,7 +77,8 @@ class DTSystem:
return {}
try:
data = onieprom.from_tlv(open(dev.attrpath("nvmem"), "rb", 0))
with open(dev.attrpath("nvmem"), "rb", 0) as f:
data = onieprom.from_tlv(f)
except:
data = {}
@@ -84,14 +93,18 @@ class DTSystem:
}
def infix_usb_devices(self, out):
names=self.infix.str_array("usb-port-names", ())
phs=self.__get_phandle_array("usb-ports")
data=dict(zip(names,phs))
names = self.infix.str_array("usb-port-names", ())
phs = self.__get_phandle_array("usb-ports")
data = dict(zip(names, phs))
if data != {}:
out["usb-ports"] = []
for name,ph in data.items():
[out["usb-ports"].extend([{"name": name, "path": dev.attrpath("authorized")}, {"name": name, "path": dev.attrpath("authorized_default")}]) for dev in self.devices_from_ph(ph)]
for name, ph in data.items():
[out["usb-ports"].extend([{
"name": name,
"path": dev.attrpath("authorized")}, {
"name": name,
"path": dev.attrpath("authorized_default")
}]) for dev in self.devices_from_ph(ph)]
def infix_devices(self, kind):
phs = self.__get_phandle_array(kind)
@@ -101,6 +114,7 @@ class DTSystem:
flat_devices = [device for sublist in self.infix_devices("vpds") for device in sublist]
return [self.into_vpd(device) for device in flat_devices]
class QEMUSystem:
BASE = "/sys/firmware/qemu_fw_cfg"
REV = BASE + "/rev"
@@ -110,7 +124,8 @@ class QEMUSystem:
data = {}
if os.path.exists(QEMUSystem.VPD):
try:
data = onieprom.from_tlv(open(QEMUSystem.VPD, "rb", 0))
with open(QEMUSystem.VPD, "rb", 0) as f:
data = onieprom.from_tlv(f)
except:
pass
@@ -127,31 +142,27 @@ class QEMUSystem:
def usb_ports(self):
ports = [
{
"name": "USB",
"path": "/sys/bus/usb/devices/usb1/authorized"
},
{
"name": "USB",
"path": "/sys/bus/usb/devices/usb1/authorized_default"
},
{
"name": "USB2",
"path": "/sys/bus/usb/devices/usb2/authorized"
},
{
"name": "USB2",
"path": "/sys/bus/usb/devices/usb2/authorized_default"
}]
"name": "USB",
"path": "/sys/bus/usb/devices/usb1/authorized"
}, {
"name": "USB",
"path": "/sys/bus/usb/devices/usb1/authorized_default"
}, {
"name": "USB2",
"path": "/sys/bus/usb/devices/usb2/authorized"
}, {
"name": "USB2",
"path": "/sys/bus/usb/devices/usb2/authorized_default"
}]
return ports
class Device:
def __init__(self, ph, dtpath, syspath):
self.ph, self.dtpath, self.syspath = ph, dtpath, syspath
def available(self):
return self.syspath != None
return self.syspath is not None
def __getitem__(self, attr):
return self.attr(attr).decode("utf-8").strip("\0")
@@ -159,7 +170,6 @@ class Device:
def __setitem__(self, attr, value):
return self.attr(attr, val=value.encode("utf-8"))
def attrpath(self, attr):
return os.path.join(self.syspath, attr)
@@ -168,13 +178,16 @@ class Device:
def attr(self, attr, default=None, val=None):
if not self.hasattr(attr):
return default if val == None else False
return default if val is None else False
if val:
open(self.attrpath(attr), "wb").write(value)
with open(self.attrpath(attr), "wb") as f:
f.write(val)
return True
return open(self.attrpath(attr), "rb").read()
with open(self.attrpath(attr), "rb") as f:
data = f.read()
return data
def str(self, attr, default=None):
val = self.attr(attr)
@@ -194,7 +207,9 @@ class Device:
if not self.hasdtattr(attr):
return default
return open(self.dtattrpath(attr), "rb").read()
with open(self.dtattrpath(attr), "rb") as f:
data = f.read()
return data
def dtstr(self, attr, default=None):
val = self.dtattr(attr)
@@ -212,6 +227,7 @@ def vpd_get_json_ve(vpd, pem):
return out
def vpd_get_pwhash(vpd):
if not vpd.get("trusted"):
return None
@@ -219,8 +235,9 @@ def vpd_get_pwhash(vpd):
kkit = vpd_get_json_ve(vpd, KKIT_IANA_PEM)
return kkit.get("pwhash")
def vpd_inject(out, vpds):
out["vpd"] = { vpd["board"]: vpd for vpd in vpds }
out["vpd"] = {vpd["board"]: vpd for vpd in vpds}
product = out["vpd"].get("product", {}).get("data", {})
hoistattrs = ("vendor", "product-name", "part-number", "serial-number", "mac-address")
@@ -234,6 +251,7 @@ def vpd_inject(out, vpds):
out["factory-password-hash"] = pwhash
break
def qemu_base_mac():
"""Find MAC address of first non-loopback interface, subtract with 1"""
base_path = '/sys/class/net'
@@ -244,7 +262,8 @@ def qemu_base_mac():
continue
try:
# pylint: disable=invalid-name
with open(os.path.join(base_path, iface, 'address'), 'r', encoding='ascii') as f:
fn = os.path.join(base_path, iface, 'address')
with open(fn, 'r', encoding='ascii') as f:
mac = f.read().strip()
interfaces.append((mac, iface))
except FileNotFoundError:
@@ -261,6 +280,7 @@ def qemu_base_mac():
return None
def probe_qemusystem(out):
"""Probe Qemu based test systems and 'make run'"""
admin_hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A"
@@ -288,6 +308,7 @@ def probe_qemusystem(out):
subprocess.run("initctl -nbq cond set qemu".split(), check=False)
return 0
def probe_dtsystem(out):
"""Probe DTS based system, expects a VPD in ONIE PROM format."""
dtsys = DTSystem()
@@ -297,6 +318,8 @@ def probe_dtsystem(out):
if model:
out["product-name"] = model
out["compatible"] = dtsys.base.str_array("compatible")
staticpw = dtsys.infix.str("factory-password-hash")
if not out["factory-password-hash"]:
out["factory-password-hash"] = staticpw
@@ -304,6 +327,7 @@ def probe_dtsystem(out):
vpd_inject(out, vpds)
return 0
def main():
out = {
"vendor": None,
@@ -338,5 +362,6 @@ def main():
shutil.chown(SYSTEM_JSON, user="root", group="wheel")
return err
if __name__ == "__main__":
sys.exit(main())
@@ -1,22 +1,48 @@
#!/bin/sh
# Find and install any product specific files in /etc before bootstrap
# Find, install, and run product specific files and script in /etc
# before resuming bootstrap.
#
# Use /etc/product/init.d/S01-myscript for scripts, may be a symlink, it
# will be called with `start` as its only argument.
#
# The compatible array is listed in the same order as the device tree,
# most significant to least. Hence the reverse.[], to ensure overrides
# are applied in order of significance.
ident=$(basename "$0")
PRODUCT_INIT=/etc/product/init.d
PREFIXD=/usr/share/product
PRODUCT=$(jq -r '."product-name" | ascii_downcase' /run/system.json)
COMPATIBLES=$(jq -r '.compatible | reverse.[] | ascii_downcase' /run/system.json)
note()
{
logger -I $$ -k -p user.notice -t "$ident" "$1"
}
DIR="$PREFIXD/$PRODUCT"
if [ -z "$PRODUCT" ] || [ ! -d "$DIR" ]; then
note "No vendor/product specific directory found, using built-in defaults."
exit 0
found=false
for PRODUCT in $COMPATIBLES; do
DIR="$PREFIXD/$PRODUCT"
if [ -d "$DIR" ]; then
note "Using vendor/product-specific defaults for $PRODUCT."
for dir in "$DIR"/*; do
[ -d "$dir" ] && cp -a "$dir" /
done
found=true
fi
done
if [ "$found" = false ]; then
note "No vendor/product-specific directory found, using built-in defaults."
fi
note "Using vendor/product specific defaults."
for dir in "$DIR"/*; do
[ -d "$dir" ] && cp -a "$dir" /
done
# Conditions for bootstrap services, this enables product specific
# init scripts to prevent select services from starting.
initctl -nbq cond set led
note "Calling runparts $PRODUCT_INIT/S[0-9]+.* start"
/usr/libexec/finit/runparts -bsp "$PRODUCT_INIT"
# Product specific init done.
initctl -nbq cond set product
exit 0
@@ -46,7 +46,11 @@ while [ "$1" ]; do
[ $txqs -lt 2 ] && continue
[ $txqs -gt 8 ] && txqs=8
tc qdisc add dev $iface root mqprio hw 1 \
num_tc $txqs $(map $txqs) $(queues $txqs) || true
output=$(tc qdisc add dev $iface root mqprio hw 1 \
num_tc $txqs $(map $txqs) $(queues $txqs) 2>&1) || true
if echo "$output" | grep -q "does not support hardware offload"; then
echo "Skipping $iface, hardware offload not supported."
elif [ -n "$output" ]; then
echo "$output"
fi
done
@@ -1,102 +1,16 @@
#!/bin/sh
# Run .cfg migration jq scripts to backup and transform older .cfg files
ident=$(basename "$0")
MIGRATIONS_DIR="/usr/share/confd/migrate"
# Check if /cfg/startup-config.cfg needs to be migrated to new syntax.
# Backup of the original is created in /cfg/backup/ for old versions,
# the migrate tool inserts old version in name before .cfg extension.
CONFIG_FILE="/cfg/startup-config.cfg"
BACKUP_DIR="/cfg/backup"
note()
{
logger -I $$ -k -p user.notice -t "$ident" "$1"
}
err()
{
logger -I $$ -k -p user.err -t "$ident" "$1"
}
file_version()
{
jq -r '
if .["infix-meta:meta"] | has("version") then
.["infix-meta:meta"]["version"]
else
"0.0"
end
' "$1"
}
atoi()
{
echo "$1" | awk -F. '{print $1 * 1000 + $2}'
}
BACKUP_FILE="/cfg/backup/startup-config.cfg"
mkdir -p "$(dirname "$BACKUP_FILE")"
if [ ! -f "$CONFIG_FILE" ]; then
# Nothing to migrate
note "No $(basename "$CONFIG_FILE" .cfg) yet, likely factory reset."
exit 0
fi
cfg_version=$(file_version "$CONFIG_FILE")
current_version=$(atoi "$cfg_version")
# Find the latest version by examining the highest numbered directory
sys_version=$(find "$MIGRATIONS_DIR" -mindepth 1 -maxdepth 1 -type d | sort -V | tail -n1 | xargs -n1 basename)
latest_version=$(atoi "$sys_version")
# Check for downgrade
if [ "$current_version" -gt "$latest_version" ]; then
err "Configuration file $CONFIG_FILE version ($cfg_version) is newer than the latest supported version ($sys_version). Exiting."
exit 1
fi
# If the current version is already the latest, exit the script
if [ "$current_version" -eq "$latest_version" ]; then
note "Configuration is already at the latest version ($sys_version). No migration needed."
elif migrate -cq "$CONFIG_FILE"; then
exit 0
fi
note "Configuration file $CONFIG_FILE is of version $cfg_version, migrating ..."
# Create the backup directory if it doesn't exist
mkdir -p "$BACKUP_DIR"
# Create a backup of the current configuration file
nm=$(basename "$CONFIG_FILE" .cfg)
BACKUP_FILE="$BACKUP_DIR/${nm}-${cfg_version}.cfg"
if cp "$CONFIG_FILE" "$BACKUP_FILE"; then
note "Backup created: $BACKUP_FILE"
else
err "Failed creating backup: $BACKUP_FILE"
exit 1
fi
# Apply the scripts for each version directory in sequence
for version_dir in $(find "$MIGRATIONS_DIR" -mindepth 1 -maxdepth 1 -type d | sort -V); do
dir=$(basename "$version_dir")
version=$(atoi "$dir")
# Step by step upgrade file to latest version
if [ "$current_version" -lt "$version" ]; then
note "Applying migrations for version $dir ..."
# Apply all scripts in the version directory in order
for script in $(find "$version_dir" -type f -name '*.sh' | sort -V); do
note "Calling $script for $CONFIG_FILE ..."
sh "$script" "$CONFIG_FILE"
done
# File now at $version ...
current_version="$version"
fi
done
# Update the JSON file to the latest version
if jq --arg version "$sys_version" '.["infix-meta:meta"] = {"infix-meta:version": $version}' "$CONFIG_FILE" \
> "${CONFIG_FILE}.tmp" && mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"; then
note "Configuration updated to version $sys_version."
else
err "Failed updating configuration to version $sys_version!"
exit 1
fi
migrate -i -b "$BACKUP_FILE" "$CONFIG_FILE"
@@ -1,2 +1,2 @@
#!/bin/sh
exec initctl -bq cond set ixinit-done
exec initctl -bq cond set ixinit
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
# Store and convert RSA PUBLIC/PRIVATE KEYs to be able to use them in
# OpenSSHd.
set -e
NAME="$1"
DIR="$2"
PUBLIC="$3"
PRIVATE="$4"
TMP="$(mktemp)"
echo -e '-----BEGIN RSA PRIVATE KEY-----' > "$DIR/$NAME"
echo "$PRIVATE" >> "$DIR/$NAME"
echo -e '-----END RSA PRIVATE KEY-----' >> "$DIR/$NAME"
echo -e "-----BEGIN RSA PUBLIC KEY-----" > "$TMP"
echo -e "$PUBLIC" >> "$TMP"
echo -e "-----END RSA PUBLIC KEY-----" >> "$TMP"
ssh-keygen -i -m PKCS8 -f "$TMP" > "$DIR/$NAME.pub"
chmod 0600 "$DIR/$NAME.pub"
chmod 0600 "$DIR/$NAME"
chown sshd:sshd "$DIR/$NAME.pub"
chown sshd:sshd "$DIR/$NAME"
+1 -6
View File
@@ -45,11 +45,6 @@ factory_reset()
find /sys/class/leds/ -type l -exec sh -c 'echo 100 > $0/brightness' {} \;
logger $opt -p user.crit -t "$nm" "Resetting to factory defaults."
# Shred all files to prevent restoring contents
find /mnt/cfg -type f -exec shred -zu {} \;
find /mnt/var -type f -exec shred -zu {} \;
# Remove any lingering directories and symlinks as well
rm -rf /mnt/cfg/* /mnt/var/*
logger $opt -p user.crit -t "$nm" "Factory reset complete."
@@ -146,7 +141,7 @@ mount_overlay home "$cfgsrc" /home
mount_overlay root "$cfgsrc" /root
mount_bind "$varsrc" /var
[ "$vlibsrc" ] && mount_bind "$vlibsrc" /var/lib
[ -n "$vlibsrc" ] && mount_bind "$vlibsrc" /var/lib
for tag in $(ls /sys/bus/virtio/devices/*/mount_tag 2>/dev/null); do
if [ "$(cat $tag | tr -d '\0')" = hostfs ]; then
@@ -17,6 +17,13 @@ device
- Initializes auxiliary and configuration filesystems and metadata
- Installs Infix to both primary and secondary partitions
To run this script again (on an already provisioned system), erase the
partition table, reboot and netboot Infix again.
Example:
sudo sgdisk --zap-all /dev/mmcblk0
EOF
}
+224 -59
View File
@@ -1,5 +1,18 @@
#!/bin/sh
# This script can be used to start, stop, create, and delete containers.
# It is what confd use, with the Finit container@.conf template, to set
# up, run, and delete containers.
#
# NOTE: when creating/deleting containers, remember 'initctl reload' to
# activate the changes! In confd this is already handled.
#
DOWNLOADS=/var/lib/containers/oci
BUILTIN=/lib/oci
TMPDIR=/var/tmp
checksum=""
extracted=
timeout=30
dir=""
all=""
env=""
port=""
@@ -10,6 +23,87 @@ log()
logger -I $PPID -t container -p local1.notice -- "$*"
}
err()
{
rc=$1; shift
logger -I $PPID -t container -p local1.err -- "Error: $*"
if [ -n "$extracted" ]; then
if [ -d "$TMPDIR/$dir" ]; then
log "Cleaning up extracted $dir"
rm -rf "$dir"
fi
fi
[ "$rc" -eq 0 ] || exit "$rc"
}
check()
{
file=$1
if [ -z "$checksum" ]; then
log "no checksum to verify $file against, continuing."
return 0
fi
if echo "${checksum} ${file}" | "$cmdsum" -c -s; then
log "$file checksum verified OK."
return 0
fi
got=$("$cmdsum" "${file}" | awk '{print $1}')
log "$file checksum mismatch, got $got, expected $checksum, removing file."
rm -f "$file"
return 1
}
# Fetch an OCI image over ftp/http/https. Use wget for FTP, which curl
# empirically does not work well with. Log progress+ & error to syslog.
fetch()
{
url=$1
file=$(basename "$url")
dst="$DOWNLOADS/$file"
cd "$DOWNLOADS" || return
if [ -e "$file" ]; then
log "$file already available."
if check "$file"; then
echo "$dst"
return 0
fi
fi
log "Fetching $url"
if echo "$url" | grep -qE "^ftp://"; then
cmd="wget -q $url"
elif echo "$url" | grep -qE "^https?://"; then
cmd="curl $creds -sSL --fail -o \"$file\" $url"
else
log "Unsupported URL scheme: $url"
return 1
fi
if out=$(eval "$cmd" 2>&1); then
log "$file downloaded successfully."
if check "$file"; then
echo "$dst"
return 0
fi
fi
# log error message from backend
while IFS= read -r line; do
log "$line"
done <<EOF
$out
EOF
return 1
}
# Unpacks a given oci-archive.tar[.gz] in the current directory. Sanity
# checks, at least one index.json in the top-level dir of the archive.
# If there are more index files, this function does not handle them.
@@ -26,45 +120,74 @@ unpack_archive()
oci-archive:*) # Packed OCI image, .tar or .tar.gz format
file=${image#oci-archive:}
;;
ftp://* | http://* | https://*)
if ! file=$(fetch "$image"); then
return 1
fi
;;
*) # docker://*, docker-archive:*, or URL
echo "$image"
if podman image exists "$image"; then
echo "$image"
return 0
fi
# XXX: use --retry=0 with Podman 5.0 or later.
if ! id=$(podman pull --quiet "$image"); then
log "Failed pulling $image"
return 1
fi
# Echo image name to caller
podman images --filter id="$id" --format "{{.Repository}}:{{.Tag}}"
return 0
;;
esac
if [ ! -e "$file" ]; then
if [ -e "/var/lib/containers/oci/$file" ]; then
file="/var/lib/containers/oci/$file"
elif [ -e "/lib/oci/$file" ]; then
file="/lib/oci/$file"
if [ -e "$DOWNLOADS/$file" ]; then
file="$DOWNLOADS/$file"
elif [ -e "$BUILTIN/$file" ]; then
file="$BUILTIN/$file"
else
log "Error: cannot find OCI archive $file in search path."
exit 1
err 1 "cannot find OCI archive $file in search path."
fi
fi
if [ -d "$file" ]; then
index=$(find "$file" -name index.json)
if [ -z "$index" ]; then
log "Error: cannot find index.json in OCI image $file"
exit 1
err 1 "cannot find index.json in OCI image $file"
fi
else
cd "$TMPDIR" || err 0 "failed cd $TMPDIR, wiill use $(pwd) for OCI archive extraction."
index=$(tar tf "$file" |grep index.json)
if [ -z "$index" ]; then
log "Error: invalid OCI archive, cannot find index.json in $file"
exit 1
err 1 "invalid OCI archive, cannot find index.json in $file"
fi
[ -n "$quiet" ] || log "Extracting OCI archive $file ..."
tar xf "$file" || (log "Error: failed unpacking $file in $(pwd)"; exit 1)
remove=true
tar xf "$file" || err 1 "failed unpacking $file in $(pwd)"
extracted=true
fi
dir=$(dirname "$index")
if echo "$dir" | grep -q ":"; then
if [ -z "$name" ]; then
name="$dir"
fi
sanitized_dir=$(echo "$dir" | cut -d':' -f1)
mv "$dir" "$sanitized_dir" || err 1 "failed renaming $dir to $sanitized_dir"
dir="$sanitized_dir"
fi
[ -n "$quiet" ] || log "Loading OCI image $dir ..."
podman load -qi "$dir" >/dev/null
# Clean up after ourselves
if [ -n "$extracted" ]; then
log "Cleaning up extracted $dir"
rm -rf "$dir"
fi
# Rename image from podman default $dir:latest
if [ -n "$name" ]; then
podman tag "$dir" "$name" >/dev/null
@@ -73,10 +196,6 @@ unpack_archive()
name=$dir
fi
if [ "$remove" = "true" ]; then
rm -rf "$file"
fi
echo "$name"
}
@@ -102,15 +221,18 @@ create()
# Unpack and load docker-archive/oci/oci-archive, returning image
# name, or return docker:// URL for download.
image=$(unpack_archive "$image")
if [ -z "$logging" ]; then
logging="--log-driver k8s-file --log-opt path=/run/containers/$name.fifo"
if ! image=$(unpack_archive "$image"); then
exit 1
fi
args="$args --replace --quiet --cgroup-parent=containers $caps"
if [ -z "$logging" ]; then
logging="--log-driver syslog"
fi
# When we get here we've already fetched, or pulled, the image
args="$args --read-only --replace --quiet --cgroup-parent=containers $caps"
args="$args --restart=$restart --systemd=false --tz=local $privileged"
args="$args $ro $vol $mount $hostname $entrypoint $env $port $logging"
args="$args $vol $mount $hostname $entrypoint $env $port $logging"
pidfn=/run/container:${name}.pid
[ -n "$quiet" ] || log "---------------------------------------"
@@ -134,16 +256,17 @@ create()
fi
# shellcheck disable=SC2048
log "Calling podman create --name $name --conmon-pidfile=$pidfn $args $image $*"
log "podman create --name $name --conmon-pidfile=$pidfn $args $image $*"
if podman create --name "$name" --conmon-pidfile="$pidfn" $args "$image" $*; then
[ -n "$quiet" ] || log "Successfully created container $name from $image"
rm -f "/run/containers/env/${name}.env"
[ -n "$quiet" ] || log "Successfully created container $name from $image"
[ -n "$manual" ] || start "$name"
# Should already be enabled by confd (this is for manual use)
initctl -bnq enable "container@${name}.conf"
exit 0
fi
log "Error: failed creating container $name, please check the configuration."
exit 1
err 1 "failed creating container $name, please check the configuration."
}
delete()
@@ -157,18 +280,27 @@ delete()
exit 1
fi
# Should already be stopped, but if not ...
container stop "$name"
while running "$name"; do
_=$((timeout -= 1))
if [ $timeout -le 0 ]; then
err 1 "timed out waiting for container $1 to stop before deleting it."
fi
sleep 1
done
podman rm -vif "$name" >/dev/null 2>&1
[ -n "$quiet" ] || log "Container $name has been removed."
}
waitfor()
{
timeout=$2
while [ ! -f "$1" ]; do
_=$((timeout -= 1))
if [ $timeout -le 0 ]; then
log "Timeout waiting for $1, aborting!"
exit 1
err 1 "timed out waiting for $1, aborting!"
fi
sleep 1;
done
@@ -236,6 +368,12 @@ netrestart()
done
}
cleanup()
{
log "Received signal, exiting."
exit 1
}
usage()
{
cat <<EOF
@@ -248,6 +386,7 @@ options:
--dns-search LIST Set host lookup search list when creating container
--cap-add CAP Add capability to unprivileged container
--cap-drop CAP Drop capability, for privileged containter
--checksum TYPE:SUM Use md5/sha256/sha512 to verify ftp/http/https archives
-c, --creds USR[:PWD] Credentials to pass to curl -u for remote ops
-d, --detach Detach a container started with 'run IMG [CMD]'
-e, --env FILE Environment variables when creating container
@@ -267,14 +406,15 @@ options:
Syntax: [[ip:][hostPort]:]containerPort[/protocol]
-q, --quiet Quiet operation, called from confd
-r, --restart POLICY One of "no", "always", or "on-failure:NUM"
--read-only Do not create a writable layer
-s, --simple Show output in simplified format
-t, --timeout SEC Set timeout for delete/restart commands, default: 20
-v, --volume NAME:PATH Create named volume mounted inside container on PATH
commands:
create NAME IMAGE NET Create container NAME using IMAGE with networks NET
delete [network] NAME Remove container NAME or network NAME from all containers
exec NAME CMD Run a command inside a container
flush Clean up lingering containers and associated anonymous volumes
find [ifname PID] Find PID of container where '--net IFNAME' currently lives
or, find the name of our IFNAME inside the container @PID
help Show this help text
@@ -285,6 +425,7 @@ commands:
restart [network] NAME Restart a (crashed) container or container(s) using network
run NAME [CMD] Run a container interactively, with an optional command
save IMAGE FILE Save a container image to an OCI tarball FILE[.tar.gz]
setup NAME Create and set up container as a Finit task
shell Start a shell inside a container
show [image | volume] Show containers, images, or volumes
stat Show continuous stats about containers (Ctrl-C aborts)
@@ -307,6 +448,25 @@ while [ "$1" != "" ]; do
shift
caps="$caps --cap-drop=$1"
;;
--checksum)
shift
type="${1%%:*}"
checksum="${1#*:}"
case "$type" in
md5)
cmdsum=md5sum
;;
sha256)
cmdsum=sha256sum
;;
sha512)
cmdsum=sha512sum
;;
*)
err 1 "Unsupported checksum type: $type"
;;
esac
;;
-c | --creds)
shift
creds="-u $1"
@@ -351,7 +511,6 @@ while [ "$1" != "" ]; do
--log-path)
shift
logging="$logging --log-opt path=$1"
log_path="$1"
;;
-m | --mount)
shift
@@ -386,12 +545,13 @@ while [ "$1" != "" ]; do
shift
restart=$1
;;
--read-only)
ro="--read-only=true"
;;
-s | --simple)
simple=true
;;
-t | --timeout)
shift
timeout=$1
;;
-v | --volume)
shift
vol="$vol -v $1"
@@ -408,6 +568,8 @@ if [ -n "$cmd" ]; then
shift
fi
trap cleanup INT TERM
case $cmd in
# Does not work atm., cannot attach to TTY because
# we monitor 'podman start -ai foo' with Finit.
@@ -430,6 +592,10 @@ case $cmd in
exec)
podman exec -it "$@"
;;
flush)
echo "Cleaning up any lingering containers";
podman rm -av
;;
find)
cmd=$1
pid=$2
@@ -455,25 +621,12 @@ case $cmd in
usage
;;
load)
url=$1
name=$2
# shellcheck disable=SC2086
if echo "$url" | grep -q "://"; then
file=$(basename "$url")
curl -k $creds -Lo "$file" "$url"
else
file="$url"
fi
# shellcheck disable=SC2086
name=$(unpack_archive "$file" $name)
name=$(unpack_archive "$1" $2)
[ -n "$name" ] || exit 1
# Show resulting image(s) matching $name
if [ -n "$name" ]; then
podman images -n "$name"
else
exit 1
fi
podman images -n "$name"
;;
locate) # Find where the host's ifname lives
if [ -z "$network" ]; then
@@ -500,7 +653,7 @@ case $cmd in
podman images $all --format "{{.Repository}}:{{.Tag}}"
;;
oci)
find /lib/oci /var/lib/containers/oci -type f 2>/dev/null
find $BUILTIN $DOWNLOADS -type f 2>/dev/null
;;
*)
podman ps $all --format "{{.Names}}"
@@ -542,6 +695,20 @@ case $cmd in
gzip "$file"
fi
;;
setup)
[ -n "$name" ] || err 1 "setup: missing container name."
script=/run/containers/${name}.sh
[ -x "$script" ] || err 1 "setup: $script does not exist or is not executable."
while ! "$script"; do
# Wait for address/route changes, or retry every 60 secods
# shellcheck disable=2162,3045
ip monitor address route | while read -t 60 _; do break; done
# On IP address/route changes, wait a few seconds more to ensure
# the system has ample time to react and set things up for us.
sleep 2
done
;;
shell)
podman exec -it "$1" sh -l
;;
@@ -596,12 +763,10 @@ case $cmd in
else
name=$1
stop "$name"
timeout=20
while running "$name"; do
_=$((timeout -= 1))
if [ $timeout -le 0 ]; then
log "Timeout waiting for container $1 to stop before restarting it."
exit 1
err 1 "timed out waiting for container $1 to stop before restarting it."
fi
sleep 1
done
@@ -627,7 +792,7 @@ case $cmd in
;;
upgrade)
# Start script used to initially create container
script=/var/lib/containers/active/S01-${1}.sh
script=/run/containers/${1}.sh
# Find container image
img=$(podman inspect "$1" | jq -r .[].ImageName)
@@ -658,7 +823,7 @@ case $cmd in
[ -n "$cmd" ] && shift
case $cmd in
prune)
podman volume $force prune
podman volume prune $force
;;
*)
false
@@ -50,7 +50,7 @@ set_dhcp_routes()
# format: dest1/mask gw1 ... destn/mask gwn
set -- $staticroutes
while [ -n "$1" -a -n "$2" ]; do
log "adding route $1 via $2 dev $interface proto dhcp"
log "adding route $1 via $2 metric $metric tag 100"
echo "ip route $1 $2 $metric tag 100" >> "$NEXT"
shift 2
done
@@ -115,7 +115,7 @@ case "$ACTION" in
/usr/sbin/avahi-autoipd -c $interface && /usr/sbin/avahi-autoipd -k $interface
fi
if /bin/ip addr add dev $interface $ip/$subnet $BROADCAST proto 5; then
if /bin/ip addr add dev $interface $ip/$subnet $BROADCAST proto dhcp; then
echo "$ip" > "$IP_CACHE"
fi
if [ -n "$ipv6" ] ; then
+6 -2
View File
@@ -1,4 +1,4 @@
echo "Press Ctrl-C NOW to enter boot menu"
echo "Press Ctrl-C NOW to override the default boot sequence"
if sleep "${ixbootdelay}"; then
run ixbootorder
@@ -7,8 +7,12 @@ if sleep "${ixbootdelay}"; then
reset
fi
bootmenu
if test "${dev_mode}" != "yes"; then
bootmenu
pause "Console shell access PROHIBITED. Press any key to reset..."
reset
fi
echo
echo 'Run "bootmenu" to interactively select a boot device'
echo
+7 -3
View File
@@ -1,16 +1,20 @@
setenv autoload no
if dhcp; then
if test -n "${ipaddr}" || dhcp; then
setenv proto tftp
setenv dltool tftpboot
setenv dlfile "${bootfile}"
if setexpr proto sub "^(http|tftp)://.*" "\\1" "${bootfile}" && setexpr bootfile sub "^(http|tftp)://([^/]+?)/(.*)" "\2:\3"; then
if setexpr proto sub "^(http|tftp)://.*" "\\1" "${bootfile}"; then
if test "${proto}" = "http"; then
setenv dltool wget
setexpr dlfile sub "^http://([^/]+?)/(.*)" "\\1:/\\2" "${bootfile}"
else
setexpr dlfile sub "^tftp://([^/]+?)/(.*)" "\\1:\\2" "${bootfile}"
fi
fi
if ${dltool} ${ramdisk_addr_r} "${bootfile}"; then
if ${dltool} ${ramdisk_addr_r} "${dlfile}"; then
setenv old_fdt_addr ${fdt_addr}
if fdt addr ${ramdisk_addr_r}; then
fdt get value sqoffs /images/rootfs data-position
+7 -2
View File
@@ -33,6 +33,7 @@ CONFIG_KALLSYMS_ALL=y
CONFIG_PROFILING=y
CONFIG_SMP=y
CONFIG_EFI=y
CONFIG_KPROBES=y
# CONFIG_GCC_PLUGINS is not set
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
@@ -144,7 +145,6 @@ CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
CONFIG_BPFILTER=y
CONFIG_BRIDGE=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
@@ -161,12 +161,14 @@ CONFIG_MPLS=y
CONFIG_NET_MPLS_GSO=y
CONFIG_MPLS_ROUTING=m
CONFIG_MPLS_IPTUNNEL=m
CONFIG_NET_SWITCHDEV=y
CONFIG_NET_PKTGEN=y
# CONFIG_WIRELESS is not set
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_LWTUNNEL=y
CONFIG_PCI=y
CONFIG_PCI_MSI=y
CONFIG_UEVENT_HELPER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
@@ -208,6 +210,7 @@ CONFIG_NET_VRF=y
CONFIG_E1000=y
CONFIG_NE2K_PCI=y
CONFIG_8139CP=y
CONFIG_ROCKER=y
# CONFIG_WLAN is not set
CONFIG_INPUT_EVDEV=y
CONFIG_SERIAL_8250=y
@@ -260,7 +263,9 @@ CONFIG_CRYPTO_GCM=y
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_TIMEOUT=20
CONFIG_DETECT_HUNG_TASK=y
CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
# CONFIG_FTRACE is not set
CONFIG_FUNCTION_TRACER=y
CONFIG_UNWINDER_FRAME_POINTER=y
+13 -9
View File
@@ -14,6 +14,7 @@ BR2_INIT_FINIT=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_ROOTFS_MERGED_USR=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
@@ -24,16 +25,11 @@ BR2_TARGET_TZ_INFO=y
BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/rootfs"
BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
BR2_ROOTFS_MERGED_USR=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.52"
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.11"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/linux_defconfig"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="alder/alder styx/styx-a styx/styx-b marvell/armada-3720-espressobin marvell/armada-3720-espressobin-emmc marvell/armada-3720-espressobin-v7 marvell/armada-3720-espressobin-v7-emmc marvell/armada-3720-espressobin-ultra marvell/cn9130-crb-A marvell/cn9130-crb-B microchip/sparx5_pcb135_emmc_no_psci"
BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/dts"
BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y
BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_INFIX_PATH}/board/common/busybox_defconfig"
BR2_PACKAGE_STRACE=y
@@ -80,6 +76,7 @@ BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPTABLES_NFTABLES=y
BR2_PACKAGE_IPUTILS=y
BR2_PACKAGE_LLDPD=y
BR2_PACKAGE_MSTPD=y
BR2_PACKAGE_NETCALC=y
BR2_PACKAGE_NETCAT_OPENBSD=y
BR2_PACKAGE_NETSNMP=y
@@ -109,6 +106,7 @@ BR2_PACKAGE_RAUC=y
BR2_PACKAGE_RAUC_DBUS=y
BR2_PACKAGE_RAUC_GPT=y
BR2_PACKAGE_RAUC_NETWORK=y
BR2_PACKAGE_RAUC_JSON=y
BR2_PACKAGE_SYSKLOGD=y
BR2_PACKAGE_SYSKLOGD_LOGGER=y
BR2_PACKAGE_WATCHDOGD=y
@@ -130,9 +128,14 @@ INFIX_DESC="Infix is a Network Operating System based on Linux. It can be set u
INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_ALDER_ALDER=y
BR2_PACKAGE_MARVELL_CN9130_CRB=y
BR2_PACKAGE_MARVELL_ESPRESSOBIN=y
BR2_PACKAGE_STYX_DCP_SC_28P=y
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_CONFD_TEST_MODE=y
BR2_PACKAGE_CURIOS_HTTPD=y
BR2_PACKAGE_EXECD=y
BR2_PACKAGE_CURIOS_NFTABLES=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_STATD=y
BR2_PACKAGE_FACTORY=y
@@ -140,10 +143,11 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
BR2_PACKAGE_K8S_LOGGER=y
BR2_PACKAGE_KEYACK=y
BR2_PACKAGE_KLISH_PLUGIN_INFIX=y
BR2_PACKAGE_LANDING=y
@@ -159,7 +163,7 @@ BR2_PACKAGE_TETRIS=y
BR2_PACKAGE_ROUSETTE=y
BR2_PACKAGE_LIBINPUT=y
BR2_PACKAGE_HOST_PYTHON_YANGDOC=y
BR2_PACKAGE_TEST_MODE=y
BR2_PACKAGE_RAUC_INSTALLATION_STATUS=y
DISK_IMAGE_BOOT_BIN=y
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
+16 -11
View File
@@ -14,6 +14,7 @@ BR2_INIT_FINIT=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_ROOTFS_MERGED_USR=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
@@ -24,16 +25,11 @@ BR2_TARGET_TZ_INFO=y
BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/rootfs"
BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
BR2_ROOTFS_MERGED_USR=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.52"
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.11"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/linux_defconfig"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="alder/alder styx/styx-a styx/styx-b marvell/armada-3720-espressobin marvell/armada-3720-espressobin-emmc marvell/armada-3720-espressobin-v7 marvell/armada-3720-espressobin-v7-emmc marvell/armada-3720-espressobin-ultra marvell/cn9130-crb-A marvell/cn9130-crb-B microchip/sparx5_pcb135_emmc_no_psci"
BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/dts"
BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y
BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_INFIX_PATH}/board/common/busybox_defconfig"
BR2_PACKAGE_STRACE=y
@@ -75,7 +71,11 @@ BR2_PACKAGE_FRR=y
BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPUTILS=y
BR2_PACKAGE_LLDPD=y
BR2_PACKAGE_MSTPD=y
BR2_PACKAGE_NETCALC=y
BR2_PACKAGE_NGINX=y
BR2_PACKAGE_NGINX_HTTP_SSL_MODULE=y
BR2_PACKAGE_NGINX_HTTP_V2_MODULE=y
BR2_PACKAGE_OPENRESOLV=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_SOCAT=y
@@ -89,6 +89,7 @@ BR2_PACKAGE_RAUC=y
BR2_PACKAGE_RAUC_DBUS=y
BR2_PACKAGE_RAUC_GPT=y
BR2_PACKAGE_RAUC_NETWORK=y
BR2_PACKAGE_RAUC_JSON=y
BR2_PACKAGE_SYSKLOGD=y
BR2_PACKAGE_SYSKLOGD_LOGGER=y
BR2_PACKAGE_WATCHDOGD=y
@@ -110,13 +111,21 @@ INFIX_DESC="Infix is a Network Operating System based on Linux. It can be set u
INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_ALDER_ALDER=y
BR2_PACKAGE_MARVELL_CN9130_CRB=y
BR2_PACKAGE_MARVELL_ESPRESSOBIN=y
BR2_PACKAGE_STYX_DCP_SC_28P=y
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_CONFD_TEST_MODE=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_STATD=y
BR2_PACKAGE_FACTORY=y
BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
@@ -126,12 +135,8 @@ BR2_PACKAGE_LOWDOWN=y
BR2_PACKAGE_MCD=y
BR2_PACKAGE_MDNS_ALIAS=y
BR2_PACKAGE_LIBINPUT=y
BR2_PACKAGE_TEST_MODE=y
BR2_PACKAGE_NGINX=y
BR2_PACKAGE_NGINX_HTTP_SSL_MODULE=y
BR2_PACKAGE_NGINX_HTTP_V2_MODULE=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_ROUSETTE=y
BR2_PACKAGE_RAUC_INSTALLATION_STATUS=y
DISK_IMAGE_BOOT_BIN=y
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
+4 -3
View File
@@ -128,6 +128,7 @@ BR2_PACKAGE_RAUC=y
BR2_PACKAGE_RAUC_DBUS=y
BR2_PACKAGE_RAUC_GPT=y
BR2_PACKAGE_RAUC_NETWORK=y
BR2_PACKAGE_RAUC_JSON=y
BR2_PACKAGE_SYSKLOGD=y
BR2_PACKAGE_SYSKLOGD_LOGGER=y
BR2_PACKAGE_WATCHDOGD=y
@@ -175,7 +176,6 @@ INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_EXECD=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_STATD=y
BR2_PACKAGE_FACTORY=y
@@ -183,10 +183,11 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
BR2_PACKAGE_K8S_LOGGER=y
BR2_PACKAGE_KEYACK=y
BR2_PACKAGE_KLISH_PLUGIN_INFIX=y
BR2_PACKAGE_LANDING=y
@@ -201,7 +202,7 @@ BR2_PACKAGE_PODMAN_DRIVER_VFS=y
BR2_PACKAGE_TETRIS=y
BR2_PACKAGE_ROUSETTE=y
BR2_PACKAGE_HOST_PYTHON_YANGDOC=y
# BR2_PACKAGE_TEST_MODE is not set
BR2_PACKAGE_RAUC_INSTALLATION_STATUS=y
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
# GNS3_APPLIANCE is not set
+7 -6
View File
@@ -11,8 +11,8 @@ BR2_TARGET_GENERIC_ISSUE="Infix by KernelKit"
BR2_INIT_FINIT=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
BR2_ROOTFS_MERGED_USR=y
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_ROOTFS_MERGED_USR=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
@@ -65,9 +65,7 @@ BR2_PACKAGE_UBOOT_TOOLS_FIT_CHECK_SIGN=y
BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=y
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_GUNICORN=y
BR2_PACKAGE_LIBSSH_OPENSSL=y
BR2_PACKAGE_LIBSSH2=y
BR2_PACKAGE_LIBSSH2_OPENSSL=y
BR2_PACKAGE_LIBXCRYPT=y
BR2_PACKAGE_LIBOPENSSL_BIN=y
BR2_PACKAGE_LIBINPUT=y
@@ -90,6 +88,7 @@ BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPTABLES_NFTABLES=y
BR2_PACKAGE_IPUTILS=y
BR2_PACKAGE_LLDPD=y
BR2_PACKAGE_MSTPD=y
BR2_PACKAGE_NETCALC=y
BR2_PACKAGE_NETCAT_OPENBSD=y
BR2_PACKAGE_NETSNMP=y
@@ -119,6 +118,7 @@ BR2_PACKAGE_RAUC=y
BR2_PACKAGE_RAUC_DBUS=y
BR2_PACKAGE_RAUC_GPT=y
BR2_PACKAGE_RAUC_NETWORK=y
BR2_PACKAGE_RAUC_JSON=y
BR2_PACKAGE_SYSKLOGD=y
BR2_PACKAGE_SYSKLOGD_LOGGER=y
BR2_PACKAGE_WATCHDOGD=y
@@ -166,7 +166,7 @@ INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_EXECD=y
# BR2_PACKAGE_CONFD_TEST_MODE is not set
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_STATD=y
BR2_PACKAGE_FACTORY=y
@@ -174,10 +174,11 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
BR2_PACKAGE_K8S_LOGGER=y
BR2_PACKAGE_KEYACK=y
BR2_PACKAGE_KLISH_PLUGIN_INFIX=y
BR2_PACKAGE_LANDING=y
@@ -192,7 +193,7 @@ BR2_PACKAGE_PODMAN_DRIVER_VFS=y
BR2_PACKAGE_TETRIS=y
BR2_PACKAGE_ROUSETTE=y
BR2_PACKAGE_HOST_PYTHON_YANGDOC=y
# BR2_PACKAGE_TEST_MODE is not set
BR2_PACKAGE_RAUC_INSTALLATION_STATUS=y
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
# GNS3_APPLIANCE is not set
+10 -5
View File
@@ -13,6 +13,7 @@ BR2_INIT_FINIT=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_ROOTFS_MERGED_USR=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
@@ -23,10 +24,9 @@ BR2_TARGET_TZ_INFO=y
BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/rootfs"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
BR2_ROOTFS_MERGED_USR=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.52"
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.11"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/linux_defconfig"
BR2_LINUX_KERNEL_INSTALL_TARGET=y
@@ -57,6 +57,7 @@ BR2_PACKAGE_LIBSSH2_OPENSSL=y
BR2_PACKAGE_LIBXCRYPT=y
BR2_PACKAGE_LIBOPENSSL_BIN=y
BR2_PACKAGE_LIBCURL_CURL=y
BR2_PACKAGE_LIBMNL=y
BR2_PACKAGE_NETOPEER2_CLI=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_LINUX_PAM=y
@@ -75,6 +76,7 @@ BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPTABLES_NFTABLES=y
BR2_PACKAGE_IPUTILS=y
BR2_PACKAGE_LLDPD=y
BR2_PACKAGE_MSTPD=y
BR2_PACKAGE_NETCALC=y
BR2_PACKAGE_NETCAT_OPENBSD=y
BR2_PACKAGE_NETSNMP=y
@@ -104,6 +106,7 @@ BR2_PACKAGE_RAUC=y
BR2_PACKAGE_RAUC_DBUS=y
BR2_PACKAGE_RAUC_GPT=y
BR2_PACKAGE_RAUC_NETWORK=y
BR2_PACKAGE_RAUC_JSON=y
BR2_PACKAGE_SYSKLOGD=y
BR2_PACKAGE_SYSKLOGD_LOGGER=y
BR2_PACKAGE_WATCHDOGD=y
@@ -134,8 +137,9 @@ INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_CONFD_TEST_MODE=y
BR2_PACKAGE_CURIOS_HTTPD=y
BR2_PACKAGE_EXECD=y
BR2_PACKAGE_CURIOS_NFTABLES=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_STATD=y
BR2_PACKAGE_FACTORY=y
@@ -143,10 +147,11 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
BR2_PACKAGE_K8S_LOGGER=y
BR2_PACKAGE_KEYACK=y
BR2_PACKAGE_KLISH_PLUGIN_INFIX=y
BR2_PACKAGE_LANDING=y
@@ -161,7 +166,7 @@ BR2_PACKAGE_PODMAN_DRIVER_VFS=y
BR2_PACKAGE_TETRIS=y
BR2_PACKAGE_ROUSETTE=y
BR2_PACKAGE_HOST_PYTHON_YANGDOC=y
BR2_PACKAGE_TEST_MODE=y
BR2_PACKAGE_RAUC_INSTALLATION_STATUS=y
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
GNS3_APPLIANCE_RAM=512
+13 -7
View File
@@ -13,6 +13,7 @@ BR2_INIT_FINIT=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_ROOTFS_MERGED_USR=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
@@ -23,10 +24,9 @@ BR2_TARGET_TZ_INFO=y
BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/rootfs"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
BR2_ROOTFS_MERGED_USR=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.52"
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.11"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/linux_defconfig"
BR2_LINUX_KERNEL_INSTALL_TARGET=y
@@ -56,6 +56,7 @@ BR2_PACKAGE_LIBSSH2_OPENSSL=y
BR2_PACKAGE_LIBXCRYPT=y
BR2_PACKAGE_LIBOPENSSL_BIN=y
BR2_PACKAGE_LIBCURL_CURL=y
BR2_PACKAGE_LIBMNL=y
BR2_PACKAGE_NETOPEER2_CLI=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_LINUX_PAM=y
@@ -70,7 +71,11 @@ BR2_PACKAGE_FRR=y
BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPUTILS=y
BR2_PACKAGE_LLDPD=y
BR2_PACKAGE_MSTPD=y
BR2_PACKAGE_NETCALC=y
BR2_PACKAGE_NGINX=y
BR2_PACKAGE_NGINX_HTTP_SSL_MODULE=y
BR2_PACKAGE_NGINX_HTTP_V2_MODULE=y
BR2_PACKAGE_OPENRESOLV=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_SOCAT=y
@@ -84,6 +89,7 @@ BR2_PACKAGE_RAUC=y
BR2_PACKAGE_RAUC_DBUS=y
BR2_PACKAGE_RAUC_GPT=y
BR2_PACKAGE_RAUC_NETWORK=y
BR2_PACKAGE_RAUC_JSON=y
BR2_PACKAGE_SYSKLOGD=y
BR2_PACKAGE_SYSKLOGD_LOGGER=y
BR2_PACKAGE_WATCHDOGD=y
@@ -114,12 +120,16 @@ INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_CONFD_TEST_MODE=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_STATD=y
BR2_PACKAGE_FACTORY=y
BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
@@ -128,12 +138,8 @@ BR2_PACKAGE_KLISH_PLUGIN_INFIX=y
BR2_PACKAGE_LOWDOWN=y
BR2_PACKAGE_MCD=y
BR2_PACKAGE_MDNS_ALIAS=y
BR2_PACKAGE_TEST_MODE=y
BR2_PACKAGE_NGINX=y
BR2_PACKAGE_NGINX_HTTP_SSL_MODULE=y
BR2_PACKAGE_NGINX_HTTP_V2_MODULE=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_ROUSETTE=y
BR2_PACKAGE_RAUC_INSTALLATION_STATUS=y
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
GNS3_APPLIANCE_RAM=512
+339 -4
View File
@@ -4,7 +4,309 @@ Change Log
All notable changes to the project are documented in this file.
[v24.09.0][] - 2024-09-27
[v25.01.0][] - 2025-01-31
-------------------------
> [!NOTE]
> This release contains breaking changes in the configuration file
> syntax for DHCP clients. Specifically DHCP options *with value*,
> i.e., the syntax for sending a hexadecimal value now require `hex`
> prefix before a string of colon-separated pairs of hex values.
### Changes
- Upgrade Linux kernel to 6.12.11 (LTS)
- Upgrade Buildroot to 2024.02.10 (LTS)
- Upgrade FRR from 9.1.2 to 9.1.3
- Add support for configuring SSH server, issue #441. As a result,
both SSH and NETCONF now use the same host key in `factory-config`
- Add operational support for reading DNS resolver info, issue #510
- Add operational support for NTP client, issue #510
- Add support for more mDNS settings: allow/deny interfaces, acting
as "reflector" and filtering of reflected services. Issue #678
- Add DHCPv4 server support, multiple subnets with static hosts and
DHCP options on global, subnet, or host level, issue #703.
Contributed by [MINEx Networks](https://minexn.com/)
- DHCP client options aligned with DHCP server, `startup-config`
files with old syntax are automatically migrated
- Breaking change in DHCP client options *with value*. Hexadecimal
values must now be formatted as `{ "hex": "c0:ff:ee" }` (JSON)
- Add documentation on management via SSH, Web (RESTCONF, Web
Console), and Console Port, issue #787
- Add documentation of DNS client use and configuration, issue #798
- Add support for changing boot order for the system with an RPC,
including support for reading boot order from operational datastore
- Add support for GRE/GRETAP tunnels
- Add support for STP/RSTP on bridges
- Add support for VXLAN tunnels
### Fixes
- Fix #777: Authorized SSH key not applied to `startup-config`
- Fix #829: Avahi (mDNS responder) not starting properly on switches
with *many* ports (>10). This led to a review of `sysctl`:
- New for IPv4:
- Adjust IGMP max memberships: 20 -> 1000
- Use neighbor information on nexthop selection
- Use inbound interface address on ICMP errors
- Ignore routes with link down
- Disable `rp_filter`
- ARP settings have been changed to better fit routers, i.e.,
systems with multiple interfaces:
- Always use best local address when sending ARP
- Only reply to ARP if target IP is on the inbound interface
- Generate ARP requests when device is brought up or HW address changes
- New for IPv6:
- Keep static global addresses on link down
- Ignore routes with link down
- Fix #861: Fix error when running 251+ reconfigurations in test-mode
- Fix #869: Setup of bridges is now more robust
- Fix #899: DHCP client with client-id does not work
- Minor cleanup of Networking Guide
- Fix memory leaks in `confd`
[v24.11.1][] - 2024-11-29
-------------------------
### Changes
- Upgrade Frr to 9.1.2, fixes an OSPF issue where *Zebra* lost netlink
messages and drifted out of sync with the kernel's view of addresses
and interfaces available in the system
- Allow setting IP address directly on VLAN filtering bridges. This
only works when the bridge is an untagged member of a (single) VLAN.
- cli: usability -- showing log files now automatically jump to the end
of the file, where the latest events are
- cli: usability -- showing container status, or other status that
overflows the terminal horizontally, now wrap the lines and exit the
pager immediately if the contents fit on the first screen
- The default log level of the mDNS responder, `avahi-daemon`, has been
adjusted to make it less verbose. Now only `LOG_NOTICE` and higher
severity is logged -- making it very quiet
### Fixes
- Fix #685: DSA conduit interface not always detected. Previous
attempt at a fix (v24.10.2) mitigated the issue, but did not
completely solve it.
- Fix #835: redesign how the system creates/deletes containers from the
`running-config`. Prior to this change, all removal and creation was
handled by a separate queue that ran asynchronously from the `confd`
process. This could lead to situations where new configurations are
applied before the queue had been fully processed. After this change
containers are deleted synchronously and new containers are created
in the same flow as during normal runtime operation (start/upgrade)
- Fix start of containers with `manual=True` option should now work
again, regression in v24.11.0
- Fix loss of writable volumes when temporarily disabling a container
in the configuration, now the container remains dormant with all its
volumes still available
- Fix presentation bug in CLI `show interfaces` where all line-drawing
characters showed up as hexadecimal values. Regression in v24.11.0
- Fix missing log messages from Frr Zebra daemon
- Stop the zeroconf (IPv4LL) agent, `avahi-autoipd`, when removing an
interface, e.g., `br0`
- Creating more than one container trigger restarts of previously set
up containers. Which in some cases may cause these earlier ones to
end up in an inconsistent state
- Prevent traffic assigned to locally terminated VLANs from being
forwarded, when the underlying ports are simultaneously attached to
a VLAN filtering bridge.
[v24.11.0][] - 2024-11-20
-------------------------
> [!CAUTION]
> This release contains breaking changes for container users! As of
> v24.11.0, all persistent[^1] containers always run in `read-only` mode
> and the setting itself is deprecated (kept only for compatibility
> reasons). The main reason for this change is to better serve users
> with embedded container images in their builds of Infix. I.e., they
> can now upgrade the OCI image in their build and rely on the container
> being automatically upgraded when Infix is upgraded, issue #823. For
> other users, the benefit is that *all* container configuration changes
> take when activated, issue #822, without having to perform any tricks.
### Changes
- Add validation of interface name lengths, (1..15), Linux limit
- Add support for ftp/http/https URI:s in container image, with a new
`checksum` setting for MD5/SHA256/SHA512 verification, issue #801
- Add a retry timer to the background container create service. This
will ensure failing `docker pull` operations from remote images are
retrying after 60 seconds, or quicker
- CLI base component, `klish`, has been updated with better support for
raw terminal mode and alternate quotes (' in addition to ")
- Log silenced from container activation messages, only the very bare
necessities are now logged, e.g., `podman create` command + status
- Factory reset no longer calls `shred` to "securely erase" any files
from writable data partitions. This will speed up the next boot
considerably
### Fixes
- Fix #659: paged output in CLI accessed via console port sometimes
causes lost lines, e.g. missing interfaces. With updated `klish`
and the terminal in raw mode, the pager (less) can now control both
the horizontal and vertical
- Fix #822: adding, or changing, an environment variable to a running
container does not take without the `container upgrade NAME` trick
- Fix #823: with an OCI image embedded in the Infix image, an existing
container in the configuration is not upgraded to the new OCI image
with the Infix upgrade.
- Frr leaves log files in `/var/tmp/frr` on unclean shutdowns. This
has now been fixed with a "tmpfiles" cleanup of that path at boot
[^1]: I.e., set up in the configuration, as opposed to temporary ones
started with `container run` from the CLI admin-exec context.
[v24.10.2][] - 2024-11-08
-------------------------
### Changes
- Support for showing interfaces owned by running containers in the CLI
command `show interfaces`. This also adds support for showing the
peer interface of VETH pairs. Issue #626
- Reboot system on kernel "oops", on "oops" the kernel now panics and
reboots after 20 seconds. Issue #740
- Update static factory-config for NanoPi R2S: enable NACM, securing all
passwords, and enabling `iburst` for the NTP client. Issue #750
- Updated QoS documentation with pictures and more information on VLAN
interface ingress/egress priority handling, issue #759
- Disable RTC device in Styx device tree, issue #794
- Support for saving and restoring system clock from a disk file. This
allows restoring the system clock to a sane date in case the RTC is
disabled or does not have a valid time, issue #794
- Update device discovery chapter with information on `infix.local` mDNS
alias, `netbrowse` support to discover *all* local units, and command
examples for disabling LLDP and mDNS services, issue #786
- Updated OSPF documentation to include information on *global OSPF
settings* (`redistribution`, `explicit-router-id`, etc.), issue #812
- Added information on *forwarding of IEEE reserved group addresses*
to bridge section of networking documentation, issue #788
- Add support for bootstrap conditions and early init product overrides
- Styx: enable second Ethernet port LED in device tree, again, rename
it: yellow -> aux, and make sure it is turned off at boot
- Styx: disable second port LED for the 4xSFP slots, does not work
- Styx: override iitod (LED daemon) with a product specific LED script
### Fixes
- Fix #685: DSA conduit interface not always detected, randomly causing
major issues configuring systems with multiple switch cores
- Fix #778: reactivate OpenSSL backend for libssh/libssh2 for NanoPI R2S.
This fixes a regression in v24.10.0 causing loss of NETCONF support
- Fix #809: enable syslog logging for RAUC
- Fix harmless bootstrap log error message on systems without USB ports:
`jq: error (at <stdin>:0): Cannot iterate over null (null)`
- Change confusing `tc` log error message: `Error: does not support
hardware offload` to `Skipping $iface, hardware offload not supported.`
[v24.10.1][] - 2024-10-18
-------------------------
### Changes
- Add support for interface description, sometimes referred to as
"ifAlias". Saved as an Linux interface alias (not `altname`), e.g.,
`/sys/class/interfaces/veth0a/ifalias`, includes operational support
### Fixes
- Fix #735: `copy` and `erase` commands missing from CLI, regression
in Infix v24.10.0 defconfigs, now added as dep. in klish package
[v24.10.0][] - 2024-10-18
-------------------------
**News:** this release contains *breaking YANG changes* in custom MAC
addresses for interfaces! For details, see below issue #680.
Also, heads-up to all downstream users of Infix. YANG models have been
renamed to ease maintenance, more info below.
### Changes
- Software control of port LEDs on the Styx platform has been disabled.
Default driver behavior, green link and green traffic blink, is kept
as-is, which should mitigate issues reported in #670
- Correcting documentation on QoS. For packets containing both a VLAN
tag and an IP header, PCP priority takes precedence over DSCP
priority (not vice versa).
- Update CONTRIBUTING.md for scaling core team and helping external
contributors understand the development process, issue #672
- Updated branding documentation with more information on how dynamic
and static factory-config work, including examples
- Updated container documentation, improved images, detail how to set
interface name inside the container, and some syntax fixes
- Updated networking documentation, new General settings section, and
more details added to initial section on network building blocks
- As of this release, all Infix YANG models have dropped the `@DATE`
suffix from the name, this type of versioning is not handled using
symlinks instead.
- Update Infix `provision` script, used to install Infix on eMMC, add
example of how to erase partition table to be able to re-run the
script on already provisioned devices, issue #671
- OSPF: Add limitation to allow an interface to be in one area only
- Add support for "dummy" interfaces, mostly useful for testing
- Add support for container hostname format specifiers, just like it
already works for the host's hostname setting
- Hide all `status obsolete` YANG nodes in CLI
- Add YANG `units`, if available, to CLI help text (default value)
- The CLI commands `copy` and `erase` are now available also from Bash
- Greatly reduced size of bundled curiOS httpd OCI container image,
reduced from 1.8 MiB to 281 KiB
- Add deviation to ietf-interfaces.yang, `link-up-down-trap-enable` is
not supported (yet) in Infix, issue #709
- The default builds now include the curiOS nftables container image,
which can be used for advanced firewall setups. For an introduction
see <https://kernelkit.org/posts/firewall-container/>
### Fixes
- Fix #499: add an NACM rule to factory-config, which by default deny
everyone to read user password hash(es)
- Fix #663: internal Ethernet interfaces shown in CLI tab completion
- Fix #674: CLI `show interfaces` display internal Ethernet interfaces,
regression introduced late in v24.09 release cycle
- Fix #676: port dropped from bridge when changing its VLAN membership
from tagged to untagged
- Fix #680: replace deviation for `phys-address` in ietf-interfaces.yang
with `custom-phys-address` to allow for constructing more free-form
MAC addresses based on the chassis MAC (a.k.a., base MAC) address.
For more information, see the YANG model, a few examples are listed in
the updated documentation.
The syntax will be automatically updated in the `startup-config` and
`factory-config` -- make sure to verify the changes and update any
static `factory-config` used for your products
- Fix #690: CLI `show ip route` command stops working after 24 hours,
this includes all operational data in ietf-routing:/routing/ribs.
- Fix #697: password is not always set for new users, bug introduced
in v24.06.0 when replacing Augeas with native user handling
- Fix #700: add missing `admin-status` to interface operational data
- Fix #701: make sure CLI (and Bash) `copy` command use same sysrepo
timeout as other operations that load sysrepo. Was 10 second timeout,
which caused some (really big) configurations not to apply from the
CLI, but worked at boot, for instance. New timeout is 60 seconds
- Fix #708: allow all container networks to set interface name inside
container, not just auto-generated veth-pair ends for `docker0` bridge
- Fix `show interfaces` on platforms like the NanoPi R2S, which does not
support reading RMON counters in JSON format using `ethtool`
- Fix #730: CLI command `show ntp [sources]` stopped working in v24.08.
Missing access rights after massive CLI lock-down
- Fix BFD in OSPF, previously you could not enable BFD on a single
interface without enabling it on all interfaces
[v24.09.0][] - 2024-09-30
-------------------------
**News:** this release enhances the integration of all types of static
@@ -17,7 +319,17 @@ adjusting the administrative distance of all types of static routes has
also been added to facilitate site specific adaptations. Please see the
documentation for details.
### Known Issues
- The CLI command `show interfaces` may for some terminal resolutions
not display all interfaces (on systems with >20 interfaces). This
problem is limited to the console port and only occurs for smaller
terminals (30-50 rows height). Calling `show ifaces` from the shell,
dumping `/ietf-interfaces:interfaces` XPath using `sysrepocfg`, or
using the CLI from an SSH session, is not affected. Issue #659
### Changes
- Upgrade Buildroot to 2024.02.6 (LTS)
- Upgrade Linux kernel to 6.6.52 (LTS)
- Upgrade libyang to 3.4.2
@@ -37,6 +349,7 @@ documentation for details.
by `mctl` reporting no multicast filtering enabled on bridge
### Fixes
- Fix #357: EUI-64 based IPv6 autoconf address on bridges seem to be
randomized. Problem caused by kernel setting a random MAC before any
bridge port is added. Fixed by using the device's base MAC address on
@@ -68,12 +381,18 @@ documentation for details.
in the kernel. This has resulted in a complete overhaul of route
management, using FRRouting for all routes, including DHCP and IPv4LL
routes, presentation in the CLI, and also support for custom route
preference for static routes.
preference for static routes
- Fix #658: deleting VETH pairs does not work unless rebooting first.
Creating a VETH pair, followed by at least one other reconfiguration
before removing the pair, causes `confd` to fail when applying the
interface changes (tries to delete both ends of the pair)
- Spellcheck path to `/var/lib/containers` when unpacking OCI archives
on container upgrade
- cli: restore `tcpdump` permissions for administrator level users,
regression introduced in v24.08.0
- The timeout before giving up on loading the `startup-config` at boot
is now 1 minute, just like operations via other front-ends (NETCONF
and RESTCONF). This was previously (incorrectly) set to 10 seconds.
and RESTCONF). This was previously (incorrectly) set to 10 seconds
[Frr]: https://frrouting.org/
@@ -93,6 +412,7 @@ Finally, the following consumer boards are now fully supported:
- StarFive VisionFive2 (RISC-V)
### Changes
- Upgrade Buildroot to 2024.02.5 (LTS)
- Upgrade Linux kernel to 6.6.46 (LTS)
- Issue #158: enhance security of factory reset. All file content
@@ -144,6 +464,7 @@ Finally, the following consumer boards are now fully supported:
log messages. See `/var/log/debug` for *all* log messages
### Fixes
- Fix #274: add missing link/traffic LEDs on NanoPi R2S LAN port
- Fix #489: ensure all patches are versioned, including Linux kernel
- Fix #531: creating a new VLAN interface named `vlanN` should not set
@@ -173,6 +494,7 @@ Finally, the following consumer boards are now fully supported:
> upgrade, but before reboot, a factory reset is required!
### Changes
- Upgrade Buildroot to 2024.02.3 (LTS)
- Upgrade Linux kernel to 6.6.34 (LTS)
- Upgrade bundled curiOS httpd container to v24.05.0
@@ -239,6 +561,7 @@ Finally, the following consumer boards are now fully supported:
[yescrypt]: https://en.wikipedia.org/wiki/Yescrypt
### Fixes
- Fix #424: regression, root user can log in without password
- Fix build regressions in `cn9130_crb_boot_defconfig` caused by upgrade
to Buildroot v2024.02 and recent multi-key support in RAUC and U-Boot
@@ -270,11 +593,13 @@ Finally, the following consumer boards are now fully supported:
-------------------------
### Changes
- Add small delay in U-Boot to allow stopping boot on reference boards
- Document how to provision the bootloader and Infix on a blank board
- Use initial hostname from `/etc/os-release` as configuration fallback
### Fixes
- Fix build regressions in `cn9130_crb_boot_defconfig` caused by upgrade
to Buildroot v2024.02 and recent multi-key support in RAUC and U-Boot
- Fix provisioning script after changes to make GRUB loading more robust
@@ -289,6 +614,7 @@ Finally, the following consumer boards are now fully supported:
-------------------------
### Changes
- Default web landing page refactored into a Buildroot package to make
it possible to overload from customer repos.
- Enable DCB support in aarch64 kernel (for EtherType prio override)
@@ -299,6 +625,7 @@ Finally, the following consumer boards are now fully supported:
- Issue #374: add timestamps to dagger .log files
### Fixes
- Add missing LICENSE hash for factory reset tool
- Fix #424: regression, root user can log in without password
@@ -320,6 +647,7 @@ idea is to generate supported features from the models and include in
future releases.
### Changes
- Bump the base Buildroot version to v2024.02 LTS
- Bump the base Linux kernel version to 6.6 LTS
- Drop Classic variant to reduce overhead, simplify build & release
@@ -400,6 +728,7 @@ future releases.
named 'default'
### Fixes
- confd: Fix memory leak when operating on candidate configuration
- probe: Fix crash on systems without USB
- Reduced syslog errors for accesses no non-existing xpaths
@@ -1142,7 +1471,13 @@ Supported YANG models in addition to those used by sysrepo and netopeer:
- N/A
[buildroot]: https://buildroot.org/
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v24.08.0...HEAD
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v25.01.0...HEAD
[v25.01.0]: https://github.com/kernelkit/infix/compare/v24.11.0...v25.01.0
[v24.11.1]: https://github.com/kernelkit/infix/compare/v24.11.0...v24.11.1
[v24.11.0]: https://github.com/kernelkit/infix/compare/v24.10.0...v24.11.0
[v24.10.2]: https://github.com/kernelkit/infix/compare/v24.10.1...v24.10.2
[v24.10.1]: https://github.com/kernelkit/infix/compare/v24.10.0...v24.10.1
[v24.10.0]: https://github.com/kernelkit/infix/compare/v24.09.0...v24.10.0
[v24.09.0]: https://github.com/kernelkit/infix/compare/v24.08.0...v24.09.0
[v24.08.0]: https://github.com/kernelkit/infix/compare/v24.06.0...v24.08.0
[v24.06.0]: https://github.com/kernelkit/infix/compare/v24.04.0...v24.06.0
+3 -1
View File
@@ -143,7 +143,7 @@ which offers lots of benefits out-of-the-box:
media like USB sticks or SD-cards) and from remote servers using FTP
or HTTP(S).
To initiate a system upgrade, run:
To initiate a system upgrade from the shell[^1], run:
rauc install <file|url>
@@ -349,3 +349,5 @@ can funtion reasonably well without a persistent `/var`, loosing
If `var` is not available, Infix will still persist `/var/lib` using
`cfg` as the backing storage.
[^1]: See [CLI Upgrade](cli/upgrade.md) for information on upgrading
via CLI.
+232 -18
View File
@@ -41,13 +41,92 @@ Verify the result after a build by inspecting:
printed on a label on the device.
Factory Defaults
----------------
Factory & Failure Config
------------------------
The Infix default configuration, factory-config, is part static files
and part per-device generated files, e.g., SSH hostkey and hostname.
The latter is constructed from the file `/etc/hostname`, appended with
the last three octets of the system's base MAC address. To override the
To support booting the same image (CPU architecture) on multiple boards,
Infix by default generates the device's initial configuration every time
at boot. This also ensures the device can always be restored to a known
state after a factory reset, since the `factory-config` is guaranteed to
be compatible with the YANG models for the given software version. (For
more information on how the system boots, please see the section [Key
Concepts](introduction.md#key-concepts) in the Introduction document.)
However, for custom builds of Infix it is possible to override this with
a single static `/etc/factory-config.cfg` (and failure-config) in your
rootfs overlay -- with a [VPD](vpd.md) you can even support several!
### Variables & Format Specifiers
Parts of the configuration you likely always want to generated, like the
SSH hostkey used by SSH server and NETCONF, a unique hostname, or the `admin` user's
unique (per-device with a VPD) password hash. This section lists the
available keywords, see the next section for examples of how to use
them:
- **Default password hash:** `$factory$` (from VPD, .dtb, or built-in)
XPath: `/ietf-system:system/authentication/user/password`
- **Default SSH and NETCONF hostkey:** `genkey` (regenerated at factory reset)
XPath: `/ietf-keystore:keystore/asymmetric-keys/asymmetric-key[name='genkey']`
- **Hostname format specifiers:**
XPath: `/ietf-system:system/hostname`
- `%i`: OS ID, from `/etc/os-release`, from Menuconfig branding
- `%h`: Default hostname, from `/etc/os-release`, from branding
- `%m`: NIC specific part of base MAC, e.g., to `c0-ff-ee`
- `%%`: Literal %
### Static Files
> **Caveat:** maintaining static a factory-config and failure-config may
> seem like an obvious choice, but as YANG models evolve (even the IETF
> models get upgraded), you may need to upgrade your static files.
First, for one-off builds (one image per product), the simplest way is
to override the location where the system looks for the files, `/etc`
already at build time. This can be done using a Buildroot rootfs
overlay providing, e.g., `/etc/factory-config.cfg`. Example: [NanoPi
R2S][] in `${INFIX}/board/aarch64/r2s/rootfs/etc/factory-config.cfg`.
Second, to support multiple products in a single image, we can employ
another method to install a `/etc/factory-config.cfg` override -- at
runtime. This relies on the very early system `probe` that detects the
specific product from VPD data.
The `probe` consists of several sequential steps that currently run from
`${INFIX}/board/common/rootfs/usr/libexec/infix/init.d/`. One of them
check if `/usr/share/product/<PRODUCT>` exists, and if so attempts to
copy the entire contents to `/`. Here, `<PRODUCT>` is determined from
the VPD, which is available in `/run/system.json` as `"product-name"`,
after `00-probe` has run. The lower case version of the string is used.
I.e., create a rootfs overlay that provides any combination of:
- `/usr/share/product/<PRODUCT>/etc/factory-config.cfg`
- `/usr/share/product/<PRODUCT>/etc/failure-config.cfg`
### Dynamically Generated
The generated `factory-config` and `failure-config` files consist of
both static JSON files and part generated files at runtime for each
device. The resulting files are written to the RAM disk in `/run`:
- `/run/confd/factory-config.gen`
- `/run/confd/failure-config.gen`
Provided no custom overrides (see above) have been installed already,
these files are then copied to:
- `/etc/factory-config.cfg`
- `/etc/failure-config.cfg`
... where the bootstrap process expects them to be in the next step.
Examples of generated contents are the SSH hostkey and hostname. The
latter is constructed from the file `/etc/hostname`, appended with the
last three octets of the system's base MAC address. To override the
base hostname, set `BR2_TARGET_GENERIC_HOSTNAME` in your defconfig.
The static files are installed by Infix `confd` in `/usr/share/confd/`
@@ -97,6 +176,132 @@ bootstrap script for more help, and up-to-date information.
> you may want to look into `GEN_IFACE_OPTS`.
### Example Snippets
**IETF System:**
```hsib
"ietf-system:system": {
"hostname": "example-%m",
"ntp": {
"enabled": true,
"server": [
{
"name": "ntp.org",
"udp": {
"address": "pool.ntp.org"
}
}
]
},
"authentication": {
"user": [
{
"name": "admin",
"password": "$factory$",
"infix-system:shell": "bash"
}
]
},
"infix-system:motd-banner": "Li0tLS0tLS0uCnwgIC4gLiAgfCBJbmZpeCAtLSBhIE5ldHdvcmsgT3BlcmF0aW5nIFN5c3RlbQp8LS4gdiAuLXwgaHR0cHM6Ly9rZXJuZWxraXQuZ2l0aHViLmlvCictJy0tLSctJwo="
}, # <---- REMEMBER COMMA SEPARATORS IN SNIPPETS!
# <---- ... and no comments.
```
The `motd-banner` is a binary type, which is basically a Base64 encoded
text file without line breaks (`-w0`):
```bash
$ echo "Li0tLS0tLS0uCnwgIC4gLiAgfCBJbmZpeCAtLSBhIE5ldHdvcmsgT3BlcmF0aW5nIFN5c3RlbQp8LS4gdiAuLXwgaHR0cHM6Ly9rZXJuZWxraXQuZ2l0aHViLmlvCictJy0tLSctJwo=" |base64 -d
.-------.
| . . | Infix -- a Network Operating System
|-. v .-| https://kernelkit.github.io
'-'---'-'
```
**IETF Keystore**
Notice how both the public and private keys are left empty here, this
cause them to be always automatically regenerated after each factory reset.
Keeping the `factory-config` snippet like this means we can use the same
file on multiple devices, without risking them sharing the same host
keys. Sometimes you may want the same host keys, but that is the easy
use-case and not documented here.
```json
"ietf-keystore:keystore": {
"asymmetric-keys": {
"asymmetric-key": [
{
"name": "genkey",
"public-key-format": "ietf-crypto-types:ssh-public-key-format",
"public-key": "",
"private-key-format": "ietf-crypto-types:rsa-private-key-format",
"cleartext-private-key": "",
"certificates": {}
}
]
}
},
```
**IETF NETCONF Server**
```json
"ietf-netconf-server:netconf-server": {
"listen": {
"endpoints": {
"endpoint": [
{
"name": "default-ssh",
"ssh": {
"tcp-server-parameters": {
"local-address": "::"
},
"ssh-server-parameters": {
"server-identity": {
"host-key": [
{
"name": "default-key",
"public-key": {
"central-keystore-reference": "genkey"
}
}
]
}
}
}
}
]
}
}
},
```
**Infix Services**
```json
"infix-services:ssh": {
"enabled": true,
"hostkey": [
"genkey"
],
"listen": [
{
"name": "ipv4",
"address": "0.0.0.0",
"port": 22
},
{
"name": "ipv6",
"address": "::1",
"port": 22
}
]
}
```
Integration
-----------
@@ -185,21 +390,30 @@ But you can of course use only two numbers, *major.minor*, as well.
> with your own versioning scheme.
### `INFIX_RELEASE`
### Specifying Versioning Information
This global variable **must be** a lower-case string (no spaces or
other characters outside of 09, az, '.', '_' and '-') identifying
the operating system version, excluding any OS name information or
release code name, and suitable for processing by scripts or usage
in generated filenames.
Two optional environment variables control the version information
recorded in images. Both of these **must be** a lower-case string (no
spaces or other characters outside of 09, az, '.', '_' and '-')
identifying the operating system version, excluding any OS name
information or release code name, and suitable for processing by
scripts or usage in generated filenames.
#### `INFIX_BUILD_ID`
Used for `BUILD_ID` in `/etc/os-release`.
**Default:** `$(git describe --always --dirty --tags)`, from the _top
directory_. By default, the top directory refers to the root of the
Infix source tree, but this can be changed by setting the branding
variable `INFIX_OEM_PATH`, e.g. in a `defconfig` file or via `make
menuconfig`, to the path of an enclosing br2-external.
#### `INFIX_RELEASE`
Used for `VERSION` and `VERSION_ID` in `/etc/os-release` and
generated file names like disk images, etc.
**Default:** generated using `git describe --always --dirty --tags`,
with an additional `-C $infix_path`. This variable defaults to the
Infix tree and can be changed by setting the menuconfig branding
variable `INFIX_OEM_PATH` to that of the br2-external. It is also
possible to set the `GIT_VERSION` variable in your `post-build.sh`
script to change how the VCS version is extracted.
**Default:** `${INFIX_BUILD_ID}`
[NanoPi R2S]: https://github.com/kernelkit/infix/blob/main/board/aarch64/r2s/rootfs/etc/factory-config.cfg
+287 -104
View File
@@ -1,5 +1,6 @@
Containers in Infix
===================
<img align="right" src="img/docker.webp" alt="Docker whale" width=360>
* [Introduction](#introduction)
* [Caution](#caution)
@@ -19,6 +20,9 @@ Containers in Infix
* [Application Container: ntpd](#application-container-ntpd)
* [Advanced](#advanced)
* [Running Host Commands From Container](#running-host-commands-from-container)
* [Container Requirements](#container-requirements)
* [Advanced Users](#advanced-users)
Introduction
------------
@@ -35,10 +39,11 @@ All network specific settings are done using the IETF interfaces YANG
model, with augments for containers to ensure smooth integration with
container networking in podman.
> **Note:** even though the `podman` command can be used directly from a
> shell prompt, we strongly recommend using the CLI commands instead.
> They employ the services of a wrapper `container` script which handles
> the integration of containers in the system.
> [!IMPORTANT]
> Even though the `podman` command can be used directly from a shell
> prompt, we strongly recommend using the CLI commands instead. They
> employ the services of a wrapper `container` script which handles the
> integration of containers in the system.
Caution
@@ -75,39 +80,52 @@ Getting Started
In the CLI, containers can be run in one of two ways:
1. `container run IMAGE [COMMAND]`, and
1. `container run IMAGE [COMMAND]`, or
2. enter `configure` context, then `edit container NAME`
The first is useful mostly for testing, or running single commands in an
image. It is a wrapper for `podman run -it --rm ...`, while the latter
is a wrapper and adaptation of `podman create ...`.
The former is useful mostly for testing, or running single commands in
an image. It is a wrapper for `podman run -it --rm ...`, while the
latter is a wrapper and adaptation of `podman create ...`.
The second create a container with a semi-persistent writable layer that
survives container restarts and host system restarts. However, if you
change the container configuration or upgrade the image (see below), the
container will be recreated and the writable layer is lost. This is why
it is recommended to set up a named volume for directories, or use file
[Content Mounts][], in your container you want truly persistent content.
The second creates a read-only container that is automatically started
at every boot. When non-volatile storage is needed, data stored in a
volume is persisted until explicitly removed from the configuration,
i.e., across host and container reboots and upgrades.
In fact, in many cases the best way is to create a `read-only` container
and use file mounts and volumes only for the critical parts. Podman
ensures (using tmpfs) `read-only` containers still have writable
directories for certain critical file system paths: `/dev`, `/dev/shm`,
`/run`, `/tmp`, and `/var/tmp`. Meaning, what you most often need is
writable volumes for `/var/lib` and `/etc`, or only file mounts for a
few files in `/etc`. The actual needs depend on the container image and
application to run.
Another option is [Content Mounts](#content-mounts), where the content
of a file mounted into the container is kept along with the container
configuration in the device's `startup-config`.
> **Note:** when running containers from public registries, double-check
> that they support the CPU architecture of your host system. Remember,
> unlike virtualization, containers reuse the host's CPU and kernel.
Podman ensures (using tmpfs) all containers have writable directories
for certain critical file system paths: `/dev`, `/dev/shm`, `/run`,
`/tmp`, and `/var/tmp`. Meaning, what you most often need is writable
volumes for `/var/lib` and `/etc`, or only file mounts for a few files
in `/etc`. The [actual requirements](#container-requirements) depend on
your container image and application to run.
> [!IMPORTANT]
> When running containers from public registries, double-check that they
> support the CPU architecture of your host system. Remember, unlike
> virtualization, containers reuse the host's CPU and kernel.
<img align="right" src="img/docker-hello-world.svg" alt="Hello World" width=360>
### Examples
Classic Hello World:
admin@example:/> container run docker://hello-world
Starting docker://hello-world :: use Ctrl-p Ctrl-q to detach
Trying to pull docker.io/library/hello-world:latest...
Getting image source signatures
Copying blob c1ec31eb5944 done
Copying config d2c94e258d done
Writing manifest to image destination
Storing signatures
Hello from Docker!
This message shows that your installation appears to be working correctly.
Persistent web server using nginx, sharing the host's network:
@@ -132,7 +150,7 @@ container at runtime.
Container Images
----------------
The underlying `podman` project support importing and fetching images in
The underlying `podman` project supports importing and fetching images in
a variety of ways, the most common ones are also supported by Infix. In
this section we present how to use them and in the next section we show
how to upgrade to a newer base image.
@@ -154,13 +172,20 @@ The CLI help shows:
oci-archive:/lib/oci/archive -- Use archive:latest from OCI archive
May be in .tar or .tar.gz format
Additionally, the following URIs are also supported for setups
that do not use a HUB or similar. Recommend using 'checksum'!
ftp://addr/path/to/archive -- Downloaded using wget
http://addr/path/to/archive -- Downloaded using curl
https://addr/path/to/archive -- Downloaded using curl
Note: if a remote repository cannot be reached, the creation of the
container will be put on a queue that retries pull every time
there is a route change in the host's system.
> **Note::** the built-in help system in the CLI is generated from the
> YANG model, so the same information is also available for remote
> NETCONF users.
> [!TIP]
> The built-in help system in the CLI is generated from the YANG model,
> so the same information is also available for remote NETCONF users.
The two most common variants are `docker://` and `oci-archive:/`.
@@ -203,40 +228,72 @@ mind.
-rw-r--r-- 1 root root 7261785 Mar 27 14:22 curios-oci-amd64.tar.gz
drwx------ 6 frr frr 4096 Mar 27 11:57 frr/
Importing the image into podman can be done either from the CLI
Importing the image into Podman can be done either from the CLI
admin-exec context ...
admin@example:/var/tmp$ cli
admin@example:/> container load /var/tmp/curios-oci-amd64.tar.gz name curios:edge
> By assigning The `name curios:edge` is the tag you give the imported
> (raw) archive which you can then reference in your container image
> configuration: `set image curios:edge`.
> [!TIP]
> The `name curios:edge` is the tag you give the imported (raw) archive
> which you can then reference in your container image configuration:
> `set image curios:edge`.
... or by giving the container configuration the full path to the OCI
archive, which helps greatly with container upgrades (see below):
admin@example:/config/container/system/> set image oci-archive:/var/tmp/curios-oci-amd64.tar.gz
**Checksum Example:**
admin@example:/> configure
admin@example:/config/> edit container sys
admin@example:/config/container/sys/> set hostname sys
admin@example:/config/container/sys/> set image ftp://192.168.122.1/curios-oci-amd64-v24.05.0.tar.gz
admin@example:/config/container/sys/> set checksum
md5 sha256 sha512
admin@example:/config/container/sys/> set checksum sha256 4f01077036527498ed910f1a3e80645ae3eff629d10043cf80ebc6850c99c629
admin@example:/config/container/sys/> leave
admin@example:/> copy running-config startup-config
admin@example:/> show container
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b02e945c43c9 localhost/curios-oci-amd64-v24.05.0:latest 5 seconds ago Up 5 seconds sys
admin@example:/> show log
...
Nov 20 07:24:56 infix container[5040]: Fetching ftp://192.168.122.1/curios-oci-amd64-v24.05.0.tar.gz
Nov 20 07:24:56 infix container[5040]: curios-oci-amd64-v24.05.0.tar.gz downloaded successfully.
Nov 20 07:24:56 infix container[5040]: curios-oci-amd64-v24.05.0.tar.gz checksum verified OK.
Nov 20 07:24:57 infix container[5040]: Cleaning up extracted curios-oci-amd64-v24.05.0
Nov 20 07:24:57 infix container[5040]: podman create --name sys --conmon-pidfile=/run/container:sys.pid --read-only --replace --quiet --cgroup-parent=containers --restart=always --systemd=false --tz=local --hostname sys --log-driver k8s-file --log-opt path=/run/containers/sys.fifo --network=none curios-oci-amd64-v24.05.0
Nov 20 07:24:57 infix container[3556]: b02e945c43c9bce2c4be88e31d6f63cfdb1a3c8bdd02179376eb059a49ae05e4
Upgrading a Container Image
---------------------------
<img align="right" src="img/shield-checkmark.svg" alt="Hello World" width=100>
> **Note:** the default writable layer is lost when upgrading the image.
> Use named volumes for content that you want to persist across upgrades.
The applications in your container are an active part of the system as a
whole, so make it a routine to keep your container images up-to-date!
All container configurations are locked to the image hash at the time of
first download, not just ones that use an `:edge` or `:latest` tag. An
upgrade of containers using versioned images is more obvious -- update
the configuration to use the new `image:tag` -- the latter is a bit
trickier. Either remove the configuration and recreate it (leave/apply
the changes between), or use the admin-exec level command:
Containers are created at first setup and at every boot. If the image
exists in the file system it is reused -- i.e., an image pulled from a
remote registry is not fetched again.
To upgrade a versioned image:
- update your `running-config` to use the new `image:tag`
- `leave` to activate the change, if you are in the CLI
- Podman pulls the new image in the background
- Your container is recreated with the new image
- The container is started
For "unversioned" images, e.g., images using a `:latest` or `:edge` tag,
use the following CLI command (`NAME` is the name of your container):
admin@example:/> container upgrade NAME
Where `NAME` is the name of your container. This command stops the
container, does `container pull IMAGE`, and then recreates it with the
new image. Upgraded containers are automatically restarted.
This stops the container, does `container pull IMAGE`, and recreates it
with the new image. Upgraded containers are automatically restarted.
**Example using registry:**
@@ -261,12 +318,30 @@ the upgrade command as
Upgrading container system with local archive: oci-archive:/var/tmp/curios-oci-amd64.tar.gz ...
7ab4a07ee0c6039837419b7afda4da1527a70f0c60c0f0ac21cafee05ba24b52
OCI archives can also be fetched from ftp/http/https URL, in that case
the upgrade can be done the same way as a registry image (above).
> [!TIP]
> Containers running from OCI images embedded in the operating system,
> e.g., `/lib/oci/mycontainer.tar.gz`, always run from the version in
> the operating system. To upgrade, install the new container image at
> build time, after system upgrade the container is also upgraded. The
> system unpacks and loads the OCI images into Podman every boot, which
> ensures the running container always has known starting state.
>
> **Example:** default builds of Infix include a couple of OCI images
> for reference, one is `/lib/oci/curios-nftables-v24.11.0.tar.gz`, but
> there is also a symlink called `curios-nftables-latest.tar.gz` in the
> same directory, which is what the Infix regression tests use in the
> image configuration of the container. This is what enables easy
> upgrades of the container along with the system itself.
Capabilities
-------------
An unprivileged container works for almost all use-cases, but there are
occasions where they are too restricted and users being looking for the
occasions where they are too restricted and users start looking for the
`privileged` flag. Capabilities offers a middle ground.
For example, a system container from which `ping` does not work:
@@ -282,9 +357,9 @@ For example, a system container from which `ping` does not work:
...
Infix supports a subset of all [capabilities][6] that are relevant for
containers. Please note, that this is and advanced topic and will
require time and analysis of your container application to figure out
which capabilities you need.
containers. Please note, that this is an advanced topic that require
time and analysis of your container application to figure out which
capabilities you need.
Networking and Containers
@@ -294,19 +369,31 @@ By default, unlike other systems, persistent[^1] containers have no
networking enabled. All network access has to be set up explicitly.
Currently two types of of container networks are supported:
- `host`: one end of a VETH pair, or a physical Ethernet port
- `host`: an managed host interface, e.g., one end of a VETH pair,
or even a physical interface
- `bridge`: an IP masquerading bridge
In the former the interface is delegated to (moved into) the container,
while in the latter a VETH pair is automatically created by Podman and
one end delegated to the container, while the other end is assigned to
the bridge (see the next section).
> [!TIP]
> For more information on VETH pairs, see the [Networking Guide][0].
### Container Bridge
A container bridge is what most container setups use and users want.
![IP Masquerading Container Bridge](img/cni-bridge-firewall.svg)
The difference from a regular bridge is that the container runtime fully
manages them -- connecting containers automatically with VETH pairs and
setting up firewall rules between the host and other containers, as well
as managing port forwarding. This transparent background management is
what makes container use seem to be so simple.
manages them -- connecting containers with automatically created VETH
pairs (look at the bridge port names) and setting up firewall rules
between the host and other containers, as well as managing port
forwarding. This transparent background management is what makes
container use seem to be so simple.
All interface configuration is done in configure context.
@@ -324,10 +411,12 @@ have to set manually:
admin@example:/config/interface/docker0/> set type bridge
admin@example:/config/interface/docker0/> set container-network type bridge
> **Note:** when doing the same operation over NETCONF there is no
> inference, so all the "magic" settings needs to be defined. This
> makes the CLI very useful for first setup and then extracting the
> resulting XML from the shell using the `cfg -X` command.
> [!IMPORTANT]
> When configuring the system via an API such as NETCONF or RESTCONF, no
> settings are inferred. Instead it is up to the caller to fully define
> the desired setup. This makes the CLI very useful for first setup and
> then extracting the resulting XML from the shell using the `cfg -X`
> command.
We have to declare the interface as a container network, ensuring the
interface cannot be used by the system for any other purpose. E.g., a
@@ -394,20 +483,25 @@ namespace of a container[^3]. This of course works with plain Ethernet
interfaces as well, but here we will use one end of a VETH pair as an
example.
The network `option` setting is available also for this case, but only
the `interface_name=foo0` option works. Which is still very useful. To
set:
- IP address, use IPv4/IPv6 settings in the interface settings
- MAC address, to use the `custom-phys-address` in the interface settings
For an example of both, see the next section.
[^3]: Something which the container bridge network type does behind the
scenes with one end of an automatically created VETH pair.
#### Routed Setup
In this routed setup we reserve 192.168.0.0/24 for the network between
the host and the `ntpd` container.
_____________
| |
veth0 .1 | .2 eth0 |
\ 192.168.0.0/24 | / |
'--------------------' [ntpd] |
|_____________|
![Basic VETH pair connecting ntpd container.](img/cni-ntpd-routed.svg)
Configuration is a straight-forward VETH pair setup where we name the
container-end of pair `ntpd`. This is just a convenience for us when
@@ -420,18 +514,23 @@ line where we declare the `ntpd` end as a container network interface:
admin@example:/config/interface/veth0/> end
admin@example:/config/> edit interface ntpd
admin@example:/config/interface/ntpd/> set ipv4 address 192.168.0.2 prefix-length 24
admin@example:/config/interface/ntpd/> set phys-address 00:c0:ff:ee:00:01
admin@example:/config/interface/ntpd/> set custom-phys-address static 00:c0:ff:ee:00:01
admin@example:/config/interface/ntpd/> set container-network
> [!TIP]
> Notice how you can also set a custom MAC address at the same time.
Adding the interface to the container is the same as before, but since
everything for host interfaces is set up in the interfaces context, we
can take a bit of a shortcut.
admin@example:/config/container/ntpd/> set network ntpd
admin@example:/config/container/ntpd/> set network interface ntpd
admin@example:/config/container/ntpd/> leave
> [!TIP]
> Use the `set network interface ntpd option interface_name=foo0` to set
> the name of the interface inside the container to `foo0`.
The point of the routed case is that port forwarding from the container
in this case is limited to a single interface, not *all interfaces* as
is the default in the masquerading container bridge setup.
@@ -443,21 +542,16 @@ A perhaps more common case is to bridge the other end of the VETH pair
with other physical ports. In this section we show how to add a new
pair to give our container two interfaces:
_______________
| | .1 br0
veth0 .1 | .2 eth0 | / \
\ 192.168.0.0/24 | / eth1 .2 | veth1b e1
'------------------' \ | 192.168.1.0/24 /
| [ntpd] '------------------'
|_______________|
![Bridged setup with ntpd container.](img/cni-ntpd-bridged.svg)
We start by adding the second VETH pair:
admin@example:/config/> edit interface veth1a
admin@example:/config/interface/veth1a/> set veth peer veth1b
admin@example:/config/interface/veth1a/> set veth peer veth1
admin@example:/config/interface/veth1a/> set ipv4 address 192.168.1.2 prefix-length 24
> The LAN bridge (br0) in this example has IP address 192.168.1.1.
> [!NOTE]
> The LAN bridge (br1) in this example has IP address 192.168.1.1.
When a container has multiple host interfaces it can often be useful to
have a default route installed. This can be added from the host with a
@@ -473,15 +567,16 @@ have a default route installed. This can be added from the host with a
}
}
veth {
peer veth1b;
peer veth1;
}
admin@example:/config/interface/veth1a/> end
admin@example:/config/> set interface veth1b bridge-port bridge br0
admin@example:/config/> set interface veth1 bridge-port bridge br1
Please note, container network routes require the base interface also
have a static IP address set. Setting only the route, but no address,
means the route is skipped.
### Host Networking
The third use-case is host networking, this is where a container share
@@ -491,7 +586,7 @@ the host operating system.
The host networking setup cannot be combined with any other network.
For an example, see below.
For an example, [see below](#application-container-nftables).
Mounts and Volumes
@@ -507,29 +602,40 @@ file system:
admin@example:/config/container/system/mount/leds> end
admin@example:/config/container/system/>
Sometimes *volumes* are a better fit. A volume is an automatically
Any type of file can be *bind mounted* into the container, just watch
out for permissions though. In the example above, `/sys/class/leds` is
not writable from a container unless it runs in *privileged* mode. For
plain configuration files you get more freedom, and your container can
rely on, e.g., *inotify* events to trigger reloading its services when
you change the file on the host.
So it depends on the container, and indeed your overall setup, what to
use. An intriguing option is *Content Mounts*, which when changed also
trigger a container restart.
Other times *volumes* are a better fit. A volume is an automatically
created read-writable entity that follows the life of your container.
admin@example:/config/container/ntpd/> set volume varlib target /var/lib
Volumes survive reboots and upgrading of the base image, unlike the
persistent writable layer you get by default, which does not survive
upgrades. The volume is created by podman when the container first
starts up, unlike a regular bind mount it synchronizes with the contents
of the underlying container image's path on the first start. I.e.,
"bind-mount, if empty: then rsync".
Volumes are persistent across both reboots and upgrades of the base
image. They are created by Podman when the container first starts up,
unlike a regular bind mount it synchronizes with the contents of the
underlying container image's path at first use. I.e., "bind-mount, if
empty: then rsync".
> [!NOTE]
> Infix support named volumes (only), and it is not possible to share a
> volume between containers. All the tricks possible with volumes may
> be added in a later release.
### Content Mounts
Content mount is a special type of where the file contents for the
container is stored alongside the container configuration. This can be
very useful when deploying similar systems at multiple sites. When the
host loads its `startup-config` (or even `factory-config`) a temporary
file is created using the decoded base64 data from the `content` node.
Content mounts are a special type of file mount where the file contents
is stored with the container configuration. This can be very useful
when deploying similar systems at multiple sites. When the host loads
its `startup-config` (or even `factory-config`) a temporary file is
created using the decoded base64 data from the `content` node.
admin@example:/config/container/ntpd/> edit mount ntpd.conf
admin@example:/config/container/ntpd/mount/ntpd.conf> text-editor content
@@ -542,9 +648,10 @@ The editor is a small [Emacs clone called Mg][2], see the built-in help
text, or press Ctrl-x Ctrl-c to exit and save. When the editor exits
the contents are base64 encoded and stored in the candidate datastore.
> **Note:** since these files are always recreated when the host is
> restarted, changes made by the container are not preserved, or saved
> back to the host's startup-config even if the read-only option is off.
> [!NOTE]
> Since these files are always recreated when the host is restarted,
> changes made by the container are not preserved, or saved back to the
> host's startup-config.
Infix has three different text editors available. For more information,
see [CLI Text Editor](cli/text-editor.md).
@@ -566,10 +673,11 @@ we created previously:
admin@example:/config/container/system/> set publish 222:22
admin@example:/config/container/system/> leave
> **Note:** ensure you have a network connection to the registry.
> If the image cannot be pulled, creation of the container will be
> put in a queue and be retried every time there is a change in the
> routing table, e.g., default route is added.
> [!NOTE]
> Ensure you have a network connection to the registry. If the image
> cannot be pulled, creation of the container will be put in a queue and
> be retried every time there is a change in the routing table, e.g.,
> default route is added, and every 60 seconds.
Provided the image is downloaded successfully, a new `system` container
now runs behind the docker0 interface, forwarding container port 22 to
@@ -599,6 +707,17 @@ container ID (hash) is used, but this can be easily changed:
admin@example:/> container shell system
root@sys101:/#
In fact, the container `hostname` setting supports the same format
specifiers as the host's `hostname` setting:
- `%i`: OS ID, from `/etc/os-release`, from Menuconfig branding
- `%h`: Default hostname, from `/etc/os-release`, from branding
- `%m`: NIC specific part of base MAC, e.g., to `c0-ff-ee`
- `%%`: Literal %
The most useful combination is probably `"container-name-%m"`, which in
this example give the container hostname `container-name-c0-ff-ee`.
[^1]: this does not apply to the admin-exec command `container run`.
This command is intended to be used for testing and evaluating
container images. Such containers are given a private network
@@ -626,6 +745,7 @@ Notice how we `set network host`, so the container can see and act on
all the host's interfaces, and that we also have to run the container
in *privileged* mode.
### Application Container: ntpd
The default NTP server/client in Infix is Chrony, a fully working and
@@ -673,12 +793,13 @@ Another *insecure* approach is to access the host system directly,
bypassing the namespaces that make up the boundary between host and
container.
> **Security:** Please note, this completely demolishes the isolation
> barrier between container and host operating system. It is only
> suitable in situations where the container serves more as a unit of
> distribution rather than as a separate component of the system.
> *Strongly recommended* to use this only in trusted setups! Consider
> also limiting the time frame in which this is active!
> [!CAUTION]
> Please note, this completely demolishes the isolation barrier between
> container and host operating system. It is only suitable in
> situations where the container serves more as a unit of distribution
> rather than as a separate component of the system. *Strongly
> recommended* to use this only in trusted setups! Consider also
> limiting the time frame in which this is active!
First, enable *Privileged* mode, this unlocks the door and allows the
container to manage resources on the host system. An example is the
@@ -706,18 +827,80 @@ and then asking what the hostname is on the host:
One use-case for this method is when extending Infix with a management
container that connects to other systems. For some tips on how to
control an Infix system this way, see [Scripting Infix](scriptiong.md).
control an Infix system this way, see [Scripting Infix](scripting.md).
[^2]: The `nsenter` program is available from either the util-linux
package in Debian/Ubuntu/Mint, or in BusyBox. Note, however,
it may not be enabled by default in BusyBox.
Container Requirements
----------------------
In addition to general [*best practices*][7] for container images, there
are a few more things to consider when targeting embedded systems:
- Ensure the image targets the CPU architecture of the target system,
learn more about [Multi-platform Builds][8]
- Follow [best practices for naming and tagging][10], e.g., `:latest` vs `:1.0`
- Follow [OCI recommendations and layout][9],
learn more about [OCI and Docker Exporters][6]
If the [Docker documentation][11] is not enough, there are plenty of
[guides online][12] with examples on how to create your own container
image. For the more advanced, please see the next section.
### Advanced Users
Most people prefer their system containers small, often based on Alpine
Linux, or similar, with only a few small applications, including their
own, and an SSH server perhaps. For some developers, even this is too
big, so they roll their own from source. This section is for you.
Depending on your needs, here is a checklist:
- you need something that can forward signals, e.g.,
- [tini][]
- [Bash only][13], or
- BusyBox init, a classic most embedded developers know, but read on ...
- a system container only need the bare necessities of a system bringup
- E.g., BusyBox's init, [but not everything][15]
- Some of the networking is set up by Podman and CNI for you, but
you may want to run a DHCP client?
- Do *not* rename interfaces inside the container, use the dedicated
`interface_name` option in the configuration instead
- Remember, Podman provides a `tmpfs` for all critical system paths:
`/dev`, `/dev/shm`, `/run`, `/tmp`, and `/var/tmp`, so you don't
need to clean or set up any of these mount points
Examples using `tini` and BusyBox init are available from the KernelKit
[curiOS project][14]. It is a small Buildroot based container image
builder that generates OCI compatible image tarballs without any tools
from Docker or Podman -- ready-made images exist for testing on both
AMD64 and ARM64 targets, as well as `docker pull` images and and OCI
tarballs with SHA256 checksums for integrity checking.
Finally, if you build your own version of Infix, and embed OCI tarballs
in the system image, then see the tip at the end of [Upgrading a
Container Image](#upgrading-a-container-image) (above).
[0]: networking.md
[1]: https://github.com/kernelkit/infix/blob/main/src/confd/yang/infix-containers%402023-12-14.yang
[1]: https://github.com/kernelkit/infix/blob/main/src/confd/yang/infix-containers.yang
[2]: https://github.com/troglobit/mg
[3]: https://github.com/opencontainers/image-spec/blob/main/image-layout.md
[4]: system.md#ssh-authorized-key
[5]: https://docs.docker.com/build/exporters/oci-docker/
[6]: https://man7.org/linux/man-pages/man7/capabilities.7.html
[7]: https://docs.docker.com/build/building/best-practices/
[8]: https://docs.docker.com/build/building/multi-platform/
[9]: https://github.com/opencontainers/image-spec/blob/main/image-layout.md
[10]: https://docs.docker.com/get-started/docker-concepts/building-images/build-tag-and-publish-an-image/#tagging-images
[11]: https://www.docker.com/blog/multi-arch-images/
[12]: https://lemariva.com/blog/2018/05/tutorial-docker-on-embedded-systems-raspberry-pi-beagleboard
[13]: https://sirikon.me/posts/0009-pid-1-bash-script-docker-container.html
[14]: https://github.com/kernelkit/curiOS/
[15]: https://github.com/kernelkit/curiOS/blob/2e4748f65e356b2c117f586cd9420d7ba66f79d5/board/system/rootfs/etc/inittab
[tini]: https://github.com/krallin/tini
[podman]: https://podman.io
+15 -14
View File
@@ -206,20 +206,18 @@ corresponding image for execution with our normal tooling:
Contributing
------------
Infix is built from many parts, when contributing you need to set up
your own fork, create a local branch for your change, push to your fork,
and then use GitHub to create a *Pull Reqeuest*.
Infix is built from many components, when contributing you need to set
up your own fork, create a local branch for your change, push to your
fork, and then use GitHub to create a *Pull Reqeuest*.
For this to work as painlessly as possible:
For this to work as *painlessly as possible* for everyone involved:
1. Fork Infix to your own user or organization[^1]
2. Fork all the Infix submodules, e.g., `kernelkit/buildroot` to your
own user or organization as well
3. Clone your fork of Infix to your laptop/workstation
If you use a GitHub organization you get the added benefit of having
local peer reviews of changes before making a pull request to the
upstream Infix repository.
1. Fork Infix to your own user or organization[^1]
2. Fork all the Infix submodules, e.g., `kernelkit/buildroot` to your
own user or organization as well
3. Clone your fork of Infix to your laptop/workstation
4. [Deactivate the Actions][6] you don't want in your fork
5. Please read the [Contributing Guidelines][5] as well!
```bash
$ cd ~/Projects
@@ -227,10 +225,10 @@ $ git clone https://github.com/YOUR_USER_NAME/infix.git
$ cd infix/
$ git submodule update --init
```
> **Note:** when updating/synchronizing with upstream Infix changes you
> may have to synchronize your forks as well. GitHub have a `Sync fork`
> button in the GUI for your fork for this purpose.
> button in the GUI for your fork for this purpose. A cronjob on your
> server of choice can do this for you with the [GitHub CLI tool][7].
[^1]: Organizations should make sure to lock the `main` (or `master`)
branch of their clones to ensure members do not accidentally merge
@@ -243,3 +241,6 @@ $ git submodule update --init
[2]: https://github.com/wkz/qeneth
[3]: https://netopeer.liberouter.org/doc/sysrepo/master/html/dev_guide.html
[4]: https://buildroot.org/downloads/manual/manual.html#_developer_guide
[5]: https://github.com/kernelkit/infix/blob/main/.github/CONTRIBUTING.md
[6]: https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
[7]: https://cli.github.com/
+171
View File
@@ -0,0 +1,171 @@
DHCP Server
===========
The DHCPv4 server provides automatic IP address assignment and network
configuration for clients. It supports address pools, static host
assignments, and customizable DHCP options. It also serves as a DNS
proxy for local subnets and can even forward queries to upstream DNS
servers[^1].
> [!NOTE]
> When using the CLI, the system automatically enables essential options
> like DNS servers and default gateway based on the system's network
> configuration. These options can be disabled, changed or overridden,
> at any level: global, subnet, or per-host.
## Basic Configuration
The following example configures a DHCP server for subnet 192.168.2.0/24
with an address pool:
```
admin@example:/> configure
admin@example:/config/> edit dhcp-server
admin@example:/config/dhcp-server/> edit subnet 192.168.2.0/24
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/> set pool start-address 192.168.2.100 end-address 192.168.2.200
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/> leave
```
When setting up the server from the CLI, the system automatically adds a
few default DHCP options that will be sent to clients: both DNS server
and default gateway will use the system address on the matching
interface.
```
admin@example:/> show running-config
"infix-dhcp-server:dhcp-server": {
"subnet": [
{
"subnet": "192.168.2.0/24",
"option": [
{
"id": "dns-server",
"address": "auto"
},
{
"id": "router",
"address": "auto"
}
],
"pool": {
"start-address": "192.168.2.100",
"end-address": "192.168.2.200"
}
}
]
}
```
> [!IMPORTANT]
> Remember to set up an interface in this subnet, avoid using addresses
> in the DHCP pool, or reserved for static hosts. In Class C networks
> the router usually has address `.1`. Depending on the use-case, you
> may also want to set up routing.
## Static Host Assignment
To reserve specific IP addresses for clients based on their MAC address,
hostname, or client ID:
```
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/> edit host 192.168.2.10
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/host/192.168.2.10/> set match mac-address 00:11:22:33:44:55
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/host/192.168.2.10/> set hostname printer
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/host/192.168.2.10/> leave
```
Match hosts using a client identifier instead of MAC address:
```
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/> edit host 192.168.1.50
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/host/192.168.1.50/> edit match
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/host/192.168.1.50/match/> set client-id hex c0:ff:ee
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/host/192.168.1.50/match/> leave
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/host/192.168.1.50/> set lease-time infinite
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/host/192.168.1.50/> leave
```
The `hex` prefix here ensures matching of client ID is done using the
hexadecimal octets `c0:ff:ee`, three bytes. Without the prefix the
ASCII string "c0:ff:ee", eight bytes, is used.
> [!NOTE]
> The DHCP server is fully RFC conformant, in the case of option 61 this
> means that using the `hex` prefix will require the client to set the
> `htype` field of the option to `00`. See RFC 2132 for details.
## Custom DHCP Options
Configure additional DHCP options globally, per subnet, or per host:
```
admin@example:/config/dhcp-server/> edit subnet 192.168.2.0/24
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/> edit option dns-server
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/option/dns-server/> set address 8.8.8.8
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/option/dns-server/> leave
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/> edit option ntp-server
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/option/ntp-server/> set address 192.168.2.1
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/option/ntp-server/> leave
```
When configuring, e.g., `dns-server`, or `router` options with the value
`auto`, the system uses the IP address from the interface matching the
subnet. For example:
```
admin@example:/> show interfaces brief
Interface Status Address
eth0 UP 192.168.1.1/24
eth1 UP 192.168.2.1/24
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/> edit option dns-server
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/option/dns-server/> set address auto
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/option/dns-server/> leave
```
In this case, clients in subnet 192.168.1.0/24 will receive 192.168.1.1
as their DNS server address.
## Multiple Subnets
Configure DHCP for multiple networks:
```
admin@example:/> configure
admin@example:/config/> edit dhcp-server
admin@example:/config/dhcp-server/> edit subnet 192.168.1.0/24
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/> set pool start-address 192.168.1.100 end-address 192.168.1.200
admin@example:/config/dhcp-server/subnet/192.168.1.0/24/> leave
admin@example:/config/dhcp-server/> edit subnet 192.168.2.0/24
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/> set pool start-address 192.168.2.100 end-address 192.168.2.200
admin@example:/config/dhcp-server/subnet/192.168.2.0/24/> leave
```
## Monitoring
View active leases and server statistics:
```
admin@example:/> show dhcp-server
IP ADDRESS MAC HOSTNAME CLIENT ID EXPIRES
192.168.2.22 00:a0:85:00:02:05 00:c0:ff:ee 3591s
192.168.1.11 00:a0:85:00:04:06 foo 01:00:a0:85:00:04:06 3591s
admin@example:/> show dhcp-server statistics
DHCP offers sent : 6
DHCP ACK messages sent : 5
DHCP NAK messages sent : 0
DHCP decline messages received : 0
DHCP discover messages received : 6
DHCP request messages received : 5
DHCP release messages received : 6
DHCP inform messages received : 6
```
[^1]: This requires the system DNS resolver to be configured.
+213 -65
View File
@@ -1,29 +1,29 @@
Discover Infix Units
====================
# Discover Devices
Infix advertises itself via the [mDNS-SD](#mdns-sd) and [LLDP](#lldp)
discovery protocols. mDNS-SD has good client support in Windows, macOS
and on Linux systems. More on these protocols later.
An even simpler method is available when directly attached to an Infix
device:
```
.----. Ethernet .-------.
| PC +---------------------+ Infix |
'----' if1 eth0 '-------'
.----. Ethernet .-------.
| PC +---------------------+ Infix |
'----' if1 e1 '-------'
```
Figure 1: PC directly connected over Ethernet to Infix unit (here eth0).
When you wish to discover the IP address of an Infix switch, the simplest
way is probably to *ping the IPv6 all-hosts* address (ff02::1) over a
directly connected Ethernet cable. The unit's link-local IPv6 address is
seen in the response.
In the example below, the PC is connected to Infix via interface *tap0*
(*tap0* is *if1* in Figure 1) and Infix responds with address
*fe80::ff:fe00:0*.
With IPv6 you can *ping the all-hosts* address (ff02::1), the device's
link-local IPv6 address is then seen in the response. In the following
example, the PC here uses *tap0* as *if1*, Infix responds with address
*fe80::ff:fec0:ffed*.
```
linux-pc:# ping -6 -L -c 3 ff02::1%tap0
PING ff02::1%tap0(ff02::1%tap0) 56 data bytes
64 bytes from fe80::ff:fe00:0%tap0: icmp_seq=1 ttl=64 time=0.558 ms
64 bytes from fe80::ff:fe00:0%tap0: icmp_seq=2 ttl=64 time=0.419 ms
64 bytes from fe80::ff:fe00:0%tap0: icmp_seq=3 ttl=64 time=0.389 ms
64 bytes from fe80::ff:fec0:ffed%tap0: icmp_seq=1 ttl=64 time=0.558 ms
64 bytes from fe80::ff:fec0:ffed%tap0: icmp_seq=2 ttl=64 time=0.419 ms
64 bytes from fe80::ff:fec0:ffed%tap0: icmp_seq=3 ttl=64 time=0.389 ms
--- ff02::1%tap0 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2043ms
@@ -31,42 +31,42 @@ rtt min/avg/max/mdev = 0.389/0.455/0.558/0.073 ms
linux-pc:#
```
The PC could connect then connect to Infix, e.g., using SSH.
> [!TIP]
> The `-L` option ignores local responses from the PC.
This address can then be used to connect to the device, e.g., using SSH.
Notice the syntax `username@address%interface`:
```
linux-pc:# ssh admin@fe80::ff:fe00:0%tap0
admin@fe80::ff:fe00:0%tap0's password: admin
admin@infix-00-00-00:~$
linux-pc:# ssh admin@fe80::ff:fec0:ffed%tap0
admin@fe80::ff:fec0:ffed%tap0's password: admin
admin@infix-c0-ff-ee:~$
```
## Discovery mechanisms available in Infix
Infix advertises its presence via the [mDNS](#mdns) and [LLDP](#lldp)
discovery protocols.
## LLDP
Infix supports LLDP (IEEE 802.1AB). For a device with factory default
settings, the link-local IPv6 address can be read from the Management
Address TLV using *tcpdump* or other sniffing tools[^1]:
### LLDP
Infix supports LLDP (IEEE 802.1AB). For a unit with factory default
settings, the PC can readout the link-local IPv6 address from the
Management Address TLV using *tcpdump* or other sniffing tools[^1].
```
linux-pc:# tcpdump -i tap0 -Qin -v ether proto 0x88cc
tcpdump: listening on tap0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
15:51:52.061071 LLDP, length 193
Chassis ID TLV (1), length 7
Subtype MAC address (4): 02:00:00:00:00:00 (oui Unknown)
Subtype MAC address (4): 02:00:00:c0:ff:ee (oui Unknown)
Port ID TLV (2), length 7
Subtype MAC address (3): 02:00:00:00:00:00 (oui Unknown)
Subtype MAC address (3): 02:00:00:c0:ff:ee (oui Unknown)
Time to Live TLV (3), length 2: TTL 120s
System Name TLV (5), length 14: infix-00-00-00
System Name TLV (5), length 14: infix-c0-ff-ee
System Description TLV (6), length 91
Infix by KernelKit Linux 5.19.17 #1 SMP PREEMPT_DYNAMIC Wed Jun 7 08:47:23 CEST 2023 x86_64
System Capabilities TLV (7), length 4
System Capabilities [Bridge, WLAN AP, Router, Station Only] (0x009c)
Enabled Capabilities [Station Only] (0x0080)
Management Address TLV (8), length 24
Management Address length 17, AFI IPv6 (2): fe80::ff:fe00:0
Management Address length 17, AFI IPv6 (2): fe80::ff:fec0:ffed
Interface Index Interface Numbering (2): 2
Port Description TLV (4), length 4: eth0
Organization specific TLV (127), length 9: OUI IEEE 802.3 Private (0x00120f)
@@ -83,11 +83,12 @@ tcpdump: listening on tap0, link-type EN10MB (Ethernet), snapshot length 262144
linux-pc:#
```
If the unit has an IPv4 address assigned, it is shown in an additional
If the device has an IPv4 address assigned, it is shown in an additional
Management Address TLV.
> **Note** The Management Addresses shown by LLDP are not
> necessarily associated with the port transmitting the LLDP message.
> [!NOTE]
> The Management Addresses shown by LLDP are not necessarily associated
> with the port transmitting the LLDP message.
In the example below, the IPv4 address (10.0.1.1) happens to be
assigned to *eth0*, while the IPv6 address (2001:db8::1) is not.
@@ -97,11 +98,11 @@ linux-pc:# sudo tcpdump -i tap0 -Qin -v ether proto 0x88cc
tcpdump: listening on tap0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
15:46:07.908665 LLDP, length 207
Chassis ID TLV (1), length 7
Subtype MAC address (4): 02:00:00:00:00:00 (oui Unknown)
Subtype MAC address (4): 02:00:00:c0:ff:ee (oui Unknown)
Port ID TLV (2), length 7
Subtype MAC address (3): 02:00:00:00:00:00 (oui Unknown)
Subtype MAC address (3): 02:00:00:c0:ff:ee (oui Unknown)
Time to Live TLV (3), length 2: TTL 120s
System Name TLV (5), length 14: infix-00-00-00
System Name TLV (5), length 14: infix-c0-ff-ee
System Description TLV (6), length 91
Infix by KernelKit Linux 5.19.17 #1 SMP PREEMPT_DYNAMIC Wed Jun 7 08:47:23 CEST 2023 x86_64
System Capabilities TLV (7), length 4
@@ -130,47 +131,194 @@ tcpdump: listening on tap0, link-type EN10MB (Ethernet), snapshot length 262144
linux-pc:#
```
[^1]: [lldpd: implementation of IEEE 802.1ab
(LLDP)](https://github.com/lldp/lldpd) includes *lldpcli*, which
is handy to sniff and display LLDP packets.
The LLDP service can be disabled using the following commands.
### mDNS
```
admin@infix-c0-ff-ee:/> configure
admin@infix-c0-ff-ee:/config/> no lldp
admin@infix-c0-ff-ee:/config/> leave
admin@infix-c0-ff-ee:/>
```
DNS-SD/mDNS can be used to discover Infix units and services. Infix
units present their IP addresses, services and hostname within the
.local domain. This method has good client support in Apple and Linux
systems. On Linux, tools such as *avahi-browse* or *mdns-scan*[^2] can
be used to search for devices advertising their services via mDNS.
## mDNS-SD
DNS-SD/mDNS-SD can be used to discover Infix devices and services. By
default, Infix use the `.local` domain for advertising services. Some
networks use `.lan` instead, so this configurable:
```
admin@infix-c0-ff-ee:/> configure
admin@infix-c0-ff-ee:/config/> edit mdns
admin@infix-c0-ff-ee:/config/mdns/> set domain lan
```
Other available settings include limiting the interfaces mDNS responder
acts on:
```
admin@infix-c0-ff-ee:/config/> set interfaces allow e1
```
or
```
admin@infix-c0-ff-ee:/config/> set interfaces deny wan
```
The `allow` and `deny` settings are complementary, `deny` always wins.
----
In Linux, tools such as *avahi-browse* or *mdns-scan*[^2] can be used to
search for devices advertising their services via mDNS.
```
linux-pc:# avahi-browse -ar
+ tap0 IPv6 infix-00-00-00 SFTP File Transfer local
+ tap0 IPv4 infix-00-00-00 SFTP File Transfer local
+ tap0 IPv6 infix-00-00-00 SSH Remote Terminal local
+ tap0 IPv4 infix-00-00-00 SSH Remote Terminal local
= tap0 IPv4 infix-00-00-00 SFTP File Transfer local
hostname = [infix-00-00-00.local]
+ tap0 IPv6 infix-c0-ff-ee SFTP File Transfer local
+ tap0 IPv4 infix-c0-ff-ee SFTP File Transfer local
+ tap0 IPv6 infix-c0-ff-ee SSH Remote Terminal local
+ tap0 IPv4 infix-c0-ff-ee SSH Remote Terminal local
= tap0 IPv4 infix-c0-ff-ee SFTP File Transfer local
hostname = [infix-c0-ff-ee.local]
address = [10.0.1.1]
port = [22]
txt = []
= tap0 IPv4 infix-00-00-00 SSH Remote Terminal local
hostname = [infix-00-00-00.local]
= tap0 IPv4 infix-c0-ff-ee SSH Remote Terminal local
hostname = [infix-c0-ff-ee.local]
address = [10.0.1.1]
port = [22]
txt = []
= tap0 IPv6 infix-00-00-00 SFTP File Transfer local
hostname = [infix-00-00-00.local]
address = [fe80::ff:fe00:0]
= tap0 IPv6 infix-c0-ff-ee SFTP File Transfer local
hostname = [infix-c0-ff-ee.local]
address = [fe80::ff:fec0:ffed]
port = [22]
txt = []
= tap0 IPv6 infix-00-00-00 SSH Remote Terminal local
hostname = [infix-00-00-00.local]
address = [fe80::ff:fe00:0]
= tap0 IPv6 infix-c0-ff-ee SSH Remote Terminal local
hostname = [infix-c0-ff-ee.local]
address = [fe80::ff:fec0:ffed]
port = [22]
txt = []
^C
linux-pc:#
```
> [!TIP]
> The `-t` option is also very useful, it stops browsing automatically
> when a "more or less complete list" has been printed. However, some
> devices on the LAN may be in deep sleep so run the command again if
> you cannot find the device you are looking for.
Additionally, *avahi-resolve-host-name* can be used to verify domain
name mappings for IP addresses. By default, it translates from IPv4
addresses. This function allows users to confirm that addresses are
mapped correctly.
```
linux-pc:# avahi-resolve-host-name infix-c0-ff-ee.local
infix-c0-ff-ee.local 10.0.1.1
linux-pc:#
```
Thanks to mDNS we can use the advertised name instead of the IP
address for operations like `ping` and `ssh` as shown below:
```
linux-pc:# ping infix-c0-ff-ee.local -c 3
PING infix-c0-ff-ee.local (10.0.1.1) 56(84) bytes of data.
64 bytes from 10.0.1.1: icmp_seq=1 ttl=64 time=0.852 ms
64 bytes from 10.0.1.1: icmp_seq=2 ttl=64 time=1.12 ms
64 bytes from 10.0.1.1: icmp_seq=3 ttl=64 time=1.35 ms
--- infix-c0-ff-ee.local ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.852/1.105/1.348/0.202 ms
linux-pc:# ssh admin@infix-c0-ff-ee.local
(admin@infix-c0-ff-ee.local) Password:
.-------.
| . . | Infix -- a Network Operating System
|-. v .-| https://kernelkit.org
'-'---'-
Run the command 'cli' for interactive OAM
linux-pc:#
```
To disable mDNS/mDNS-SD, type the commands:
```
admin@infix-c0-ff-ee:/> configure
admin@infix-c0-ff-ee:/config/> no mdns
admin@infix-c0-ff-ee:/config/> leave
```
### Human-Friendly Hostname Alias
Each Infix deviuce advertise itself as *infix.local*, in addition to its
full hostname (e.g., *infix-c0-ff-ee.local* or *foo.local*). This alias
works seamlessly on a network with a single Infix device, and makes it
easy to connect when the exact hostname is not known in advance. The
examples below show how the alias can be used for actions such as
pinging or establishing an SSH connection:
```
linux-pc:# ping infix.local -c 3
PING infix.local (10.0.1.1) 56(84) bytes of data.
64 bytes from 10.0.1.1: icmp_seq=1 ttl=64 time=0.751 ms
64 bytes from 10.0.1.1: icmp_seq=2 ttl=64 time=2.28 ms
64 bytes from 10.0.1.1: icmp_seq=3 ttl=64 time=1.42 ms
--- infix.local ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.751/1.482/2.281/0.626 ms
linux-pc:# ssh admin@infix.local
(admin@infix.local) Password:
.-------.
| . . | Infix -- a Network Operating System
|-. v .-| https://kernelkit.org
'-'---'-
Run the command 'cli' for interactive OAM
admin@infix-c0-ff-ee:~$
```
When multiple Infix devices are present on the LAN the alias will not
uniquely identify a device; *infix.local* will refer to any of the
Infix devices, likely the one that first appeared.
> [!NOTE]
> When multiple Infix devices are present on the LAN, use the full name,
> e.g., *infix-c0-ff-ee.local* or *foo.local* rather than the alias
> *infix.local* to deterministically connect to the device.
### Browse Network Using *network.local*
Another mDNS alias that all Infix devices advertise is *network.local*.
This is a web service which basically runs `avahi-browse` and displays a
table of other Infix devices and their services.
![Netbrowse Service - network.local](img/network-local.png)
With multiple Infix devices on the LAN, one will take the role of your
portal to access all others, if it goes down another takes its place.
To disable the netbrowse service, and the *network.local* alias, the
following commands can be used:
```
admin@infix-c0-ff-ee:/> configure
admin@infix-c0-ff-ee:/config/> edit web
admin@infix-c0-ff-ee:/config/web/> no netbrowse
admin@infix-c0-ff-ee:/config/web/> leave
```
[^1]: E.g., [lldpd](https://github.com/lldp/lldpd) which includes the
*lldpcli* too, handy to sniff and display LLDP packets.
[^2]: [mdns-scan](http://0pointer.de/lennart/projects/mdns-scan/): a
tool for scanning for mDNS/DNS-SD published services on the local
network
tool for scanning for mDNS/DNS-SD services on the local network.
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 317 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 340 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 269 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 339 KiB

+1 -1
View File
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 268 KiB

After

Width:  |  Height:  |  Size: 281 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 464 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 388 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 343 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 224 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 269 KiB

+19 -11
View File
@@ -15,7 +15,8 @@ managing entire fleets of installed equipment.
Nevertheless, when it comes to initial deployment and debugging, it
is very useful to know how to navigate and use the CLI.
> Proceed to the [CLI User Guide](cli/tutorial.md).
> Proceed to the [CLI Introduction](cli/introduction.md) or [CLI
> Configuration Tutorial](cli/configure.md).
## Key Concepts
@@ -62,9 +63,11 @@ The system has several datastores (or files):
configure context. Any changes made here can be discarded (`abort`,
`rollback`) or committed (`commit`, `leave`) to `running-config`.
> See the [Branding & Releases](branding.md) for information on how
> `factory-config` and `failure-config` can be adapted to different
> customer requirements.
> Please see the [Branding & Releases](branding.md) document for more
> in-depth information on how `factory-config` and `failure-config` can
> be adapted to different customer requirements. Including how you can
> override the generated versions of these files with plain per-product
> ones -- this may even protect against some of the failure modes below.
## System Boot
@@ -90,7 +93,8 @@ password in VPD, are detailed later in this section.
there is a working fail safe, or rather *fail secure*, mode
4. On first power-on, and after a factory reset, the system does not
have a `startup-config`, in which case `factory-config` is copied
to `startup-config`
to `startup-config` -- if a per-product specific version exists it
is preferred over the generated one
5. Provided the integrity of the `startup-config` is OK, a system
service loads and activates the configuration
@@ -123,13 +127,17 @@ syntax, failed validation against the system's YANG model, or a bug in
the system's `confd` service, the *Fail Secure Mode* is triggered and
`failure-config` is loaded (unless VPD Failure, see above).
> Again, please see the [Branding & Releases](branding.md) document for
> how to provide a per-product hard-coded `failure-config` to suit your
> products preferences.
*Fail Secure Mode* is a fail-safe mode provided for debugging the
system. The default[^3] is isolated interfaces with communication only to
the management CPU, SSH and console login using the device's factory
reset password, IP connectivity only using IPv6 link-local, and device
discovery protocols: LLDP, mDNS-SD. The login and shell prompt are set
to `failure-c0-ff-ee`, the last three octets of the device's base MAC
address.
system. The default[^3] creates a setup of isolated interfaces with
communication only to the management CPU, SSH and console login using
the device's factory reset password, IP connectivity only using IPv6
link-local, and device discovery protocols: LLDP, mDNS-SD. The login
and shell prompt are set to `failure-c0-ff-ee`, the last three octets of
the device's base MAC address.
[^1]: YANG is a modeling language from IETF, replacing that used for
SNMP (MIB), used to describe the subsystems and properties of
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+195
View File
@@ -0,0 +1,195 @@
# Management
The system utilizes YANG models for keeping configuration and operational
data. These databases can be managed through different interfaces such
as NETCONF, RESTCONF, and CLI via SSH or Console.
## SSH Management
An SSH server (SSHv2) is provided for remote management. It can be
enabled/disabled as shown below.
```
admin@example:/> configure
admin@example:/config/> edit ssh
admin@example:/config/ssh/> set enabled
admin@example:/config/ssh/>
```
By default the SSH server accepts connections to port 22 on all its IP
addresses, but this can be adjusted using the `listen` command. To
make the server (only) listen for incoming connections to IP address
_192.168.1.1_ and port _12345_ the following commands can be used.
```
admin@example:/> configure
admin@example:/config/> edit ssh
admin@example:/config/ssh/> show
enabled true;
hostkey genkey;
listen ipv4 {
address 0.0.0.0;
port 22;
}
listen ipv6 {
address ::;
port 22;
}
admin@example:/config/ssh/> no listen ipv6
admin@example:/config/ssh/> edit listen ipv4
admin@example:/config/ssh/listen/ipv4/> set address 192.168.1.1
admin@example:/config/ssh/listen/ipv4/> set port 12345
admin@example:/config/ssh/listen/ipv4/>
```
The default SSH hostkey is generated on first boot and is used in both
SSH and NETCONF (SSH transport). Custom keys can be added to the
configuration in `ietf-keystore`. The only supported hostkey type is
RSA for now, thus the private key must be
`ietf-crypto-types:rsa-private-key-format` and the public key
`ietf-crypto-types:ssh-public-key-format`
### Use your own SSH hostkeys
Hostkeys can be generated with OpenSSL:
```bash
openssl genpkey -quiet -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -outform PEM > mykey
openssl rsa -RSAPublicKey_out < mykey > mykey.pub
```
Store the keys in `ietf-keystore` _without_ the header and footer information
created by OpenSSL.
After the key has been stored in the keystore and given the name
_mykey_ it can be added to SSH configuration:
admin@example:/> configure
admin@example:/config/> edit ssh
admin@example:/config/ssh/> set hostkey mykey
## Console Port
For units with a console port, it is possible for users to login to
shell/CLI with functionality similar to what is provided via SSH.
The type and setup for your console port is product specific. For
instance, it can be a USB-C port connected to the CPU serial port
using a USB-to-serial converter. To connect you would need a USB-C cable
connected to the console port of the device. The serial port is
typically setup to run at 115200 baud, 8N1.
```
Infix -- a Network Operating System v24.11.1 (ttyS0)
example login: admin
Password:
.-------.
| . . | Infix -- a Network Operating System
|-. v .-| https://kernelkit.org
'-'---'-'
Run the command 'cli' for interactive OAM
admin@example:~$
```
The `resize` command can be used to update terminal settings to the
size of your terminal window.
```
admin@example:~$ resize
COLUMNS=115;LINES=59;export COLUMNS LINES;
admin@example:~$
```
CLI can be entered from shell in the same way as for SSH.
```
admin@example:~$ cli
See the 'help' command for an introduction to the system
admin@example:/> show interfaces
INTERFACE PROTOCOL STATE DATA
lo ethernet UP 00:00:00:00:00:00
ipv4 127.0.0.1/8 (static)
ipv6 ::1/128 (static)
e1 ethernet LOWER-DOWN 00:53:00:06:03:01
e2 ethernet LOWER-DOWN 00:53:00:06:03:02
...
admin@example:/>
```
## Web, Web-console and RESTCONF
The system provides a set of Web services:
- a rudimentary Web server, currently limited to an information page
- a RESTCONF server with equivalent management capabilities as NETCONF
- a Web console service, where the shell/CLI can be accessed via
HTTPS, similar to connecting via a console port or SSH
There is also a *Netbrowse* Web service presenting information about
the unit's neighbors, collected via mDNS (see
[Discovery](discovery.md) for more details).
```
admin@example:/> configure
admin@example:/config/> edit web
admin@example:/config/web/> help
enabled Enable or disable on all web services.
console Web console interface.
netbrowse mDNS Network Browser.
restconf IETF RESTCONF Server.
admin@example:/config/web/>
```
### Enable/disable Web Service and Server
The Web service can be enabled as shown below.
```
admin@example:/> configure
admin@example:/config/> edit web
admin@example:/config/web/> set enabled
admin@example:/config/web/>
```
Enabling the Web service implies that a Web server is
enabled. Currently this Web server provides generic Infix information,
as well as a link to a Web console. The Web server uses HTTPS; any
HTTP request is redirected to HTTPS.
The _enabled_ setting for the Web service acts as a global
enable/disable setting for the other Web services (Web console,
RESTCONF and Netbrowse).
### Enable/disable Web Console
The Web console service provides a terminal service similar to Console
or SSH. The Web console is secured via HTTPS on port 7861.
The Web console has its own enable/disable setting, but will only be
activated if the Web service is enabled. The example below shows how
to disable the Web console.
```
admin@example:/config/web/> edit console
admin@example:/config/web/console/> no enabled
admin@example:/config/web/console/>
```
### Enable/disable RESTCONF Service
Alternatively, the system can be managed remotely using
RESTCONF. Meaning you can `curl` it instead of using a dedicated
NETCONF client.
The RESTCONF service has its own enable/disable setting, but will
only be activated if the Web service is enabled. The example below
shows how to disable the RESTCONF service.
```
admin@example:/config/web/> edit restconf
admin@example:/config/web/restconf/> no enabled
admin@example:/config/web/restconf/>
```
+314 -99
View File
@@ -7,25 +7,55 @@ model forms the base, extended with [ietf-ip.yang][2] and other layer-3
IETF models. The layer-2 bridge and aggregate models are defined by
Infix to exploit the unique features not available in IEEE models.
> **Note:** when issuing `leave` to activate your changes, remember to
> also save your settings, `copy running-config startup-config`. See
> the [CLI Introduction](cli/introduction.md) for a background.
> [!IMPORTANT]
> When issuing `leave` to activate your changes, remember to also save
> your settings, `copy running-config startup-config`. See the [CLI
> Introduction](cli/introduction.md) for a background.
## Interface LEGO®
The network building blocks available in Linux are akin to the popular
LEGO® bricks.
![Linux Networking Blocks](img/lego.svg)
| **Type** | **Yang Model** | **Description** |
| -------- | ----------------- | ------------------------------------------------------------- |
| bridge | infix-if-bridge | SW implementation of an IEEE 802.1Q bridge |
| ip | ietf-ip, infix-ip | IP address to the subordinate interface |
| vlan | infix-if-vlan | Capture all traffic belonging to a specific 802.1Q VID |
| lag[^1] | infix-if-lag | Bonds multiple interfaces into one, creating a link aggregate |
| lo | ietf-interfaces | Software loopback interface |
| eth | ietf-interfaces, | Physical Ethernet device/port |
| | ieee802-ethernet-interface | |
| veth | infix-if-veth | Virtual Ethernet pair, typically one end is in a container |
There are two types of relationships that can link two blocks together:
1. **Lower-to-upper**: Visually represented by an extruding square
connected upwards to a square socket. An interface _can only have
a single_ lower-to-upper relationship, i.e., it can be attached to
a single upper interface like a bridge or a LAG. In `iproute2`
parlance, this corresponds to the interface's `master` setting
2. **Upper-to-lower**: Visually represented by an extruding semicircle
connected downwards to a semicircle socket. The lower interface in
these relationships _accepts multiple_ upper-to-lower relationships
from different upper blocks. E.g., multiple VLANs and IP address
blocks can be connected to the same lower interface
![Stacking order dependencies](img/lego-relations.svg)
An interface may simultaneously have a _lower-to-upper_ relation to some
other interface, and be the target of one or more _upper-to-lower_
relationships. It is valid, for example, for a physical port to be
attached to a bridge, but also have a VLAN interface stacked on top of
it. In this example, traffic assigned to the VLAN in question would be
diverted to the VLAN interface before entering the bridge, while all
other traffic would be bridged as usual.
| **Type** | **Yang Model** | **Description** |
|----------|----------------------------|--------------------------------------------------------------|
| bridge | infix-if-bridge | SW implementation of an IEEE 802.1Q bridge |
| ip | ietf-ip, infix-ip | IP address to the subordinate interface |
| vlan | infix-if-vlan | Capture all traffic belonging to a specific 802.1Q VID |
| lag[^1] | infix-if-lag | Bond multiple interfaces into one, creating a link aggregate |
| lo | ietf-interfaces | Software loopback interface |
| eth | ieee802-ethernet-interface | Physical Ethernet device/port. |
| | infix-ethernet-interface | |
| veth | infix-if-veth | Virtual Ethernet pair, typically one end is in a container |
| *common* | ietf-interfaces, | Properties common to all interface types |
| | infix-interfaces | |
## Data Plane
@@ -50,6 +80,70 @@ possible to share with a container. Meaning, all the building blocks
used on the left hand side can also be used freely on the right hand
side as well.
### General
General interface settings include `type`, `enable`, custom MAC address,
and text `description`. Other settings have their own sections, below.
The `type` is important to set when configuring devices remotely because
unlike the CLI, a NETCONF or RESTCONF session cannot guess the interface
type for you. The operating system provides an override of the
available interface types.
An `enabled` interface can be inspected using the operational datastore,
nodes `admin-state` and `oper-state` show the status, . Possible values
are listed in the YANG model.
The `custom-phys-address` can be used to set an interface's MAC address.
This is an extension to the ietf-interfaces YANG model, which defines
`phys-address` as read-only[^4]. The following shows the different
configuration options.
The `description` is saved as Linux `ifalias` on an interface. It is a
free-form string, useful for describing purpose or just adding comments
for remote debugging, e.g., using the operational datastore.
> [!CAUTION]
> There is no validation or safety checks performed by the system when
> using `custom-phys-address`. In particular the `offset` variant can
> be dangerous to use -- pay attention to the meaning of bits in the
> upper-most octet: local bit, multicast/group, etc.
#### Fixed custom MAC
```
admin@example:/config/> edit interface veth0a
admin@example:/config/interface/veth0a/> set custom-phys-address static 00:ab:00:11:22:33
=> 00:ab:00:11:22:33
```
#### Chassis MAC
Chassis MAC, sometimes also referred to as base MAC. In these two
examples it is `00:53:00:c0:ff:ee`.
```
admin@example:/config/> edit interface veth0a
admin@example:/config/interface/veth0a/> set custom-phys-address chassis
=> 00:53:00:c0:ff:ee
```
#### Chassis MAC, with offset
When constructing a derived address it is recommended to set the locally
administered bit. Same chassis MAC as before.
```
admin@example:/config/> edit interface veth0a
admin@example:/config/interface/veth0a/> set custom-phys-address chassis offset 02:00:00:00:00:02
=> 02:53:00:c0:ff:f0
```
### Bridging
This is the most central part of the system. A bridge is a switch, and
@@ -57,10 +151,12 @@ a switch is a bridge. In Linux, setting up a bridge with ports
connected to physical switch fabric, means you manage the actual switch
fabric!
#### MAC Bridge
In Infix ports are by default not switch ports, unless the customer
specific factory config sets it up this way. To enable switching
between ports you create a bridge and then add ports to that
bridge. That's it.
specific factory config sets it up this way. To enable switching, with
offloading if you have a switch chipset, between ports you create a
bridge and then add ports to that bridge. Like this:
```
admin@example:/> configure
@@ -73,26 +169,38 @@ admin@example:/config/> leave
Here we add two ports to bridge `br0`: `eth0` and `eth1`.
> **Note:** Infix has many built-in helpers controlled by convention.
> E.g., if you name your bridge `brN`, where `N` is a number, Infix sets
> the interface type automatically and unlocks all bridge features.
> Other "magic" names are `ethN.M` for VLAN M on top of `ethN`, or
> `dockerN` to create an IP masquerading container bridge.
> [!TIP]
> The CLI has several built-in helpers governed by convention. E.g.,
> naming bridges `brN`, where `N` is a number, the type is *inferred*
> automatically and unlocks all bridge features. Other conventions are
> `vethNA`, where `N` is a number and `A` is a letter ('a' for access
> port and 'b' for bridge side is common), and `ethN.M` for VLAN M on
> top of `ethN`, or `dockerN` for a IP masquerading container bridge.
>
> Note, this inference only works with the CLI, configuring networking
> over NETCONF or RESTCONF requires setting the type explicitly.
![A MAC bridge with two ports](img/mac-bridge.svg)
It is possible to create multiple MAC bridges, however, it is
currently[^5] _not recommended_ to use more than one MAC bridge on
products with Marvell LinkStreet switching ASICs. A VLAN filtering
bridge should be used instead.
#### VLAN Filtering Bridge
By default bridges in Linux do not filter based on VLAN tags. It can be
enabled in Infix when creating a bridge by adding a port to a VLAN as a
tagged or untagged member. Use the port default VID (PVID) setting to
control VLAN association for traffic ingressing a port untagged (default
PVID: 1).
By default bridges in Linux do not filter based on VLAN tags. This can
be enabled when creating a bridge by adding a port to a VLAN as a tagged
or untagged member. Use the port default VID (PVID) setting to control
VLAN association for traffic ingressing a port untagged (default PVID:
1).
```
admin@example:/config/> edit interface br0
admin@example:/config/interface/br0/> up
admin@example:/config/> set interface eth0 bridge-port bridge br0
admin@example:/config/> set interface eth0 bridge-port pvid 10
admin@example:/config interface eth1 bridge-port bridge br0
admin@example:/config/> set interface eth1 bridge-port bridge br0
admin@example:/config/> set interface eth1 bridge-port pvid 20
admin@example:/config/> edit interface br0
admin@example:/config/interface/br0/> set bridge vlans vlan 10 untagged eth0
@@ -103,6 +211,8 @@ This sets `eth0` as an untagged member of VLAN 10 and `eth1` as an
untagged member of VLAN 20. Switching between these ports is thus
prohibited.
![A VLAN bridge with two VLANs](img/vlan-bridge.svg)
To terminate a VLAN in the switch itself, either for switch management
or for routing, the bridge must become a (tagged) member of the VLAN.
@@ -111,9 +221,16 @@ admin@example:/config/interface/br0/> set bridge vlans vlan 10 tagged br0
admin@example:/config/interface/br0/> set bridge vlans vlan 20 tagged br0
```
> To route or to manage via a VLAN, a VLAN interface needs to be created
> on top of the bridge, see section [VLAN Interfaces](#vlan-interfaces)
> below for more on this topic.
To route or to manage via a VLAN, a VLAN interface needs to be created
on top of the bridge, see section [VLAN Interfaces](#vlan-interfaces)
below for more on this topic.
> [!NOTE]
> In some use-cases only a single management VLAN on the bridge is used.
> For the example above, if the bridge itself is an untagged member only
> in VLAN 10, IP addresses can be set directly on the bridge without the
> need for dedicated VLAN interfaces on top of the bridge.
#### Multicast Filtering and Snooping
@@ -123,10 +240,11 @@ also supports "snooping", i.e., IGMP and MLD, to automatically reduce
the broadcast effects of multicast. See the next section for a summary
of the [terminology used](#terminology--abbreviations).
> **Note:** currently there is no way to just enable multicast filtering
> without also enabling snooping. This may change in the future, in
> which case a `filtering` enabled setting will be made available along
> with the existing `snooping` setting.
> [!IMPORTANT]
> Currently there is no way to just enable multicast filtering without
> also enabling snooping. This may change in the future, in which case
> a `filtering` enabled setting will be made available along with the
> existing `snooping` setting.
When creating your bridge you must decide if you need a VLAN filtering
bridge or a plain bridge (see previous section). Multicast filtering is
@@ -167,15 +285,15 @@ br0 224.1.1.1 e3, e2
br0 ff02::6a br0
```
It is a small LAN, so our bridge has already become the elected IGMP
querier. We see it is ours because the timeout is `None`, and we
recognize our IP address. We can also see two ports that have joined
the same IPv4 multicast group, 224.1.1.1, and one join from Infix itself
for the IPv6 group ff02::6a.
This is a rather small LAN, so our bridge has already become the elected
IGMP querier. We see it is ours because the timeout is `None`, and we
recognize the IP address the system has detected, as ours. We can also
see two ports that have joined the same IPv4 multicast group, 224.1.1.1,
and one join from the system itself for the IPv6 group ff02::6a.
Now, let's see what happens when we add another bridge, with VLAN
filtering enabled. We skip the boring parts about how to move ports
e4-e7 to `br1` and assign them to VLANs, and again, focus on the
Now, let us see what happens when we add another bridge, this time with
VLAN filtering enabled. We skip the boring parts about how to move
ports e4-e7 to `br1` and assign them to VLANs, and again, focus on the
multicast bits only:
```
@@ -187,7 +305,7 @@ admin@example:/config/interface/br1/> leave
admin@example:/> copy running-config startup-config
```
Let's see what we get:
Let us see what we get:
```
admin@example:/> show ip multicast
@@ -266,22 +384,55 @@ an IGMP/MLD fast-leave port.
tables shown above, a *None* timeout is declared when the current
device is the active querier
> **Note:** the reason why multicast flooding is enabled by default is
> to ensure safe co-existence with MAC multicast, which is very common
> in industrial networks. It also allows end devices that do not know
> of IGMP/MLD to communicate over multicast as long as the group they
> have chosen is not used by other IGMP/MLD aware devices on the LAN.
> [!TIP]
> The reason why multicast flooding is enabled by default is to ensure
> safe co-existence with MAC multicast, which is common in industrial
> networks. It also allows end devices that do not know of IGMP/MLD to
> communicate over multicast as long as the group they have chosen is
> not used by other IGMP/MLD aware devices on the LAN.
>
> As soon as an IGMP/MLD membership report to "join" a group is received
> the group is added to the MDB and forwarding to other ports stop. The
> only exception to this rule is multicast router ports.
> the group is added to the kernel MDB and forwarding to other ports
> stop. The only exception to this rule is multicast router ports.
>
> If your MAC multicast forwarding is not working properly, it may be
> because an IP multicast group maps to the same MAC address. Please
> see [RFC 1112][RFC1112] for details. Use static multicast router
> ports, or static multicast MAC filters, to mitigate.
[RFC1112]: https://www.rfc-editor.org/rfc/rfc1112.html
[RFC3376]: https://www.rfc-editor.org/rfc/rfc3376.html
[RFC3810]: https://www.rfc-editor.org/rfc/rfc3810.html
#### Forwarding of IEEE Reserved Group Addresses
Addresses in the range `01:80:C2:00:00:0X` are used by various bridge
signaling protocols, and are not forwarded by default. Still, it is
sometimes useful to let the bridge forward such packets, this can be
done by specifying protocol names or the last address *nibble* as
decimal value `0..15`:
```
admin@example:/config/> edit interface br0 bridge
admin@example:/config/interface/br0/bridge/> set ieee-group-forward # Tap the ? ley for alternatives
[0..15] List of IEEE link-local protocols to forward, e.g., STP, LLDP
dot1x 802.1X Port-Based Network Access Control.
lacp 802.3 Slow Protocols, e.g., LACP.
lldp 802.1AB Link Layer Discovery Protocol (LLDP).
stp Spanning Tree (STP/RSPT/MSTP).
admin@example:/config/interface/br0/bridge/> set ieee-group-forward
```
The following example configures bridge *br0* to forward LLDP packets.
```
admin@example:/config/interface/br0/bridge/> set ieee-group-forward lldp
admin@example:/config/interface/br0/bridge/>
```
### VLAN Interfaces
Creating a VLAN can be done in many ways. This section assumes VLAN
Creating a VLAN can be done in many ways. This section assumes VLAN
interfaces created atop another Linux interface. E.g., the VLAN
interfaces created on top of the Ethernet interface or bridge in the
picture below.
@@ -321,7 +472,9 @@ As conventions, a VLAN interface for VID 20 on top of an Ethernet
interface *eth0* is named *eth0.20*, and a VLAN interface for VID 10 on
top of a bridge interface *br0* is named *vlan10*.
> **Note:** If you name your VLAN interface `foo0.N` or `vlanN`, where `N` is a number, Infix will set the interface type automatically for you.
> [!NOTE]
> If you name your VLAN interface `foo0.N` or `vlanN`, where `N` is a
> number, the CLI infers the interface type automatically.
### Physical Ethernet Interfaces
@@ -329,7 +482,7 @@ top of a bridge interface *br0* is named *vlan10*.
#### Ethernet Settings and Status
Physical Ethernet interfaces provide low-level settings for speed/duplex as
well as packet status and statistics (*ieee802-ethernet-interface.yang*).
well as packet status and [statistics](#ethernet-statistics).
By default, Ethernet interfaces defaults to auto-negotiating
speed/duplex modes, advertising all speed and duplex modes available.
@@ -380,9 +533,10 @@ Auto-negotiation of speed/duplex mode is desired in almost all
use-cases, but it is possible to disable auto-negotiation and specify
a fixed speed and duplex mode.
> If setting a fixed speed and duplex mode, ensure both sides of the
> link have matching configuration. If speed does not match, the link
> will not come up. If duplex mode does not match, the result is
> [!IMPORTANT]
> When setting a fixed speed and duplex mode, ensure both sides of the
> link have matching configuration. If speed does not match, the link
> will not come up. If duplex mode does not match, the result is
> reported collisions and/or bad throughput.
The example below configures port eth3 to fixed speed 100 Mbit/s
@@ -411,7 +565,7 @@ require auto-negotiation to be enabled.
#### Ethernet statistics
Ethernet packet statistics can be listed as shown below.
Ethernet packet statistics[^6] can be listed as shown below.
```
admin@example:/> show interfaces name eth1
@@ -475,9 +629,10 @@ interfaces {
admin@example:/config/>
```
> **Note:** this is another example of the automatic inference of the
> interface type from the name. Any name can be used, but then you have
> to set the interface type to `veth` manually.
> [!TIP]
> This is another example of the automatic inference of the interface
> type from the name. Any name can be used, but then you have to set
> the interface type to `veth` manually.
## Management Plane
@@ -485,7 +640,8 @@ admin@example:/config/>
This section details IP Addresses And Other Per-Interface IP settings.
Infix support several network interface types, each can be assigned one
or more IP addresses, both IPv4 and IPv6 are supported.
or more IP addresses, both IPv4 and IPv6 are supported. (There is no
concept of a "primary" address.)
![IP on top of network interface examples](img/ip-iface-examples.svg)
@@ -499,33 +655,46 @@ Multiple address assignment methods are available:
| link-local | infix-ip | Auto-assignment of IPv4 address in 169.254.x.x/16 range |
| dhcp | infix-dhcp-client | Assignment of IPv4 address by DHCP server, e.g., *10.0.1.1/24* |
> [!NOTE]
> The DHCP address method is only available for *LAN* interfaces
> (Ethernet, virtual Ethernet (veth), bridge, link aggregates, etc.)
Supported DHCP (request) options, configurability (Cfg) and defaults,
are listed below. Configurable options can be disabled on a per client
interface basis, some options, like `clientid` and option 81, are
possible to set the value of as well.
| **Opt** | **Name** | **Cfg** | **Description** |
|---------|------------------|---------|-----------------------------------------------------|
| 1 | `subnet` | No | Request IP address and netmask |
| 3 | `router` | Yes | Default route(s), see also option 121 and 249 |
| 6 | `dns` | Yes | DNS server(s), static ones take precedence |
| 12 | `hostname` | Yes | DHCP cannot set hostname, only for informing server |
| 15 | `domain` | Yes | Default domain name, for name resolution |
| 28 | `broadcast` | Yes | Broadcast address, calculated if disabled |
| 42 | `ntpsrv` | Yes | NTP server(s), static ones take precedence |
| 50 | `address` | Yes | Request (previously cached) address |
| 61 | `clientid` | Yes | Default MAC address (and option 12) |
| 81 | `fqdn` | Yes | Similar to option 12, request FQDN update in DNS |
| 119 | `search` | Yes | Request domain search list |
| 121 | `staticroutes` | Yes | Classless static routes |
| 249 | `msstaticroutes` | Yes | Microsoft static route |
| | | | |
| **Opt** | **Name** | **Cfg** | **Description** |
|---------|-----------------------------|---------|-----------------------------------------------------|
| 1 | `netmask` | No | Request IP address and netmask |
| 3 | `router` | Yes | Default route(s), see also option 121 and 249 |
| 6 | `dns-server` | Yes | DNS server(s), static ones take precedence |
| 12 | `hostname` | Yes | DHCP cannot set hostname, only for informing server |
| 15 | `domain` | Yes | Default domain name, for name resolution |
| 28 | `broadcast` | Yes | Broadcast address, calculated if disabled |
| 42 | `ntp-server` | Yes | NTP server(s), static ones take precedence |
| 50 | `address` | Yes | Request (previously cached) address |
| 61 | `client-id` | Yes | Default MAC address (and option 12) |
| 81 | `fqdn` | Yes | Similar to option 12, request FQDN update in DNS |
| 119 | `search` | Yes | Request domain search list |
| 121 | `classless-static-route` | Yes | Classless static routes |
| 249 | `ms-classless-static-route` | Yes | Microsoft static route, same as option 121 |
| | | | |
**Default:** `router`, `dns`, `domain`, `broadcast`, `ntpsrv`, `search`,
`address`, `staticroutes`, `msstaticroutes`
**Default:** `router`, `dns-server`, `domain`, `broadcast`, `ntp-server`, `search`,
`address`, `classless-static-route`, `ms-classless-static-route`
When configuring a DHCP client, ensure that the NTP client is enabled
for the `ntp-server` DHCP option to be processed correctly. If the NTP
client is not enabled, any NTP servers provided by the DHCP server will
be ignored. For details on how to enable the NTP client, see the [NTP
Client Configuration](system.md#ntp-client-configuration) section.
> [!IMPORTANT]
> Per [RFC3442][4], if the DHCP server returns both a Classless Static
> Routes option (121) and Router option (3), the DHCP client *must*
> ignore the latter.
> **Note:** DHCP address method is only available for *LAN* interfaces
> (Ethernet, virtual Ethernet (veth), bridge, link aggregates, etc.)
### IPv6 Address Assignment
@@ -612,7 +781,6 @@ will be used, otherwise it falls back to the default algorithm.
admin@example:/> configure
admin@example:/config/> edit dhcp-client
admin@example:/config/dhcp-client/> set client-if eth0
admin@example:/config/dhcp-client/> set enabled true
admin@example:/config/dhcp-client/> leave
admin@example:/> show interfaces
INTERFACE PROTOCOL STATE DATA
@@ -744,7 +912,7 @@ have changed type to *random*.
### IPv4 forwarding
To be able to route (static or dynamic) on the interface it is
required to enable forwarding. This setting controlls if packets
required to enable forwarding. This setting controls if packets
received on this interface can be forwarded.
```
admin@example:/config/> edit interface eth0
@@ -760,12 +928,12 @@ This flag behaves totally different than for IPv4. For IPv6 the
ability to route between interfaces is always enabled, instead this
flag controls if the interface will be in host/router mode.
| **Feature** | **Forward enabled** | **Forward disabled** |
|:------------------------------------------|:--------------------|:---------------------|
| IsRouter set in Neighbour Advertisements. | Yes | No |
| Transmit Router Solicitations. | No | Yes |
| Router Advertisements are ignored | No | Yes |
| Accept Redirects | No | Yes |
| **Feature** | **Forward enabled** | **Forward disabled** |
|:-----------------------------------------|:--------------------|:---------------------|
| IsRouter set in Neighbour Advertisements | Yes | No |
| Transmit Router Solicitations | No | Yes |
| Router Advertisements are ignored | No | Yes |
| Accept Redirects | No | Yes |
```
admin@example:/config/> edit interface eth0
@@ -791,9 +959,10 @@ The base model, ietf-routing, is where all the other models hook in. It
is used to set configuration and read operational status (RIB tables) in
the other models.
> **Note:** the standard IETF routing models allows multiple instances,
> but Infix currently *only support one instance* per routing protocol!
> In the examples presented here, the instance name `default` is used.
> [!NOTE]
> The standard IETF routing models allows multiple instances, but Infix
> currently *only support one instance* per routing protocol! In the
> examples presented here, the instance name `default` is used.
### IPv4 Static routes
@@ -819,6 +988,7 @@ router 192.168.1.1, using the highest possible distance:
admin@example:/config/routing/control-plane-protocol/static/name/default/> leave
admin@example:/>
> [!TIP]
> Remember to enable [IPv4 forwarding](#IPv4-forwarding) for the
> interfaces you want to route between.
@@ -842,6 +1012,7 @@ enable OSPF and set one active interface in area 0:
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> leave
admin@example:/>
> [!TIP]
> Remember to enable [IPv4 forwarding](#IPv4-forwarding) for all the
> interfaces you want to route between.
@@ -896,6 +1067,38 @@ an Ethernet interface can be done as follows.
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/area/0.0.0.0/interface/e0/> set interface-type point-to-point
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/area/0.0.0.0/interface/e0/>
#### OSPF global settings
In addition to *area* and *interface* specific settings, OSPF provides
global settings for route redistribution and OSPF router identifier.
```
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default ospf
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/> set ?
area List of OSPF areas.
default-route-advertise Distribute default route to network
explicit-router-id Defined in RFC 2328. A 32-bit number
redistribute Redistribute protocols into OSPF
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/> set
```
- Explicit router ID: By default the router will pick an IP address
from one of its OSPF interfaces as OSPF router ID. An explicit ID is
used to get a deterministic behavior, e.g., `set explicit-router-id
1.1.1.1`.
- Redistribution: `set redistribute static` and `set redistribute connected`
can be used to include static or connected routes into the OSPF routing
domain. These routes are redistributed as *external type-2* (E2)
routes.
- Advertising default route: An OSPF router can be made to distribute
a default route into the OSPF domain by command `set
default-route-advertise enabled`. This route is distributed as long
as the router itself has an *active* default route in its routing
table. By adding command `set default-route-advertise always` the
router will distribute a default route even when it lacks a default
route. The default route will be distributed as an *external type-2*
(E2) route.
#### Debug OSPFv2
@@ -967,7 +1170,7 @@ This CLI example show the IPv6 routing table.
#### Route Preference
The operating system leverages FRRouting ([Frr][4]) as routing engine
The operating system leverages FRRouting ([Frr][0]) as routing engine
for both static and dynamic routing. Even routes injected from a DHCP
client, and IPv4 link-local (IPv4) routes, are injected into Frr to let
it weigh all routes before installing them into the kernel routing table
@@ -998,10 +1201,11 @@ different next-hop, learned from a DHCP server wins over an OSPF route.
The distance used for static routes and DHCP routes can be changed by
setting a different *routing preference* value.
> **Note:** the kernel metric is an unsigned 32-bit value, which is read
> by Frr as (upper) 8 bits distance and 24 bits metric. But it does not
> write it back to the kernel FIB this way, only selected routes are
> candidates to be installed in the FIB by Frr.
> [!NOTE]
> The kernel metric is an unsigned 32-bit value, which is read by Frr as
> (upper) 8 bits distance and 24 bits metric. But it does not write it
> back to the kernel FIB this way, only selected routes are candidates
> to be installed in the FIB by Frr.
#### Source protocol
@@ -1021,9 +1225,10 @@ currently supported, namely `ipv4` and `ipv6`.
[1]: https://www.rfc-editor.org/rfc/rfc8343
[2]: https://www.rfc-editor.org/rfc/rfc8344
[3]: https://www.rfc-editor.org/rfc/rfc8981
[4]: https://frrouting.org/
[4]: https://www.rfc-editor.org/rfc/rfc3442
[0]: https://frrouting.org/
[^1]: Please note, link aggregates are not yet supported in Infix.
[^1]: Please note, link aggregates are not yet supported.
[^2]: Link-local IPv6 addresses are implicitly enabled when enabling
IPv6. IPv6 can be enabled/disabled per interface in the
[ietf-ip][2] YANG model.
@@ -1031,3 +1236,13 @@ currently supported, namely `ipv4` and `ipv6`.
mapping the low-order 23-bits of the IP address in the low-order 23
bits of the Ethernet address 01:00:5E:00:00:00. Meaning, more than
one IP multicast group maps to the same MAC multicast group.
[^4]: A YANG deviation was previously used to make it possible to set
`phys-address`, but this has been replaced with the more flexible
`custom-phys-address`.
[^5]: MAC bridges on Marvell Linkstreet devices are currently limited to
a single MAC database, this may be a problem if the same MAC address
appears in different MAC bridges.
[^6]: Ethernet counters are described in *ieee802-ethernet-interface.yang*
and *infix-ethernet-interface.yang*. There is a dedicated document on
[Ethernet Counters](eth-counters.md) that provide additional details
on the statistics support.
+45 -10
View File
@@ -12,14 +12,6 @@ packets to drop and which ones to prioritize, such that critical
services remain operational.
## Software Forwarded Traffic
For packets which are processed by a CPU, i.e. typically routed
traffic, and bridged traffic between interfaces that do not belong to
the same hardware switching domain, an [nftables container][1] can be
used to define a QoS policy.
## Hardware Forwarded Traffic
The default QoS policy for flows which are offloaded to a switching
@@ -34,6 +26,14 @@ chips in this family where limited to 4 output queues per port, this
documentation is _only_ valid for newer generations with 8 output
queues per port.
![Hardware offloading for Marvell Link Street](img/qos-hw-mvls.svg)
The picture illustrates packets having their priority determined at
ingress, here interface _e1_ and _e3_. In this example, both packets
are forwarded to the same outgoing interface (_e2_), subject to output
queueing. The sections below provides more information on these
topics.
#### Default Policy
##### Queueing
@@ -54,8 +54,8 @@ significant bits of the DSCP is used to select the queue:
| 6 | 48-55 | ⇒ | 6 | 25 |
| 7 | 56-63 | ⇒ | 7 | 33 |
For packets containing both a VLAN tag and an IP header, DSCP priority
takes precedence over PCP priority. In cases where neither are
For packets containing both a VLAN tag and an IP header, PCP priority
takes precedence over DSCP priority. In cases where neither are
available, packets are always assigned to queue 0.
Each port's set of 8 egress queues operate on a Weighted Round Robin
@@ -73,6 +73,41 @@ set to the 3 most significant bits of it. If no priority information
is available in the frame on ingress (i.e. untagged non-IP), then
packets will egress out of tagged ports with PCP set to 0.
## Software Forwarded Traffic
For packets which are processed by a CPU, i.e. typically routed
traffic, and bridged traffic between interfaces that do not belong to
the same hardware switching domain, an [nftables container][1] can be
used to define a QoS policy.
For VLAN interfaces, Infix provides support for mapping the Priority
Code Point (PCP) to internal priority on ingress, and the reverse on
egress.
![Ingress and Egress Priority mapping for VLAN interfaces](img/qos-vlan-iface.svg)
These `ingress-qos` and `egress-qos` settings are done per VLAN, both
defaulting to '0'. The example below shows how to keep the PCP priority
for packets being routed between two VLAN interfaces.
```
admin@example:/config/> edit interface e1.10
admin@example:/config/interface/e1.10/> set vlan ingress-qos priority from-pcp
admin@example:/config/interface/e1.10/> up
admin@example:/config/> edit interface e1.20
admin@example:/config/interface/e1.20/> set vlan egress-qos pcp from-priority
admin@example:/config/interface/e1.20/> leave
admin@example:/>
```
## A complex example
The picture below shows a packet flow being subject both to software
forwarding and hardware offloading.
![Hardware and Software QoS Handling](img/qos-complex.svg)
[1]: container.md#application-container-nftables
[2]: https://en.wikipedia.org/wiki/IEEE_802.1Q
+64
View File
@@ -653,6 +653,70 @@ on interface *e0*.
~$
```
### Change a Binary Setting
A YANG `binary` type setting is Base64 encoded and requires a little bit
more tricks. We take the opportunity to showcase a shell script helper:
`/usr/bin/text-editor`, which works just like the `text-editor` command
in the CLI, but this one takes an XPath argument to the binary leaf to
edit.
Stripped down, it looks something like this:
```bash
if tmp=$(sysrepocfg -G "$xpath"); then
file=$(mktemp)
echo "$tmp" | base64 -d > "$file"
if edit "$file"; then
tmp=$(base64 -w0 < "$file")
sysrepocfg -S "$xpath" -u "$tmp"
fi
rm -f "$file"
else
echo "Failed to retrieve value for $xpath"
exit 1
fi
```
An example container configuration, with an embedded file that is
mounted to `/var/www/index.html` can look like this:
```json
"infix-containers:containers": {
"container": [
{
"name": "web",
"image": "oci-archive:/lib/oci/curios-httpd-latest.tar.gz",
"hostname": "web",
"network": {
"interface": [
{
"name": "veth-sys0"
}
]
},
"mount": [
{
"name": "index.html",
"content": "PCFET0NUWVBFIGh0bWwjibberish.shortened.down==",
"target": "/var/www/index.html"
}
]
}
]
}
```
The command to edit this file, and restart the container with the new
contents, look like this:
```
admin@infix:~$ cfg edit "/infix-containers:containers/container[name='web']/mount[name='index.html']/content"
```
### <a id="backup"></a> Backup Configuration Using sysrepocfg And scp
Displaying running or startup configuration is possible with
+142 -19
View File
@@ -11,9 +11,10 @@ specific string followed by the last three octets of the system base MAC
address, e.g., `switch-12-34-56`. An example of how to change the
hostname is included below.
> **Note:** when issuing `leave` to activate your changes, remember to
> also save your settings, `copy running-config startup-config`. See
> the [CLI Introduction](cli/introduction.md) for a background.
> [!NOTE]
> When issuing `leave` to activate your changes, remember to also save
> your settings, `copy running-config startup-config`. See the [CLI
> Introduction](cli/introduction.md) for a background.
## Changing Password
@@ -24,14 +25,14 @@ available in the system authentication configuration context.
```
admin@host:/config/> edit system authentication user admin
admin@host:/config/system/authentication/user/admin/> change password
New password:
Retype password:
New password:
Retype password:
admin@host:/config/system/authentication/user/admin/> leave
```
The `change password` command starts an interactive dialogue that asks
for the new password, with a confirmation, and then salts and encrypts
the password with sha512crypt.
the password with sha512crypt.
It is also possible to use the `set password ...` command. This allows
setting an already hashed password. To manually hash a password, use
@@ -39,7 +40,8 @@ the `do password encrypt` command. This launches the admin-exec command
to hash, and optionally salt, your password. This encrypted string can
then be used with `set password ...`.
> **Tip:** if you are having trouble thinking of a password, Infix has a
> [!TIP]
> If you are having trouble thinking of a password, there is a nifty
> `password generate` command in admin-exec context which generates
> random passwords using the UNIX command `pwgen`. Use the `do` prefix
> when inside any configuration context to access admin-exec commands.
@@ -55,7 +57,7 @@ With SSH keys in place it is possible to disable password login, just
remember to verify SSH login and network connectivity before doing so.
```
admin@host:/config/> edit system authentication user admin
admin@host:/config/> edit system authentication user admin
admin@host:/config/system/authentication/user/admin/> edit authorized-key example@host
admin@host:/config/system/authentication/user/admin/authorized-key/example@host/> set algorithm ssh-rsa
admin@host:/config/system/authentication/user/admin/authorized-key/example@host/> set key-data AAAAB3NzaC1yc2EAAAADAQABAAABgQC8iBL42yeMBioFay7lty1C4ZDTHcHyo739gc91rTTH8SKvAE4g8Rr97KOz/8PFtOObBrE9G21K7d6UBuPqmd0RUF2CkXXN/eN2PBSHJ50YprRFt/z/304bsBYkDdflKlPDjuSmZ/+OMp4pTsq0R0eNFlX9wcwxEzooIb7VPEdvWE7AYoBRUdf41u3KBHuvjGd1M6QYJtbFLQMMTiVe5IUfyVSZ1RCxEyAB9fR9CBhtVheTVsY3iG0fZc9eCEo89ErDgtGUTJK4Hxt5yCNwI88YaVmkE85cNtw8YwubWQL3/tGZHfbbQ0fynfB4kWNloyRHFr7E1kDxuX5+pbv26EqRdcOVGucNn7hnGU6C1+ejLWdBD7vgsoilFrEaBWF41elJEPKDzpszEijQ9gTrrWeYOQ+x++lvmOdssDu4KvGmj2K/MQTL2jJYrMJ7GDzsUu3XikChRL7zNfS2jYYQLzovboUCgqfPUsVba9hqeX3U67GsJo+hy5MG9RSry4+ucHs=
@@ -65,9 +67,10 @@ key-data AAAAB3NzaC1yc2EAAAADAQABAAABgQC8iBL42yeMBioFay7lty1C4ZDTHcHyo739gc91rTT
admin@host:/config/system/authentication/user/admin/authorized-key/example@host/> leave
```
> **Note:** the `ssh-keygen` program already base64 encodes the public
> key data, so there is no need to use the `text-editor` command, `set`
> does the job.
> [!NOTE]
> The `ssh-keygen` program already base64 encodes the public key data,
> so there is no need to use the `text-editor` command, `set` does the
> job.
## Multiple Users
@@ -145,7 +148,7 @@ is committed by issuing the `leave` command.
admin@host:/config/> edit system
admin@host:/config/system/> set hostname example
admin@host:/config/system/> leave
admin@example:/>
admin@example:/>
```
The hostname is advertised over mDNS-SD in the `.local` domain. If
@@ -154,8 +157,24 @@ case, mDNS will advertise a "uniqified" variant, usually suffixing with
an index, e.g., `example-1.local`. Use an mDNS browser to scan for
available devices on your LAN.
> **Note:** critical services like syslog, mDNS, LLDP, and similar that
> advertise the hostname, are restarted when the hostname is changed.
In some cases you may want to set the device's *domain name* as well.
This is handled the same way:
```
admin@host:/config/> edit system
admin@host:/config/system/> set hostname foo.example.com
admin@host:/config/system/> leave
admin@foo:/>
```
Both host and domain name are stored in the system files `/etc/hosts`
and `/etc/hostname`. The latter is exclusively for the host name. The
domain *may* be used by the system DHCP server when handing out leases
to clients, it is up to the clients to request the domain name *option*.
> [!NOTE]
> Critical services like syslog, mDNS, LLDP, and similar that advertise
> the hostname, are restarted when the hostname is changed.
## Changing Login Banner
@@ -164,8 +183,9 @@ The `motd-banner` setting is an Infix augment and an example of a
`binary` type setting that can be changed interactively with the
built-in [`text-editor` command](cli/text-editor.md).
> **Tip:** see the next section for how to change the editor used
> to something you may be more familiar with.
> [!TIP]
> See the next section for how to change the editor used to something
> you may be more familiar with.
```
admin@host:/config/> edit system
@@ -196,11 +216,114 @@ admin@host:/config/system/> leave
admin@host:/>
```
> **Note:** as usual, configuration changes only take effect after
> issuing the `leave` command. I.e., you must change the editor first,
> and then re-enter configure context to use your editor of choice.
> [!IMPORTANT]
> Configuration changes only take effect after issuing the `leave`
> command. I.e., you must change the editor first, and then re-enter
> configure context to use your editor of choice.
## DNS Resolver Configuration
The system supports both static and dynamic (DHCP) DNS setup. The
locally configured (static) server is preferred over any acquired
from a DHCP client.
```
admin@host:/> configure
admin@host:/config/> edit system dns-resolver
admin@host:/config/system/dns-resolver/> set server google udp-and-tcp address 8.8.8.8
admin@host:/config/system/dns-resolver/> show
server google {
udp-and-tcp {
address 8.8.8.8;
}
}
admin@host:/config/system/dns-resolver/> leave
```
It is also possible to configure resolver options like timeout and
retry attempts. See the YANG model for details, or use the built-in
help system in the CLI.
> [!NOTE]
> When acting as a DHCP server and DNS proxy for other devices, any
> local DNS server configured here is automatically used as upstream DNS
> server.
## NTP Client Configuration
Below is an example configuration for enabling NTP with a specific
server and the `iburst` option for faster initial synchronization.
```
admin@host:/> configure
admin@host:/config/> edit system ntp
admin@host:/config/system/ntp/> set enabled
admin@host:/config/system/ntp/> set server ntp-pool
admin@host:/config/system/ntp/> set server ntp-pool udp address pool.ntp.org
admin@host:/config/system/ntp/> set server ntp-pool iburst
admin@host:/config/system/ntp/> set server ntp-pool prefer
admin@host:/config/system/ntp/> leave
```
This configuration enables the NTP client and sets the NTP server to
`pool.ntp.org` with the `iburst` and `prefer` options. The `iburst`
option ensures faster initial synchronization, and the `prefer` option
designates this server as preferred.
* `prefer false`: The NTP client will choose the best available source
based on several factors, such as network delay, stratum, and other
metrics (default config).
* `prefer true`: The NTP client will try to use the preferred server
as the primary source unless it becomes unreachable or unusable.
### Show NTP Sources
The status for NTP sources is availble in YANG and accessable with
CLI/NETCONF/RESTCONF.
To view the sources being used by the NTP client, run:
```
admin@target:/> show ntp
ADDRESS MODE STATE STRATUM POLL-INTERVAL
192.168.1.1 server candidate 1 6
192.168.2.1 server candidate 1 6
192.168.3.1 server selected 1 6
```
### Show NTP Status
To check the status of NTP synchronization (only availble in CLI), use
the following command:
```
admin@host:/> show ntp tracking
Reference ID : C0248F86 (192.36.143.134)
Stratum : 2
Ref time (UTC) : Mon Oct 21 10:06:45 2024
System time : 0.000000001 seconds slow of NTP time
Last offset : -3845.151367188 seconds
RMS offset : 3845.151367188 seconds
Frequency : 4.599 ppm slow
Residual freq : +1293.526 ppm
Skew : 12.403 ppm
Root delay : 1.024467230 seconds
Root dispersion : 0.273462683 seconds
Update interval : 0.0 seconds
Leap status : Normal
admin@host:/>
```
This output provides detailed information about the NTP status, including
reference ID, stratum, time offsets, frequency, and root delay.
> [!TIP]
> The system uses `chronyd` Network Time Protocol (NTP) daemon. The
> output shown here is best explained in the [Chrony documentation][4].
[1]: https://www.rfc-editor.org/rfc/rfc7317
[2]: https://github.com/kernelkit/infix/blob/main/src/confd/yang/infix-system%402024-02-29.yang
[3]: https://www.rfc-editor.org/rfc/rfc8341
[4]: https://chrony-project.org/doc/4.6.1/chronyc.html
+1 -1
View File
@@ -17,7 +17,7 @@ Tenets
It is also much more practical and economical to build large virtual
networks than physical ones.
- **Avoid CLI scipting & scraping**. Reliably interacting with a DUT
- **Avoid CLI scripting & scraping**. Reliably interacting with a DUT
over a serial line in a robust way is _very_ hard to get right.
Given that we have a proper API (RESTCONF), we should leverage that
when testing. Front-ends can be tested by other means.
+28
View File
@@ -0,0 +1,28 @@
# Tunnel configuration
Tunnel traffic from point A to point B
## Generic Routing Encapsulation (GRE)
The support for GRE tunnels includes IPv4 and IPv6 tunnels both in GRE
(IP) and GRETAP (MAC) modes.
```
admin@example:/config/> edit interface gre1
admin@example:/config/interface/gre1/> set type gretap
admin@example:/config/interface/gre1/> set gre local 192.168.3.1 remote 192.168.3.2
admin@example:/config/interface/gre1/> leave
admin@example:/>
```
## Virtual eXtensible Local Area Network (VXLAN)
The support for VXLAN tunnels includes IPv4 and IPv6.
```
admin@example:/config/> edit interface vxlan100
admin@example:/config/interface/vxlan100/> set vxlan local 192.168.3.1
admin@example:/config/interface/vxlan100/> set vxlan remote 192.168.3.2
admin@example:/config/interface/vxlan100/> set vxlan vni 100
admin@example:/config/interface/vxlan100/> leave
```
+1 -3
View File
@@ -1,9 +1,7 @@
IXMSG = printf "\e[37;44m>>> $(call qstrip,$(1))\e[0m\n"
include $(BR2_EXTERNAL_INFIX_PATH)/infix.mk
include $(sort $(wildcard $(BR2_EXTERNAL_INFIX_PATH)/package/*/*.mk))
include $(BR2_EXTERNAL_INFIX_PATH)/board/common/common.mk
-include $(BR2_EXTERNAL_INFIX_PATH)/board/$(patsubst "%",%,$(BR2_ARCH))/board.mk
include $(BR2_EXTERNAL_INFIX_PATH)/infix.mk
include $(BR2_EXTERNAL_INFIX_PATH)/test/test.mk
.PHONY: local.mk
+11
View File
@@ -1 +1,12 @@
IXMSG = printf "\e[37;44m>>> $(call qstrip,$(1))\e[0m\n"
oem-dir := $(call qstrip,$(INFIX_OEM_PATH))
INFIX_TOPDIR = $(if $(oem-dir),$(oem-dir),$(BR2_EXTERNAL_INFIX_PATH))
# Unless the user specifies an explicit build id, source it from git.
# The build id also becomes the image version, unless an official
# release is being built.
export INFIX_BUILD_ID ?= $(shell git -C $(INFIX_TOPDIR) describe --dirty --always --tags)
export INFIX_VERSION = $(if $(INFIX_RELEASE),$(INFIX_RELEASE),$(INFIX_BUILD_ID))
INFIX_CFLAGS:=-Wall -Werror -Wextra -Wno-unused-parameter -Wformat=2 -Wformat-overflow=2 -Winit-self -Wstrict-overflow=4 -Wno-format-truncation -Wno-format-nonliteral
+10 -1
View File
@@ -1,7 +1,14 @@
menu "Packages"
comment "Hardware Support"
source "$BR2_EXTERNAL_INFIX_PATH/package/board/Config.in"
comment "Software Packages"
source "$BR2_EXTERNAL_INFIX_PATH/package/bin/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/confd/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/test-mode/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/confd-test-mode/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/curios-httpd/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/curios-nftables/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/execd/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/gencert/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/statd/Config.in"
@@ -33,4 +40,6 @@ source "$BR2_EXTERNAL_INFIX_PATH/package/sysrepo-cpp/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/rousette/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/nghttp2-asio/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/date-cpp/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/rauc-installation-status/Config.in"
endmenu

Some files were not shown because too many files have changed in this diff Show More