Compare commits

..
159 Commits
Author SHA1 Message Date
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
Joachim Wiberg e4fddb6875 doc: update ChangeLog with release news
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 20:38:41 +02:00
Joachim WibergandGitHub 5bd8e99282 Merge pull request #639 from kernelkit/ipv4ll-request-address
IPv4 autoconf request-address support

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 16:41:10 +02:00
Joachim Wiberg d9fa4d9898 doc: update ChangeLog with info on route installation overhaul
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:55:46 +02:00
Joachim Wiberg 8b60ddf70a doc: update static routing and add route pref section
This patch mainly updates the static routing chapter, and adds a new
section on route preferences, but it also makes slight touch-ups at
a few other places as well.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:55:46 +02:00
Joachim Wiberg 1101d30396 doc: break out testing requriements from devguide
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:55:46 +02:00
Joachim Wiberg 5aed8e0488 test: update specifications
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:55:46 +02:00
Joachim Wiberg dc1a2c39e8 test: update with static route canary
Now that all routes acquired from DHCP (and ZeroConf) are installed in
the kernel FIB via Frr (staticd -> zebra -> kernel), instead of directly
to the kernel FIB, let's extend this test slightly.

Add a canary static route that is installed before the DHCP client is
even started.  This canary route should be installed along with the
DHCP (classless) route(s) when the interface comes up and acquires a
DHCP lease.

We take this opportunity to also verify that the route-preference is
properly carried over from test to operational RIB status.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:55:46 +02:00
Joachim Wiberg 8ea0af6385 test: refactor infamy route helpers
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:55:46 +02:00
Joachim Wiberg ae76030e70 test: update cli output reference for "show ip route"
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:55:46 +02:00
Joachim Wiberg 7ac016b536 test: refactor test for running on hardware test bed
Also, add some logs to track progress.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg b61398103c statd: adjust "show ip route" column widths per address proto
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 752b1f4a94 confd: add support for setting preference on static routes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg dd3f1c39d1 confd: expand route info in operational data
- Enable OSPF route metrics in RIB, only defined for OSPF
 - Enable 'active' route flag for RIB, same as 'selected >' in FRR
 - Enable 'last-updated' route field for RIB, used for uptime
 - Augment route in RIB with 'installed' flag, same as 'FIB *' in FRR

The CLI "show ip route" command has been updated accordingly.  The
classic Cisco style output has been kept instead of separating the
routes into Active and Backup, as discussed previously.  Because
when inspecting large route sets you want to compare same prefix
vs distance/metric to understand why a certain route is selected.

admin@example:/> show ip route
   PREFIX                            PREF  NEXT-HOP                      PROTOCOL      UPTIME
>  0.0.0.0/0                          1/0  192.168.0.42                  static        0h2m6s
 *                                         192.168.122.1
   0.0.0.0/0                          5/0  192.168.122.1                 static        0h2m6s
   0.0.0.0/0                        254/0  e1                            static        0h2m6s
>* 169.254.0.0/16                     0/0  e1                            direct        0h2m6s
>* 192.168.0.0/24                     1/0  192.168.122.1                 static        0h2m6s
>* 192.168.122.0/24                   0/0  e1                            direct       0h2m12s

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 35276cb2e8 confd: rename ietf-routing prefix, ietf-r: -> rt:
For consistency with the other IETF routing models, e.g., OSPF, let's
use the same model prefix for internal references.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 2063c94f42 confd: drop deviation for /if:interfaces-state
Not the most obvious patch, but let me explain -- there will always be a
conflict betweem usability and "maintainability".  The ietf-interfaces
yang model already declares /interfaces-state as deprecated, so we don't
really need to add a deviation 'not-supported', for usability, however,
it may be useful since the deviation helps cut out that tree completely.

While working with ietf-routing and our companion models, I found that
since it relies on ietf-interfaces, it also breaks the reload/reimport
of infix-routing while developing extensions/changes:

  $ lint.sh -f tree ieee802-* iana-if-type@2023-01-26.yang \
            ietf-interfaces@2018-02-20.yang \
	    infix-interfaces@2024-01-15.yang \
	    ietf-routing@2018-03-13.yang \
	    ietf-ipv4-unicast-routing@2018-03-13.yang \
	    ietf-ospf@2022-10-19.yang \
	    infix-routing@2024-09-22.yang
  libyang err : Not found node "interfaces-state" in path. (Schema location "/ietf-routing:routing-state/interfaces/interface".)
  libyang err : Target of leafref "interface" cannot be referenced because it is disabled. (Schema location "/ietf-routing:routing-state/interfaces/interface".)
  YANGLINT[E]: Parsing schema module "ietf-routing@2018-03-13.yang" failed.

The only way to change/update models for a given build is to either, a)
surgically remove offending models from output/target/, then reinstall
all dependencies and hope it works better, or b) rebuild from distclean.
In most cases you end up with alternative b).

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 0ea84cf557 test: minor, whitespace and PEP-8 fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 6e85ace4b0 test: update rib source protocol, infix-routing -> ietf-ospf
Latest YANG model change reverts back to using the IETF routing-protocol
type.  Update tests to check for infix-routing:ospf -> ietf-ospf:ospfv2.

Also, refactor and extend infamy/route.py:_exist_route() slightly for
readability and PEP-8, as well as to use an optional model prefix also
for next-hop-list addresses.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 76e54420a2 confd: minor, fixes & cleanup
- Straighten out formatting issues in ospfd.conf (debug)
 - Simplify and reduce code duplication
 - Avoid 'restart zebra' errors in runlevel S

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg f65000f29e board/common: update mg default configuration file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg fa6851caa6 board/common: set DHCP and ZeroConf routes using Frr/staticd
This patch changes the way Infix DHCP and ZerocConf clients set their
routes in the system.  Instead of setting them directly in the kernel
we ask FRR staticd to set them for us.

The reason for this change is to be able to override routes from these
protocols with locally set static routes.  The routes are now set with
a distance of 5 and 254, respectively, while static routes by default
have a distance of 1.  In contrast, kernel routes are always treated
by Frr as distance 0, i.e., they are preferred over static routes.

Finally, this patch drops the use of Linux legacy interface aliases, or
colon interfaces, in an effort to reduce confusion for end users.  This
may give some odd results if using older tools like ifconfig, so we
recommend using 'show interfaces' or 'ipb a' instead.

Fixes #640

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 118dcd4b35 statd: read system routing table from vtysh intead of kernel
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg d33249512e statd: slight refactor of ospf-status
- Ignore stderr output (ospfd not running)
 - Import run_json_cmd() from yanger
 - Ensure deafault empty object + arrays

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg d5418b019f confd: switch back to ietf type for route source-protocol
With the redesign of the operational rib routes, using vtysh 'show ip route'
instead of the kernel 'ip route' as source, we no longer need the infix source
protocol.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg cf0cfc2dad confd: clarify route preference in DHCP client model
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 445ca0a9d6 board/common: restore 'show' script from 493be97 sync with present
The intention is to provide a similar set of commands as klish
admin-exec.  However, instead of trying to make the Linux tools
more accessible, we now make the Infix tooling more accessible.

E.g., instead of "show ip route" mapping to "ip route show", we
map it to:

sysrepocfg -f json -X -d operational -x "/ietf-routing:routing/ribs" | \
      /usr/libexec/statd/cli-pretty "show-routing-table"

As a spin-off we alos get a much more readable infix.xml for klish:
 - Relocate logic to shell script wrapper 'show'
 - Introduce Cisco style "show ip route" and "show ipv6 route"

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg d575538d4a statd: minor, pep8 fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 84c373ef63 statd: refactor metric in 'show routes' to distance/metric
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg cc8e31f74f board/common: adjust metric on IPv4LL and DHCP routes to match Frr
Apply a distance adjustment to routes retrieved from IPv4LL/ZeroConf and
DHCP to ensure that Frr (Zebra) can compare other protocol routes, e.g.,
static.  Without this Frr will consider all routes read from the kernel
to have a protocol distance of 0, meaning better than static routes that
have a distance of 1.

Initial proposal to fix issue #640

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg fd8826c3f1 confd: initialize sysrepo startup datastore at boot
Since /etc is not retained across reboots, the sysrepo startup datastore
is not used to bootstrap the Infix.  Instead, /cfg/startup-config.cfg is
used and loaded directly to the running datastore.

For some use-cases when operating directly on sysrepo this causes a lot
of confusion because startup == factory ds until any user calls the CLI
command `copy running-config startup-confg`.

This patch fixes this initial "glitch" by loading the starup datastore
at boot on successful loading of startup-config to unning.

To prevent any unintentional "auto-save" of, e.g., failure-config to
startup-config, we make confd aware of this "sync" operation during
bootstap.

Fixes #625

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 430948df06 confd: minor, fix global variable shadowing warnings
Follow-up to cfd95dc30, which made 'struct confd confd' a global
variable in core.h.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 0a06fc0571 confd: minor, logging and coding style
- Remove duplicate logs due to logger logging also to stderr
 - Fix coding style in new test-override-startup code path

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg e483d295da statd: also silence JSONDecodeError on check=False
In d616623a an attempt to silence bogus return values from mctl, when
multicast snooping is disabled on a bridge.  That helped get data back
for operational to produce `show interfaces` *with* a bridge and ports
but still emitted bogus log warnings.

This patch addresses that by checking 'check' on JSONDcodeError as well
before emitting any log error.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 10ef7c5fda doc: update ChangeLog with recent IPv4LL (autoconf) changes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 476c2ebe40 test/case: update ipv4-autoconf with new test passes
- Add check for specific 169.254/16 adddress (new feature)
 - Add check for disabling autoconf on interface (regression test #638)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg ec6d350bc1 test/infamy: minor, check return value, and pep8 fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg add52cdb38 confd: add support for IPv4LL request-address option
This patch allows a user to specify a specific 169.254/16 address that
the zeroconf client starts with when probing for a free address.  If the
probe fails it falls back to its default algorithm.

Fixes #628

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 151119ef0e patches/avahi: fix address cleanup on avahi-autoipd exit
Fixes #638

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 4ed4fa5052 board/common: simplify avahi-autoipd.action script
- We know we always have iproute2 tools
 - We only use one ipv4ll client per interface, so UNBIND can be
   simplified to flush ifname:avahi
 - Log all events handled by script for troubleshooting

Note: on BIND event we may be called without first getting UNBIND on
      previous address, hence the flush there too.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg af1a86f10a board/common: reactivate scp/sftp and drop non-working cli subsystem
The sftp subsystem was lost in 61213c7.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 9079c55944 doc: minor, grammar and slight clarification of example
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Joachim Wiberg 6b37a7dd7c doc: Update ChangeLog with major package upgrades
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Mattias WalströmandGitHub c39a63e181 Merge pull request #656 from kernelkit/upgrade-rousette
Upgrade rousette and required CPP-bindings
2024-09-26 15:48:25 +02:00
Mattias Walström 5461a443a3 Upgrade rousette and required CPP-bindings
First release of rousette.
2024-09-26 15:05:38 +02:00
Tobias Waldekranz 057d255179 test: Disable services_basic
As detailed in the comment, we disable this test pending a fix for
2024-09-26 12:32:13 +02:00
Richard AlpeandJoachim Wiberg e3733982ed statd: never hide yanger faults
This is basically a functionally revert of:
435c5ca9 statd: allow ethtool --json to fail without breaking operational ds

Having a fail flag that hides all yanger faults is too big of a
hammer. If some hardware doesn't support a particular command such as
"ethtool --json" it should be handled gracefully by yanger. Perhaps by
catching the error and returning an empty dataset for that node.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-09-25 17:29:20 +02:00
Richard AlpeandJoachim Wiberg 5d0f85cb07 statd: fix callback debug
Debug print the full xpath in all callbacks.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-09-25 17:29:20 +02:00
Richard AlpeandJoachim Wiberg 83567c7e17 statd: move yanger args to caller
A non functional change. The caller knows more about how to format the
args, so it makes more sense to build the Yanger cmdline from the
caller.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-09-25 17:29:20 +02:00
Richard AlpeandJoachim Wiberg 14128047e1 statd: remove nl code and improve speed
This is a major redesign of statd interface handling. The goal here is
to reduce the time it takes for statd to produce operational data for
all interfaces on larger iron. Which manifested itself most notably in
the CLI command "show interfaces".

This patch removes the netlink interface subscriptions done by the
statd c code. Instead statd now subscribes to the ietf-interfaces
base path which means it will be invoked for all interfaces.
If the user (sysrepo) has specified an explicit interface name such as
eth0, it will be extracted by statd and passed down to Yanger.

This patch also modifies Yanger to fit this new modus. No explicitly
passed interface name now means all interfaces.

Side note:
The main culprit of the slow operational interface data is the time it
takes to bootstrap python. Which prior to this patch was done for each
interface. On the HW system I'm testing this patch on, runtime is
reduced by a factor of 10.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-09-25 17:29:20 +02:00
Mattias WalströmandJoachim Wiberg 3e2b9fbd5e Build test specification on build
Also include the test specification in release tarballs.
2024-09-25 17:26:40 +02:00
Mattias Walström a857fa64f8 Changelog: Update changelog for 2024.09 release
Add fixed issues #635 and #648
2024-09-25 11:32:45 +02:00
Mattias Walström 33ad72b718 test: case: interfaces: Adapt tests to fit the test specification
Mostly text fixes but major rewrite in some tests.
2024-09-25 11:32:45 +02:00
Mattias Walström 7089f67da9 OSPF: Fix issue where all neighbors in the area where show on all interfaces
This fix #635
2024-09-25 11:32:45 +02:00
Mattias Walström aefaf94244 Bump linux kernel to 6.6.52 2024-09-25 11:32:45 +02:00
Mattias Walström a3a0d1a731 test: Remove obsolete test iface_status
Not needed, since it only verify the kernel is doing its thing.
2024-09-25 11:32:45 +02:00
Ahmed KaricandAhmed Karic 86c562d3b3 test: introduce image test-mode within the test environment
- The test mode, introduced at the config/build phase (commit 241f3f2),
causes the device to start in test-mode when used in GNS3 (or other
environments). This has unintentionally become the default
configuration for the image, which is not desirable and is only
acceptable for the Infix test system. With this update, the original
configuration is preserved, and the test mode is applied only within
the test environment.

- Align the 'dual' topology to use the same template as 'quad'

Fixes #603
2024-09-23 15:35:21 +02:00
Ahmed KaricandAhmed Karic df97c61ad6 test/docker: add e2tools
e2cp is needed for injecting test-mode file into the disk image
2024-09-23 15:35:21 +02:00
Ahmed KaricandAhmed Karic 621e76c925 Revert "board/common: introduce image test-mode"
This reverts commit 241f3f224f.
2024-09-23 15:35:21 +02:00
Mattias WalströmandJoachim Wiberg 0f9d429d9b confd: bump and add a migrate script for infix-routing 2024-09-21 08:47:02 +02:00
Mattias WalströmandJoachim Wiberg ef81abeae2 configuration migrate: Remove duplicate infix-meta:version when migrate config
when migrate configs the yang data produced was this:
  "infix-meta:meta": {
    version: "1.0"
    "infix-meta:version": "1.1"
  },

duplicate node, resulting in failed migration of startup configuration, always replace
whole node.
2024-09-21 08:47:02 +02:00
Mattias WalströmandJoachim Wiberg 4083fbf4c5 routing: Add a infix-routing-type to only support selected protocols
Today Infix only support OSPFv2 and Static routes, this hides all other
protocols in the CLI and makes it clearar about what we support in the YANG
model.
2024-09-21 08:47:02 +02:00
Mattias WalströmandJoachim Wiberg 948d029062 test: case: ietf_routing: Update test texts for test specification 2024-09-21 08:47:02 +02:00
Tobias WaldekranzandJoachim Wiberg 7d1a708274 board/aarch64: styx: Remove unconnected LED
Only one (green) LED per port is available.
2024-09-19 14:27:22 +02:00
Tobias WaldekranzandJoachim Wiberg c263ff102d board/aarch64: styx: Trivial cleanup in dts
Require an explicit addr-of when using GSWP, which makes it clearer
for a reader that the argument passed is a node reference.
2024-09-19 14:27:22 +02:00
Tobias WaldekranzandJoachim Wiberg cbd615ec78 board/aarch64: styx: Revision B Support
The rewiring of the backplane in revision B necessitates two distinct
device trees.

Co-developed-by: Henrik Nordström <henrik.nordstrom@addiva.se>
2024-09-19 14:27:22 +02:00
Tobias WaldekranzandJoachim Wiberg 8d94508a99 package/rousette: Addmissing select of date-cpp
Shows up when building aarch64_minimal_defconfig.
2024-09-18 18:32:03 +02:00
Henrik NordströmandJoachim Wiberg 508ff29c71 bug: Add missing " in date-cpp package reference 2024-09-18 18:31:12 +02:00
Mattias Walström a533b87ea4 test: case: Move infix_interfaces into ietf-interfaces
This is how all other models are handled, the topmodel is naming the
test directory
2024-09-17 08:27:23 +02:00
Mattias Walström c8d87b9060 test: case: Update some toplogy PNG files 2024-09-17 08:27:23 +02:00
Mattias Walström c78bde298a doc: develop: Add autoconf and automake as requirement 2024-09-17 08:27:23 +02:00
Mattias Walström a360395a0a Remove silent lock for login shell bash/sh on non-admin users
Added some security information in YANG model, and it is now
up to the system administrator to handle potential security
issues.

This fix #616
2024-09-17 08:27:23 +02:00
Mattias Walström 900c5b0b2f test: case: ietf_system: Update test texts
And some changes in test semantics.
2024-09-17 08:27:23 +02:00
Mattias Walström 35a909edf0 test: infamy: Make possible to override username and password
This is now possible for SSH/RESTCONF/NETCONF, most useful with
SSH and adding/modify users.
2024-09-17 08:27:23 +02:00
Ahmed KaricandMattias Walström be6554f327 test: update infix-interfaces topologies 2024-09-16 14:20:52 +02:00
Ahmed KaricandMattias Walström 1637b22979 test: update ietf-interfaces topologies 2024-09-16 14:20:52 +02:00
Ahmed KaricandMattias Walström 3a8bede611 test: update infix-containers topologies 2024-09-16 14:20:52 +02:00
Ahmed KaricandMattias Walström 935c5e1af9 test: update ietf-hardware topologies 2024-09-16 14:20:52 +02:00
Ahmed KaricandMattias Walström a03465c249 test: update infix-services topologies 2024-09-16 14:20:52 +02:00
Ahmed KaricandMattias Walström cbe7c7f033 test: update misc topologies 2024-09-16 14:20:52 +02:00
Ahmed KaricandMattias Walström 7a29dbf419 test: minor update in infamy/topologies 2024-09-16 14:20:52 +02:00
Mattias Walström 895a790d57 Bump netopeer2, libnetconf2, libyang and sysrepo 2024-09-16 12:43:33 +02:00
Mattias Walström 710f6b82ce Upgrade linux kernel to 6.6.51 (LTS) 2024-09-16 12:43:33 +02:00
Joachim Wiberg 637e2d6692 buildroot: bump to 2024.02.6
2024.02.6, released September 9th, 2024

Important / security related fixes.

 Added a large number of additional runtime tests.

 Infrastructure:
 - Be more robust against text files (for package hashes and
   users) incorrectly missing a terminating newline.

 - Fix various issues with the pkg-kconfig infrastructure and
   per-package-directories builds
   (BR2_PER_PACKAGE_DIRECTORIES).

Updated/fixed packages: aer-inject, am335x-pru-package,
apache, apr, apr-util, attr, boost, btrfs-progs, busybox,
cryptsetup, dropbear, elfutils, fetchmail, ffmpeg, fluidsynth,
freerdp, gcc, gdb, gnutls, gpsd, hiawatha, hostapd, htop,
intel-microcode, iperf3, ksmbd-tools, libcoap, libcurl,
libest, libgtk3, libpwquality, libressl, libupnp, libxml2,
libxslt, lrzsz, mdio-tools, micropython, mjpg-streamer, mpir,
ncftp, nginx, nodejs, open-iscsi, openldap, openvpn, pistache,
procps-ng, python-django, ruby, speex, swaybg, tinyssh,
uclibc, uclibc-ng-test, unbound, uuu, wpewebkit, zfs

 Issues resolved:
- Toolchain (host-gcc-final-14.1.0) build failure with
  y2038/BR2_TIME_BITS_64 enabled
  https://gitlab.com/buildroot.org/buildroot/-/issues/16

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-16 08:03:47 +02:00
Joachim Wiberg e4119be1e2 doc: update ChangeLog with fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-13 16:31:39 +02:00
Joachim Wiberg 32f3db41b6 doc: adjust ChangeLog entry, issue fixed in v24.09, not v24.04
Follow-up to cfd95dc3

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-13 16:31:39 +02:00
Joachim Wiberg 0f6cbe9d30 doc: minor update, missing period + grammar
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-13 16:31:39 +02:00
Joachim Wiberg db136bce32 Fix container upgrade regression
In 0edc2d5 and afbe5ca, just prior to v24.06.0-rc1, support for deleting
containers in the background was added.  However, this also broke support
for upgrading containers.

In afbe5ca the start script for containers was renamed from NAME.sh to
S01-NAME.sh, but the container wrapper script's upgrade command was not
updated.  Neither was the cleanup and post-hook callbacks in confd!  So
when a container had been added to the system, the cleanup callback just
simply deleted the script, preventing it from being recreated at ugprade

This patch fixes the container identification code and also refactors
the execd code to ensure that kill scripts (for deleting in background)
and start scripts are run in the proper order *and* ensuring that execd
also does not accidentally remove the container start script.

Some cosmetic changes to the output at upgrade have also been added.

Fixes #623

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-13 16:31:39 +02:00
Joachim Wiberg 3003044601 board/common: add container --net IFNAME locate
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-13 16:31:39 +02:00
Joachim Wiberg b6472766b1 board/common: spellcheck path to downloaded OCI files
Check correct path for downloaded container images.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-13 16:31:39 +02:00
Joachim Wiberg d616623a8e statd: silence bogus log warnings
With a basic bridge setup, which has multicast snooping disabled by
default, `show interfaces` cause the following bogus log messages:

Sep 13 07:08:35 yanger: Command '['mctl', 'show', 'igmp', 'json']' returned non-zero exit status 1
Sep 13 07:08:35 yanger: Command '['mctl', 'show', 'igmp', 'json']' returned non-zero exit status 1
Sep 13 07:08:35 yanger: Command '['mctl', '-p', 'show', 'igmp', 'json']' returned non-zero exit status 1

Add a quiet flag to the run methods and set quiet=True for all mctl
commands to silence these log messages.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-13 16:31:39 +02:00
Joachim Wiberg 685b04d7cc cli: show configured name servers in 'show dns' command
Before we add proper operational support for DNS and NTP, we can at
least improve on the built-in CLI commands.

Issue #510

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-13 16:31:39 +02:00
Joachim Wiberg 063ef91f8d cli: fix regression in tab completion of 'container shell ...'
Only administrators are allowed to work with containers, allow them to
perform tab completion of all admin-exec commands as well.

Fixes #613

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-13 16:31:39 +02:00
Joachim Wiberg a8cf1a853c statd: add missing default {} when snooping is disabled
When multicast snooping is disabled on a bridge, mctl will exit with a
non-zero return code.  Default to {} for these cases so that the bridge
and its ports are properly returned by yanger.

Fixes #618

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-13 16:31:39 +02:00
Jon-Olov VatnandMattias Walström cfa9c74ef4 Updated Changlog for deviation fixes in infix-routing.yang 2024-09-13 14:46:34 +02:00
Jon-Olov VatnandMattias Walström 54ad3f82c5 Adding deviations for unsupported OSPF RPCs and Notifications 2024-09-13 14:46:34 +02:00
Richard AlpeandJoachim Wiberg 1f74ebf828 test: change query-interval and add retry in igmp_basic
There's a case where the first query is lost due to the network just
starting up. To handle this we introduce a retry loop in the test case
that waits for a second query message to be sent.

In this commit we also lower the query interval to speed up the case
when the first message is lost. Ideally mcd (the underlying multicast
daemon) should implement a Startup Query Interval to send it even
faster.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-09-10 17:58:26 +02:00
Joachim Wiberg cfd95dc300 confd: use the system base mac as mac address on bridges
To prevent the kernel from setting a random mac address on new bridges,
before we have added any bridge ports, we create bridges using the:

  1. Custom mac address from the configuration (phys-address)
  2. System base mac from /run/system.json
  3. None, if there is no base mac address in system.json, e.g. r2s

Fixes #357

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-10 17:58:26 +02:00
Richard AlpeandJoachim Wiberg 9a2df4b94b confd: initctl touch mcd after querier changes
Prior to this commit, querier multicast changes such as query-interval
where not applied to an existing multicast interface. The new initctl
touch makes finit send a sighup to mcd which causes it to re-load its
configuration files.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-09-10 16:14:23 +02:00
Mattias WalströmandJoachim Wiberg 5ad2b5da5f build: Add rousette (RESTCONF) to minimal defconfigs 2024-09-10 14:59:50 +02:00
Ahmed KaricandTobias Waldekranz ed6f0b4dce test: update ietf_routing .png 2024-09-10 14:59:12 +02:00
Ahmed KaricandTobias Waldekranz 4efe89b3ea test: update ietf_syslog topologies 2024-09-10 14:59:12 +02:00
Ahmed KaricandMattias Walström b963788fbc test: update infix_dhcp test topologies 2024-09-09 19:15:21 +02:00
Mattias WalströmandJoachim Wiberg f5884098fb Bump rousette to latest GIT hash
Since we are using an old GCC we need to add a new requirement for rousette 'date'
this is included in GCC 14+.
2024-09-09 17:02:51 +02:00
Mattias Walström c456fa1c75 test: spec: Update all test specifications with relative path 2024-09-09 15:11:36 +02:00
Mattias Walström d79d6b7f4d test: spec: Always generate specifications with relative path 2024-09-09 15:11:36 +02:00
Mattias Walström 257c2ac3a1 test: case: Use common topologies for some tests
No need to have seperate topology for theese tests
2024-09-09 15:11:36 +02:00
Ahmed KaricandMattias Walström 47bbc1431a test: update ietf_routing test topologies 2024-09-09 11:50:57 +02:00
Ahmed KaricandMattias Walström 77cd7c6860 test/infamy: cosmetic update in topology (.dot) files 2024-09-09 11:50:57 +02:00
Mattias Walström 1b46444e0b doc: Documentation for test specifcation generate 2024-09-06 10:18:16 +02:00
Mattias Walström b47bbf0221 doc: Update developers guide
Add required tools to build the test specification.
2024-09-06 10:18:16 +02:00
Mattias Walström e4e7dbd714 tests: Add test specification
Add minor changes in all testscripts, to add name and description
Add generated test specification
Add generated topology image
2024-09-06 10:18:16 +02:00
Mattias Walström 4e41663987 test: USB: Refactor general USB test
Better instructions means better test specification
Also add header, used when generate test specification.
2024-09-06 10:18:16 +02:00
Mattias Walström 91d6a7be85 test: USB: Add new test to test systems with two USB ports
Break out this from the general USB test. Test if you can
modify the ports independent of eachother.
2024-09-06 10:18:16 +02:00
Mattias Walström b3831ebe9f Add generation of test specification
The test specifcation is written in Asciidoc and is autogenerated from the content
in the test scripts.

Fonts imported from https://github.com/adobe-fonts/source-code-pro/

To generate the test script:

$ make test-spec
2024-09-06 10:18:16 +02:00
Tobias Waldekranz f77f5852c1 confd: Use system timeout value when loading startup/failure
Now that we have a unified timeout value that all front-ends should
honor, make sure to do so when loading startup-config and
failure-config during boot.

This fixes an issue where the system would fallback to failure-config
even though a legitimate startup-config was available, but took more
than 10s to apply.
2024-09-05 23:41:19 +02:00
Tobias Waldekranz 8d13effbe5 confd: Accept a custom timeout when loading startup/failure
This will enable us to align this timeout with the other front-ends in
the system.
2024-09-05 23:41:19 +02:00
Tobias Waldekranz eb3f8ce711 confd: Break out front-end timeout to common environment file
While sysrepo's architecture places the responsibility of choosing a
timeout on each front-end, we want to control it centrally since the
majority of the time is spend actually applying the config to the
system - which is front-end agnostic.

Therefore, create a single definition of the timeout, which can be
included by all front-ends.
2024-09-05 23:41:19 +02:00
Joachim Wiberg 436b9f20f2 doc: open v24.09 release cycle
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 10:38:06 +02:00
Joachim Wiberg 6752ff4d2f cli: regression in ospf show commands
With the recent changes in Infix v24.08 to tighten up permissions, a
regression in the 'show ospf' family of commands was introduced.

This patch adds a 'doas' prefix to all vtysh commands.  The 'doas' tool
wraps sudo in a way such than unauthorized users do not get a sudo error
thrown as result.

A better fix might be to either include all admin group users also in
the UNIX group 'frrvty', or even better, change the default group of
vtysh to 'wheel'.  Affected files are /etc/frr/vtysh.conf and all
/run/frr/*.vty sockets, the latter are created at runtime by zebra,
ospfd, etc.  This require modifying the buildroot/package/frr/frr.mk
file, which unfortunately have the group hard coded.

    admin@R2:~$ ls -l /etc/frr/vtysh.conf
    -rw-r-----    1 frr      frrvty    32 Sep  3 05:27 /etc/frr/vtysh.conf

    admin@R2:~$ ls -l /run/frr/*.vty
    srwxrwx---    1 frr      frrvty     0 Sep  5 04:37 /run/frr/ospfd.vty
    srwxrwx---    1 frr      frrvty     0 Sep  5 04:37 /run/frr/zebra.vty

Fixes #601

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 10:38:06 +02:00
Joachim Wiberg d856fc8dbc board/common: shellcheck fixes to 'doas' sudo wrapper
Passing $@ to sudo requires quoting to prevent splitting arguments like
this:

    admin@R2:~$ doas vtysh -c 'show ip ospf routes'
    % Command incomplete: show

After this patch:

    admin@R2:~$ doas vtysh -c 'show ip ospf route'
    ============ OSPF network routing table ============
    N    192.168.50.0/24       [1] area: 0.0.0.0
			       directly attached to e7

    ============ OSPF router routing table =============
    R    192.168.100.1         [1] area: 0.0.0.0, ASBR
			       via 192.168.50.1, e7

    ============ OSPF external routing table ===========
    N E2 192.168.10.0/24       [1/20] tag: 0
			       via 192.168.50.1, e7
    N E2 192.168.100.1/32      [1/20] tag: 0
			       via 192.168.50.1, e7

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 10:38:06 +02:00
Joachim Wiberg 56a12d13c4 .github: show size of resulting build tree
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg ba1143cf9b .github: allow defconfig control using manual dispatch
Issue #597

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg 7ddef25013 .github: control defconfig using pull request labels
Issue #597

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg 89f6a8f0fb .github: derive build flavor from branch name
Always build the minimal flavor for branches != main, otherwise use the
default defconfigs so latest build has the correct image.

Issue #597

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg fb96888538 .github: switch default builds to minimal defconfigs
Issue ##597

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg 53df903689 test: skip container tests if target lacks support
Issue #597

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg 804df9373f test: adjust hard-coded transports
RESTCONF, or NETCONF, may not always be available.  Break out and
refactor transport detection/reachability.

NOTE: The shared code paths between wait.py and util.py:wait_boot()
      have been refactored as well to reduce code duplication.

Issue #597

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg f071dacf8b test: add __str__ to Device class for reading device name
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg a69f1c9272 test: autodetect available transports from .config
With the addition of minimal defconfigs without RESTCONF support, detect
transport when 'make test' and 'make test-sh' are called.

We set the new variable INFAMY_TRANSPORT so Infamy can detect protocol
also when in interactive test mode ('make test-sh').

Issue #597

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg 5e03b20bb2 test: minor, cleanup & pep-8 fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg 12b62f7803 configs: add minimal defconfigs for tier one platforms
Fixes #597

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg 09e8fad970 configs: pristine copies for minimal build
The name 'minimal' was chosen after a long AFK discussion where names
like 'generic', 'reference', 'testing', 'mod', and others were tossed
around and quickly discarded.

The minimal name can also be extended upon in customer trees, e.g., a
aarch64_minimal_styx_defconfig would indicate something built on the
upstream minimal Aarch64 build of Infix, but with Styx additions.

Issue #597

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg d0f3a5c8b4 board/common: include .config as /usr/share/infix/config.gz
Issue #597

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Joachim Wiberg b363d0f0f7 doc: update, INFIX_TESTS=.. -> TESTS=..
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-05 07:04:58 +02:00
Tobias Waldekranz 24fe4e2d4d utils/gh-dl-artifact.sh: Add support script to download artifacts
This will make it easier to locally test images when reviewing PRs,
and will also be a useful tool when running tests on physical test
rigs.

[skip ci]
2024-09-04 15:37:48 +02:00
Ahmed KaricandMattias Walström 46ad19793b test: refactor test environment 2024-09-03 12:13:32 +02:00
Joachim Wiberg e7c9f59582 confd: unchecked return value from remove()
Not much we can do, other than log and report.

Found by Coverity Scan

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-02 11:18:27 +02:00
Joachim Wiberg 480172612a confd: fix possible NULL pointer dereference
The srx_get_str() function may return NULL, which goes unchecked in
both fxlate() and sxlate(), as well as the calls to free().

Found by Coverity Scan

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-02 11:18:27 +02:00
Joachim Wiberg b1d69b69a7 confd: minor, reduce complexity
- Silence linter, add braces
 - Unindent code block to reduce complexity

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-02 11:18:27 +02:00
Joachim Wiberg 3c3c3c95f2 confd: reduce scope of local variables
Found by clang-tidy

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-02 11:18:27 +02:00
Joachim Wiberg ca310589ad confd: fix variable overloading, global xpath unused
Found by clang-tidy

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-02 11:18:27 +02:00
Joachim Wiberg 5baec171c2 confd: constify, found by clang-tidy
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-02 11:18:27 +02:00
Mattias Walström dc4c38ede6 test: Adapt tests/infamy for the new test config
Instead of copy factoy config to reset between tests,
use the new test-config.cfg.

Change the logic in the factory config since the default values have changed.
2024-08-30 17:40:02 +02:00
Mattias Walström 3c045460ef Add implementation to control test mode functions using an action
This intoduce a new sysrepo plugin to handle a new YANG
model 'infix-test'. Today only contains the actions.

This is required to run tests on infix using infamy.

This is a part of #561

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-08-30 17:40:02 +02:00
413 changed files with 9272 additions and 5264 deletions
+59 -11
View File
@@ -2,10 +2,17 @@ name: Bob the Builder
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
push:
branches:
- main
workflow_dispatch:
inputs:
minimal:
description: 'Build minimal defconfigs'
required: false
default: true
type: boolean
jobs:
build:
@@ -31,10 +38,26 @@ jobs:
- name: Set Build Variables
id: vars
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ "${{ github.event.inputs.minimal }}" == "true" ]; then
flavor="_minimal"
fi
else
# Ensure 'release' job get the proper image when building main
if [ "$GITHUB_REF_NAME" != "main" ]; then
flavor="_minimal"
else
flavor=""
fi
if ${{ contains(github.event.pull_request.labels.*.name, 'ci:main') }}; then
flavor=""
fi
fi
target=${{ matrix.target }}
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
echo "flv=$flavor" >> $GITHUB_OUTPUT
echo "Building target ${target}${flavor}_defconfig"
- name: Restore Cache of dl/
uses: actions/cache@v4
with:
@@ -52,23 +75,38 @@ jobs:
ccache-${{ matrix.target }}-
ccache-
- name: Configure ${{ matrix.target }}
- name: Configure ${{ matrix.target }}${{ steps.vars.outputs.flv }}
run: |
make ${{ matrix.target }}_defconfig
make ${{ matrix.target }}${{ steps.vars.outputs.flv }}_defconfig
- name: Unit Test ${{ matrix.target }}
run: |
make test-unit
- name: Build ${{ matrix.target }}
- name: Build ${{ matrix.target }}${{ steps.vars.outputs.flv }}
run: |
echo "Building ${{ matrix.target }}_defconfig ..."
echo "Building ${{ matrix.target }}${{ steps.vars.outputs.flv }}_defconfig ..."
make
- name: Check SBOM from Build
run: |
make legal-info
- name: Build test specification
run: |
make test-spec
- name: Resulting size of build
run: |
printf "Size of complete tree : "
du -sh .
printf "Size of output/ : "
du -sh output
printf "Size of dl/ : "
du -sh dl
printf "Size of output/images/: "
ls -l output/images/
- name: Prepare ${{ matrix.target }} Artifact
run: |
cd output/
@@ -91,16 +129,26 @@ jobs:
clean: true
submodules: recursive
- name: Configure x86_64
- name: Set Build Variables
id: vars
run: |
make x86_64_defconfig
if [ "$GITHUB_REF_NAME" != "main" ]; then
flavor="_minimal"
else
flavor=""
fi
echo "flv=$flavor" >> $GITHUB_OUTPUT
- name: Configure x86_64${{ steps.vars.outputs.flv }}
run: |
make x86_64${{ steps.vars.outputs.flv }}_defconfig
- uses: actions/download-artifact@v4
with:
pattern: "artifact-*"
merge-multiple: true
- name: Restore x86-64 output/
- name: Restore x86-64${{ steps.vars.outputs.flv }} output/
run: |
ls -l
mkdir -p output
@@ -109,11 +157,11 @@ jobs:
tar xf infix-x86_64.tar.gz
ln -s infix-x86_64 images
- name: Regression Test
- name: Regression Test x86_64${{ steps.vars.outputs.flv }}
run: |
make test
- name: Publish Test Result
- name: Publish Test Result for x86_64${{ steps.vars.outputs.flv }}
# Ensure this runs even if Regression Test fails
if: always()
run: cat test/.log/last/result-gh.md >> $GITHUB_STEP_SUMMARY
@@ -152,7 +200,7 @@ jobs:
run: |
cat <<EOF >> $GITHUB_STEP_SUMMARY
# Latest Build Complete! :rocket:
For the public download links of these build artifacts, please see:
<https://github.com/kernelkit/infix/releases/tag/latest>
EOF
+7 -3
View File
@@ -76,6 +76,10 @@ jobs:
run: |
make legal-info
- name: Build test specification
run: |
make test-spec
- name: Prepare Artifacts
run: |
cd output/
@@ -83,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:
@@ -153,7 +157,7 @@ jobs:
run: |
cat <<EOF >> $GITHUB_STEP_SUMMARY
# Infix ${{ github.ref_name }} Released! :rocket:
For the public download links of this release, please see:
<https://github.com/kernelkit/infix/releases/tag/${{ github.ref_name }}>
EOF
+61
View File
@@ -0,0 +1,61 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (C) 2021 Marvell International Ltd.
* Copyright (C) 2024 Addiva Elektronik AB
*
* Device tree for revision A of DCP-SC-28P
*/
#include "dcp-sc-28p.dtsi"
/ {
compatible = "styx,dcp-sc-28p-a",
"styx,dcp-sc-28p",
"marvell,armada-ap807-quad",
"marvell,armada-ap807";
};
&sw3 {
ports {
#address-cells = <1>;
#size-cells = <0>;
/* Can't use XSWP macro as port 0 does not have
* any LEDs attached to it. LEDs for port 10 seem
* to be wired to the corresponding SFP cage. Maybe
* we can apply a static workaround by binding port
* 10's green LED to "Special LED 1", so we can at
* least see link/act.
*/
port@0 {
reg = <0>;
label = "e16";
nvmem-cells = <&base_mac 16>;
nvmem-cell-names = "mac-address";
phy-mode = "10gbase-r";
managed = "in-band-status";
sfp = <&sfp3>;
};
XSWCPU(9, &cp0_eth0);
sw3p10: XSWLINK(a, &sw2p10 &sw1p0);
};
};
&sw2 {
ports {
#address-cells = <1>;
#size-cells = <0>;
sw2p0: XSWLINK(0, &sw1p0);
XSWP(9, "e15", 15, &sfp2);
sw2p10: XSWLINK(a, &sw3p10);
};
};
&sw1 {
ports {
sw1p0: XSWLINK(0, &sw2p0 &sw3p10);
XSWP(9, "e14", 14, &sfp1);
XSWP(a, "e13", 13, &sfp0);
};
};
+39
View File
@@ -0,0 +1,39 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (C) 2021 Marvell International Ltd.
* Copyright (C) 2024 Addiva Elektronik AB
*
* Device tree for revision B of DCP-SC-28P
*/
#include "dcp-sc-28p.dtsi"
/ {
compatible = "styx,dcp-sc-28p-b",
"styx,dcp-sc-28p",
"marvell,armada-ap807-quad",
"marvell,armada-ap807";
};
&sw3 {
ports {
XSWCPU(0, &cp0_eth0);
sw3p9: XSWLINK(9, &sw2p0 &sw1p0);
XSWP(a, "e16", 16, &sfp3);
};
};
&sw2 {
ports {
sw2p0: XSWLINK(0, &sw3p9);
XSWP(9, "e15", 15, &sfp2);
sw2p10: XSWLINK(a, &sw1p0);
};
};
&sw1 {
ports {
sw1p0: XSWLINK(0, &sw2p10 &sw3p9);
XSWP(9, "e14", 14, &sfp1);
XSWP(a, "e13", 13, &sfp0);
};
};
@@ -1,5 +1,5 @@
#ifndef _STYX_MPP_H
#define _STYX_MPP_H
#ifndef _DCP_SC_28P_MPP_H
#define _DCP_SC_28P_MPP_H
#define SFP0_TX_DISABLE(X) X( "mpp0", cp0_gpio1, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)
#define SFP1_TX_DISABLE(X) X( "mpp1", cp0_gpio1, 1, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)
@@ -73,4 +73,4 @@
#define MPP_GPIO_REF_NO_CHIP(_mpp, _chip, _no, _flags) <_no (_flags)>
#define MPP_IRQ_REF(_mpp, _chip, _no, _flags) <&_chip _no (_flags)>
#endif /* _STYX_MPP_H */
#endif /* _DCP_SC_28P_MPP_H */
@@ -3,7 +3,7 @@
* Copyright (C) 2021 Marvell International Ltd.
* Copyright (C) 2023 Addiva Elektronik AB
*
* Device tree for Styx board
* Device tree base for DCP-SC-28P
*/
#include <dt-bindings/input/input.h>
@@ -12,13 +12,10 @@
#include "../marvell/cn9130-patched.dtsi"
#include "styx-mpp.h"
#include "dcp-sc-28p-mpp.h"
/ {
model = "Styx";
compatible = "styx,styx",
"marvell,armada-ap807-quad",
"marvell,armada-ap807";
model = "DCP-SC-28P";
chosen {
stdout-path = "serial0:115200n8";
@@ -271,12 +268,6 @@
color = <LED_COLOR_ID_GREEN>; \
default-state = "keep"; \
}; \
led@1 { \
reg = <1>; \
function = _func; \
color = <LED_COLOR_ID_YELLOW>; \
default-state = "off"; \
}; \
}
#define XSWP(_n, _label, _mac_offs, _sfp) \
@@ -287,10 +278,33 @@
nvmem-cell-names = "mac-address"; \
phy-mode = "10gbase-r"; \
managed = "in-band-status"; \
sfp = <&_sfp>; \
sfp = <_sfp>; \
SWP_LED("sfp"); \
}
#define XSWCPU(_n, _eth) \
port@_n { \
reg = <0x ## _n>; \
label = "cpu"; \
ethernet = <_eth>; \
phy-mode = "10gbase-r"; \
fixed-link { \
speed = <10000>; \
full-duplex; \
}; \
}
#define XSWLINK(_n, _link) \
port@_n { \
reg = <0x ## _n>; \
link = <_link>; \
phy-mode = "10gbase-r"; \
fixed-link { \
speed = <10000>; \
full-duplex; \
}; \
}
#define GSWP(_n, _label, _mac_offs, _phy) \
port@_n { \
reg = <0x ## _n>; \
@@ -298,7 +312,7 @@
nvmem-cells = <&base_mac _mac_offs>; \
nvmem-cell-names = "mac-address"; \
phy-mode = "gmii"; \
phy-handle = <&_phy>; \
phy-handle = <_phy>; \
SWP_LED("tp"); \
}
@@ -332,52 +346,14 @@
#address-cells = <1>;
#size-cells = <0>;
port@9 {
reg = <0x9>;
label = "cpu";
ethernet = <&cp0_eth0>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
sw3p10: port@a {
reg = <0xa>;
link = <&sw2p10 &sw1p0>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
/* Can't use XSWP macro as port 0 does not have
* any LEDs attached to it. LEDs for port 10 seem
* to be wired to the corresponding SFP cage. Maybe
* we can apply a static workaround by binding port
* 10's green LED to "Special LED 1", so we can at
* least see link/act.
*/
port@0 {
reg = <0>;
label = "e16";
nvmem-cells = <&base_mac 16>;
nvmem-cell-names = "mac-address";
phy-mode = "10gbase-r";
managed = "in-band-status";
sfp = <&sfp3>;
};
GSWP(1, "e22", 22, sw3phy1);
GSWP(2, "e21", 21, sw3phy2);
GSWP(3, "e24", 24, sw3phy3);
GSWP(4, "e23", 23, sw3phy4);
GSWP(5, "e26", 26, sw3phy5);
GSWP(6, "e25", 25, sw3phy6);
GSWP(7, "e28", 28, sw3phy7);
GSWP(8, "e27", 27, sw3phy8);
GSWP(1, "e22", 22, &sw3phy1);
GSWP(2, "e21", 21, &sw3phy2);
GSWP(3, "e24", 24, &sw3phy3);
GSWP(4, "e23", 23, &sw3phy4);
GSWP(5, "e26", 26, &sw3phy5);
GSWP(6, "e25", 25, &sw3phy6);
GSWP(7, "e28", 28, &sw3phy7);
GSWP(8, "e27", 27, &sw3phy8);
};
mdio {
@@ -412,36 +388,14 @@
#address-cells = <1>;
#size-cells = <0>;
sw2p0: port@0 {
reg = <0x0>;
link = <&sw1p0>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
sw2p10: port@a {
reg = <0xa>;
link = <&sw3p10>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
GSWP(1, "e10", 10, sw2phy1);
GSWP(2, "e9", 9, sw2phy2);
GSWP(3, "e12", 12, sw2phy3);
GSWP(4, "e11", 11, sw2phy4);
GSWP(5, "e18", 18, sw2phy5);
GSWP(6, "e17", 17, sw2phy6);
GSWP(7, "e20", 20, sw2phy7);
GSWP(8, "e19", 19, sw2phy8);
XSWP(9, "e15", 15, sfp2);
GSWP(1, "e10", 10, &sw2phy1);
GSWP(2, "e9", 9, &sw2phy2);
GSWP(3, "e12", 12, &sw2phy3);
GSWP(4, "e11", 11, &sw2phy4);
GSWP(5, "e18", 18, &sw2phy5);
GSWP(6, "e17", 17, &sw2phy6);
GSWP(7, "e20", 20, &sw2phy7);
GSWP(8, "e19", 19, &sw2phy8);
};
mdio {
@@ -476,26 +430,14 @@
#address-cells = <1>;
#size-cells = <0>;
sw1p0: port@0 {
reg = <0x0>;
link = <&sw2p0 &sw3p10>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
GSWP(1, "e2", 2, sw1phy1);
GSWP(2, "e1", 1, sw1phy2);
GSWP(3, "e4", 4, sw1phy3);
GSWP(4, "e3", 3, sw1phy4);
GSWP(5, "e6", 6, sw1phy5);
GSWP(6, "e5", 5, sw1phy6);
GSWP(7, "e8", 8, sw1phy7);
GSWP(8, "e7", 7, sw1phy8);
XSWP(9, "e14", 14, sfp1);
XSWP(a, "e13", 13, sfp0);
GSWP(1, "e2", 2, &sw1phy1);
GSWP(2, "e1", 1, &sw1phy2);
GSWP(3, "e4", 4, &sw1phy3);
GSWP(4, "e3", 3, &sw1phy4);
GSWP(5, "e6", 6, &sw1phy5);
GSWP(6, "e5", 5, &sw1phy6);
GSWP(7, "e8", 8, &sw1phy7);
GSWP(8, "e7", 7, &sw1phy8);
};
mdio {
-9
View File
@@ -1,9 +0,0 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (C) 2021 Marvell International Ltd.
* Copyright (C) 2023 Addiva Elektronik AB
*
* Device tree for Styx board
*/
#include "styx.dtsi"
+1
View File
@@ -0,0 +1 @@
dcp-sc-28p-b.dtb
+1
View File
@@ -0,0 +1 @@
dcp-sc-28p-a.dtb
-12
View File
@@ -107,18 +107,6 @@ config DISK_IMAGE_BOOT_OFFSET
to make sure that the GPT still fits at the start of the
image.
config DISK_IMAGE_TEST_MODE
bool "Enable Test Mode"
depends on DISK_IMAGE
default y
help
Enable the test mode option by default. This setting creates a test-mode flag
in the auxiliary partition of the disk image, initiating the system with the test-config
instead of regular startup-config. The primary purpose of running an image in this mode
is to ensure proper execution of all Infix tests. Additionally, it enables extra RPCs
related to system restart and configuration overrides, allowing tests to be run even on
systems where the factory configuration may potentially create L2 loops.
config DISK_IMAGE_RELEASE_URL
string "Infix URL"
depends on DISK_IMAGE
+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.
+1 -10
View File
@@ -128,7 +128,7 @@ diskimg=disk.img
bootimg=
bootpart=
while getopts "a:b:B:n:s:t" opt; do
while getopts "a:b:B:n:s:" opt; do
case ${opt} in
a)
arch=$OPTARG
@@ -145,9 +145,6 @@ while getopts "a:b:B:n:s:t" opt; do
s)
total=$(size2int $OPTARG)
;;
t)
testmode=true
;;
esac
done
shift $((OPTIND - 1))
@@ -193,12 +190,6 @@ cp -f $BINARIES_DIR/rootfs.itbh $root/aux/primary.itbh
cp -f $BINARIES_DIR/rootfs.itbh $root/aux/secondary.itbh
cp -f $BINARIES_DIR/rauc.status $root/aux/rauc.status
if [ "$testmode" = true ]; then
touch "$root/aux/test-mode"
else
rm -f "$root/aux/test-mode"
fi
case "$arch" in
aarch64)
mkenvimage -s 0x4000 -o "$root/aux/uboot.env" \
+4
View File
@@ -104,6 +104,10 @@ rm -f "$TARGET_DIR/etc/os-release"
echo "$INFIX_TAGLINE $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"
gzip -f "$TARGET_DIR/usr/share/infix/config"
# Drop Buildroot default symlink to /tmp
if [ -L "$TARGET_DIR/var/lib/avahi-autoipd" ]; then
rm "$TARGET_DIR/var/lib/avahi-autoipd"
+4 -6
View File
@@ -59,13 +59,8 @@ if [ "$DISK_IMAGE" = "y" ]; then
tar -xa --strip-components=1 -C "$BINARIES_DIR" -f "$archive"
fi
testmode_flag=""
if [ "$DISK_IMAGE_TEST_MODE" = "y" ]; then
testmode_flag="-t"
fi
$common/mkrauc-status.sh "$BINARIES_DIR/${NAME}.pkg" >"$BINARIES_DIR/rauc.status"
$common/mkdisk.sh -a $BR2_ARCH -n $diskimg $testmode_flag -s $DISK_IMAGE_SIZE $bootcfg
$common/mkdisk.sh -a $BR2_ARCH -n $diskimg -s $DISK_IMAGE_SIZE $bootcfg
fi
load_cfg SDCARD_AUX
@@ -107,3 +102,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/"
@@ -1,24 +1,4 @@
#!/bin/sh
# This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with avahi; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
set -e
# Command line arguments:
# $1 event that happened:
# BIND: Successfully claimed address
@@ -29,60 +9,54 @@ set -e
# $3 IP adddress
PATH="$PATH:/usr/bin:/usr/sbin:/bin:/sbin"
NAME="/etc/frr/static.d/$2-zeroconf.conf"
NEXT="${NAME}+"
# Use a different metric for each interface, so that we can set
# identical routes to multiple interfaces.
log()
{
logger -I $$ -t zeroconf -p user.notice "$*"
}
METRIC=$((1000 + `cat "/sys/class/net/$2/ifindex" 2>/dev/null || echo 0`))
if [ -x /bin/ip -o -x /sbin/ip ] ; then
# We have the Linux ip tool from the iproute package
case "$1" in
BIND)
ip addr flush dev "$2" label "$2:avahi"
ip addr add "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev "$2" proto 6
ip route add default dev "$2" metric "$METRIC" scope link proto zeroconf ||:
;;
CONFLICT|UNBIND|STOP)
ip route del default dev "$2" metric "$METRIC" scope link ||:
ip addr del "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev "$2"
;;
*)
echo "Unknown event $1" >&2
exit 1
;;
# Reduce changes needed by comparing with previous route(s)
act()
{
case $1 in
add)
echo "! Generated by avahi-autoipd" > "$NEXT"
echo "ip route 0.0.0.0/0 $2 254" >> "$NEXT"
cmp -s "$NAME" "$NEXT" && return
mv "$NEXT" "$NAME"
;;
del)
[ -f "$NAME" ] || return
rm "$NAME"
;;
*)
return
;;
esac
elif [ -x /bin/ifconfig -o -x /sbin/ifconfig ] ; then
initctl -nbq restart staticd
}
# We have the old ifconfig tool
case "$1" in
BIND)
ip addr flush dev "$2" proto random
ip addr add "$3"/16 brd 169.254.255.255 scope link dev "$2" proto random
act add "$2"
log "set ipv4ll $3 on iface $2"
;;
case "$1" in
BIND)
ifconfig "$2:avahi" inet "$3" netmask 255.255.0.0 broadcast 169.254.255.255 up
route add default dev "$2:avahi" metric "$METRIC" ||:
;;
CONFLICT|UNBIND|STOP)
act del "$2"
ip addr flush dev "$2" proto random
log "clr ipv4ll on iface $2"
;;
CONFLICT|STOP|UNBIND)
route del default dev "$2:avahi" metric "$METRIC" ||:
ifconfig "$2:avahi" down
;;
*)
echo "Unknown event $1" >&2
exit 1
;;
esac
else
echo "No network configuration tool found." >&2
exit 1
fi
*)
log "Unknown event $1 on iface $2"
exit 1
;;
esac
exit 0
+1
View File
@@ -0,0 +1 @@
CONFD_TIMEOUT=60
@@ -1,3 +1,3 @@
service name:rousette notify:none log <pid/confd> \
[12345] rousette --syslog -t 60 \
service name:rousette notify:none log <pid/confd> env:/etc/default/confd \
[12345] rousette --syslog -t $CONFD_TIMEOUT \
-- RESTCONF server
@@ -0,0 +1,9 @@
! Default settings for staticd, used for both
! confd generated routes, udhcpc and zeroconf
frr defaults traditional
hostname Router
password zebra
enable password zebra
no log unique-id
log syslog informational
log facility local2
+5
View File
@@ -1 +1,6 @@
# Micro GNU Emacs default configuration file
auto-indent-mode
auto-fill-mode
make-backup-files 0
require-final-newline T
set-fill-column 72
+3
View File
@@ -1 +1,4 @@
# Allow client to pass locale environment
AcceptEnv LANG LC_*
Include /etc/ssh/sshd_config.d/*.conf
@@ -1 +0,0 @@
Subsystem cli /usr/bin/klish
@@ -0,0 +1 @@
Subsystem sftp /usr/libexec/sftp-server
+1 -1
View File
@@ -2,4 +2,4 @@
# Silly wrapper around sudo to prevent it from printing an error for
# unprivileged users: sudo: a password is required
id -nG $LOGNAME | grep -qw wheel && sudo -n $@
id -nG "$LOGNAME" | grep -qw wheel && sudo -n "$@"
+366
View File
@@ -0,0 +1,366 @@
#!/bin/sh
# Displays basic information about the system
# shellcheck disable=SC2048,SC2086
. /etc/os-release
bopt="-c"
opt="-br"
all=""
plain=""
h1()
{
STR="$*"
if [ -n "$plain" ]; then
echo "$STR" | tr '[:lower:]' '[:upper:]'
else
printf "\033[7m%-${COLUMNS}s\033[0m\n" "$STR"
fi
}
h2()
{
STR="$*"
if [ -n "$plain" ]; then
echo "$STR"
echo "$STR" | sed 's/./-/g'
else
printf "\033[1m%-${COLUMNS}s\033[0m\n" "$STR"
fi
}
dm()
{
if [ -n "$plain" ]; then
echo "${*}"
else
printf "\033[2m%s\033[0m\n" "$*"
fi
}
ul()
{
if [ -n "$plain" ]; then
printf "__%s__" "$*"
else
printf "\033[4%s\033[0m" "$*"
fi
}
em()
{
if [ -n "$plain" ]; then
printf "**%s**" "$*"
else
printf "\033[5m%s\033[0m" "$*"
fi
}
usage()
{
cat <<EOF
usage:
show [opt] cmd
options:
-a Show all, of something
-f Show full output, not brief port/iface listings
-h Show this help text
-n Show output without any footer
-p Show plain output, no bells or whistles
commands:
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
ip addr Show IPv4 addresses
route Show routing table
ipv6 addr Show IPv6 addresses
route Show routing table
log [FILE] Show latest entries from syslog, or other FILE
rmon PORT Show RMON counters for PORT (when applicable)
system Show OS details
version Show OS verson
EOF
}
# Usage 1: show port eth0
# Usage 2: show port
# Usage 3: show ports
#
# The first show ethtool output for 'eth0' (in this case). The latter
# two are the same, showing a summary of all interfaces classified as
# access ports.
ports()
{
if [ $# -gt 0 ] && [ -e "/sys/class/net/$1" ]; then
for port in $*; do
ethtool "$port"
done
return
fi
h1 "PORT STATE MAC ADDRESS FLAGS"
if grep -q port /etc/iproute2/group; then
ip $opt link show group port
else
ip $opt link show
fi
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
dm "______________________________________________________________________________"
dm "Use: '[ip|bridge] --help' and '[ip|bridge] link help' for more details."
fi
}
vlans()
{
h1 "INTERFACE VLAN FLAGS"
bridge $bopt vlan show |tail +2 | awk 'NF { iface=$1; vid=$2; printf("%-16s %4d ", iface, vid); for (i=3; i <= NF; i++) printf("%s ", $i); printf("\n"); }'
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
dm "______________________________________________________________________________"
dm "See: 'bridge --help' and 'bridge vlan help' for more details."
fi
}
ifaces()
{
if [ -n "$all" ]; then
if [ $# -gt 0 ]; then
for iface in $*; do
ip $opt addr show dev "$iface"
done
return
fi
h1 "INTERFACE STATE ADDRESS"
ip $opt addr show
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
dm "______________________________________________________________________________"
dm "See: 'ip --help' and 'ip address help' for more details."
fi
else
if [ $# -gt 0 ]; then
for iface in $*; do
sysrepocfg -f json -X -d operational -x \
"/ietf-interfaces:interfaces/interface[name='$iface']" | \
/usr/libexec/statd/cli-pretty "show-interfaces" -n "$iface"
done
return
fi
sysrepocfg -f json -X -d operational -m ietf-interfaces | \
/usr/libexec/statd/cli-pretty "show-interfaces"
fi
}
log()
{
if [ -n "$1" ] && [ -r "/var/log/$1" ]; then
fn="/var/log/$1"
else
fn="/var/log/syslog"
fi
less +G $fn
}
rmon()
{
if [ -z "$*" ]; then
echo "Missing argument, see 'show port' for available interfaces"
exit 1
fi
for port in $*; do
ethtool -S "$port"
done
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
dm "______________________________________________________________________________"
dm "See: 'ethtool --help' for more details."
fi
}
rstp()
{
mstpctl showbridge
echo "br0 port info"
mstpctl showport br0
}
fdb()
{
bridge $bopt fdb show
}
mdb()
{
bridge $bopt mdb show
}
routes()
{
if [ -n "$1" ]; then
arg="-i $1"
else
arg="-i ipv4"
fi
sysrepocfg -f json -X -d operational -x "/ietf-routing:routing/ribs" | \
/usr/libexec/statd/cli-pretty "show-routing-table" $arg
}
igmp()
{
mctl $@
}
system()
{
h1 "SYSTEM INFORMATION"
echo "System Name : $(uname -n)"
echo "System Variant : $VARIANT"
echo "System Description : $PRETTY_NAME"
echo "System Contact : $HOME_URL"
echo "System Timezone : $(cat /etc/timezone)"
echo "System Type : $NAME"
echo "System Version : $(cat /etc/version)"
echo "System Arch : $(uname -m)"
echo "Kernel Version : $(uname -sr)"
}
version()
{
cat /etc/version
}
while [ "$1" != "" ]; do
case $1 in
-a)
all=1
;;
-f)
opt=""
if [ -n "$plain" ]; then
opt="-color=never"
bopt="-color=never"
fi
opt="-d $opt"
bopt="-d $bopt"
;;
-n)
nofoot="yes"
;;
-p)
plain="yes"
opt="$opt -color=never"
bopt="$bopt -color=never"
;;
-h)
usage
exit 0
;;
*)
break
esac
shift
done
if [ -z "$plain" ]; then
TTY=$(resize)
eval "$TTY"
# COLUMS and ROWS should be set on the console, if not, use fallback
if [ -z "$COLUMNS" ]; then
if command -v tput; then
COLUMNS=$(tput cols)
else
COLUMNS=80
fi
fi
fi
cmd=$1
if [ -n "$cmd" ]; then
shift
fi
case $cmd in
help)
usage
;;
port*)
ports $*
;;
vlan*)
vlans
;;
fdb)
fdb
;;
mdb)
mdb
;;
ifa*)
ifaces $*
;;
ip)
cmd=$1
shift
case $cmd in
addr*)
all=1
opt="$opt -d"
ifaces $*
;;
route*)
routes ipv4
;;
igmp*)
igmp $*
;;
*)
usage
;;
esac
;;
ipv6)
cmd=$1
shift
case $cmd in
addr*)
ifaces
;;
route*)
routes ipv6
;;
mld*)
igmp $*
;;
*)
usage
;;
esac
;;
log)
log $1
;;
rmon)
rmon $*
;;
route*)
routes
;;
span*)
rstp
;;
sys*)
system
;;
ver*)
version
;;
*)
usage
exit 1
;;
esac
@@ -93,7 +93,7 @@ for version_dir in $(find "$MIGRATIONS_DIR" -mindepth 1 -maxdepth 1 -type d | so
done
# Update the JSON file to the latest version
if jq --arg version "$sys_version" '.["infix-meta:meta"]["infix-meta:version"] = $version' "$CONFIG_FILE" \
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
+35 -5
View File
@@ -33,8 +33,8 @@ unpack_archive()
esac
if [ ! -e "$file" ]; then
if [ -e "/var/lib/conatainers/oci/$file" ]; then
file="/var/lib/conatainers/oci/$file"
if [ -e "/var/lib/containers/oci/$file" ]; then
file="/var/lib/containers/oci/$file"
elif [ -e "/lib/oci/$file" ]; then
file="/lib/oci/$file"
else
@@ -280,6 +280,7 @@ commands:
help Show this help text
list [image | oci] List names (only) of containers, images, or OCI archives
load [NAME | URL] NM Load OCI tarball fileNAME or URL to image NM
locate Find container that currently owns '--net IFNAME'
remove IMAGE Remove an (unused) container image
restart [network] NAME Restart a (crashed) container or container(s) using network
run NAME [CMD] Run a container interactively, with an optional command
@@ -474,6 +475,23 @@ case $cmd in
exit 1
fi
;;
locate) # Find where the host's ifname lives
if [ -z "$network" ]; then
echo "Missing --net IFNAME option."
exit 1
fi
containers=$(podman ps $all --format "{{.Names}}")
for c in $containers; do
json=$(podman inspect "$c")
nets=$(echo "$json" |jq -r '.[].NetworkSettings.Networks | keys[]' 2>/dev/null)
for n in $nets; do
if [ "$network" = "$n" ]; then
echo "$c"
exit 0;
fi
done
done
;;
ls | list)
cmd=$1
[ -n "$cmd" ] && shift
@@ -608,20 +626,32 @@ case $cmd in
podman stats -i 2
;;
upgrade)
# Start script used to initially create container
script=/var/lib/containers/active/S01-${1}.sh
# Find container image
img=$(podman inspect "$1" | jq -r .[].ImageName)
if [ -z "$img" ]; then
echo "No such container ($1), or invalid ImageName. Cannot upgrade."
exit 1;
fi
# Likely an OCI archive, or local directory, assume user has updated image.
if echo "$img" | grep -Eq '^localhost/'; then
# Likely an OCI archive, or local directory, assume user has updated image.
file=$(awk '{s=$NF} END{print s}' "/var/lib/containers/active/${1}.sh")
file=$(awk '{s=$NF} END{print s}' "$script")
echo "Upgrading container ${1} with local archive: $file ..."
else
printf ">> Stopping ... "
podman stop "$1"
printf ">> "
podman pull "$img" || (echo "Failed fetching $img, check your network (settings)."; exit 1)
fi
"/var/lib/containers/active/${1}.sh" || (echo "Failed recreating container $1"; exit 1)
echo ">> Starting $1 ..."
if ! "$script"; then
echo ">> Failed recreating container $1"
exit 1
fi
echo ">> Done."
;;
volume)
cmd=$1
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
# Sort and collate all /etc/frr/static.d/*.conf files managed by confd,
# udhcpc, and avahi-autoipd before starting staticd.
DIRD=/etc/frr/static.d
NAME=/etc/frr/staticd.conf
NEXT=${NAME}+
rm -f "$NEXT"
find "$DIRD" -type f -name '*.conf' ! -name '*~' | sort | while read -r file; do
cat "$file" >> "$NEXT"
done
cmp -s "$NAME" "$NEXT" && exit 0
mv "$NEXT" "$NAME"
@@ -7,9 +7,12 @@ ACTION="$1"
IP_CACHE="/var/lib/misc/${interface}.cache"
RESOLV_CONF="/run/resolvconf/interfaces/${interface}.conf"
NTPFILE="/run/chrony/dhcp-sources.d/${interface}.sources"
NAME="/etc/frr/static.d/${interface}-dhcp.conf"
NEXT="${NAME}+"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] || subnet=32
[ -n "$metric" ] || metric=100
[ -n "$metric" ] || metric=5
# Handle stateful DHCPv6 like DHCPv4
[ -n "$ipv6" ] && ip="$ipv6/128"
@@ -23,7 +26,7 @@ log()
logger -I $$ -t udhcpc -p user.notice "$*"
}
wwait_for_ipv6_default_route()
wait_for_ipv6_default_route()
{
log "waiting for IPv6 default route to be installed."
while [ $IF_WAIT_DELAY -gt 0 ]; do
@@ -42,28 +45,35 @@ wwait_for_ipv6_default_route()
# client MUST ignore the Router option.
set_dhcp_routes()
{
echo "! Generated by udhcpc" > "$NEXT"
if [ -n "$staticroutes" ]; then
# 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"
ip route add "$1" via "$2" dev $interface metric $metric proto dhcp
echo "ip route $1 $2 $metric tag 100" >> "$NEXT"
shift 2
done
elif [ -n "$router" ] ; then
for i in $router ; do
ip route add default via $i dev $interface metric $((metric++)) proto dhcp
echo "ip route 0.0.0.0/0 $i $metric tag 100" >> "$NEXT"
done
fi
# Reduce changes needed by comparing with previous route(s)
cmp -s "$NAME" "$NEXT" && return
mv "$NEXT" "$NAME"
initctl -nbq restart staticd
}
clr_dhcp_routes()
{
log "deleting DHCP routes from $interface"
ip route show proto dhcp dev $interface | while read rt via nh dev dev; do
log "removing $rt nh $nh on $dev"
ip route del $rt via $nh dev $dev proto dhcp
done
[ -f "$NAME" ] || return
rm "$NAME"
initctl -nbq restart staticd
}
clr_dhcp_addresses()
@@ -112,7 +122,6 @@ case "$ACTION" in
wait_for_ipv6_default_route
fi
clr_dhcp_routes
set_dhcp_routes
# set hostname if given
+3 -2
View File
@@ -27,11 +27,11 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image
BR2_ROOTFS_MERGED_USR=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.46"
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.52"
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 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_INTREE_DTS_NAME="alder/alder styx/dcp-sc-28p-a styx/dcp-sc-28p-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
@@ -159,6 +159,7 @@ BR2_PACKAGE_TETRIS=y
BR2_PACKAGE_ROUSETTE=y
BR2_PACKAGE_LIBINPUT=y
BR2_PACKAGE_HOST_PYTHON_YANGDOC=y
BR2_PACKAGE_TEST_MODE=y
DISK_IMAGE_BOOT_BIN=y
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
+139
View File
@@ -0,0 +1,139 @@
BR2_aarch64=y
BR2_ARM_FPU_VFPV4=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=y
BR2_DL_DIR="${BR2_EXTERNAL_INFIX_PATH}/dl"
BR2_CCACHE=y
BR2_CCACHE_DIR="${BR2_EXTERNAL_INFIX_PATH}/.ccache"
BR2_ENABLE_DEBUG=y
BR2_GLOBAL_PATCH_DIR="${BR2_EXTERNAL_INFIX_PATH}/patches"
BR2_TARGET_GENERIC_HOSTNAME="ix"
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_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
BR2_SYSTEM_DHCP="eth0"
BR2_ENABLE_LOCALE_WHITELIST="C en_US en_CA C.UTF-8"
BR2_GENERATE_LOCALE="en_US en_CA C.UTF-8"
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_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/dcp-sc-28p-a styx/dcp-sc-28p-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
BR2_PACKAGE_STRESS_NG=y
BR2_PACKAGE_JQ=y
BR2_PACKAGE_E2FSPROGS=y
BR2_PACKAGE_DBUS_CXX=y
BR2_PACKAGE_DBUS_GLIB=y
BR2_PACKAGE_DBUS_TRIGGERD=y
BR2_PACKAGE_EUDEV_RULES_GEN=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_MDIO_TOOLS=y
BR2_PACKAGE_RNG_TOOLS=y
BR2_PACKAGE_UBOOT_TOOLS=y
BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT=y
BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
BR2_PACKAGE_UBOOT_TOOLS_FIT_CHECK_SIGN=y
BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=y
BR2_PACKAGE_PYTHON3=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_LIBCURL_CURL=y
BR2_PACKAGE_NETOPEER2_CLI=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_LINUX_PAM=y
BR2_PACKAGE_ONIGURUMA=y
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_DEFAULT_SERVICES=y
BR2_PACKAGE_CHRONY=y
BR2_PACKAGE_DNSMASQ=y
BR2_PACKAGE_ETHTOOL=y
BR2_PACKAGE_FRR=y
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPUTILS=y
BR2_PACKAGE_LLDPD=y
BR2_PACKAGE_NETCALC=y
BR2_PACKAGE_OPENRESOLV=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_SOCAT=y
BR2_PACKAGE_TCPDUMP=y
BR2_PACKAGE_WHOIS=y
BR2_PACKAGE_BASH_COMPLETION=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_KMOD_TOOLS=y
BR2_PACKAGE_PWGEN=y
BR2_PACKAGE_RAUC=y
BR2_PACKAGE_RAUC_DBUS=y
BR2_PACKAGE_RAUC_GPT=y
BR2_PACKAGE_RAUC_NETWORK=y
BR2_PACKAGE_SYSKLOGD=y
BR2_PACKAGE_SYSKLOGD_LOGGER=y
BR2_PACKAGE_WATCHDOGD=y
BR2_PACKAGE_LESS=y
BR2_PACKAGE_MG=y
BR2_PACKAGE_NANO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_E2FSPROGS=y
BR2_PACKAGE_HOST_ENVIRONMENT_SETUP=y
BR2_PACKAGE_HOST_GENEXT2FS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_RAUC=y
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
INFIX_VENDOR_HOME="https://github.com/kernelkit"
INFIX_DESC="Infix is a Network Operating System based on Linux. It can be set up both as a switch, with offloading using switchdev, and a router with firewalling."
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_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_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
BR2_PACKAGE_KEYACK=y
BR2_PACKAGE_KLISH_PLUGIN_INFIX=y
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
DISK_IMAGE_BOOT_BIN=y
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
GNS3_APPLIANCE_RAM=512
GNS3_APPLIANCE_IFNUM=10
+1
View File
@@ -201,6 +201,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
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
# GNS3_APPLIANCE is not set
+1
View File
@@ -192,6 +192,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
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
# GNS3_APPLIANCE is not set
+2 -1
View File
@@ -26,7 +26,7 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image
BR2_ROOTFS_MERGED_USR=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.46"
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.52"
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
@@ -161,6 +161,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
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
GNS3_APPLIANCE_RAM=512
+140
View File
@@ -0,0 +1,140 @@
BR2_x86_64=y
BR2_x86_corei7=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=y
BR2_DL_DIR="${BR2_EXTERNAL_INFIX_PATH}/dl"
BR2_CCACHE=y
BR2_CCACHE_DIR="${BR2_EXTERNAL_INFIX_PATH}/.ccache"
BR2_ENABLE_DEBUG=y
BR2_GLOBAL_PATCH_DIR="${BR2_EXTERNAL_INFIX_PATH}/patches"
BR2_TARGET_GENERIC_HOSTNAME="ix"
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_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
BR2_SYSTEM_DHCP="eth0"
BR2_ENABLE_LOCALE_WHITELIST="C en_US en_CA C.UTF-8"
BR2_GENERATE_LOCALE="en_US en_CA C.UTF-8"
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_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
BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_INFIX_PATH}/board/common/busybox_defconfig"
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_STRESS_NG=y
BR2_PACKAGE_JQ=y
BR2_PACKAGE_E2FSPROGS=y
BR2_PACKAGE_DBUS_CXX=y
BR2_PACKAGE_DBUS_GLIB=y
BR2_PACKAGE_DBUS_TRIGGERD=y
BR2_PACKAGE_EUDEV_RULES_GEN=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_RNG_TOOLS=y
BR2_PACKAGE_UBOOT_TOOLS=y
BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT=y
BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
BR2_PACKAGE_UBOOT_TOOLS_FIT_CHECK_SIGN=y
BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=y
BR2_PACKAGE_PYTHON3=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_LIBCURL_CURL=y
BR2_PACKAGE_NETOPEER2_CLI=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_LINUX_PAM=y
BR2_PACKAGE_ONIGURUMA=y
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_DEFAULT_SERVICES=y
BR2_PACKAGE_CHRONY=y
BR2_PACKAGE_DNSMASQ=y
BR2_PACKAGE_ETHTOOL=y
BR2_PACKAGE_FRR=y
# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPUTILS=y
BR2_PACKAGE_LLDPD=y
BR2_PACKAGE_NETCALC=y
BR2_PACKAGE_OPENRESOLV=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_SOCAT=y
BR2_PACKAGE_TCPDUMP=y
BR2_PACKAGE_WHOIS=y
BR2_PACKAGE_BASH_COMPLETION=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_KMOD_TOOLS=y
BR2_PACKAGE_PWGEN=y
BR2_PACKAGE_RAUC=y
BR2_PACKAGE_RAUC_DBUS=y
BR2_PACKAGE_RAUC_GPT=y
BR2_PACKAGE_RAUC_NETWORK=y
BR2_PACKAGE_SYSKLOGD=y
BR2_PACKAGE_SYSKLOGD_LOGGER=y
BR2_PACKAGE_WATCHDOGD=y
BR2_PACKAGE_LESS=y
BR2_PACKAGE_MG=y
BR2_PACKAGE_NANO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_EDK2=y
BR2_TARGET_GRUB2=y
BR2_TARGET_GRUB2_X86_64_EFI=y
BR2_TARGET_GRUB2_BUILTIN_MODULES_EFI="boot linux ext2 squash4 part_gpt normal efi_gop configfile loadenv test echo reboot net efinet tftp loopback cat search"
BR2_TARGET_GRUB2_BUILTIN_CONFIG_EFI="${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/grub-embed.cfg"
BR2_TARGET_GRUB2_INSTALL_TOOLS=y
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_E2FSPROGS=y
BR2_PACKAGE_HOST_ENVIRONMENT_SETUP=y
BR2_PACKAGE_HOST_GENEXT2FS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_RAUC=y
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
INFIX_VENDOR_HOME="https://github.com/kernelkit"
INFIX_DESC="Infix is a Network Operating System based on Linux. It can be set up both as a switch, with offloading using switchdev, and a router with firewalling."
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_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_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
BR2_PACKAGE_KEYACK=y
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
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
GNS3_APPLIANCE_RAM=512
GNS3_APPLIANCE_IFNUM=10
+91 -2
View File
@@ -4,6 +4,94 @@ Change Log
All notable changes to the project are documented in this file.
[v24.09.0][] - 2024-09-30
-------------------------
**News:** this release enhances the integration of all types of static
routes with FRRouting ([Frr][]), including all routes that can be set by
DHCP and IPvLL (ZeroConf) clients. Due to this fundamental change, the
system routing table is now primarily read from Frr, which increases the
amount of relevant routing information available to the user. E.g., in
the CLI exec command `show ip route` and `show ipv6 route`. Support for
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
- Upgrade sysrepo to 2.11.7
- Upgrade netopeer2 (NETCONF) to 2.2.31
- Updated `infix-routing.yang` to declare deviations for unsupported
OSPF RPCs and Notifications in `ietf-ospf.yang`
- The CLI admin-exec command `show dns` now also shows any configured
name servers, not just ones acquired via DHCP. Issue #510
- Add support for IPv4 (autoconf) `request-address`. This instructs the
ZeroConf client to start with the requested address. If this is not
successful the client falls back to its default behavior. Issue #628
- Major speedup (10x) in operational data, in particular when querying
interface status. Very noticeable in the CLI `show interfaces`
command on devices with large port counts. Issue #651
- Silence `yanger` log warnings for failing `mctl` command. Caused
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
bridge interfaces. Possible to override using `phys-address` option
- Fix #601: CLI regression in `show ospf` family of commands causing
authorized users, like `admin`, to not being able to query status
of OSPF or BFD. Workaround by using the UNIX shell `sudo vtysh`.
Regression introduced in v24.08.0
- Fix #603: regression in GNS3 image, starts in test mode by default.
Introduced in v24.08.
- Fix #613: CLI regression in tab completion of container commands,
e.g., `container shell <TAB>`. Regression introduced in v24.08.0
- Fix #616: Silent failure when selecting bash as login shell for
non-admin user, this silent lock has been removed
- Fix #618: CLI command `show interfaces` does not show bridges and
bridge ports, regression introduced in v24.08.0 -- only affects
bridges without multicast snooping
- Fix #623: CLI command `container upgrade NAME` does not work,
regression introduced in v24.06.0
- Fix #625: initialize sysrepo startup datastore at boot. Improves
usability when working directly against the sysrepo datastores from
the shell with `sysrepocfg` and `sysrepoctl` tools
- Fix #635: OSPF: all router neighbors reported as neighbor on every
interface
- Fix #638: Disabling IPv4LL (autoconf) on an interface does not clean
up 169.254/16 addresses
- Fix #640: unable to set static default route due to priority inversion
from DHCP or IPv4LL (ZeroConf) clients setting their routes directly
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
- 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
[Frr]: https://frrouting.org/
[v24.08.0][] - 2024-08-30
-------------------------
@@ -22,7 +110,7 @@ Finally, the following consumer boards are now fully supported:
- 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
is now overwritten x3, the last time with zeroes, then removed.
is now overwritten x3, the last time with zeroes, then removed.
Example, on the NanoPi R2S this process takes ~30 seconds, but may
take longer in setups with bigger configurations, e.g., containers
- Issue #497: support for auto-mounting USB media. Useful for logging,
@@ -162,7 +250,7 @@ Finally, the following consumer boards are now fully supported:
- Merge infix-shell-types.yang with infix-system.yang
- cli: improved error/warning message on missing or incomplete command
[yescrypt]: https://en.wikipedia.org/wiki/Yescrypt)
[yescrypt]: https://en.wikipedia.org/wiki/Yescrypt
### Fixes
- Fix #424: regression, root user can log in without password
@@ -1069,6 +1157,7 @@ Supported YANG models in addition to those used by sysrepo and netopeer:
[buildroot]: https://buildroot.org/
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v24.08.0...HEAD
[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
[v24.04.2]: https://github.com/kernelkit/infix/compare/v24.04.1...v24.04.2
+2 -3
View File
@@ -222,9 +222,8 @@ archive, which helps greatly with container upgrades (see below):
Upgrading a Container Image
---------------------------
> **Note:** the default writable layer is lost when upgrading the image
> Use named volumes for directories with writable content you wish to
> keep over an upgrade.
> **Note:** the default writable layer is lost when upgrading the image.
> Use named volumes for content that you want to persist across upgrades.
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
+45 -8
View File
@@ -67,14 +67,7 @@ $ sudo apt install bc binutils build-essential bzip2 cpio \
diffutils file findutils git gzip \
libncurses-dev libssl-dev perl patch \
python3 rsync sed tar unzip wget \
autopoint bison flex
```
For testing, a few more tools and services are required on your system:
```bash
$ sudo apt install jq graphviz qemu-system-x86 qemu-system-arm \
ethtool gdb-multiarch tcpdump tshark
autopoint bison flex autoconf automake
```
> For details, see the Getting Started and System Requirements sections
@@ -94,6 +87,23 @@ To see available defconfigs for supported targets, use:
make list-defconfigs
### Test
Working with the regression test framework, *Infamy*, a few more tools
and services are required on your system:
```bash
$ sudo apt install jq graphviz qemu-system-x86 qemu-system-arm \
ethtool gdb-multiarch tcpdump tshark
```
To be able to build the test specification you also need:
```bash
$ sudo apt-get install python3-graphviz ruby-asciidoctor-pdf
```
Development
-----------
@@ -166,6 +176,33 @@ The Infix automated test suite is built around Qemu and [Qeneth][2], see:
* [Docker Image](../test/docker/README.md)
Reviewing
---------
While reviewing a pull request, you might find yourself wanting to
play around with a VM running that _exact_ version. For such
occations, [gh-dl-artifact.sh](../utils/gh-dl-artifact.sh) is your
friend in need! It will use the [GitHub CLI
(gh)](https://cli.github.com) to locate a prebuilt image from our CI
workflow, download it, and prepare a local output directory from which
you can launch both `make run` instances, and run regression tests
with `make test` and friends.
For example, if you are curious about how PR 666 behaves in some
particular situation, you can use `gh` to switch to that branch, from
which `gh-dl-artifact.sh` can then download and prepare the
corresponding image for execution with our normal tooling:
gh pr checkout 666
./utils/gh-dl-artifact.sh
cd x-artifact-a1b2c3d4-x86_64
make run
> **Note:** CI artifacts are built from a merge commit of the source
> and target branches. Therefore, the version in the Infix banner
> will not match the SHA of the commit you have checked out.
Contributing
------------
+153 -42
View File
@@ -598,6 +598,13 @@ As shown, the link-local IPv4 address is configured with `set autconf
enabled true`. The resulting address (169.254.1.3/16) is of type
*random* ([ietf-ip.yang][2]).
The IPv4LL client also supports a `request-address` setting which can be
used to "seed" the client's starting address. If the address is free it
will be used, otherwise it falls back to the default algorithm.
admin@example:/config/interface/eth0/ipv4/> set autoconf request-address 169.254.1.2
#### Use of DHCP for IPv4 address assignment
![Using DHCP for IPv4 address assignment](img/ip-address-example-ipv4-dhcp.svg)
@@ -657,6 +664,7 @@ admin@example:/>
ipv6 ::1/128 (static)
admin@example:/>
#### Stateless Auto-configuration of Global IPv6 Address
![Auto-configuration of global IPv6](img/ip-address-example-ipv6-auto-global.svg)
@@ -693,6 +701,7 @@ below.
ipv6 ::1/128 (static)
admin@example:/>
#### Random Link Identifiers for IPv6 Stateless Autoconfiguration
![Auto-configuration of global IPv6](img/ip-address-example-ipv6-auto-global.svg)
@@ -731,7 +740,9 @@ possible to specify use of a random identifier ([ietf-ip.yang][2] and
Both the link-local address (fe80::) and the global address (2001:)
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
received on this interface can be forwarded.
@@ -742,7 +753,9 @@ received on this interface can be forwarded.
admin@example:/>
```
### IPv6 forwarding
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.
@@ -760,18 +773,36 @@ flag controls if the interface will be in host/router mode.
admin@example:/config/interface/eth0/> leave
admin@example:/>
```
## Routing support
| **Yang Model** | **Description** |
|:--------------------------|:--------------------------------------------------------------------------------------|
| ietf-routing | Base model, used to set configuration and read operational status in the other models |
| ietf-ipv4-unicast-routing | Static IPv4 unicast routing |
| ietf-ipv6-unicast-routing | Static IPv6 unicast routing |
| ietf-ospf | OSPF routing |
| infix-routing | Infix deviations |
Currently supported YANG models:
| **YANG Model** | **Description** |
|:--------------------------|:--------------------------------|
| ietf-routing | Base model for all other models |
| ietf-ipv4-unicast-routing | Static IPv4 unicast routing |
| ietf-ipv6-unicast-routing | Static IPv6 unicast routing |
| ietf-ospf | OSPF routing |
| infix-routing | Infix deviations and extensions |
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.
### IPv4 Static routes
Remember to enable [IPv4 forwarding](#IPv4-forwarding) for the interfaces.
The standard IETF model for static routes reside under the `static`
control plane protocol. For our examples we use the instance name
`default`, you can use any name.
For a route with destination 192.168.200.0/24 via 192.168.1.1:
admin@example:/> configure
admin@example:/config/> edit routing control-plane-protocol static name default
@@ -779,7 +810,18 @@ Remember to enable [IPv4 forwarding](#IPv4-forwarding) for the interfaces.
admin@example:/config/routing/control-plane-protocol/static/name/default/> leave
admin@example:/>
> **Note:** You can only have one instance per routing protocol.
For a "floating" static route with destination 10.0.0.0/16 via a backup
router 192.168.1.1, using the highest possible distance:
admin@example:/> configure
admin@example:/config/> edit routing control-plane-protocol static name default
admin@example:/config/routing/control-plane-protocol/static/name/default/> set ipv4 route 10.0.0.0/16 next-hop next-hop-address 192.168.1.1 route-preference 254
admin@example:/config/routing/control-plane-protocol/static/name/default/> leave
admin@example:/>
> Remember to enable [IPv4 forwarding](#IPv4-forwarding) for the
> interfaces you want to route between.
### IPv6 Static routes
@@ -789,24 +831,25 @@ Remember to enable [IPv4 forwarding](#IPv4-forwarding) for the interfaces.
admin@example:/config/routing/control-plane-protocol/static/name/default/> leave
admin@example:/>
> **Note:** You can only have one instance per routing protocol.
### OSPFv2 Routing
Infix supports OSPF dynamic routing for IPv4, i.e., OSPFv2.
Remember to enable [IPv4 forwarding](#IPv4-forwarding) for the
interfaces you want to run OSPFv2.
The system supports OSPF dynamic routing for IPv4, i.e., OSPFv2. To
enable OSPF and set one active interface in area 0:
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> set ospf area 0.0.0.0 interface e0 enabled true
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> set ospf area 0.0.0.0 interface e0 enabled
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> leave
admin@example:/>
> **Note:** You can only have one instance per routing protocol.
> Remember to enable [IPv4 forwarding](#IPv4-forwarding) for all the
> interfaces you want to route between.
#### OSPF area types
In addition to *regular* OSPF areas, area types *NSSA* and *Stub* are supported.
To configure a NSSA area with summary routes:
In addition to *regular* OSPF areas, area types *NSSA* and *Stub* are
also supported. To configure an NSSA area with summary routes:
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> set ospf area 0.0.0.1 area-type nssa-area
@@ -814,8 +857,10 @@ To configure a NSSA area with summary routes:
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> leave
admin@example:/>
#### Bidirectional Forwarding Detection (BFD)
It is possible to enable BFD per interface to speed up detection of
It is possible to enable BFD per OSPF interface to speed up detection of
link loss.
admin@example:/config/> edit routing control-plane-protocol ospfv2 name default
@@ -823,12 +868,13 @@ link loss.
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> leave
admin@example:/>
#### OSPF interface settings
We have already seen how to enable OSPF per interface (*enabled true*)
and BFD for OSPF per interface (*bfd enabled true*). These and other
OSPF interface settings are done in context of an OSFP area, e.g.,
*area 0.0.0.0*. Available commands can be listed using the `?` mark.
and BFD for OSPF per interface (*bfd enabled true*). These and other
OSPF interface settings are done in context of an OSFP area, e.g., *area
0.0.0.0*. Available commands can be listed using the `?` mark.
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/> edit ospf area 0.0.0.0
admin@example:/config/routing/control-plane-protocol/ospfv2/name/default/ospf/area/0.0.0.0/> edit interface e0
@@ -870,47 +916,112 @@ routes`.
### View routing table
The routing table can be viewed from the operational datastore over
NETCONF or using the CLI:
The routing table can be inspected from the operational datastore, XPath
`/routing/ribs`, using sysrepocfg, NETCONF/RESTCONF, or using the CLI.
#### IPv4 routing table
admin@example:/> show routes ipv4
PREFIX NEXT-HOP PREF PROTOCOL
192.168.1.0/24 e0 kernel
192.168.200.0/24 192.168.1.1 20 static
This CLI example shows the IPv4 routing table with a few connected
routes and some routes learned from OSPF. See the next section for
an explanation of route preferences (PREF).
The `>` at the start of a line marks a selected route (in the IETF YANG
model referred to as *active*), if there are more than one route with
the same destination the `*` marks the next-hop used and installed in
the kernel FIB (the YANG model refers to this as *installed*).
admin@example:/> show ip route
DESTINATION PREF NEXT-HOP PROTO UPTIME
>* 0.0.0.0/0 110/2 10.0.23.1 ospfv2 4h2m43s
>* 10.0.0.1/32 110/4000 10.0.13.1 ospfv2 4h2m43s
10.0.0.3/32 110/0 lo ospfv2 4h2m57s
>* 10.0.0.3/32 0/0 lo direct 4h2m58s
10.0.13.0/30 110/2000 e5 ospfv2 4h2m57s
>* 10.0.13.0/30 0/0 e5 direct 4h2m58s
10.0.23.0/30 110/1 e6 ospfv2 4h2m57s
>* 10.0.23.0/30 0/0 e6 direct 4h2m58s
192.168.3.0/24 110/1 e2 ospfv2 4h2m57s
>* 192.168.3.0/24 0/0 e2 direct 4h2m58s
admin@example:/>
#### IPv6 routing table
admin@example:/> show routes ipv6
PREFIX NEXT-HOP PREF PROTOCOL
2001:db8:3c4d:50::/64 eth4 256 kernel
fe80::/64 eth5 256 kernel
fe80::/64 eth3 256 kernel
fe80::/64 eth1 256 kernel
fe80::/64 eth0 256 kernel
fe80::/64 eth2 256 kernel
fe80::/64 eth4 256 kernel
This CLI example show the IPv6 routing table.
admin@example:/> show ipv6 route
DESTINATION PREF NEXT-HOP PROTO UPTIME
>* ::/0 1/0 2001:db8:3c4d:50::1 static 0h1m20s
>* 2001:db8:3c4d:50::/64 0/0 e6 direct 0h1m20s
>* 2001:db8:3c4d:200::1/128 0/0 lo direct 0h1m20s
* fe80::/64 0/0 e7 direct 0h1m20s
* fe80::/64 0/0 e6 direct 0h1m20s
* fe80::/64 0/0 e5 direct 0h1m20s
* fe80::/64 0/0 e4 direct 0h1m20s
* fe80::/64 0/0 e3 direct 0h1m20s
* fe80::/64 0/0 e2 direct 0h1m20s
>* fe80::/64 0/0 e1 direct 0h1m20s
admin@example:/>
#### Route Preference
The operating system leverages FRRouting ([Frr][4]) 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
(sometimes referred to as FIB).
Routes have different weights made up from a *distance* and a *metric*.
The kernel routing table only talks about *metric*, which unfortunately
is **not the same** -- this is one of the reasons why the term *route
preference* is used instead. It is recommended to use the CLI, or any
of the other previously mentioned YANG based front-ends, to inspect the
routing table.
Default distances used (lower numeric value wins):
| **Distance** | **Protocol** |
|--------------|-----------------------------------------|
| 0 | Kernel routes, i.e., connected routes |
| 1 | Static routes |
| 5 | DHCP routes |
| 110 | OSPF |
| 254 | IPv4LL (ZeroConf) device routes |
| 255 | Route will not be used or redistributed |
Hence, a route learned from OSPF may be overridden by a static route set
locally. By default, even a route to the same destination, but with a
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.
#### Source protocol
The source protocol describes the origin of the route.
| **Protocol** | **Description** |
|:-------------|:---------------------------------------------------------------------|
| kernel | Added when setting a subnet address on an interface |
| static | User created static routes |
| dhcp | Routes retrieved from DHCP |
| ospf | Routes retreived from OSPFv2 |
| **Protocol** | **Description** |
|:-------------|:----------------------------------------------------|
| kernel | Added when setting a subnet address on an interface |
| static | User created, learned from DHCP, or IPv4LL |
| ospfv2 | Routes learned from OSPFv2 |
The YANG model *ietf-routing* support multiple ribs but only two are
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/
[^1]: Please note, link aggregates are not yet supported in Infix.
[^2]: Link-local IPv6 addresses are implicitly enabled when enabling
+35 -2
View File
@@ -265,7 +265,7 @@ suite:
This is useful because this value can then be used to rerun a test (or
the whole suite) with identical topology mappings:
$ make PYTHONHASHSEED=3773822171 INFIX_TESTS=case/ietf_system/hostname.py test
$ make PYTHONHASHSEED=3773822171 TESTS=case/ietf_system/hostname.py test
### Deterministic Transport Protocol
@@ -274,7 +274,7 @@ chosen randomly. If you supply a `PYTHONHASHSEED` as described above,
you get the same protocol used for that hash. But if you want to choose
the protocol, add extra arguments to Infamy:
$ make INFAMY_EXTRA_ARGS="--transport=restconf" INFIX_TESTS=case/ietf_system/hostname.py test
$ make INFAMY_EXTRA_ARGS="--transport=restconf" TESTS=case/ietf_system/hostname.py test
or, when running interactively:
@@ -282,5 +282,38 @@ or, when running interactively:
09:08:17 infamy0:test # ./9pm/9pm.py -o"--transport=restconf" case/ietf_system/hostname.py
### Test specification
The test specification is automaticly generated from the test cases,
this puts some constraints on the test cases:
All test cases must be written so that it can be understandable with
only the steps so the result can be reproduced manually. E.g., instead
of `set ip address on the interface` it should be more human readable,
for example:
```python
test.step("Set IPv4 address on the interface dut:cross")
test.step("Verify the IP address is set on dut:cross")
```
where dut, cross and the IPv4 address could be found inside the
logical topology for the test.
Each test case must begin with the test name followed by a empty line and
the description of the test. For example:
```
"""
Set hostname
Verify that it it possible to change hostname
"""
```
The test specifaction can be genererated with:
$ make test-spec
[9PM]: https://github.com/rical/9pm
[Qeneth]: https://github.com/wkz/qeneth
+2
View File
@@ -1,5 +1,6 @@
menu "Packages"
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/curios-httpd/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/execd/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/gencert/Config.in"
@@ -31,4 +32,5 @@ source "$BR2_EXTERNAL_INFIX_PATH/package/libyang-cpp/Config.in"
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"
endmenu
+6 -6
View File
@@ -12,20 +12,20 @@ service name:confd log:prio:daemon.err <run/bootstrap/success> \
-- Configuration daemon
# Bootstrap system with startup-config
run name:startup log:prio:user.notice norestart <pid/confd> \
[S] /usr/libexec/confd/load startup-config \
run name:startup log:prio:user.notice norestart <pid/confd> env:/etc/default/confd \
[S] /usr/libexec/confd/load -t $CONFD_TIMEOUT startup-config \
-- Loading startup-config
# Run if loading startup-config fails for some reason
run name:failure log:prio:user.critical norestart <pid/confd> if:<run/startup/failure> \
[S] /usr/libexec/confd/load failure-config \
run name:failure log:prio:user.critical norestart <pid/confd> env:/etc/default/confd if:<run/startup/failure> \
[S] /usr/libexec/confd/load -t $CONFD_TIMEOUT failure-config \
-- Loading failure-config
run name:error :2 log:console norestart if:<run/failure/failure> \
[S] /usr/libexec/confd/error --
service name:netopeer notify:none log <pid/confd> \
[12345] netopeer2-server -F -t 60 -v 1 \
service name:netopeer notify:none log <pid/confd> env:/etc/default/confd \
[12345] netopeer2-server -F -t $CONFD_TIMEOUT -v 1 \
-- NETCONF server
# Create initial /etc/resolv.conf after successful bootstrap
+1 -1
View File
@@ -4,7 +4,7 @@
#
################################################################################
CONFD_VERSION = 1.0
CONFD_VERSION = 1.1
CONFD_SITE_METHOD = local
CONFD_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/confd
CONFD_LICENSE = BSD-3-Clause
@@ -0,0 +1,29 @@
From c8ec120afa3a66674ef30b10490eeeb36d806eed Mon Sep 17 00:00:00 2001
From: Tomas Pecka <peckato1@fit.cvut.cz>
Date: Fri, 17 Feb 2023 13:50:17 +0100
Subject: [PATCH] Fix getting current timezone on ARM-based devices
Our software using date on buildroot ARM-based device terminates with an
uncaught exception.
terminate called after throwing an instance of 'std::runtime_error'
what(): posix/Etc/UTC not found in timezone database
I have applied workaround from [1].
[1] https://github.com/HowardHinnant/date/issues/252
Bug: https://github.com/HowardHinnant/date/issues/252
---
src/tz.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tz.cpp b/src/tz.cpp
index bd9fad4..eea48ce 100644
--- a/src/tz.cpp
+++ b/src/tz.cpp
@@ -3925,7 +3925,7 @@ sniff_realpath(const char* timezone)
if (realpath(timezone, rp) == nullptr)
throw system_error(errno, system_category(), "realpath() failed");
auto result = extract_tz_name(rp);
- return result != "posixrules";
+ return result.find("posix") == decltype(result)::npos;
}
const time_zone*
--
2.39.2
+6
View File
@@ -0,0 +1,6 @@
config BR2_PACKAGE_DATE_CPP
bool "date-cpp"
help
A date and time library based on the C++11/14/17 <chrono> header
https://github.com/HowardHinnant/date
+3
View File
@@ -0,0 +1,3 @@
# Locally calculated
sha256 c90f6c00fb961170560299cbda28ca2d45804913aa8b2a9f36dbb8e0028d6930 LICENSE.txt
sha256 7a390f200f0ccd207e8cff6757e04817c1a0aec3e327b006b7eb451c57ee3538 date-3.0.1.tar.gz
+10
View File
@@ -0,0 +1,10 @@
DATE_CPP_VERSION = 3.0.1
DATE_CPP_SITE = $(call github,HowardHinnant,date,v$(DATE_CPP_VERSION))
DATE_CPP_INSTALL_STAGING = YES
DATE_CPP_LICENSE = MIT
DATE_CPP_LICENSE_FILES = LICENSE.txt
DATE_CPP_CONF_OPTS = \
-DBUILD_TZ_LIB=ON \
-DUSE_SYSTEM_TZ_DB:BOOL=ON \
-DENABLE_DATE_TESTING=OFF
$(eval $(cmake-package))
+1 -1
View File
@@ -1,3 +1,3 @@
# Locally calculated
sha256 82e3758011ec44c78e98d0777799d6e12aec5b8a64b32ebb20d0fe50e32488bb LICENSE
sha256 fc5ae5218d441afef697d4fc7912ddbe322060103c053d50fc2db829bd359458 libyang-cpp-b852ea3b9a2729da364f2c4122db05d882df37f2-br1.tar.gz
sha256 43c84317ba13470f421a90bca74c062cf63a70e488d2e90c432b662c4638a14e libyang-cpp-v3.tar.gz
+2 -3
View File
@@ -3,9 +3,8 @@
# CPP bindings for libyang
#
################################################################################
LIBYANG_CPP_VERSION = b852ea3b9a2729da364f2c4122db05d882df37f2
LIBYANG_CPP_SITE = https://github.com/kernelkit/libyang-cpp.git
LIBYANG_CPP_SITE_METHOD = git
LIBYANG_CPP_VERSION = v3
LIBYANG_CPP_SITE = $(call github,CESNET,libyang-cpp,$(LIBYANG_CPP_VERSION))
LIBYANG_CPP_LICENSE = BSD-3-Clause
LIBYANG_CPP_LICENSE_FILES = LICENSE
LIBYANG_CPP_DEPENDENCIES = libyang
+2 -1
View File
@@ -2,14 +2,15 @@ config BR2_PACKAGE_ROUSETTE
bool "rousette"
depends on BR2_USE_MMU
select BR2_PACKAGE_BOOST
select BR2_PACKAGE_BOOST_ATOMIC
select BR2_PACKAGE_BOOST_THREAD
select BR2_PACKAGE_BOOST_SYSTEM
select BR2_PACKAGE_DATE_CPP
select BR2_PACKAGE_DOCOPT_CPP
select BR2_PACKAGE_LIBYANG_CPP
select BR2_PACKAGE_NGHTTP2
select BR2_PACKAGE_NGHTTP2_ASIO
select BR2_PACKAGE_SPDLOG
select BR2_PACKAGE_SYSREPO_CPP
select BR2_PACKAGE_DATE
help
RESTconf server
+1 -1
View File
@@ -1,3 +1,3 @@
# Locally calculated
sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
sha256 74b0d3115e73335399c5f8847fb7baa4d23497be75d12fccf56a754015af4c76 rousette-226a2410376e5befd0bf6dc180618a108b11b256-br1.tar.gz
sha256 400929f9c6550b8f6efd639b56ea76b49ef850a9f2716830637f3eef8c144a89 rousette-v1.tar.gz
+3 -6
View File
@@ -3,13 +3,11 @@
# Rousette RESTconf server
#
################################################################################
ROUSETTE_VERSION = 226a2410376e5befd0bf6dc180618a108b11b256
ROUSETTE_SITE = https://github.com/kernelkit/rousette.git
ROUSETTE_SITE_METHOD = git
ROUSETTE_VERSION = v1
ROUSETTE_SITE = $(call github,CESNET,rousette,$(ROUSETTE_VERSION))
ROUSETTE_LICENSE = Apache-2.0
ROUSETTE_LICENSE_FILES = LICENSE
ROUSETTE_DEPENDENCIES = boost docopt-cpp nghttp2-asio spdlog sysrepo-cpp linux-pam
ROUSETTE_DEPENDENCIES = boost docopt-cpp nghttp2-asio spdlog sysrepo-cpp linux-pam date-cpp
ROUSETTE_CONF_OPTS = \
-DTESTAR=on \
@@ -19,4 +17,3 @@ define ROUSETTE_USERS
yangnobody 333666 yangnobody 333666 * - - - Unauthenticated operations via RESTCONF
endef
$(eval $(cmake-package))
@@ -45,8 +45,10 @@ endif
ifeq ($(BR2_PACKAGE_AVAHI_AUTOIPD),y)
define SKELETON_INIT_FINIT_SET_AVAHI_AUTOIPD
echo "service [2345789] name:zeroconf :%i avahi-autoipd --force-bind --syslog %i -- ZeroConf for %i" \
> $(FINIT_D)/available/zeroconf@.conf
echo 'service name:zeroconf :%i env:-/etc/default/zeroconf-%i \' >$(FINIT_D)/available/zeroconf@.conf
echo ' <!> kill:5 pid:!/run/avahi-autoipd.%i.pid \'>>$(FINIT_D)/available/zeroconf@.conf
echo ' [2345789] log avahi-autoipd $$ZEROCONF_ARGS %i \'>>$(FINIT_D)/available/zeroconf@.conf
echo ' -- ZeroConf for %i' >>$(FINIT_D)/available/zeroconf@.conf
endef
SKELETON_INIT_FINIT_POST_INSTALL_TARGET_HOOKS += SKELETON_INIT_FINIT_SET_AVAHI_AUTOIPD
endif
@@ -87,6 +89,7 @@ define SKELETON_INIT_FINIT_SET_FRR
for svc in babeld bfdd bgpd eigrpd isisd ldpd ospfd ospf6d pathd ripd ripng staticd vrrpd zebra; do \
cp $(SKELETON_INIT_FINIT_AVAILABLE)/frr/$$svc.conf $(FINIT_D)/available/$$svc.conf; \
done
ln -sf ../available/staticd.conf $(FINIT_D)/enabled/staticd.conf
ln -sf ../available/zebra.conf $(FINIT_D)/enabled/zebra.conf
endef
SKELETON_INIT_FINIT_POST_INSTALL_TARGET_HOOKS += SKELETON_INIT_FINIT_SET_FRR
@@ -1 +1,4 @@
service [2345] log:null <!pid/zebra> staticd -A 127.0.0.1 -u frr -g frr -f /etc/frr/staticd.conf -- Static routing daemon
# Run staticd-helper to collate /etc/static.d/*.conf before starting staticd
service log:null <!pid/zebra> pre:/usr/sbin/staticd-helper \
[2345] staticd -A 127.0.0.1 -u frr -g frr -f /etc/frr/staticd.conf \
-- Static routing daemon
+1 -1
View File
@@ -1,3 +1,3 @@
# Locally calculated
sha256 82e3758011ec44c78e98d0777799d6e12aec5b8a64b32ebb20d0fe50e32488bb LICENSE
sha256 74d7d89307c9fc188c7f23ae5128fe320a569f455a325286122eaa927a0d95ed sysrepo-cpp-99747f74e57a09c664251ea1f4e059e3f4f8e66a-br1.tar.gz
sha256 1fe8b979a53d3581157607bbbf608cc556b02ccfb05b77e26b77b8c875201bd3 sysrepo-cpp-v3.tar.gz
+2 -4
View File
@@ -3,10 +3,8 @@
# CPP bindings for sysrepo
#
################################################################################
SYSREPO_CPP_VERSION = 99747f74e57a09c664251ea1f4e059e3f4f8e66a
SYSREPO_CPP_SITE = https://github.com/kernelkit/sysrepo-cpp.git
SYSREPO_CPP_SITE_METHOD = git
SYSREPO_CPP_VERSION = v3
SYSREPO_CPP_SITE = $(call github,sysrepo,sysrepo-cpp,$(SYSREPO_CPP_VERSION))
SYSREPO_CPP_LICENSE = BSD-3-Clause
SYSREPO_CPP_LICENSE_FILES = LICENSE
SYSREPO_CPP_DEPENDENCIES = sysrepo libyang-cpp
+10
View File
@@ -0,0 +1,10 @@
config BR2_PACKAGE_TEST_MODE
bool "test-mode"
select BR2_PACKAGE_LIBITE
select BR2_PACKAGE_LIBYANG
select BR2_PACKAGE_SYSREPO
select BR2_PACKAGE_LIBSRX
select BR2_PACKAGE_CONFD
help
A plugin to sysrepo that provides functionality required to
run tests with infamy.
+32
View File
@@ -0,0 +1,32 @@
TEST_MODE_VERSION = 1.0
TEST_MODE_SITE_METHOD = local
TEST_MODE_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/test-mode
TEST_MODE_LICENSE = BSD-3-Clause
TEST_MODE_LICENSE_FILES = LICENSE
TEST_MODE_REDISTRIBUTE = NO
TEST_MODE_DEPENDENCIES = sysrepo libite libyang confd
TEST_MODE_AUTORECONF = YES
TEST_MODE_SYSREPO_SHM_PREFIX = sr_buildroot$(subst /,_,$(CONFIG_DIR))_test_mode
COMMON_SYSREPO_ENV = \
SYSREPO_SHM_PREFIX=$(CONFD_SYSREPO_SHM_PREFIX) \
SYSREPOCTL_EXECUTABLE="$(HOST_DIR)/bin/sysrepoctl" \
SYSREPOCFG_EXECUTABLE="$(HOST_DIR)/bin/sysrepocfg" \
SEARCH_PATH="$(TARGET_DIR)/usr/share/yang/modules/confd/"
define TEST_MODE_INSTALL_YANG_MODULES
$(COMMON_SYSREPO_ENV) \
SEARCH_PATH="$(TARGET_DIR)/usr/share/yang/modules/test-mode/" $(BR2_EXTERNAL_INFIX_PATH)/utils/sysrepo-load-modules.sh $(@D)/yang/test-mode.inc
endef
define TEST_MODE_PERMISSIONS
/etc/sysrepo/data/ r 660 root wheel - - - - -
/etc/sysrepo/data d 770 root wheel - - - - -
endef
define TEST_MODE_CLEANUP
rm -f /dev/shm/$(TEST_MODE_SYSREPO_SHM_PREFIX)*
endef
TEST_MODE_PRE_INSTALL_TARGET_HOOKS += TEST_MODE_CLEANUP
TEST_MODE_POST_INSTALL_TARGET_HOOKS += TEST_MODE_INSTALL_YANG_MODULES
$(eval $(autotools-package))
@@ -0,0 +1,46 @@
From 74ec0f8335f811e4f5becc8bbea4a52af4d3e749 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Tue, 17 Sep 2024 04:08:12 +0200
Subject: [PATCH] On SIGTERM, allow dispatcher to process event before exiting
Organization: Addiva Elektronik
On non-systemd systems, like those managed by Finit, when the main PID
used by avahi-autoipd call the dispatcher on reception of SIGTERM, it
may not have time to complete the callout because the main PID exits
almost immediately.
Even though the dispatcher run as a separate process, when the main PID
is collected by FInit it will unconditionally reap lingering processes
in the same process group.
Add a small enough sleep to allow the dispatcher to complete the call to
/etc/avahi/avahi-autoipd.action before we exit the main PID. A better
patch would be to add support for the dispatcher to messages the main
PID when it has run the script, but there does not seem to be any such
bidirectional communication available today.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
avahi-autoipd/main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/avahi-autoipd/main.c b/avahi-autoipd/main.c
index 96c9188..8f7a7e5 100644
--- a/avahi-autoipd/main.c
+++ b/avahi-autoipd/main.c
@@ -1404,8 +1404,11 @@ static int loop(int iface, uint32_t addr) {
fail:
- if (state == STATE_RUNNING || state == STATE_ANNOUNCING)
+ if (state == STATE_RUNNING || state == STATE_ANNOUNCING) {
do_callout(dispatcher, CALLOUT_STOP, iface, addr);
+ /* Don't leave yet, allow dispatcher to process event */
+ sleep(2);
+ }
avahi_free(out_packet);
avahi_free(in_packet);
--
2.43.0
@@ -1,59 +0,0 @@
From 2b3e1c379bf9b9404452b7aa1a66a6ce6d1301e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= <lazzer@gmail.com>
Date: Fri, 17 May 2024 13:33:53 +0200
Subject: [PATCH] Add support for system authentication as fallback
First check if the user is configurured in ietf-netconf-server YANG,
if found in YANG go with the user found. Else, if using shadow or pam,
just continue, try to auth anyway. PAM will block the login later if
incorrect.
---
src/session_server_ssh.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/session_server_ssh.c b/src/session_server_ssh.c
index c8386bc..86d5bb1 100644
--- a/src/session_server_ssh.c
+++ b/src/session_server_ssh.c
@@ -1415,6 +1415,7 @@ nc_session_ssh_msg(struct nc_session *session, struct nc_server_ssh_opts *opts,
* process known messages
*/
if (type == SSH_REQUEST_AUTH) {
+ int username_allocated = 0;
if (session->flags & NC_SESSION_SSH_AUTHENTICATED) {
ERR(session, "User \"%s\" authenticated, but requested another authentication.", session->username);
ssh_message_reply_default(msg);
@@ -1439,6 +1440,15 @@ nc_session_ssh_msg(struct nc_session *session, struct nc_server_ssh_opts *opts,
}
}
+#if defined(HAVE_LIBPAM) || defined(HAVE_SHADOW)
+ if (!auth_client) {
+ username_allocated = 1;
+ auth_client = malloc(sizeof(*auth_client)); /* Get freed when closing session. */
+ memset(auth_client, 0, sizeof(*auth_client));
+ auth_client->username = strdup(username);
+ auth_client->kb_int_enabled = 1;
+ }
+#else
if (!auth_client) {
if (opts->referenced_endpt_name) {
/* client not known by the endpt, but it references another one so try it */
@@ -1457,9 +1467,12 @@ nc_session_ssh_msg(struct nc_session *session, struct nc_server_ssh_opts *opts,
ssh_message_reply_default(msg);
return 0;
}
-
+#endif
if (!session->username) {
- session->username = strdup(username);
+ if (username_allocated)
+ session->username = auth_client->username;
+ else
+ session->username = strdup(username);
/* configure and count accepted auth methods */
if (auth_client->store == NC_STORE_LOCAL) {
--
2.34.1
@@ -1,300 +0,0 @@
From 0a09b00dab204bb5890978a17bb23c4c25280580 Mon Sep 17 00:00:00 2001
From: Jan Kundrát <jan.kundrat@cesnet.cz>
Date: Sun, 24 Mar 2024 20:41:25 +0100
Subject: [PATCH] Port to libyang v3
Four parts, really:
- some enum reshuffling when creating new nodes
- a more capable XPath finding, but we have not been exporting any
"non-JSON XPaths", whatever that might be
- system-ordered lists are now ordered alphabetically
- a more capable error handling API
Change-Id: Ic6de06f004c16e56cef93fae0136c07d903394c0
---
diff --git a/.zuul.yaml b/.zuul.yaml
index d9d95e1..b41c490 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -4,13 +4,13 @@
- f38-gcc-cover:
required-projects:
- name: github/CESNET/libyang
- override-checkout: cesnet/2024-03--v2-latest
+ override-checkout: devel
- name: github/onqtam/doctest
override-checkout: v2.3.6
- f38-clang-asan-ubsan:
required-projects: &projects
- name: github/CESNET/libyang
- override-checkout: cesnet/2024-03--v2-latest
+ override-checkout: devel
- name: github/onqtam/doctest
override-checkout: v2.4.11
- f38-clang-tsan:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 288b62a..6e54707 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,7 +28,7 @@
option(BUILD_SHARED_LIBS "By default, shared libs are enabled. Turn off for a static build." ON)
find_package(PkgConfig REQUIRED)
-pkg_check_modules(LIBYANG REQUIRED libyang>=2.1.140 IMPORTED_TARGET)
+pkg_check_modules(LIBYANG REQUIRED libyang>=2.2.3 IMPORTED_TARGET)
set(LIBYANG_CPP_PKG_VERSION "1.1.0")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
diff --git a/README.md b/README.md
index 5e79a23..9009a54 100644
--- a/README.md
+++ b/README.md
@@ -8,8 +8,7 @@
Object lifetimes are managed automatically via RAII.
## Dependencies
-- [libyang](https://github.com/CESNET/libyang) - ~~the `devel` branch (even for the `master` branch of *libyang-cpp*)~~
- - temporarily (March 2024) this requires the [pre-v3 API of libyang (commit `b3d079fc3`)](https://github.com/CESNET/libyang/tree/b3d079fc37ac119f5a2a4a120b86d1c7102c3a08)
+- [libyang v3](https://github.com/CESNET/libyang) - the `devel` branch (even for the `master` branch of *libyang-cpp*)
- C++20 compiler (e.g., GCC 10.x+, clang 10+)
- CMake 3.19+
diff --git a/include/libyang-cpp/Context.hpp b/include/libyang-cpp/Context.hpp
index 1dab9f3..6f6e233 100644
--- a/include/libyang-cpp/Context.hpp
+++ b/include/libyang-cpp/Context.hpp
@@ -69,7 +69,9 @@
LogLevel level;
std::string message;
ErrorCode code;
- std::optional<std::string> path;
+ std::optional<std::string> dataPath;
+ std::optional<std::string> schemaPath;
+ uint64_t line;
ValidationErrorCode validationCode;
};
diff --git a/include/libyang-cpp/Enum.hpp b/include/libyang-cpp/Enum.hpp
index 3ded4d2..85dcc83 100644
--- a/include/libyang-cpp/Enum.hpp
+++ b/include/libyang-cpp/Enum.hpp
@@ -115,11 +115,15 @@
};
enum class CreationOptions : uint32_t {
- Update = 0x01,
- Output = 0x02,
- Opaque = 0x04,
- // BinaryLyb = 0x08, TODO
- CanonicalValue = 0x10
+ Output = 0x01,
+ StoreOnly = 0x02,
+ // BinaryLyb = 0x04, TODO
+ CanonicalValue = 0x08,
+ ClearDefaultFromParents = 0x10,
+ Update = 0x20,
+ Opaque = 0x40,
+ PathWithOpaque = 0x80,
+ // LYD_NEW_ANY_USE_VALUE is not relevant
};
/**
diff --git a/src/Context.cpp b/src/Context.cpp
index 337070f..713c50f 100644
--- a/src/Context.cpp
+++ b/src/Context.cpp
@@ -579,8 +579,10 @@
.appTag = errIt->apptag ? std::optional{errIt->apptag} : std::nullopt,
.level = utils::toLogLevel(errIt->level),
.message = errIt->msg,
- .code = static_cast<ErrorCode>(errIt->no),
- .path = errIt->path ? std::optional{errIt->path} : std::nullopt,
+ .code = static_cast<ErrorCode>(errIt->err),
+ .dataPath = errIt->data_path ? std::optional{errIt->data_path} : std::nullopt,
+ .schemaPath = errIt->schema_path ? std::optional{errIt->schema_path} : std::nullopt,
+ .line = errIt->line,
.validationCode = utils::toValidationErrorCode(errIt->vecode)
});
diff --git a/src/DataNode.cpp b/src/DataNode.cpp
index ab8cb4a..0e609c4 100644
--- a/src/DataNode.cpp
+++ b/src/DataNode.cpp
@@ -1187,7 +1187,8 @@
const std::string& xpath)
{
ly_set* set;
- auto ret = lyd_find_xpath3(contextNode ? contextNode->m_node : nullptr, forest.m_node, xpath.c_str(), nullptr, &set);
+ auto ret = lyd_find_xpath3(contextNode ? contextNode->m_node : nullptr, forest.m_node, xpath.c_str(),
+ LY_VALUE_JSON, nullptr, nullptr, &set);
throwIfError(ret, "libyang::findXPathAt:");
diff --git a/src/utils/enum.hpp b/src/utils/enum.hpp
index 7674fc6..5e02d24 100644
--- a/src/utils/enum.hpp
+++ b/src/utils/enum.hpp
@@ -72,11 +72,14 @@
{
return static_cast<uint32_t>(flags);
}
-static_assert(LYD_NEW_PATH_UPDATE == toCreationOptions(CreationOptions::Update));
-static_assert(LYD_NEW_PATH_OUTPUT == toCreationOptions(CreationOptions::Output));
-static_assert(LYD_NEW_PATH_OPAQ == toCreationOptions(CreationOptions::Opaque));
+static_assert(LYD_NEW_VAL_OUTPUT == toCreationOptions(CreationOptions::Output));
+static_assert(LYD_NEW_VAL_STORE_ONLY == toCreationOptions(CreationOptions::StoreOnly));
// static_assert(LYD_NEW_PATH_BIN_VALUE == toCreationOptions(CreationOptions::BinaryLyb));
-static_assert(LYD_NEW_PATH_CANON_VALUE == toCreationOptions(CreationOptions::CanonicalValue));
+static_assert(LYD_NEW_VAL_CANON == toCreationOptions(CreationOptions::CanonicalValue));
+static_assert(LYD_NEW_META_CLEAR_DFLT == toCreationOptions(CreationOptions::ClearDefaultFromParents));
+static_assert(LYD_NEW_PATH_UPDATE == toCreationOptions(CreationOptions::Update));
+static_assert(LYD_NEW_PATH_OPAQ == toCreationOptions(CreationOptions::Opaque));
+static_assert(LYD_NEW_PATH_WITH_OPAQ == toCreationOptions(CreationOptions::PathWithOpaque));
constexpr uint32_t toDuplicationOptions(const DuplicationOptions options)
{
diff --git a/tests/context.cpp b/tests/context.cpp
index d19f78b..cb629ef 100644
--- a/tests/context.cpp
+++ b/tests/context.cpp
@@ -457,7 +457,9 @@
.level = libyang::LogLevel::Error,
.message = "Invalid character sequence \"invalid\", expected a keyword.",
.code = libyang::ErrorCode::ValidationFailure,
- .path = "Line number 1.",
+ .dataPath = std::nullopt,
+ .schemaPath = std::nullopt,
+ .line = 1,
.validationCode = libyang::ValidationErrorCode::Syntax,
}
};
@@ -476,7 +478,9 @@
.level = libyang::LogLevel::Error,
.message = "Value \"9001\" is out of type int8 min/max bounds.",
.code = libyang::ErrorCode::ValidationFailure,
- .path = "Schema location \"/example-schema:leafInt8\".",
+ .dataPath = std::nullopt,
+ .schemaPath = "/example-schema:leafInt8",
+ .line = 0,
.validationCode = libyang::ValidationErrorCode::Data,
}
};
@@ -491,7 +495,9 @@
.level = libyang::LogLevel::Error,
.message = "Invalid type int8 empty value.",
.code = libyang::ErrorCode::ValidationFailure,
- .path = "Schema location \"/example-schema:leafInt8\".",
+ .dataPath = std::nullopt,
+ .schemaPath = "/example-schema:leafInt8",
+ .line = 0,
.validationCode = libyang::ValidationErrorCode::Data,
},
libyang::ErrorInfo {
@@ -499,7 +505,9 @@
.level = libyang::LogLevel::Error,
.message = "Value \"9001\" is out of type int8 min/max bounds.",
.code = libyang::ErrorCode::ValidationFailure,
- .path = "Schema location \"/example-schema:leafInt8\".",
+ .dataPath = std::nullopt,
+ .schemaPath = "/example-schema:leafInt8",
+ .line = 0,
.validationCode = libyang::ValidationErrorCode::Data,
}
};
diff --git a/tests/data_node.cpp b/tests/data_node.cpp
index 15fb727..2d27979 100644
--- a/tests/data_node.cpp
+++ b/tests/data_node.cpp
@@ -1026,12 +1026,12 @@
"/example-schema:bigTree/one",
"/example-schema:bigTree/one/myLeaf",
"/example-schema:bigTree/two",
- "/example-schema:bigTree/two/myList[thekey='43221']",
- "/example-schema:bigTree/two/myList[thekey='43221']/thekey",
+ "/example-schema:bigTree/two/myList[thekey='213']",
+ "/example-schema:bigTree/two/myList[thekey='213']/thekey",
"/example-schema:bigTree/two/myList[thekey='432']",
"/example-schema:bigTree/two/myList[thekey='432']/thekey",
- "/example-schema:bigTree/two/myList[thekey='213']",
- "/example-schema:bigTree/two/myList[thekey='213']/thekey"
+ "/example-schema:bigTree/two/myList[thekey='43221']",
+ "/example-schema:bigTree/two/myList[thekey='43221']/thekey",
};
REQUIRE(res == expected);
@@ -1255,6 +1255,7 @@
DOCTEST_SUBCASE("DataNode::findXPath")
{
+ // libyang v3 sorts these alphabetically
const auto data3 = R"({
"example-schema:person": [
{
@@ -1308,13 +1309,13 @@
auto set = node->findXPath("/example-schema:person");
REQUIRE(set.size() == 3);
- REQUIRE(set.front().path() == "/example-schema:person[name='John']");
- REQUIRE(set.back().path() == "/example-schema:person[name='David']");
+ REQUIRE(set.front().path() == "/example-schema:person[name='Dan']");
+ REQUIRE(set.back().path() == "/example-schema:person[name='John']");
auto iter = set.begin();
- REQUIRE((iter++)->path() == "/example-schema:person[name='John']");
REQUIRE((iter++)->path() == "/example-schema:person[name='Dan']");
REQUIRE((iter++)->path() == "/example-schema:person[name='David']");
+ REQUIRE((iter++)->path() == "/example-schema:person[name='John']");
REQUIRE(iter == set.end());
REQUIRE_THROWS_WITH_AS(*iter, "Dereferenced an .end() iterator", std::out_of_range);
}
@@ -1324,23 +1325,23 @@
auto set = node->findXPath("/example-schema:person");
REQUIRE((set.begin() + 0) == set.begin());
- REQUIRE((set.begin() + 0)->path() == "/example-schema:person[name='John']");
- REQUIRE((set.begin() + 1)->path() == "/example-schema:person[name='Dan']");
- REQUIRE((set.begin() + 2)->path() == "/example-schema:person[name='David']");
+ REQUIRE((set.begin() + 0)->path() == "/example-schema:person[name='Dan']");
+ REQUIRE((set.begin() + 1)->path() == "/example-schema:person[name='David']");
+ REQUIRE((set.begin() + 2)->path() == "/example-schema:person[name='John']");
REQUIRE((set.begin() + 3) == set.end());
REQUIRE_THROWS(set.begin() + 4);
REQUIRE((set.end() - 0) == set.end());
- REQUIRE((set.end() - 1)->path() == "/example-schema:person[name='David']");
- REQUIRE((set.end() - 2)->path() == "/example-schema:person[name='Dan']");
- REQUIRE((set.end() - 3)->path() == "/example-schema:person[name='John']");
+ REQUIRE((set.end() - 1)->path() == "/example-schema:person[name='John']");
+ REQUIRE((set.end() - 2)->path() == "/example-schema:person[name='David']");
+ REQUIRE((set.end() - 3)->path() == "/example-schema:person[name='Dan']");
REQUIRE((set.end() - 3) == set.begin());
REQUIRE_THROWS(set.end() - 4);
auto iter = set.end();
+ REQUIRE((--iter)->path() == "/example-schema:person[name='John']");
REQUIRE((--iter)->path() == "/example-schema:person[name='David']");
REQUIRE((--iter)->path() == "/example-schema:person[name='Dan']");
- REQUIRE((--iter)->path() == "/example-schema:person[name='John']");
REQUIRE_THROWS(--iter);
}
diff --git a/tests/pretty_printers.hpp b/tests/pretty_printers.hpp
index 6ae8934..6bbc16f 100644
--- a/tests/pretty_printers.hpp
+++ b/tests/pretty_printers.hpp
@@ -59,7 +59,9 @@
oss << "appTag: " << (err.appTag ? *err.appTag : "std::nullopt") << "\n ";
oss << "code: " << err.code << "\n ";
oss << "message: " << err.message << "\n ";
- oss << "path: " << (err.path ? *err.path : "std::nullopt") << "\n ";
+ oss << "dataPath: " << (err.dataPath ? *err.dataPath : "std::nullopt") << "\n ";
+ oss << "schemaPath: " << (err.schemaPath ? *err.schemaPath : "std::nullopt") << "\n ";
+ oss << "line: " << err.line << "\n ";
oss << "level: " << err.level << "\n ";
oss << "validationCode: " << err.validationCode << "\n }";
return oss.str();
@@ -1,73 +0,0 @@
From 1544e0adb44a18d95e1bb23d2881a73a89fa5631 Mon Sep 17 00:00:00 2001
From: Michal Vasko <mvasko@cesnet.cz>
Date: Mon, 22 Apr 2024 14:12:24 +0200
Subject: [PATCH] plugins BUGFIX safe retrieval of canonical value
Fixes cesnet/netopeer2#1562
---
src/plugins_types/binary.c | 6 +++---
src/plugins_types/instanceid.c | 2 +-
src/plugins_types/string.c | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/plugins_types/binary.c b/src/plugins_types/binary.c
index c2655119d..c70b4a008 100644
--- a/src/plugins_types/binary.c
+++ b/src/plugins_types/binary.c
@@ -338,7 +338,7 @@ lyplg_type_store_binary(const struct ly_ctx *ctx, const struct lysc_type *type,
* @brief Implementation of ::lyplg_type_validate_clb for the binary type.
*/
static LY_ERR
-lyplg_type_validate_binary(const struct ly_ctx *UNUSED(ctx), const struct lysc_type *type, const struct lyd_node *UNUSED(ctx_node),
+lyplg_type_validate_binary(const struct ly_ctx *ctx, const struct lysc_type *type, const struct lyd_node *UNUSED(ctx_node),
const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
{
struct lysc_type_bin *type_bin = (struct lysc_type_bin *)type;
@@ -349,8 +349,8 @@ lyplg_type_validate_binary(const struct ly_ctx *UNUSED(ctx), const struct lysc_t
LY_CHECK_ARG_RET(NULL, type, storage, err, LY_EINVAL);
val = LYPLG_TYPE_VAL_IS_DYN(val) ? (struct lyd_value_binary *)(storage->dyn_mem) : (struct lyd_value_binary *)(storage->fixed_mem);
- value = storage->_canonical;
- value_len = strlen(storage->_canonical);
+ value = lyd_value_get_canonical(ctx, storage);
+ value_len = strlen(value);
*err = NULL;
/* length restriction of the binary value */
diff --git a/src/plugins_types/instanceid.c b/src/plugins_types/instanceid.c
index 84e92b698..00ad45a98 100644
--- a/src/plugins_types/instanceid.c
+++ b/src/plugins_types/instanceid.c
@@ -244,7 +244,7 @@ lyplg_type_validate_instanceid(const struct ly_ctx *ctx, const struct lysc_type
/* find the target in data */
if ((ret = ly_path_eval(storage->target, tree, NULL, NULL))) {
- value = lyplg_type_print_instanceid(ctx, storage, LY_VALUE_CANON, NULL, NULL, NULL);
+ value = lyd_value_get_canonical(ctx, storage);
path = lyd_path(ctx_node, LYD_PATH_STD, NULL, 0);
return ly_err_new(err, ret, LYVE_DATA, path, strdup("instance-required"), LY_ERRMSG_NOINST, value);
}
diff --git a/src/plugins_types/string.c b/src/plugins_types/string.c
index e4c1cb986..2ad003551 100644
--- a/src/plugins_types/string.c
+++ b/src/plugins_types/string.c
@@ -112,7 +112,7 @@ lyplg_type_store_string(const struct ly_ctx *ctx, const struct lysc_type *type,
* @brief Implementation of ::lyplg_type_validate_clb for the string type.
*/
static LY_ERR
-lyplg_type_validate_string(const struct ly_ctx *UNUSED(ctx), const struct lysc_type *type, const struct lyd_node *UNUSED(ctx_node),
+lyplg_type_validate_string(const struct ly_ctx *ctx, const struct lysc_type *type, const struct lyd_node *UNUSED(ctx_node),
const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
{
LY_ERR ret;
@@ -121,8 +121,8 @@ lyplg_type_validate_string(const struct ly_ctx *UNUSED(ctx), const struct lysc_t
size_t value_len;
LY_CHECK_ARG_RET(NULL, type, storage, err, LY_EINVAL);
- value = storage->_canonical;
- value_len = strlen(storage->_canonical);
+ value = lyd_value_get_canonical(ctx, storage);
+ value_len = strlen(value);
*err = NULL;
/* length restriction of the string */
@@ -1,4 +1,4 @@
From c11849437a9b58133900e901e8520e46fd670033 Mon Sep 17 00:00:00 2001
From 4be3e500b670f7b98e3dd6696b8e51e83f122c65 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Thu, 25 Jan 2024 21:36:59 +0100
Subject: [PATCH 01/33] net: phy: add support for PHY LEDs polarity modes
@@ -28,7 +28,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 files changed, 38 insertions(+)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index c895cd178e6a..82666d5fd06c 100644
index 2e4bff6055e2..1b144e23911c 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -3095,6 +3095,7 @@ static int of_phy_led(struct phy_device *phydev,
@@ -1,4 +1,4 @@
From 3d1c94102137d719c5ec499492cafdccad57ff09 Mon Sep 17 00:00:00 2001
From 4833b140cd11a57dd9f59754cdacfd71bc564c8f Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Mon, 4 Dec 2023 11:08:11 +0100
Subject: [PATCH 02/33] net: mvmdio: Support setting the MDC frequency on XSMI
@@ -1,4 +1,4 @@
From 1fb08332958226206c8db121397d45d4b18377c8 Mon Sep 17 00:00:00 2001
From 50a2973e8a520a82e9f9ec15a1f69e059ce7a334 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 14 Dec 2023 14:50:23 +0100
Subject: [PATCH 03/33] net: dsa: mv88e6xxx: Create API to read a single stat
@@ -1,4 +1,4 @@
From d1ff7f41334ce40b50bc79e7f7f484932f431bfe Mon Sep 17 00:00:00 2001
From 5916503e23e7f85796c1f927747e66b9535bac53 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 14 Dec 2023 14:50:25 +0100
Subject: [PATCH 04/33] net: dsa: mv88e6xxx: Give each hw stat an ID
@@ -1,4 +1,4 @@
From 640ab238cbcf0cb15fad064023180e18dc5334bb Mon Sep 17 00:00:00 2001
From 32dda6562734ec8ee667bc546f3ef56794d5bf82 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 14 Dec 2023 14:50:26 +0100
Subject: [PATCH 05/33] net: dsa: mv88e6xxx: Add "eth-mac" counter group
@@ -1,4 +1,4 @@
From 5a8d8971ed506fefe689eaf0c1e5d622b88a9826 Mon Sep 17 00:00:00 2001
From 36adbdd466ec550cab8b2ae54177f674c02cf631 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 14 Dec 2023 14:50:27 +0100
Subject: [PATCH 06/33] net: dsa: mv88e6xxx: Limit histogram counters to
@@ -1,4 +1,4 @@
From fdf336096b8bc0577d194778dfe0c53e91ab820e Mon Sep 17 00:00:00 2001
From abfa532c1149525b128b8c76d80965f55e208240 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 14 Dec 2023 14:50:28 +0100
Subject: [PATCH 07/33] net: dsa: mv88e6xxx: Add "rmon" counter group support
@@ -1,4 +1,4 @@
From 4b150e48c66e441a01c0916e8295d1a59dae21a6 Mon Sep 17 00:00:00 2001
From 4407b94b4a08536fccb6eea2826955ff12d63ec2 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 16 Nov 2023 19:44:32 +0100
Subject: [PATCH 09/33] net: dsa: mv88e6xxx: Add LED infrastructure
@@ -1,4 +1,4 @@
From 15cf831abbb34b3448e34a647f877993d05617b0 Mon Sep 17 00:00:00 2001
From a5cf5c0353db07e74d7a29dd4d5c2cb7775d5bec Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 16 Nov 2023 21:59:35 +0100
Subject: [PATCH 10/33] net: dsa: mv88e6xxx: Add LED support for 6393X
@@ -1,4 +1,4 @@
From cd513e5fa94fe4e595248f10e2c819fa4a5faf5e Mon Sep 17 00:00:00 2001
From be94ec851dbb8e55c3f5e82f197b2dc59566aea2 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 12 Mar 2024 10:27:24 +0100
Subject: [PATCH 11/33] net: dsa: mv88e6xxx: Fix timeout on waiting for PPU on
@@ -1,4 +1,4 @@
From 01782f2f13cffb1698bd774521e9a371d63901ba Mon Sep 17 00:00:00 2001
From 69092f83541e6539ab82eec3052325c403675de4 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 16 Jan 2024 16:00:55 +0100
Subject: [PATCH 12/33] net: dsa: Support MDB memberships whose L2 addresses
@@ -1,4 +1,4 @@
From 4f23cbbb2851495ff86d0879618dfdb336ff214b Mon Sep 17 00:00:00 2001
From 7c19df77212d0728874515e97cf297863a6ff2cd Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 19 Sep 2023 18:38:10 +0200
Subject: [PATCH 13/33] net: phy: marvell10g: Support firmware loading on
@@ -1,4 +1,4 @@
From 561dca36644be70a4c485154c165b3ada6c1c5e9 Mon Sep 17 00:00:00 2001
From 0c34b42b7a72ddf1af6f3534870d647801e493fa Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 21 Nov 2023 20:15:24 +0100
Subject: [PATCH 14/33] net: phy: marvell10g: Fix power-up when strapped to
@@ -1,4 +1,4 @@
From 12e6b629426c70aa01fba85266f2af2489285306 Mon Sep 17 00:00:00 2001
From 6576918d3348f8e20802379d568d7632228af4d7 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Wed, 15 Nov 2023 20:58:42 +0100
Subject: [PATCH 15/33] net: phy: marvell10g: Add LED support for 88X3310
@@ -1,4 +1,4 @@
From 1de94e0474fbda4163869dd011f65b7bf759245d Mon Sep 17 00:00:00 2001
From 1ad7f010e46133c725df5cab4d85f71f689ca191 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 12 Dec 2023 09:51:05 +0100
Subject: [PATCH 16/33] net: phy: marvell10g: Support LEDs tied to a single
@@ -1,4 +1,4 @@
From 4535990fd3cbffb3b80cfb07f80fcddebd73a582 Mon Sep 17 00:00:00 2001
From 11b9a3e328241edede03b6615bb9b0f1a40b9b7d Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Fri, 24 Nov 2023 23:29:55 +0100
Subject: [PATCH 17/33] nvmem: layouts: onie-tlv: Let device probe even when
@@ -1,4 +1,4 @@
From e597f57d5d9dc1c1b009b3a7d0659910f63e0c90 Mon Sep 17 00:00:00 2001
From ce1148b5c2e33541ad13ff2c4769d0b37d4e42b9 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Mon, 4 Mar 2024 16:47:28 +0100
Subject: [PATCH 18/33] net: bridge: avoid classifying unknown multicast as
@@ -1,4 +1,4 @@
From 6f1699021fcc0940f1632febe6769a5b08856153 Mon Sep 17 00:00:00 2001
From ce74ee8c5461cc53851ca323b4dfc9937cab0e41 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Tue, 5 Mar 2024 06:44:41 +0100
Subject: [PATCH 19/33] net: bridge: Ignore router ports when forwarding L2
@@ -1,4 +1,4 @@
From fb8bcf342a9d852dbfe712416aa462f5623125c9 Mon Sep 17 00:00:00 2001
From 3c9b05198e0b7193f2dcddc1860cd77f0adbc3a2 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 21 Mar 2024 19:12:15 +0100
Subject: [PATCH 20/33] net: dsa: Support EtherType based priority overrides
@@ -1,4 +1,4 @@
From 0e4e5ced35d74ad6011b88c18069e8507f425190 Mon Sep 17 00:00:00 2001
From 333134a4ff2b8dd7fb00a75560254de96d1082ad Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Fri, 22 Mar 2024 16:15:43 +0100
Subject: [PATCH 21/33] net: dsa: mv88e6xxx: Support EtherType based priority
@@ -1,4 +1,4 @@
From 145aa1ce386559d515753835822b4c3cb936845c Mon Sep 17 00:00:00 2001
From cdddc24c05cedc0d0fabc48da17ec26aeb7c1ef9 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Wed, 27 Mar 2024 10:10:19 +0100
Subject: [PATCH 22/33] net: phy: Do not resume PHY when attaching
@@ -20,7 +20,7 @@ administratively down.
1 file changed, 1 deletion(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 82666d5fd06c..3bd17166d211 100644
index 1b144e23911c..16c9938465a2 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1555,7 +1555,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
@@ -1,4 +1,4 @@
From 7f1a5cd654c494e281f7602862f7816181bcaef6 Mon Sep 17 00:00:00 2001
From 1ec21a3fc54fb447501fd7edbf692b00a31fe3ec Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Wed, 27 Mar 2024 15:52:43 +0100
Subject: [PATCH 23/33] net: dsa: mv88e6xxx: Improve indirect register access
@@ -1,4 +1,4 @@
From 16ef0d66acb9bccb539b5040333ece6b57d9a9b6 Mon Sep 17 00:00:00 2001
From 5d7be493dcaa75ee69d521043062389d7772f8dc Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Thu, 4 Apr 2024 16:36:30 +0200
Subject: [PATCH 24/33] net: bridge: drop delay for applying strict multicast
@@ -1,4 +1,4 @@
From 966ef6027b1b2797c069adfe0cc274f1c72b80cb Mon Sep 17 00:00:00 2001
From 492a824661dbc188b5abeb7434b5cf67c2016415 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Mon, 22 Apr 2024 23:18:01 +0200
Subject: [PATCH 25/33] net: dsa: mv88e6xxx: Honor ports being managed via
@@ -1,4 +1,4 @@
From e10370efdce8698e87b729027b35bd93e1b68498 Mon Sep 17 00:00:00 2001
From c9c9597a47b00b720f5223c83ab05bb89481eda8 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Wed, 24 Apr 2024 21:35:26 +0200
Subject: [PATCH 26/33] net: dsa: mv88e6xxx: Fix port policy config on 6393X
@@ -1,4 +1,4 @@
From fecfb8b284c458b010f33de19e3d9937a22a5c09 Mon Sep 17 00:00:00 2001
From 4ff224b5f5de1347a1f686aa85cb918a7db18879 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Wed, 24 Apr 2024 22:41:04 +0200
Subject: [PATCH 27/33] net: dsa: mv88e6xxx: Limit rsvd2cpu policy to user
@@ -1,4 +1,4 @@
From 7889c66642251ae3ddad342194c2a3e3db657fcc Mon Sep 17 00:00:00 2001
From f0d4beabe769fec594b309c3f1ebb79cfdbede8b Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Mon, 29 Apr 2024 15:14:51 +0200
Subject: [PATCH 28/33] usb: core: adjust log level for unauthorized devices
@@ -1,4 +1,4 @@
From f3a01b1b551eaf93cab827e882af6cb4a9baea93 Mon Sep 17 00:00:00 2001
From 5f96d718c850084504c53ec0b8d9fcf75ea9996c Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Wed, 15 May 2024 13:50:58 +0200
Subject: [PATCH 29/33] net: dsa: mv88e6xxx: Grab register lock during counter
@@ -1,4 +1,4 @@
From 35678f05a08ec9cf6a04a6c5fd6929659cb1c6fc Mon Sep 17 00:00:00 2001
From 6d4c436335003259cc02a0f015fd3d1d54e988a2 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Thu, 16 May 2024 14:51:54 +0200
Subject: [PATCH 30/33] net: bridge: Differentiate MDB additions from
@@ -1,4 +1,4 @@
From 1f574c5fedddd1e20c72617d619cc5c03c7ded51 Mon Sep 17 00:00:00 2001
From c333c612688d5e974b95fcf4b04f185d7cf4f80d Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 28 May 2024 10:38:42 +0200
Subject: [PATCH 31/33] net: dsa: tag_dsa: Use tag priority as initial
@@ -1,4 +1,4 @@
From 150f3585ab04373671a5741d2063dd25a8bc5bef Mon Sep 17 00:00:00 2001
From 18c025745fd8b8c9b3e688e9d78668a56cf71217 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 28 May 2024 11:04:22 +0200
Subject: [PATCH 32/33] net: dsa: mv88e6xxx: Add mqprio qdisc support
@@ -1,4 +1,4 @@
From 38661fd37a2687911870776a186b5595211d3476 Mon Sep 17 00:00:00 2001
From f2d4ff12c7a0e644cbeac6675b755fb4a87b362a Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Wed, 29 May 2024 13:20:41 +0200
Subject: [PATCH 33/33] net: dsa: mv88e6xxx: Use VLAN prio over IP when both
@@ -1,38 +0,0 @@
diff --git a/src/netconf_monitoring.c b/src/netconf_monitoring.c
index 467338b..4280a7f 100644
--- a/src/netconf_monitoring.c
+++ b/src/netconf_monitoring.c
@@ -273,11 +273,14 @@ np2srv_ncm_oper_cb(sr_session_ctx_t *session, uint32_t UNUSED(sub_id), const cha
{
struct lyd_node *root = NULL, *cont, *list;
const struct lys_module *mod;
+ const struct lysp_submodule *submod;
sr_conn_ctx_t *conn;
struct ly_ctx *ly_ctx;
char **cpblts;
char *time_str, buf[11];
uint32_t i;
+ LY_ARRAY_COUNT_TYPE u;
+ struct timespec ts;
/* context is locked while the callback is executed */
conn = sr_session_get_connection(session);
@@ -320,6 +323,18 @@ np2srv_ncm_oper_cb(sr_session_ctx_t *session, uint32_t UNUSED(sub_id), const cha
lyd_new_list(cont, NULL, "schema", 0, &list, mod->name, mod->revision ? mod->revision : "", "yin");
lyd_new_term(list, NULL, "namespace", mod->ns, 0, NULL);
lyd_new_term(list, NULL, "location", "NETCONF", 0, NULL);
+
+ LY_ARRAY_FOR(mod->parsed->includes, u) {
+ submod = mod->parsed->includes[u].submodule;
+
+ lyd_new_list(cont, NULL, "schema", 0, &list, submod->name, submod->revs ? submod->revs[0].date : "", "yang");
+ lyd_new_term(list, NULL, "namespace", mod->ns, 0, NULL);
+ lyd_new_term(list, NULL, "location", "NETCONF", 0, NULL);
+
+ lyd_new_list(cont, NULL, "schema", 0, &list, submod->name, submod->revs ? submod->revs[0].date : "", "yin");
+ lyd_new_term(list, NULL, "namespace", mod->ns, 0, NULL);
+ lyd_new_term(list, NULL, "location", "NETCONF", 0, NULL);
+ }
}
/* sessions */
@@ -1,27 +0,0 @@
From 1175168ef202c32ce07a674b0c14678c5c130274 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Thu, 22 Jun 2023 10:24:57 +0200
Subject: [PATCH] Allow 'factory' as copy-from (only) in rpc copy-config
Organization: Addiva Elektronik
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/netconf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/netconf.c b/src/netconf.c
index 840debb..fa778d5 100644
--- a/src/netconf.c
+++ b/src/netconf.c
@@ -332,6 +332,8 @@ np2srv_rpc_copyconfig_cb(sr_session_ctx_t *session, uint32_t UNUSED(sub_id), con
ds = SR_DS_STARTUP;
} else if (!strcmp(nodeset->dnodes[0]->schema->name, "candidate")) {
ds = SR_DS_CANDIDATE;
+ } else if (!strcmp(nodeset->dnodes[0]->schema->name, "factory")) {
+ ds = SR_DS_FACTORY_DEFAULT; /* only allowed as copy-from */
} else {
assert(!strcmp(nodeset->dnodes[0]->schema->name, "url"));
#ifdef NP2SRV_URL_CAPAB
--
2.34.1
@@ -1,20 +0,0 @@
commit 2a7478b93b9779b70e5565544c334381947c9e3f
Author: Michal Vasko <mvasko@cesnet.cz>
Date: Mon Jul 1 13:01:35 2024 +0200
maain BUGFIX clear url protocolos
Affects static reinitialization.
diff --git a/src/main.c b/src/main.c
index 92ab3de..a24f3bf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -658,6 +658,7 @@ server_destroy(void)
/* free dynamic members */
free(np2srv.url_protocols);
+ np2srv.url_protocols = NULL;
}
/**
@@ -1,21 +0,0 @@
commit d1a99ae9f40e953b8967c83c2812b9d556093a3c
Author: Michal Vasko <mvasko@cesnet.cz>
Date: Mon Jul 1 14:01:39 2024 +0200
main UPDATE zero the whole np2srv struct
diff --git a/src/main.c b/src/main.c
index a24f3bf..18d9078 100644
--- a/src/main.c
+++ b/src/main.c
@@ -658,7 +658,9 @@ server_destroy(void)
/* free dynamic members */
free(np2srv.url_protocols);
- np2srv.url_protocols = NULL;
+
+ /* zero */
+ memset(&np2srv, sizeof np2srv, 0);
}
/**
@@ -1,19 +0,0 @@
commit 7ec275a297ad62964b62fb44634da636fa1ac087
Author: Michal Vasko <mvasko@cesnet.cz>
Date: Mon Jul 1 14:07:00 2024 +0200
main BUGFIX wrong param order
diff --git a/src/main.c b/src/main.c
index 18d9078..9baf76e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -660,7 +660,7 @@ server_destroy(void)
free(np2srv.url_protocols);
/* zero */
- memset(&np2srv, sizeof np2srv, 0);
+ memset(&np2srv, 0, sizeof np2srv);
}
/**

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