Compare commits

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fix #801

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

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

Fixes #822

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

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

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

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

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

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

As of this commit:

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

Fixes #823

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

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

Fixes #659

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

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

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

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

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

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

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

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

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

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

Also, minor whitespace cleanup and bashisms fixes.

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

Fix #809

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[skip ci]

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

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

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

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

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

Therefore:

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

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

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

Fix #794

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

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

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

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

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

Also, add image check to enforce regen if broken.

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

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

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

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

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

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

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

Follow-up to 8b75022 for the NanoPi R2S.

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

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

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

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

    INFIX_COMPATIBLE="${INFIX_IMAGE_ID}"

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

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

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

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

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

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

This fix #744

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

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

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

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

Fix #750 [skip ci]

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

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

Fix #685

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

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

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

[skip ci]

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

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

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

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

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

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

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

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

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

Therefore, store the transformed value in a separate variable.

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

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

____
¹) Traditional UNIX services that properly support SIGHUP.

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

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

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

Related to: #671

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

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

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

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

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

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

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

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

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

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

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

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

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

The following specifiers are currently supported:

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

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

Fixes #708

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

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

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

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

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

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

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

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

Example (injected phys-address error):

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

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

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

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

The regression test has been updated to test all variants.

Resolves: #680

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

After:

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

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

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

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

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

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

Resolves: #572

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

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

Resolves: #672

[skip ci]

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

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

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

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

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

Fixes #668

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

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

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

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

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

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

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

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

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

[skip ci]

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

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

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

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

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

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

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

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

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

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

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

Issue #658

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

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

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

Fixes #658

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 13:00:02 +02:00
Joachim Wiberg a06436a8c8 .github: fix missing arch + version in legal-info tarball
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 08:44:36 +02:00
Joachim Wiberg ecc1e24ba9 board/common: bundle helpful README in release tarballs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-27 07:54:45 +02:00
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
Joachim Wiberg 8a09b3e22c confd: fix audit logs using proper facility
The LOG_SECURITY facility was set wrong (1 << 13) instead of (13 << 3), see
https://github.com/kernelkit/sysklogd/blob/0fc6656/src/syslog.h#L120 for
details.  This caused all audit log messages to be logged in LOG_USER.

Also, rename LOG_SECURITY -> LOG_AUDIT and log macro SECURITY() -> AUDIT()
to match RFC5424 terminology.

Similar fix to sysrepo, LOG_AUDIT facility instead of daemon + WARNING.
Additionally, drop the leading [severity] prefix to sysrepo logs.  Only
needed when logging to stdout.

Follow-up to issue #521

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-30 15:29:11 +02:00
Joachim Wiberg 7d95da7657 confd,statd: fix invalid option to openlog()
LOG_DAEMON is a facility not an option.  Replace with NDELAY option and
set facility properly in call to openlog() instead.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-30 15:29:11 +02:00
Joachim Wiberg cf1c4c32f1 board/common: disable unused pam_lastlog.so from PAM login
Fixes the following recurring login warning in syslog.  (We cannot use
pam_lastlog.so since it does not rotate its /var/log/lastlog file.)

login[2819]: PAM unable to dlopen(/lib/security/pam_lastlog.so): /lib/security/pam_lastlog.so: cannot open shared object file: No such file or directory

Follow-up to issue #542

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-30 15:29:11 +02:00
Joachim Wiberg e0483be38c Update ChangeLog for v24.08.0 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-30 15:29:11 +02:00
Joachim Wiberg 773ee7f479 confd: drop local aliases for "audit" and "cron2"
The backported patches to sysklogd now support the RFC facilities
natively, so we can focus on local facilities (and 'all').

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-30 15:29:11 +02:00
Joachim Wiberg 306baf3f41 doc: fix minor review comments on new Syslog chapter
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-30 15:29:11 +02:00
Ahmed KaricandMattias Walström 8227f1bcde test: enable running infix tests from external projects
Minor adjustments have been made to enable calling infix tests from an
external project (i.e. 'make test' target).
This essentially allows running any external test (or a group of tests)
using the infix-9pm tool.
2024-08-30 12:26:39 +02:00
Mattias Walström b76904c0e6 Add retry if HTTP error 502 (bad gateway)
This is most likely caused by nginx is up but rousette
is not fully started yet.
2024-08-29 16:29:44 +02:00
Joachim WibergandMattias Walström 04d7729de8 .github: attempt build folder cleanup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-29 16:29:44 +02:00
Mattias Walström 764a64bee8 yang: Improve must expressions for multicast-filters
Add a must expression to limit invalid configurations.
Not belonging to VLAN when added to a multicast-filter in
that VLAN. Make sure multicast snooping is enabled when
using multicast filters.

This fixes #587

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-08-29 16:29:44 +02:00
Mattias Walström 2119fd239a test:syslog: Prefix with infix-syslog model
Unsure why this test ever passed.
2024-08-29 16:29:44 +02:00
Joachim Wiberg c7e013656c Note, RESTCONF not yet ready for prime time
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-29 11:08:48 +02:00
Joachim Wiberg 48e7fe3562 doc: minor, fix 9pm option argument formatting
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-29 11:08:48 +02:00
Joachim Wiberg 6c7758b04d confd: disable ttyd and netbrowse in failure-config
Open interfaces are console, SSH, NETCONF, and RESTCONF only.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-29 11:08:48 +02:00
Joachim Wiberg 44419607e1 confd: fix obvious copy-paste bug in infix-services for RESTCONF
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-29 11:08:48 +02:00
Joachim Wiberg 926aa61ea6 buildroot: bump to 2024.02.5
Release announcement available from the Buildroot list:

https://lore.kernel.org/buildroot/87v803gwip.fsf@dell.be.48ers.dk/T/#u

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-29 11:08:48 +02:00
Joachim Wiberg ccd2b155b2 .github: check 'make legal-info' for all builds
A fairly quick step that runs for all build targets, likely saving us a
lot of time for release weeks.

Fixes #574

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 430414ab13 confd: ensure users in admin group can access all datastores
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg d05a64913e configs: drop pam_lastlog.so, does not rotate its log
The PAM plugin lastlog, previously used (optional) by Netopeer2 and
Rousette, does not rotate /var/log/lastlog, and since we don't have
cron and logrotate this can potentially fill up /var.

This patch disables pam_lastlog.so from the build and drops the two
matching session lines for both Netopeer2 and Rousette.  Both still
log user access to sysrepo, so no critical functionality is lost.

Follow-up to issue #542

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 74ac87c558 doc: update ChangeLog for upcoming v24.08 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 69e9cde1e9 doc: update project URL in motd and docs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 924346c5c5 doc: RESTCONF is now enabled in all defconfigs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 88d81f36c5 confd: fix missing yang:operation when deleting syslog actions
The srx_get_changes() API, introduced in 18b5922, does not provide the
user with a delete yang:operation when the entire YANG tree is deleted.

Refactor syslog actions to use the srx_get_diff() API instead.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 1342794671 confd: handle case of missing selectors for syslog actions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 4c81ac978e confd: adjust Frr logging for staticd and ospfd
Ensure Frr logs to the local2 syslog facility to allow sorting all
Frr (staticd, ospfd) logs into a dedicated /var/log/routing log file.

We activate OSPF debugging, but keep log level at 'informational' for
the time being.  The YANG model needs some sort of "knob" to toggle
debug messages when troubleshooting OSPF.

Fixes #541

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 8cafd6f568 board/common: disable all debug log messages from /var/log/syslog
Infix has the catch-all /var/log/debug, and now also /var/log/routing
for debug messages from Frr.

The log file /var/log/syslog now catches *all* messages except auth*,
which may contain secrets, except debug messages.  Contrast this with
/var/log/messages which only logs info/notice/warn -- i.e., no error
and above log messages.

Due to the way syslogd parses /etc/syslog.conf et al, we override the
default in Infix to disable the default /var/log/syslog, otherwise we
would get duplicates to the same log file.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 610e83cbbf patches/syslogd: backport fixes to listen .conf directive
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg dfcd8a7a56 patches/sysrepo: exit sysrepo-plugind on thread processing error
When sysrepo-plugind is processing callback events, make sure to log the
error and exit(1) the entire process so the system can handle the problem.
For example, restart all dependent services.

Fixes #585

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 740601dde1 test: cosmetic update + shellcheck
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg ee6d96d3ed test: adjust location for Infamy .venv directory to ~/.infix/venv
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 8266984c63 test: save infamy ash history across runs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-28 19:14:47 +02:00
Joachim Wiberg 76a7f7b181 Update ChangeLog with syslog, audit trail, and fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg fb00719069 package/klish: bump for droprivs refactor of script plugin
As of KernelKit Klish @ 710a631 the script plugin has been refactored to
run all commands as the logged in user instead of as root.  The default
admin user is member of the wheel group, which allows access to sysrepo
and sudo access to containers thanks to NOPASSWD rights.

The doas script is a dummy wrapper to silence 'sudo -n' output for users
without any privileges.

As of this commit, unprivileged users can no longer copy, show, or in
any other way manipulate the system configuraiton.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 3670d80034 package/klish: bump to ensure foreground daemon logs to syslog
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg ab8783dad4 package/klish-plugin-sysrepo: relocate sysrepo functionality here
This is a refactor to ensure sysrepo functionality guarded by NACM works
as intended in Infix.

Relocate infix_rpc() to klish-plugin-sysrepo, ensuring unauthenticated
users are denied access.

Drop infix_commit() in favor of slightly modified srp_commit(), this to
ensure sysrepo audit trail logs are visible at all times.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg e912ca5d3b board/common: fix missing mkpasswd argument in askpass tool
Fixes #570

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 51efa5e274 cli: enable sysrepo logging to syslog for copy command
Ensure audit trail events are logged for 'copy' to datastores.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 341188c70c cli: fix copy running-config start<TAB>
Allow completing with startup-config for both src and dst datastores in
copy command.

Fixes #576

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg dac2182069 confd: initial audit trail support
This commit introduces a new SECURITY() log macro that logs to facility
'audit' (sometimes called 'security') with severity set to 'alert'.  It
is then used to instrument the single most important things to log; all
changes to users and their privileges.

We also add logging to sysrepo, which knows the username for changes to
running-config, copies to startup-config, and RPCs.

Fixes #521

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 0ffca5aa21 test: verify remote logging with rfc5424 log format
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 977cc620de doc: new Syslog Support document
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 8d2bdd1f1d confd: rename syslog format -> log-format, add must expression
- For consistency and clarity, rename format -> log-format
 - Add must expression to ban 'bsd' format from file logging

Note: technically, sysklogd silently reverts back to rfc3164 for file
      logging, but it's better to be clear with the user with what is
      possible to configure and is going to be used.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 1f892c28dc confd: add support for local syslog facilities
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg fe389d07fd confd: document ietf-syslog augments and deviations properly
As a bare minimum, all augments and deviations made to standard models
should have a description denoting *why* they exist.

In the case of ietf-syslog the base model is still a draft and carries
some odd defaults we want to disable, or replace with better ones.  The
augments are global log rotation and and log format.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 90f818437a confd: refactor ietf-syslog callbacks for log-file and remote
This refactor changes the callback subscription for log-file and remote
log actions to ensure they are called for *all* changes.  Even changes
to deeply nested sub-trees like file-rotation when no other changes are
made.  The previous attempt failed to address that.

The refactored callbacks replace sr_get_changes() with srx_get_changes()
for better control over what they iterate over.  The callbacks always
regenerate the syslogd *.conf file snippets for each log action, so
there is no need for the overly granular sr_get_changes(), ever.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 96ee348eab confd: add support for log format selection
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg df2998777b confd: simplify /etc/syslog.d/*.conf file naming
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 203896dc49 confd: add support for syslog server configuration
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg cfd4108bb7 libsrx: srx_get_diff() is now just a wrapper for srx_get_changes()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 18b59229f3 libsrx: new api, srx_get_changes()
Reduces the overhead/repetition for module callbacks by combining the
forces of srx_get_diff() and lydx_get_descendant() into one API.  The
resulting function supports both XPath and simplified paths to get the
subtree of changes applicable to the callback.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 961306d1a3 libsrx: new function, srx_get_items()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 1091b0ad82 confd: add support for acting as a remote syslog server
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 45cc5f4897 confd: add support for syslog log-file rotation
This augments ietf-syslog.yang with global file rotation settings which
are used when per-file rotation is not configured.  The defaults chosen
match previously decided defaults for Infix: 1M:10, i.e., rotate every
file at 1 MiB and keep up to 10 gzipped aged-out archives.

The standard model includes a default value of 1 for the number of files
kept, which is removed (deviated).  There is also a unit specified for
max-file-size, 'megabytes', replaced with 'kilobytes' in this change.
On smaller embedded systems, smaller sizes may be required.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 9ada734b00 confd: refactor ietf-syslog
Also, add [] guards to remote IPv6 address.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg d44678ef37 confd: add support for logging to remote syslog servers
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg cc0321f38f test: new test ietf_syslog/basic.py
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg bf83003d23 confd: initial support for ietf-syslog.yang
Add YANG models and an initial plugin for file logging.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg f0506c6cd5 package/skeleton-init-finit: drop log rotation from command line
With the latest sysklogd backports syslogd now supports log rotation
settings in the .conf files, which we'll add yang support for later in
this patch series.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 9adcc9fe99 patches/sysklogd: backport sysklogd log rotation support
This is a backport of sysklogd v2.6.0 support for log rotation settings
in the .conf file.  Previously only supported on the command line.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg f92a6830bb package/klish-plugin-sysrepo: fix missing prefix to identities
When a the type of a leaf node (of a list) is buried inside a union we
need to fish out the module prefix if one of the types in the union is
an identityref.  It's all very simple really.

Also, when tab completing for possible identities, always make sure to
strip any leading module prefix.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 3269175118 package/klish: fix annoying freeze if pressing any key before prompt
Backport upstream fix, https://src.libcode.org/pkun/klish/commit/a1ecbdc

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 5272f56827 board/common: add 'log' and 'follow' alias for displaying syslog
These changes mirror the changes made to the CLI in an attempt to create
a better user experience for working with log files even from the shell.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Joachim Wiberg 6d03e7ef3c src/klish-plugin-infix: fixes to 'dir' and 'show log' commands
These changes are designed to make the experience working with log files
easier.  Both listing available log files and viewing them.

 - replace C dir@infix with a shell script for easier extensions,
   e.g., we want to show both available .cfg and log files
 - add support for gunzipping .gz log files before viewing them

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Ahmed KaricandMattias Walström a44f83c127 confd: add missing 10-infix-services.json to failure and test config + fix allignment 2024-08-26 13:59:49 +02:00
Ahmed KaricandMattias Walström abf54db490 doc: document introducing test-mode to infix tests 2024-08-26 13:59:49 +02:00
Ahmed KaricandMattias Walström 241f3f224f board/common: introduce image test-mode
To support testing, the test-config.cfg file has been introduced in Infix.
Additionally, a "test mode" for the running image is required for this
configuration to be applied.

Basically the test-config will only be loaded when the device is in test mode,
which is determined by the presence of the /mnt/aux/test-mode file.
However, placing this file via the Qeneth system proved to be
inconvenient in the test environment. Therefore, it the entire image is
built in test mode, with the 'test-mode' file preloaded onto the disk
image (specifically in the auxiliary partition).
To support this, a new variable, (bool) DISK_IMAGE_TEST_MODE, has been
introduced:

 enabled: the image will be built in the test mode;
 disabled: the image will be built in the standard mode.

Part of issue #568
2024-08-26 13:59:49 +02:00
Ahmed KaricandMattias Walström 21274aa379 confd: fix output directory for gen-version in gen_failure_cfg
Fixes #562
2024-08-23 11:15:12 +02:00
Ahmed KaricandMattias Walström efafa944d6 confd: minor cleanup
- removed unused parameters in functions factory() and failure()
- renamed the functions
2024-08-23 11:15:12 +02:00
Ahmed KaricandMattias Walström 837fb0ee7f confd: load test-config when in test-mode 2024-08-23 11:15:12 +02:00
Ahmed KaricandMattias Walström 4a325af4e4 confd: generate test-config.cfg
Currently, it's not possible to run infix tests from an external
project (based on infix) due to an incompatibility between the
configuration used in the tests (the default configuration
within the image generated by the external project) and the infix
base configuration expected by the test cases. Therefore, a simple
configuration specifically for testing purposes needs to be generated
within an image. This test-config should always be generated
but only loaded when the device is in test mode.

Part of issue #568
2024-08-23 11:15:12 +02:00
Joachim Wiberg 3fb49cf9dd Adjust periodic Coverity Scan to weekly, Saturdays
Fixes #573

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-22 21:55:23 +02:00
Mattias WalströmandJoachim Wiberg 1c2a491b50 yanger: Use correct file for system-output 2024-08-22 21:52:36 +02:00
Joachim Wiberg 588d8189bf test: run all CI tests with a random container name
Fixes #568

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-22 21:52:36 +02:00
Joachim Wiberg dbcc04c3f8 test: improve robustness of container actions
If a container has not yet stopped/started we may for proto RESTCONF get
"invalid URI" result back for some container actions.  With this change
we allow the action to be retried up to three times before passing on
the error.

In tests on Qemu (x86_64) this happens very rarely and need at most one
retry before succeeding.  Verified by iterating the same basic test over
night (9000+ iterations).

Fixes #558

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-22 21:52:36 +02:00
Joachim Wiberg bd498fcfa5 statd: add logger fallback for unit tests
When unit tests run in CI we may not have a syslog daemon available, in
such cases we set up a dummy handler.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-22 21:52:36 +02:00
Joachim Wiberg 8c5defa9f4 statd: return empty data from run commands, drop getitem()
These changes are intended to make yanger a bit more robust.  Instead of
bailing out on command errors, we now return empty string or object back
to the callee in run_cmd() and run_json_cmd().

One example where yanger previously exited hard, and dragged with it the
entire session, is when inspecting container status or when attempting
to restart container instances which have yet to be created/stopped.

Fixes #558

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-22 21:52:36 +02:00
Joachim Wiberg 2f5becf8b2 doc: update section on transport protocol
Simplify and add paragraph on how to select proto from test-sh.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-22 21:52:36 +02:00
Tobias Waldekranz 6a7900c6d1 board/aarch64: styx: Source product data from VPD
In order for the probe logic to source product data from a VPD, it
must be marked as such. Otherwise we end up in a scenario where the
data is collected, but not hoisted up to the system level, leaving the
system without a defined base-MAC for instance.
2024-08-19 14:07:39 +02:00
Mattias WalströmandTobias Waldekranz 60e8b24d01 infamy: Refactor xpath handling between restconf and netconf implmentation
Previous xpath may or may not been an xpath, we still called it xpath.
Remove the obscure function get_xpath() and instead transform to a
URI in restconf.py

This fix issue #490

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-08-16 16:50:13 +02:00
Joachim WibergandTobias Waldekranz e8e9f7c0a1 board/aarch64/r2s: control WAN LED with a simple DHCP client monitor
When the interface is up and has a 'proto dhcp' address the WAN LED is
lit up.  When the interface goes down, or loses its DHCP lease, the LED
is turned off.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz af5169e286 board/aarch64/r2s: add u-boot factory-reset button detect
Allow reset button on the R2S to be used for factory reset at power-on.
See board README for details.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz 9a12f8f0f5 doc: update ChangeLog with NanoPi R2S changes and related fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz a1ac456d08 configs: enable pam_lastlog.so
Backport pam-lastlog build fix from latest Buildroot master and enable
in all defconfigs to fix syslog warning:

   login[2819]: PAM unable to dlopen(/lib/security/pam_lastlog.so)

Fixes #542

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz 8353963b40 board/common: factory reset using shred and LED indication
This patch greatly improves the security of the Infix factory reset by
replacing 'rm' with 'shred'.  The shred tool overwrites the contents of
files three times.  With the -z and -u options the last pass writes
zeroes and then uninks the files.

On the NanoPi R2S the factory-reset now takes 24 seconds:

   Aug 11 16:00:34 infix mnt[121]: Resetting to factory defaults.
   Aug 11 16:00:58 infix mnt[173]: Factory reset complete.

A visual aid is also added, setting *all* LEDs to on, that can be found
mounted on the device, before starting the file shredders.  The LEDs are
reset back to off and SYS red blinking as soon as the wipe has completed
and iitod has been started.

Fixes #158

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz 9a67a95067 board/common: shellcheck, quote variables to prevent word splitting
Fixes to SC2086 mostly.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz 890d812b69 board/common: allow device specific compat strings for .pkg files
This patch allows us to define the rauc manifest compatibility string with
menuconfig.  The INFIX_IMAGE_ID is a direct replacement for the previously
composed "infix-$ARCH" in mkrauc.sh.

For example, the compatibility string "infix-aarch64" is replaced for the
NanoPi R2S with "infix-r2s" to ensure users get a proper warning if they
try upgrading to an image that maybe boots, but is not likely to work.

The CLI upgrade command gets a 'force' flag to override the compat string.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz df89b22062 board/aarch64/r2s: add support for reset button
This patch further cleans up the r2s kernel config and also enables the
input event framework for the gpio0 reset button on the device.

The very simple input-event-daemon is introduced, with the only purpose
of listening to /dev/input/event1 for KEY_RESTART and trigger reboot.

Some helpful tooling is also added to help debug events (evtest).

Issue #276

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz 4d90565838 board/aarch64/r2s: add static factory-config.cfg
This serves as an example of how a board specific builds in Infix can
carry a static factory-config.  This will be extended upon as we add
support for DHCP server, WiFi access point, and firewall support.

For now the following features are added:

 - Default hostname: r2s instead of infix-00-00-00
 - LAN port always at 192.168.2.1/24, IPv6 SLAAC enabled
 - WAN port has DHCP enabled for IPv4, IPv6 SLAAC disabled
 - NTP client enabled, default server pool.ntp.org
 - DHCP client is set up to request and allow ntp server

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz b0c5d74860 patches/linux: port relevant kkit-6.6.y patches to kkit-6.10.y
Only the most important bridge and usb fixes have been ported in this
commit, and a new patch for the r8153 link/traffic LEDs, ported from
the FriendlyELEC/Rockchip kernel tree.

Fixes #274

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz 01a4eedcad board/aarch64/r2s: map board LEDs to Infix system LEDs
The R2S has a minimal set of system LEDs, all of which are single color.
This commit tries to distill and map the essence of the Infix functions
to available LEDs.

The SYS LED is turned on (fainy red) at power-on, when U-Boot has loaded
the kernel it turns the SYS LED bright red on.  The idea is then to turn
the red SYS LED off as soon as the system has successfully loaded system
startup-config, and then turn the green LAN LED on.  Indicating that the
both the device is operational and that the user can connect to the LAN
port.

The WAN LED is given a "wan-up" input condition, with the intention of
turning it on (green) when the device has acquired a DHCP address.

The failure modes, which in many ways is the essence of Infix signaling,
are fail-safe and panic, triggered by loading failure-config, or failing
to loadd failure-config, respectively.  In fail-safe mode the SYS LED is
blinking red at 5 Hz and in panic mode *all* LEDs blink at 5 Hz.

Issue #276

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz e85f1a41a1 configs/r2s_defconfig: enable wireless tools and regdb
For prototyping experimental wireless support for Infix.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz 760e7d0683 board/aarch64/r2s: rename interfaces to match case and LEDs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz fb41249a11 board: quick fix for too small primary/secondary on sd cards
With new features & fixes, Infix grows.  With the latest support for
rauc upgrades introduced with the VisionFive2, and now also for R2S,
we need to reserve room for future upgrades even when running from
an SD card.

This is a quick fix for genimge generated SD card imaages before we
get a proper installer in place that can be used both on the target
and host systems to partition and provision an eMMC, NVME, SSD, or
an SD card.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz 9b6dedbe08 board/aarch64/r2s: add README for the NanoPi R2S board
Fixes #275

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz 094a1ac4f1 board/aarch64/r2s: enable force check of package hashes
- Enable BR2_DOWNLOAD_FORCE_CHECK_HASHES for R2S
 - Relocate VisionFive2 patches to global patch dir for sharing with R2S
 - Add hash for ATF v2.9

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz 97eab18349 board/aarch64/r2s: allow saving U-Boot environment
This change allows modifying and saving the U-Boot environment to the
aux partition on the NanoPi R2S.  Required to able to safely maintain
multiple R2S devices on the same LAN.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz e7394a89d3 board/common: disable metadata checksumming for aux partition
U-Boot (2024.07) does not yet support the 'metadata_csum' feature flag
to Ext4 file systems.  So let's disable it for now in mkaux.sh so we
can allow builds for, e.g., the R2S and VisionFive2 boards to modify
and save their U-Boot environment.

Needed on the NanoPi R2S to set ethaddr + eth1addr since it does not
have any VPD EEPROM mounted.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz d2457baf2b board/aarch64/r2s: generalized secure boot support
- Bump kernel to 6.10.3
   - Initial defconfig sync with aarch64
     - Enable kprobes, ksyms, and function tracer
     - Enable missing file systems for parity with Infix
     - Enable bridging, netfilter, and other Infix requirements
     - Initial virtion support for running in Qemu (untested)
     - Enable device mapper, required for rauc bundle install
   - Make dummy and tunnel drivers modules to be able to drop dummy0
     and tunl0 interfaces that otherwise mess up "show interfaces"
   - Disable suspend and hibernation, not supported in Infix
   - Disable unused GPIO, PHY, MDIO, and USB drivers
   - Disable RK3328 watchdog driver, cannot perform reset on R2S,
     enablle softdog instead as a seamless replacement for Infix.
     Even though not optimal (since it's software) reboot works
   - Disable ethtool netlink support, does not work and breaks
     interface configuration completely on R2S!
   - Enable netdev LED triggers, for LAN and WAN LEDs
 - Bump u-boot to 2024.07
   - Hard code developer mode to allow shell access
   - Disable factory reset button support (not yet supported)
 - Bump ATF to v2.9
 - Enable squashfs for rootfs image
 - Enable signing of images
 - Add secondary partition
 - Add dedicated var partition
 - Add aux partition for signatures and uboot env

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Joachim WibergandTobias Waldekranz df028d1fc0 configs: drop openssl engines from riscv
This was a temporary fix to a Buildroot regression, reverted
in Infix commit c7c21b3

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-16 16:47:28 +02:00
Mattias Walström c9ef775012 cli: always sort lo first in 'show interfaces'
This fixes #545

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-08-16 16:32:22 +02:00
Mattias Walström 8d6bf14937 Upgrade kernel to 6.6.46 2024-08-16 16:32:22 +02:00
Tobias Waldekranz 3da46f7249 uboot: Support overriding the interface used for netbooting Infix
For systems with multiple paths to the network, different situations
may call for different paths to be used. Therefore, allow the user to
override the active interface via the environment on the auxiliary
partition.

The default (defined the bootloader's device tree) is still used in
cases when nothing else is specified in the environment.
2024-08-12 14:48:14 +02:00
Joachim Wiberg fa1cece60f Follow-up to 2194f7be: migrate /libexec to /usr/libexec
For consistency with the / + /usr merge, see 2194f7be, let's move the
last remnants in /: /libexec/infix to /usr/libexec/infix

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 2201543090 package/finit: add support for BR2_ROOTFS_MERGED_USR
Ensure Finit installs its files to /usr/lib/finit when building with the
merged-usr config option.  For consistency we adjust --exec-prefix, which
is the base for $libdir, meaning also /libexec is moved to /usr/libexec.

Finit tracks the paths internally, we only need to update runparts probe.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 95519212be board/riscv64: add README for the VisionFive2 board
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 28b1ffe2ae board/riscv64: generalized secure boot support
- Enable squashfs for rootfs image
 - Enable signing of images
 - Add secondary partition
 - Add mkaux.sh script

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg b7c2cde57f doc: minor grammar fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 32f4f37281 board/common: riscv64 is also a 64-bit platform
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg f9d14aeab3 package/nghttp2-asio: fix package naming
~/src/infix/x-riscv(riscv)$ make
Makefile:574: *** nghttp2-asio is in the dependency chain of rousette that has added it to its _DEPENDENCIES variable without selecting it or depending on it from Config.in.  Stop.

Fixes #536

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 7cc8ca703e Update ChangeLog and mention new RISC-V board support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg ce417dedd7 Finalize board support for StarFive VisionFive2
- Sync defconfig with aarch64
 - Sync linux_defconfig with aarch64
   - ethtool w/ netlink not supported yet for the StarFice dwmac
   - note, waaay too many unused drivers still
 - Add aux/cfg/var partitions to sdcard, no rauc support yet
 - Add factory-password-hash to device tree

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 6277b7c94c statd: log critical yanger errors to syslog
Switch to logger, with syslog backend, instead of print() for logging
errors.  This way we can log errors/warnings yet still return partial
JSON data back to statd.  For example, failing to read JSON counters
from ethtool should not break "show interfaces", just return empty
array and log failure to run command.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 6b20dc35de statd: pep-8 fixes
- Missing whitespace in assignments, before comments and methods
 - Drop semicolons from end of statements
 - Use 'if foo not in bar' instead of 'if not foo in bar'
 - Some too long lines (not all, that would be painful)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 435c5ca9b4 statd: allow ethtool --json to fail without breaking operational ds
On boards like the R2S and the VisionFive2 `ethtool --json -S ethX` is
not yet supported.  This patch allows ethtool to fail, with a slightly
better log message, without breaking the operational datastore.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 2e27a7112a statd: fix log facility and missing pid
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 05526dd893 confd: avoid setting lower-layer-if to vlanN
Inference for an interface named vlanN can only guess C-VLAN and VID,
the base interface must be left to the user to fill in.  This is also
mandatory in the model.

Fixes #531

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 76d3627ccd confd: fix vid sanity check, 4095 is reserved
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg f6b3dfabf9 confd: minor whitespace and readability changes
Reduce scope of pointer, reduce repetition with a define, and add
whitespace for readability.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg c3a4a93cc8 confd: disable password aging when unlocking password login for user
We cannot rely on time being correct.  Password expiration need to be handled
by external mechanism, e.g., RADIUS.

Fixes #534

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 12d969ab0c confd: log PID in migration and prodoct probe scripts
Like other scripts already do, makes it easier to read syslog.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg a275282307 confd: harmonize empty and missing password hash behavior
Removing a user's password hash should be the same an empty password
hash.  In the latter case we already allow login with SSH keys, this
change harmonizes the behavior by also allowing login with SSH keys
when the users's password hash is removed.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 39e4935369 confd: refactor user hash validation
Consolidate empty password and $factory$ hash extraction to a common
function called before set_pasword().  The purpose is to ensure all
error handling and log messages are in the same place, except for
missing factory-password-hash, which is now treated as a PANIC and
logged to /dev/console.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 9bbc973d9d confd: silence user group member check
Fixes group record leakage to syslog.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 43b3c43a38 doc: spell out meaning of OAM at least somewhere
;-)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 0be6f5694c patches: make sure to version linux patches
Just like other packages we should version our Linux patches as well,
even though it may be painful and cause some extra overhead, in the
end it allows multi-kernel setups and compatibility with customer's
using Infix as a BR2_EXTERNAL.

Fixes #489

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg 959ce88b83 board/common: fix bogus syslog warnings
When syncing interface defaults at boot, some settings are read-only and
some are write-only.  Filter these out so sysctl does not log any bogus
Permission Denied messages.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Joachim Wiberg c925b2f0a8 board/riscv64: initial support for StarFive VisonFive2
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-08 13:35:27 +02:00
Mattias WalströmandJoachim Wiberg 8c333ab7e5 Fix regression when merge /usr
cp: cannot stat '/home/lazzer/Documents/addiva/infix/board/common/rootfs/bin/onieprom': No such file or directory
Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-08-07 17:22:25 +02:00
Mattias Walström 2194f7bebe Merge /usr/* directories into /
/usr/bin  -> /bin
/usr/sbin -> /sbin
/usr/lib  -> /lib
2024-08-06 11:15:38 +02:00
Mattias Walström 0f305ccb84 buildroot: Remove commits from when rousette was introduced
* spdlog: set SPDLOG_FMT_EXTERNAL=OFF
* linux-pam: Set libdir to /usr/lib to get pkg-config to work
2024-08-06 11:15:38 +02:00
Joachim Wiberg ee3c7f44e5 doc: new hardware section, Using a USB Stick
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-04 07:42:44 +02:00
Joachim Wiberg f0ae642144 doc: minor, whitespace cleanup + root -> admin
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-04 07:42:44 +02:00
Joachim Wiberg 438ea3818e board/common: add support for auto-mounting USB sticks
Fixes #497

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-04 07:42:44 +02:00
Joachim Wiberg 9457521626 qemu.sh: check if mkfs.vfat exists, fall back to mkfs.exfat
Also add disk label for future experiments.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-04 07:42:44 +02:00
Joachim Wiberg b9238b2a96 board: add support for exFAT file systems
From https://en.wikipedia.org/wiki/exFAT:

   ... a file system optimized for flash memory such as USB flash
   drives and SD cards.
   ... has been adopted by the SD Association as the default file
   system for SDXC and SDUC cards larger than 32 GB.

The exfatprogs is also a default installed package on most modern
distros, compared to dosfstools (mkfs.vfat) which is not.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-04 07:42:44 +02:00
Joachim Wiberg c7c21b3f6e buildroot: bump to v2024.02.4 LTS
Adjust defconfigs after revert of OpenSSL engines before .4 release.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-02 22:51:21 +02:00
Joachim Wiberg 1b996f543a package/python-yangdoc: bump to v0.6.0
Fixes #529

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-07-11 02:47:02 +02:00
Joachim Wiberg ffb3af5533 buildroot: bump for security fixes
- OpenSSH CVE-2024-6387

 - GLIBC-SA-2024-0004:
     ISO-2022-CN-EXT: fix out-of-bound writes when writing escape
     sequence (CVE-2024-2961)

 - GLIBC-SA-2024-0005:
     nscd: Stack-based buffer overflow in netgroup cache (CVE-2024-33599)

 - GLIBC-SA-2024-0006:
     nscd: Null pointer crash after notfound response (CVE-2024-33600)

 - GLIBC-SA-2024-0007:
     nscd: netgroup cache may terminate daemon on memory allocation
     failure (CVE-2024-33601)

 - GLIBC-SA-2024-0008:
     nscd: netgroup cache assumes NSS callback uses in-buffer strings
     (CVE-2024-33602)

Please note, with this bump it is required to enable the new OpenSSL
option BR2_PACKAGE_LIBOPENSSL_ENGINES, otherwise libssh will not build.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-07-11 02:47:02 +02:00
Jon-Olov VatnandJoachim Wiberg 66d9a80600 Doc: fix typo
[skip ci]
2024-07-08 16:32:12 +02:00
Jon-Olov VatnandJoachim Wiberg f6e4ea3fa7 Doc: Minor tweaks to Speed/Duplex documentation.
[skip ci]
2024-07-08 16:32:12 +02:00
Jon-Olov VatnandJoachim Wiberg b7b3a55fbd Doc: Adding picture to illustrate ethernet auto-neg
[skip ci]
2024-07-08 16:32:12 +02:00
Jon-Olov VatnandJoachim Wiberg 2dab79c321 Doc: Include information on Ethernet config, status and stats
[skip ci]
2024-07-08 16:32:12 +02:00
Mattias Walström 2b5ed0615f Bump libyang, libnetconf2, sysrepo and netopeer2
For netopeer2 we need to patch away local-users, since if it is enabled
netopeer2 requires all users that should be allowed to use netconf to
also be configured in ietf-netconf-server.

Also add some upstream patches.
2024-07-03 09:08:56 +02:00
Joachim Wiberg a672074cef buildroot: fix libyang license hash, updated copyright year
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 15:25:11 +02:00
Joachim Wiberg 8f8766c340 package/python-libyang: allow building also for target
No need to lock it down solely for host build-time use.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 15:24:28 +02:00
Joachim Wiberg 46598a875d package/python-yangdoc: fix misspelled DEPENDENCIES variable
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 15:23:27 +02:00
Joachim Wiberg d523e588d6 packakge: spellcheck license file references
Minor spelling error and mistakes, hashes actually OK.

 - LICENCE -> LICENSE
 - LICENCE -> COPYING

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 15:21:48 +02:00
Joachim Wiberg 269c0f2b00 .github: generate checksum files also for latest build
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 14:49:25 +02:00
Joachim Wiberg 53c079e1b2 doc: update ChangeLog, final update for v24.06.0-rc1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 12:54:27 +02:00
Joachim Wiberg 10744c5116 board/common: extract YANG documentation for all builds
This change builds on top of the earlier work to bootstrap Infix YANG
modules at build time.  Adding a step at the end of post-build.sh to
call the yangdoc tool.  The resulting yangdoc.html is a stand-alone HTML
file of (almost) all YANG nodes.  Almost because some top-level nodes
are unused by Infix atm. and have been filtered out for readability.

Fixes #432

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 12:54:27 +02:00
Joachim Wiberg edaaa33ddc package/python-yangdoc: new package
To be used with automatic generation of YANG documentation extracted
from sysrepo at build time.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 12:54:27 +02:00
Joachim Wiberg 31a30c736a package/python-libyang: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 12:54:27 +02:00
Joachim Wiberg 5a3897b1aa package/confd: drop empty help text
This silences an annoying warning at defconfig/oldconfig about MD5CRYPT.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 12:54:27 +02:00
Joachim Wiberg 1fac47a728 doc: split CLI tutorial into multile files
Fixes #455

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 12:54:27 +02:00
Joachim Wiberg f1585476da confd: fix ietf-tcp-common version
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 12:54:27 +02:00
Mattias Walström d27153ea95 Refactor randomization of transport protocol
Simplify the logic and add a parameter to the command line parser
instead of environment variable.
2024-06-27 15:43:06 +02:00
Mattias Walström e3cd981830 restconf: Add workaround for bug in request 2.32.x 2024-06-27 15:43:06 +02:00
Mattias Walström 3b8505f8c4 sysrepo-cpp: Add timeout to getData 2024-06-27 15:43:06 +02:00
Mattias Walström 3feea4d9e2 rousette: Add timeout option 2024-06-27 15:43:06 +02:00
Mattias Walström 91c55ddeb8 backport fix for extending timeouts in initctl 2024-06-27 15:43:06 +02:00
Mattias Walström 4a3559d88f infamy: Remove duplicate function
Get management ip was implemented in two functions, removing one.
2024-06-27 15:43:06 +02:00
Mattias Walström d340ba7407 infamy: Wait for NETCONF and RESTCONF
Also remove some code duplication.
2024-06-27 15:43:06 +02:00
Mattias Walström b790c46dc4 restconf: Bugfix download yang modules
Actually check if the model is already downloaded,
before download.
2024-06-27 15:43:06 +02:00
Mattias Walström b57353294f test: usb: Make possible to run on physical devices
Virtual devices always have two USB ports, but physical, may have more
or less.
2024-06-27 15:43:06 +02:00
Mattias Walström c05ed73ff5 Document randomisation of restconf/netconf 2024-06-27 15:43:06 +02:00
Mattias Walström 4cc23092b2 restconf: Implement actions
And refactor how it was implemented in netconf
2024-06-27 15:43:06 +02:00
Mattias Walström 2919c23fde tests: containers: Adapt tests to work with restconf
Move the web port used in containers from 80 -> 91
this to not collide with nginx which is required
for restconf.
2024-06-27 15:43:06 +02:00
Mattias Walström df7dab5951 infamy: Randomize tests for restconf/netconf 2024-06-27 15:43:06 +02:00
Mattias Walström dd0f1610ab Add get_current_time_with_offset to netconf/restconf
This allows the timezone tests to run on restconf as well
2024-06-27 15:43:06 +02:00
Mattias Walström 29f56eb384 Restconf, netconf: Implement full feature compatibility
Abstract functions and common functions are located in transport.py
Some quirks has been required due to how rousette works,
these functions has been added to the abstract class

Can be removed when rousette behaves as expected.
2024-06-27 15:43:06 +02:00
Mattias Walström ba4d4caeb3 infamy: netconf: Implement deletion by xpath
This is the only way to delete with restconf so it it must also be
implemented in netconf. This replace the put_diff_dict function.

Also: how the xpath looks is different in restconf/netconf therefore
each protocl has a get_xpath() function as well.
2024-06-27 15:43:06 +02:00
Mattias Walström 0595628e97 infamy: Adapt for operational changes between netconf and restconf 2024-06-27 15:43:06 +02:00
Mattias Walström 095b256971 Adapt tests to be able to run them with NETCONF and RESTCONF 2024-06-27 15:43:06 +02:00
Mattias Walström ef09c65f40 restconf: Add support to download YANG-modules 2024-06-27 15:43:06 +02:00
Joachim Wiberg 2ecb6922a0 doc: update changelog for upcoming release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 19:08:22 +02:00
Joachim Wiberg 4c3a46b288 package/klish: bump for improved error message on missing command
Replaces:

    Error: Illegal command

with:

    Error: Command not found, or incomplete.  Try ? for help or Tab for completion.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 19:08:22 +02:00
Joachim Wiberg 95a5f153df statd: increase port column width for 'show bridge mdb'
Fixes #462

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 19:08:22 +02:00
Joachim Wiberg afbe5ca20b confd: when disabling containers, delete in background
Instead of potentially blocking sysrepo, which has a 5 second timeout,
we move 'container delete' jobs to be run by the execd queue.

Fixes #479

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 19:08:22 +02:00
Joachim Wiberg 0edc2d5b70 execd: add support for SNN and KNN queue scripts
This change makes sure execd calls KNN style scripts before SNN,
allowing confd to post teardown jobs that are guaranteed to run
before any jobs to create new resources run.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 19:08:22 +02:00
Joachim Wiberg 56a5388242 confd: fix warning in call to initctl
ietf-system.c: In function ‘change_hostname’:
ietf-system.c:1722:9: warning: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1722 |         system("initctl -nbq touch netbrowse");
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 19:08:22 +02:00
Joachim Wiberg 4202c07926 package/curios-httpd: bump to v24.05.0
- Fixes to missing BusyBox tools (cat)
 - Bump Buildroot to this year's LTS (2024.02)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 19:08:22 +02:00
Joachim Wiberg 3e045e62b1 confd: adjust libxcrypt dependency slightly
Ubuntu 22.04 (ubuntu-latest runner on GitHub) has a slightly earlier
version of libxcrypt.  The only hard requirement we have is yescrypt
support, so we can relax the configure check slightly to be able to
run coverity scan.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 773b229749 .github: update coverity job to include libxrypt, drop augeas
We recently dropped Augas from confd and this branch adds support for
$0$cleartext passwords, which require libxcrypt.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg dcdc2ba24d confd: follow-up to 7d9257f
First, actually remove setup.sh.  No reason to have the old version
lingering in the repo confusing devs.  Also simplify script heading
dropping previous netopeer2 text and distilling the comment before
sourcing the .inc file.

Silence the install/update, dropping -v -- no need to be overly verbose
now that we now the new yang loader works at build time.

Crucially -- fix a bug in UPDATE_MODULE(), missing closing '

Simplify naming and location of .inc files.  No need for the long
filenames, or the new directory, the directory name gives plenty of
context.

Add reminder of duplicate infix-interfaces.yang in .inc files -- this
duplication is unfortunate and we should try to fix this better.  We
will forget to update one or the other any day ...

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 3e7340cb52 confd: add support for $0$cleartext password
Finalize support for IETF System YANG incl. all IANA crypt-hash types.

This patch builds on the earlier work adding yescrypt and $factory$ key
word.  The YANG description for the crypt-hash type override has been
significantly udpated to discourage use of $0$cleartext passwords.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg ed88a92fac confd: add support for vendor/product specific factory-config
With the recent changes to confd to support: hostname format specifiers,
$factory$ default keyword for password, and on-the-fly generation of the
NETCONF SSH host keys, the system no longer depend on the very intricate
confd gen-* scripts to create factory-config and failure-config.

This patch set adds support for detecting and installing product/vendor
specific static factory-config and failure-config files.  See the confd
README for details.

To facilitate generation, e.g., of the NETCONF SSH host keys, the confd
daemon must be running when bootstrapping the first startup-config from
eithe generated or static factory-config.  This is why the bootstrap and
load helper scripts have been changed.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 3aead122ee package/finit: backport batch mode for runparts
Drop annoying escape characters from ixinit when logging to syslog.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 067c911640 confd: refactor netconf hostkey generation
This patch adds support for an empty "genkey" pair in the keystore for
the NETCONF hostkeys.  Primarily intended for static factory-config.

When a configuration is loaded and confd detects a missing public or
private key in the "genkey" asymmetric key, it loads generated keys
from disk and store in the running datastore.

Fixes #435

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 935bb0d808 confd: minor, fix linter warning (value unused)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 170392cdb1 libsrx: new helper function srx_isset()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 2c81c7cdb6 doc: update ChangeLog for upcoming v24.06 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 0d0d97ad3f test: verify hostname format %h-%m in running and operational
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 32ef120928 test: verify admin user default password in running and operational
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg e5820e1e55 test: new method get_password() in Env
Allow tests to fetch expected factory default password of devices.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg fb424709d7 test: minor, fix pep-8 warnings from pylint
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 99117fc90f conf: add support for handling breaking model changes
Add metadata 'version' field to ietf-system to be able to detect .cfg
file version.  Fixes #308

Add early boot script to automatically migrate configuration files of
older version to new syntax.  Fixes #178

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 8851b279f5 confd: merge infix-shell-types.yang with infix-system.yang
All typedefs and identities should be declared in the module that uses
them unless other modules need them.  This change also makes it easier
to work with tools like yanglint and pyang.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 86a962795a confd: operational support for ietf-system hostname and passwords
Fixes #478

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 3a40bbca39 confd: silence setup.sh and fix update bug
This patch silences the previously very verbose setup.sh script, and
crucially also fixes a bug in UPDATE_MODULE().  Missing closing '

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 4deeacd0ad confd: change failure mode hostname to capitals
For consistency with UNKNOWN base mac address, and making it easier for
the user to actually notice the fault condition.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 1361d02e59 confd: add support for hostname format specifiers
The following specifiers are currently supported:

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

Fixes #435

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 173e6040fe confd: allow non-admin users to use the CLI, NACM rules apply
With this patch, users not in the NACM admin group and a login shell set
to clish can now log in to the CLI.  Prior to this change only members
of the UNIX group 'wheel' could open the klishd socket.

The patch adds another group, 'sys-cli', which acts as a capability for
users.  An admin user (member of the admin group) will now be member of
both the UNIX 'wheel' and 'sys-cli' groups.  A non-admin user that has
shell set to 'clish' will only be member of the 'sys-cli' group.  Other
users will not be mapped to any UNIX group and have only permissions set
in NACM.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 3cbafd8ef4 confd: add supoprt for yescrypt
Fixes #447

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 75d560440e confd: allow web services in failure mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 174bf7dc6f confd: add support for $factory$ password hash
This patch simplifies the handling of factory default password for the
admin user by overloading the ietf-system password type.  The new type,
$factory$, acts a system hint to use any device specific (or built-in
software/device-tree) default password hash.

Fixes #435

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 83d2e1b0ae container: clean up after unpacking oci archive
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg b251cb56f0 container: enable logging of output from start/stop action
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg fec19e1808 container: fix timeout handling in restart
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg aa529242c7 klish-plugin-infix: ensure filesystem is synced after 'copy' command
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 03a8ea9500 package/klish-plugin-sysrepo: fix 'show leaf-node' in configure
This patch bumps klish-plugins-sysrepo to fix the annoying issue with
the CLI not supporting, e.g. "show hostname" in system config context.

Details: https://github.com/kernelkit/klish-plugin-sysrepo/issues/3

The problem was two-fold, first we used the wrong ptype for 'show'
(and 'diff') commands, so srp_show() was not even called.  Then the
klish-plugin-sysrepo code did not account for show being called for
leaf nodes.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Ahmed KaricandMattias Walström 2b1543ba11 confd: Minor Update on YANG Modules Setup Refactor
- Fix indentations:
    - Corrected indentations in confd.mk to adhere to Buildroot coding
     standards

  - Relocate YANG Modules List Files:
    - Moved the YANG modules list files (.inc) from package/confd to
     src/confd

  - Add Missing YANG Module:
    - Included infix-interfaces@2024-01-15.yang in
      yang_modules_confd.inc
    - This module was missing in the non-containerized build and is now
      correctly added
2024-06-19 15:41:33 +02:00
Mattias Walström b92276bfac docker: Upgrade requests to silence dependabot
Unintended leak of Proxy-Authorization header in requests #1
Requests `Session` object does not verify requests after making first request with verify=False #2
2024-06-19 15:35:51 +02:00
Mattias Walström ee0b035e4b doc: Update Changelog 2024-06-19 15:35:51 +02:00
Mattias Walström ac70c6bffc kernel: Upgrade kernel to 6.6.34 2024-06-19 15:35:51 +02:00
Mattias Walström 61b9e6307c buildroot: Update buildroot to 2024.02.3 2024-06-19 15:35:51 +02:00
Mattias Walström f0f8b7e06a containers: Remove empty entrypoint
This made it impossible to use the "command" in container
configuration.

This fix issue #476
2024-06-19 15:35:51 +02:00
Mattias Walström dadf81baf7 rousette: Import upstream patch to remove systemd dependancy 2024-06-19 15:35:51 +02:00
Mattias Walström f819279aea qemu: Make the size of /var configurable 2024-06-19 15:35:51 +02:00
Mattias Walström 6ce0fe7607 confd: Stop bfdd if ospf is removed
This was not handled in the previous design.
2024-06-19 15:35:51 +02:00
Ahmed KaricandMattias Walström 7d9257f5f6 confd: refactor yang modules setup script for better modularity and maintainability
- Moved setup.sh and yang_modules files from infix/src/confd/scripts/ to infix/utils/ to streamline the repository structure
- Updated confd.mk to correctly reference the new location of the setup script
- Introduced yang_modules_<type>.inc file to list all YANG modules for improved clarity and maintainability
- Modified the new setup script to dynamically source module lists from yang_modules_<type>.inc
2024-06-18 18:54:18 +02:00
Tobias Waldekranz 8baca7df03 test: unit: defconfig: Skip root login checks for all boot configs
Also, hoist the whitelist check up one level, so that we can report
which configs we are exempting, and which ones we are actually
checking.
2024-06-17 14:59:27 +02:00
Tobias Waldekranz 34a6a0ecc4 uboot: Allow untrusted images to boot in developer mode
Since a user has access to the shell in developer mode, we might as
well allow booting through the standard boot scripts as well. This
means that a product with a bootloader only accepting images signed by
Company A can now be configured to netboot a regular developer image
without any special user interaction.
2024-06-17 14:59:27 +02:00
Tobias Waldekranz 97c38ee024 cn9130-crb: Update U-Boot glue after bootmenu additions
We no longer need to set bootdelay on development platforms. You can
now always get to the bootmenu with a Ctrl-C, from there you can get
to the shell if developer mode is enabled. Therefore, override the
default dev-mode detection to statically enable it on the CRB.
2024-06-17 14:59:27 +02:00
Tobias Waldekranz ba73f3e832 uboot: HTTP netboot support
If we receive an option 67 (bootfile) matching http://IP/rootfs.itb,
use U-Boot's wget implementation to download the file. The web server
must listen on port 80. tftp:// is also supported.

Without a protocol prefix, assume that the bootfile should be fetched
using TFTP from ${serverip}.
2024-06-17 14:59:27 +02:00
Tobias Waldekranz ccb17b1c91 uboot: Remove dead code 2024-06-17 14:59:27 +02:00
Tobias Waldekranz 0b643f1a78 uboot: Add boot menu
Generate a boot menu, accessible with C-c during a short window, where
a user can interactively select a custom boot source and/or trigger a
factory reset of the device.

With this in place, we should always be able to unbrick a device, as
the image can be fed over the network, and local data can be ignored
by opting in to a factory reset.
2024-06-17 14:59:27 +02:00
Tobias Waldekranz 6eb8a41103 uboot: Import hush fixes from kkit/u-boot-2023.07.y 2024-06-17 14:59:27 +02:00
Tobias Waldekranz 60118fad0d uboot: Remove old unused patches
Patches are now versioned in the expected patches/uboot directory
instead.
2024-06-17 14:59:27 +02:00
Tobias Waldekranz 3b77db13c5 aarch64: Add defconfig to build U-Boot for QEMU 2024-06-17 14:59:27 +02:00
Tobias Waldekranz 81f05d1539 build: Allow relative relative output paths
Before this change, this invocation...

    make O=x-x64 x86_64_defconfig

...would use the output directory...

    /path/to/infix/buildroot/x-x64

...which is not the expected behavior. This would happen because
Buildroot will, naturally, expand relative paths based on _its_ top
directory.

Therefore, translate any relative paths to absolute ones based on
_Infix's_ top directory, before handing control over to Buildroot,
such that the expected...

    /path/to/infix/x-x64

...output directory is used.
2024-06-17 14:59:27 +02:00
Tobias Waldekranz ec5af122f6 qemu: Create UNIX socket for connecting to QEMU's GDB stub
This let's you debug the running operating system kernel, or the
bootloader.
2024-06-17 14:59:27 +02:00
Tobias Waldekranz b536f0c874 doc: Update ChangeLog with QoS improvements 2024-06-07 10:10:38 +02:00
Tobias Waldekranz 640ccea288 test: case: vlan_qos: Add
Verify that we can map VLAN PCP to skb->priority on ingress, and back
to PCP on egress.
2024-06-07 10:10:38 +02:00
Tobias Waldekranz 68b1632f19 test: netns: Add packet capture helper
This tries to improve on the existing sniffer in a couple of ways:

- In addition to being usable as a context manager, also allow
  explicitly starting and stopping the capture.

- Try to synchronize the start of the capture by snooping stderr and
  wait for tcpdump to start up. This should eliminate the need for
  sleeps before starting to send packets.

- By default, execute a safety sleep when terminating the capture to
  ensure that any straggling packets have had time to arrive at their
  destination.
2024-06-07 10:10:38 +02:00
Tobias Waldekranz c39f122014 test: netns: ping: Support specifying an ID
By default, ping(1) will use a random ID in the ICMP packet. Allow
setting it to a fixed value instead.

This makes it easy to identify that particular packet in a packet
capture later on.
2024-06-07 10:10:38 +02:00
Tobias Waldekranz ab8cb7a3ac confd: interfaces: VLAN QoS mappings
Let the ring-bearer^Wuser decide the policy around how VLAN PCP is
mapped to skb->priority on ingress, and back to PCP again on egress.

Either a fixed value is used for all packets, or a 1:1 mapping is done
between the two domains. By default, we follow Linux's defaults of a
fixed 0 value on both ingress and egress.
2024-06-07 10:10:38 +02:00
Tobias Waldekranz 20d7f901a2 confd: interfaces: Translate internal errors to sysrepo domain
Sysrepo expects callbacks to return `sr_error_t`'s, not POSIX errnos.
2024-06-07 10:10:38 +02:00
Tobias Waldekranz f0098059a7 confd: interfaces: Flush addresses when exiting current generation
The interface in question might not exist at init:49 if some other
change requires it to be recreated from scratch, in which case it will
be removed in exit:50. Therefore, run the flush at exit:49, where it
should always still exist.
2024-06-07 10:10:38 +02:00
Tobias Waldekranz de6c624b95 confd: dagger: Add debug statements to trace dagger commands 2024-06-07 10:10:38 +02:00
Tobias Waldekranz d9b14c457a confd: dagger: Detect failing scripts
When timestamping of scripts was added, we unfortunately started to
record the exitstatus of `ts(1)`, rather than the script itself.

Refactor the metadata collection to use `time(1)` instead, which will
propagate the inferior's exitcode. This will also allow us to collect
other parameters in the future.
2024-06-07 10:10:38 +02:00
Tobias Waldekranz 366cc4c8e7 board/common: Disable priority reclassification when forwarding IPv4
By default, Linux will map an IP packet's TOS field into skb->priority
when acting as a router. Unfortunately this is only globally
configurable (per network namespace), which leaves us with the
following dilemma:

If we keep reclassification enabled, then a setup like this...

vlan1 vlan2
   \   /
    br0
    / \
  e1   e2

...would likely not work as expected because any priority information
from hardware, that might be mapped to skb->priority via vlan1's
ingress-qos-map, would then be replaced by the standard TOS-mapping on
the routing boundary.

On the other hand, if we disable reclassification, then we won't be
able to source priority information from the TOS field when no other
source is available, as is the case when the source interface is a
regular NIC.

Given that the primary use-case is to run on switchdev ports, we will
most likely always have priority information available from hardware,
which is why we opt to disable the reclassification.

If this ever becomes configurable per interface, then we could open up
the configuration to let users define the policy of which layer's
priority should take precedence.
2024-06-07 10:10:38 +02:00
Tobias Waldekranz e358e6bc1f board/common: Use mqprio on supported interfaces
Opportunistically look for interfaces with multiple transmit queues
and hardware support for the mqprio queuing discipline. For every
matching interface, set up mappings from kernel-internal packet
priorities, via traffic classes, to transmit queues such that as many
high priorities as possible are scheduled on separate queues.
2024-06-07 10:10:38 +02:00
Tobias Waldekranz a5d98e9351 board/common: Collect all system init in a dedicated runparts dir
This makes it easier to add more scripts without having to update the
finit config file, and it clarifies which of the scripts in
/libexec/infix only execute at boot.
2024-06-07 10:10:38 +02:00
Tobias Waldekranz dfdd3b1090 package/sysrepo: Import upstream datastore corruption fix
See sysrepo/sysrepo#3268
2024-06-07 10:10:38 +02:00
Tobias Waldekranz b4e3c955d8 kernel: Import mqprio support for mv88e6xxx from kkit-linux-6.6.y
...and enable mqprio support in the kernel config.
2024-06-07 10:10:38 +02:00
Joachim WibergandTobias Waldekranz 91148de095 confd: allow ipv6 address with global prefix in factory bridges
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-05 15:08:06 +02:00
Joachim WibergandTobias Waldekranz fe036049b8 Fix #473: bridges never get IPv6 autoconf enabled
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-05 15:08:06 +02:00
Mattias Walström d2d1562c8c sysrepo-cpp: Change to kernelkit-url 2024-06-04 13:38:03 +02:00
Joachim WibergandMattias Walström eebba3b3cb doc: initial RESTCONF scripting examples
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-04 13:38:03 +02:00
Joachim WibergandMattias Walström 310563abda confd: background factory reset to allow time to respond to RPC
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-04 13:38:03 +02:00
Joachim WibergandMattias Walström 37506bcdd9 configs: enable rousette for RESTCONF support
Sync after `make update-defconfig`:

 - avahi selected by mdns-alias package (all)
 - iptables and ca-certs selected by other packages (r2s)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-04 13:38:03 +02:00
Mattias Walström 23585486de test: Add backend to run tests with restconf
Very simple tests work (hostname.py), more complex
tests (static_routing.py) failes due to the lack of
model prefix, for example. infix-ip:ipv4 instead of just
ipv4.

We need to fix this before you send your configuration, run
it through libyang for example and get the full model-name.
2024-06-04 13:38:03 +02:00
Joachim WibergandMattias Walström 78153e62cf nginx: forward /yang and /.well-known as well to restconf agent
We skip /telemetry/optics for now since we don't support any telementry atm.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-04 13:38:03 +02:00
Joachim WibergandMattias Walström a37dd412e1 netbrowse: add /netbrowse route and RESTCONF mDNS xlate
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-04 13:38:03 +02:00
Joachim WibergandMattias Walström f9bbb86d49 confd: configurable support for RESTCONF using infix-services
This enables access to /restconf on port 443 over HTTP/1.1 and HTTP/2
via rousette when enabled.

Also, slight refactor to allow including /restconf and /netbrowse as
optional locations in the main servier directive.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-04 13:38:03 +02:00
Joachim WibergandMattias Walström 59eb73bf24 confd: minor, whitespace fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-04 13:38:03 +02:00
Mattias Walström 44465b679f Add C.UTF-8 locale
Required by rousette
2024-06-04 13:38:03 +02:00
Mattias Walström 4f3ae3b9a4 Add new package: Rousette - a RESTConf server 2024-06-04 13:38:03 +02:00
Joachim WibergandTobias Waldekranz 3339fc5738 doc: update ChangeLog for upcoming v24.06 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz 90b35affe2 Drop augeas from system completely
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz ff10f4ee2f confd: drop augeas from build requirements and clean up
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz 96cdc7c628 confd: simplify, drop augeas for direct hostname update
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz 189ecd8fb0 confd: clean up internal user mgmg functions from augeas
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz 23dd84a690 confd: simplify, drop augeas also for add/del user to/from wheel
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz b5eb566c35 confd: replace malfunctioning augeas for setting password and shell
With increased use of augeas to manage users, groups, and permissions,
we seem to have reached peak complexity.  Because when re-running the
same test[1] over and over, somtimes the aug_save() function fails to
actually save the changes to /etc/shadow to disk!

We have already experienced weird behavior with augeas, see comment in
deleted code, and these latest problems became the last straw.  We have
decided to replace it with standard C APIs.

As a spin-off, thanks to the requried refactoring, the check_shell()
function, used by the change_nacm() callback, could be replaced with a
call to set_shell() for both "is-admin" and "non-admin" cases.  This
means we now also restore Bash privileges (and not just take them away)
when modifying nacm group memberships.

Fixes #468

[1]: test/case/ietf_system/user_admin.py

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz 21ef50ebfb test: new test, verify handling of non-admin users
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz 47ee01be96 test: minor, whitespace cleanup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz eea5f77be9 confd: refactor nacm user shell check
reuse shells array from sys_find_usable_shell(), used elsewhere.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz 5f07fc9d9f confd: check if user has administrator rights for shell selection
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz 43d68289b9 confd: refactor, break out user-in-group check to separate function
No logical changes made.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz 50e068ef10 confd: fix check for group membership
Checking if a user is an administratr we cannot rely solely on the
return value of sr_get_items() but also ensure at least one group
matches the search criteria.

Fixes #469

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Joachim WibergandTobias Waldekranz 2218901dc7 confd: fix invalid module prefix to legacy motd setting
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Tobias WaldekranzandJoachim Wiberg 8eb67c1d13 test: Fixup permissions of generated files when using docker
Since containers managed by docker runs as root, files created in bind
mounted volumes will be owned by root:root. This is a problem for
files generated during test execution, as the calling user does not
have permission to remove them.

Therefore, add a wrapper entrypoint that hooks up an exit handler that
will fixup the permissions before exiting the container.
2024-05-24 19:10:10 +02:00
Joachim Wiberg 8fdd147d1e .github: ignore any existing output/ directory
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-05-24 17:40:36 +02:00
Joachim Wiberg f29ad88b16 .github: set up build env. for 'make test'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-05-24 17:00:15 +02:00
Joachim Wiberg 3f36c4541d .github: drop make from configure step and fix test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-05-24 15:41:05 +02:00
Joachim Wiberg 9f8b27ae4a .github: split build and test in separate jobs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-05-24 14:43:05 +02:00
Joachim Wiberg b5af266953 .github: simplify build and regression testing
Now that Reggie builds all supported archs there is no point in keeping
two separate (and now very similar) workflows.  So we've decided to lay
off Reggie and let Bob, who has seniority, take over Reggie's tasks.

This simplification also means that jobs will no longer be started on
push to branches, only pull requests.  For half-baked branches a draft
pull request can be used to auto-start builds, if needed.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-05-24 13:23:16 +02:00
Mattias WalströmandTobias Waldekranz 0b3816473d setup.sh: Document the origin of this script. 2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz b9a8d65e61 libsrx: Remove srx_require_module API
Not needed anymore since all YANG modules should be loaded at
build.
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz b1a6606728 confd: Add sysrepo and netopeer as a dependency.
And remove not needed environment variable
2024-05-24 11:58:47 +02:00
Joachim WibergandTobias Waldekranz 453afeb2d7 confd: simplify sysrepo datastore makedev permissions 2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz c3128c4080 Update Changelog regarding updated YANG models 2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz 6e07f5b6f8 test: ipv4_autoconf: Increace possible delay when waiting for link local
No reason to be that narrow (10s) change to 30s
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz d47cc76ab5 libyang: Add upstream segfault patch 2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz a4b1d37763 confd: Update SHM path
Do not use netopeer-created shm-path
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz c4d567f994 infamy: route: ospf: Adopt to changes done in 2c88e1bdf5
Now there is no guarantee that the control-plane-protocol array
exist in operational.
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz 05a46475ed yanger: Change behavior to always genereate a valid YANG
Before we generated an invalid YANG model but it was
still accepted by libyang, but now, since the upgrade
it is not.
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz 2096d93282 ospf-status: Return {} if no status can be retreived (ospfd is disabled)
This helps yanger to generate a valid configuration.
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz dfe0a507fc confd: Always use model prefix for intentityrefs
This is a hardened requirement i latest libyang(/sysrepo)
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz 05f063d81b test: Refactor ipv4 address
More robust and less code duplication
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz fe06bea056 netopeer2: Add a custom PAM configuration file
The one installed with netopeer2 includes files that exist on ubuntu
but not in buildroot.
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz 4975a16446 FRR: Fix compatibility with newer libyang
only minor.
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz 8022bd31dc Refactor gen-key to generate SSH accepted keys. 2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz 58541177aa libnetconf: Add support for passwd accounts
This was removed when the new version of ietf-netconf-server was
introduced with the new version of libnetconf.
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz d3b102d46e Bump sysrepo, netopeer2, libyang and libnetconf
This also adds support in sysrepot to install factory config on boot,
default is only to allow it when installing the module, we can not do
that anymore, since the modules is installed during build and the factory
config (or failure) can only be determed when booted.
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz 3354effc53 Build in required modules on buildtime
This to hopefully speed up boot, do as little as possible
during boot.

* New modules needs to be added to src/confd/scripts/setup.sh
* Permission needs to be changed post-build for YANG files,
  see CONFD_PERMISSIONS in confd.mk
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz bef44b725e Remove ietf-netconf-acm@2018-02-14.yang
Provided by libnetconf
2024-05-24 11:58:47 +02:00
Mattias Walström 115f5c8f52 infamy: igmp_vlan: Refactor
Simplify test, and speed it up when do positive testing.
2024-05-23 08:45:05 +02:00
Mattias Walström 6df2c90d85 test: Refactor routing tests
Make more in parallel and restructure code
2024-05-23 08:45:05 +02:00
Mattias WalströmandJoachim Wiberg 06742cf825 kernel: Upgrade to 6.6.31 2024-05-22 12:01:30 +02:00
835 changed files with 36060 additions and 13040 deletions
+36
View File
@@ -0,0 +1,36 @@
Checklists for Pull Requests and Releases
=========================================
Maintainer checklists for reviewing pull requests and doing releases.
Pull Requests
-------------
- If applicable, is there a readable ChangeLog entry?
- If any LICENSE file has been updated, has the `.hash` file been updated?
- If any change to a Finit `.svc` file, does any run/task linger?
I.e., is there a runlevel and/or condition defined to prevent them
from running outside of their intended runlevel?
- If any change to grub or qemu/qeneth setup, has it been tested in GNS3?
- If any change to u-boot/buildroot, has it been tested with `<booloader>_defconfig`
- If any change to logging, have the resulting logs been audited?
- Check for duplicate entries, misspellings
- Check for sneaky severity changes, e.g., error vs note, error vs warning
- If new subsystem, or major changes to a subsystem, have the docs been updated?
- If change to mDNS, has it been tested with netbrowse?
- If change to `_defconfig`, verify `local.mk` and sync with other archs
- Test manually as well, e.g., CLI changes do not have ha regression tests
- Build from distclean, or use artifacts built by build servers, for manual tests
Releases
--------
- Make at least one -betaN release to verify the GitHub workflow well in time release day
- Stuff happens, remember kernelkit/infix#735
- Make at least one -rcN to flush out any issues in customer repos
- Easy to forget adaptations/hacks in customer repos -- may need Infix change/support
- Ensure the markdown link for the release diff is updated
- Ensure subrepos are tagged (can be automated, see kernelkit/infix#393)
- Sync tags for all repo. sync activities
+126 -29
View File
@@ -1,25 +1,49 @@
Contributing to Infix
=====================
Contributing Guidelines
=======================
We welcome any and all help in the form of bug reports, fixes, patches
to add new features -- *preferably as GitHub pull requests*.
Thank :heart: you for taking the time to read this!
If you are unsure of what to do, or how to implement an idea or bug fix,
open an issue with `"[RFC]: Unsure if this is a bug ... ?"`, or use the
[GitHub discussions forum](https://github.com/orgs/kernelkit/discussions).
Talking about code and problems first is often the best way to get started
before submitting a pull request.
We welcome any help in the form of bug reports, fixes, or patches to add
new features. We *prefer* GitHub pull requests, but are open to other
forms of collaboration as well. [Let's talk!][support] :handshake:
When submitting a bug report, patch, or pull request, please start by
stating the version the change is made against, what it does, *and why*.
If you are unsure how to start implementing an idea or fix:
- :bug: open an issue, there are human friendly templates for _bugs_
and _feature requests_ at <https://github.com/kernelkit/infix/issues>
- :speech_balloon: use the [Q&A Forum][discuss]
- :technologist: The [Developer's Guide][devguide] is also a useful start
> _Talking about code and problems first is often the best way to get
> started before submitting a pull request. We have found it always
> saves time, yours and ours._
:sparkles: General Guidelines
-----------------------------
When submitting bug reports or patches to bugs, please state which
version the change is made against, what it does, and, more importantly
*why* -- from your perspective, why is it a bug, why does the code need
changing in this way. Start with why.
- :bug: Bug reports need metadata like Infix version or commit hash
- :adhesive_bandage: Bug fixes also need version, and (preferably) a
corresponding issue number for the ChangeLog
- :new: New features, you need to get approval of the YANG model first!
:speech_balloon: Please use the [Forum][discuss], e.g., category:
*Ideas*, or open a :pray: feature request issue
- :white_check_mark: New features also need new regression tests, this
can be basic tests or more complex use-case tests comprising multiple
subsystems, see [Testing Changes](#test_tube-testing-changes), below
Please take care to ensure you follow the project coding style and the
commit message format. If you follow these recommendations you help
the maintainer(s) and make it easier for them to include your code.
the maintainers and make it easier for them to include your code.
Coding Style
------------
:woman_technologist: Coding Style
---------------------------------
Before jumping into code, remember to **document new features** and bug
fixes. Both the manual and ChangeLog are in the `doc/` sub-directory
@@ -40,23 +64,58 @@ We expect code contributions for:
> code! Legacy takes precedence, and remember, we read code a lot more
> than write it, so legibility is important.
As a final note, lines are allowed to be longer than 72 characters these
days. There is no enforced maximum, but the team usually keep it around
100 characters for both C and Python.
The ChangeLog deserves a separate mention:
- Releases are listed in reverse chronological order order, so the
latest/next release is at the beginning of the file
- Only *user-facing bugs and features* are detailed, so code refactor,
new tests, etc. are not listed.
- Add your changes/features to the Changes section
- Add your Fix line in the Fixes section, in numeric order
- Changes and fixes without an issue number are listed after all
numbered ones
- YANG model changes are documented in their respective model, for
standard models, e.g., for `ietf-interfaces.yang`, the corresponding
`infix-interfaces.yang` detail augments/deviations as revisions.
A final note, lines of code are allowed to be longer than 72 characters
these days, unless you live by PEP-8 (see above). There is no enforced
maximum, but the team usually keep it around 100 characters for both C
and Python.
Commit Messages
---------------
:test_tube: Testing Changes
---------------------------
Please test your changes, no matter how trivial or obviously correct
they may seem. Nobody is infallible, making mistakes is only human.
It is also the best insurance policy for your feature, it ensures your
use-case will remain functional as the source base evolves.
For new functionality we expect new regression tests to be added in
the same pull request.
For help getting started with testing, see the following resources:
- [Developer's Guide][devguide]
- [Regression Testing][testing]
:memo: Commit Messages
----------------------
Commit messages exist to track *why* a change was made. Try to be as
clear and concise as possible in your commit messages, and always, be
proud of your work and set up a proper GIT identity for your commits:
<img src="../doc/jack.png" width=70 align="right">
$ git config --global user.name "Jacky Linker"
$ git config --global user.email jacky.linker@example.com
Example commit message from the [Pro Git][gitbook] online book, notice
how `git commit -s` is used to automatically add a `Signed-off-by`:
Example commit message from one of many [online guides][cbeams]. Use
`git commit -s` to automatically add a `Signed-off-by` for proof of
origin, see [DCO][] for more info.
subsystem: brief, but clear and concise summary of changes
@@ -73,20 +132,58 @@ how `git commit -s` is used to automatically add a `Signed-off-by`:
- Typically a hyphen or asterisk is used for the bullet, preceded
by a single space, with blank lines in between, but conventions
vary here
If you use an issue tracker, put references to them at the bottom,
like this:
Resolves: #123
See also: #456, #789
Signed-off-by: Jacky Linker <jacky.linker@example.com>
This is an example of how to [automatically close][closing] an issue
when the commit is merged to mainline. Several keywords are available.
Code of Conduct
---------------
:twisted_rightwards_arrows: Pull Requests
-----------------------------------------
> _The git repository is the canonical location for information._
A pull request should preferably address a single issue or change. This
may of course include multiple related changes, but what is important to
remember is the bandwidth of the maintainers. A smaller well documented
PR is more likely to get attention quicker in some reviewer's busy day.
Well documented here means that each commit message stands on its own,
telling the complete story of the change. In fact each commit should,
as much as possible, be independent of other changes. This is very
important, not only when digging though logs to understand why a piece
of code exists, but also when bisecting a problem -- each single commit
should also compile and be possible to run.
If you've worked on projects that send patches, like the Linux kernel or
Buildroot, consider the pull request message body similar to the cover
letter for a series of patches -- it's a summary of changes, and it is
lost when the changes are merged to the mainline branch.
:balance_scale: Code of Conduct
-------------------------------
It is expected of everyone to respect the [Code of Conduct][conduct].
The *"maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, discussion forum threads, issues, and
other contributions that are not aligned to this Code of Conduct."*
[Linux]: https://www.kernel.org/doc/html/v6.9/process/coding-style.html
[PEP-8]: https://peps.python.org/pep-0008/
[RDD]: https://tom.preston-werner.com/2010/08/23/readme-driven-development
[gitbook]: https://git-scm.com/book/ch5-2.html
[conduct]: CODE-OF-CONDUCT.md
[support]: https://github.com/kernelkit/infix/blob/main/.github/SUPPORT.md
[discuss]: https://github.com/orgs/kernelkit/discussions
[testing]: https://github.com/kernelkit/infix/blob/main/doc/testing.md
[devguide]: https://github.com/kernelkit/infix/blob/main/doc/developers-guide.md
[Linux]: https://www.kernel.org/doc/html/v6.9/process/coding-style.html
[PEP-8]: https://peps.python.org/pep-0008/
[RDD]: https://tom.preston-werner.com/2010/08/23/readme-driven-development
[cbeams]: https://cbea.ms/git-commit/#seven-rules
[conduct]: CODE-OF-CONDUCT.md
[DCO]: https://developercertificate.org/
[closing]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests
+12 -1
View File
@@ -1 +1,12 @@
Paid support and development provided by Addiva Elektronik <https://addiva.se>
Limited free support is only available using the online resources of the
project on GitHub, and Discord, see <https://github.com/kernelkit>:
&nbsp;&nbsp; :speech_balloon: <https://github.com/orgs/kernelkit/discussions>
&nbsp;&nbsp; :bug: <https://github.com/kernelkit/infix/issues>
Support contracts, development of new features, fast-tracking of reviews
and contributions, customer branding of Infix, and even customer specific
features for dedicated products is provided by Addiva Elektronik.
&nbsp;&nbsp; :globe_with_meridians: <https://www.addiva.se/electronics/>
&nbsp;&nbsp; :e-mail: <mailto:ael@addiva.se>
+4 -7
View File
@@ -5,12 +5,6 @@
-- Remember: assign a reviewer, or use @mentions if org. member.
-->
## Other information
<!-- Other relevant info, e.g., before/after screenshots -->
## Checklist
Tick *relevant* boxes, this PR is-a or has-a:
@@ -23,9 +17,12 @@ Tick *relevant* boxes, this PR is-a or has-a:
- [ ] Regression tests added?
- [ ] ChangeLog updates (for next release)
- [ ] Documentation added?
- [ ] Test changes
- [ ] Checked in changed Readme.adoc (make test-spec)
- [ ] Added new test to group Readme.adoc and yaml file
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (please detail in commit messages)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] ChangeLog updated (for major changes)
- [ ] Other (please describe):
@@ -0,0 +1,16 @@
name: Adds all issues to project Infix & C:o
on:
issues:
types:
- opened
jobs:
add-to-project:
name: Add issue to project Infix&co
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/kernelkit/projects/3
github-token: ${{ secrets.ADD_TO_PROJECT }}
+119 -15
View File
@@ -1,10 +1,18 @@
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:
@@ -15,6 +23,13 @@ jobs:
target: [aarch64, x86_64]
fail-fast: false
steps:
- name: Cleanup Build Folder
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@v4
with:
clean: true
@@ -23,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:
@@ -44,35 +75,102 @@ jobs:
ccache-${{ matrix.target }}-
ccache-
- name: Configure & Build
- name: Configure ${{ matrix.target }}${{ steps.vars.outputs.flv }}
run: |
target=${{ matrix.target }}_defconfig
echo "Building $target ..."
make $target
make ${{ matrix.target }}${{ steps.vars.outputs.flv }}_defconfig
- name: Unit Test ${{ matrix.target }}
run: |
make test-unit
- name: Build ${{ matrix.target }}${{ steps.vars.outputs.flv }}
run: |
echo "Building ${{ matrix.target }}${{ steps.vars.outputs.flv }}_defconfig ..."
make
- name: Prepare Artifact
- 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/
mv images ${{ steps.vars.outputs.dir }}
ln -s ${{ steps.vars.outputs.dir }} images
tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
- name: Test
if: matrix.target == 'x86_64'
run: |
make test
- uses: actions/upload-artifact@v4
with:
path: output/${{ steps.vars.outputs.tgz }}
name: artifact-${{ matrix.target }}
test:
name: Regression Test of Infix x86_64
needs: build
runs-on: [ self-hosted, regression ]
steps:
- uses: actions/checkout@v4
with:
clean: true
submodules: recursive
- name: Set Build Variables
id: vars
run: |
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${{ steps.vars.outputs.flv }} output/
run: |
ls -l
mkdir -p output
mv infix-x86_64.tar.gz output/
cd output/
tar xf infix-x86_64.tar.gz
ln -s infix-x86_64 images
- name: Regression Test x86_64${{ steps.vars.outputs.flv }}
run: |
make test
- 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
release:
if: ${{github.repository_owner == 'kernelkit' && github.ref_name == 'main'}}
name: Upload Latest Build
needs: build
runs-on: [ self-hosted, latest ]
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
@@ -81,6 +179,12 @@ jobs:
pattern: "artifact-*"
merge-multiple: true
- name: Create checksums ...
run: |
for file in *.tar.gz; do
sha256sum $file > $file.sha256
done
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
@@ -90,13 +194,13 @@ jobs:
prerelease: true
tag: "latest"
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "*.tar.gz"
artifacts: "*.tar.gz*"
- name: Summary
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
+2 -2
View File
@@ -2,7 +2,7 @@ name: Coverity Scan
on:
schedule:
- cron: '5 0 * * *'
- cron: '5 0 * * 6'
workflow_dispatch:
env:
@@ -54,7 +54,7 @@ jobs:
run: |
sudo apt-get -y update
sudo apt-get -y install pkg-config libjansson-dev libev-dev \
libaugeas-dev libglib2.0-dev libpcre2-dev \
libcrypt-dev libglib2.0-dev libpcre2-dev \
libuev-dev libite-dev
- name: Build dependencies
-94
View File
@@ -1,94 +0,0 @@
name: Reggie Regression
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Regression Testing ${{ matrix.target }}
runs-on: [ self-hosted, regression ]
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
target: [aarch64, x86_64]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
clean: true
submodules: recursive
- name: Clean up cruft ...
run: |
./test/env -c
- name: Set Build Variables
id: vars
run: |
target=${{ matrix.target }}
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
- name: Restore Cache of dl/
uses: actions/cache@v4
with:
path: dl/
key: dl-netconf-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v4
with:
path: .ccache/
key: ccache-x86_64-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.target }}-
ccache-
- name: Configure ${{ matrix.target }}
run: |
target=${{ matrix.target }}_defconfig
echo "Building $target ..."
make $target
- name: Unit Test
run: |
make test-unit
- name: Build
run: |
make
- name: Prepare Artifact
run: |
cd output/
mv images ${{ steps.vars.outputs.dir }}
ln -s ${{ steps.vars.outputs.dir }} images
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
path: output/${{ steps.vars.outputs.tgz }}
name: artifact-${{ matrix.target }}
- name: Regression Test
if: matrix.target == 'x86_64'
run: |
make test
- name: Publish Test Result
# Ensure this runs even if Regression Test fails
if: always()
run: cat test/.log/last/result-gh.md >> $GITHUB_STEP_SUMMARY
+11 -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:
@@ -97,6 +101,7 @@ jobs:
runs-on: [ self-hosted, release ]
permissions:
contents: write
discussions: write
steps:
- uses: actions/checkout@v4
with:
@@ -111,12 +116,14 @@ jobs:
ver=${GITHUB_REF#refs/tags/}
fi
echo "ver=${ver}" >> $GITHUB_OUTPUT
echo "cat=" >> $GITHUB_OUTPUT
if echo $ver | grep -qE 'v[0-9.]+(-alpha|-beta|-rc)[0-9]*'; then
echo "pre=true" >> $GITHUB_OUTPUT
echo "latest=false" >> $GITHUB_OUTPUT
elif echo $ver | grep -qE '^v[0-9.]+\.[0-9.]+(\.[0-9]+)?$'; then
echo "pre=false" >> $GITHUB_OUTPUT
echo "latest=true" >> $GITHUB_OUTPUT
echo "cat=Releases" >> $GITHUB_OUTPUT
else
echo "pre=false" >> $GITHUB_OUTPUT
echo "latest=false" >> $GITHUB_OUTPUT
@@ -146,6 +153,7 @@ jobs:
name: Infix ${{ github.ref_name }}
prerelease: ${{ steps.rel.outputs.pre }}
makeLatest: ${{ steps.rel.outputs.latest }}
discussionCategory: ${{ steps.rel.outputs.cat }}
bodyFile: release.md
artifacts: "*.tar.gz*"
@@ -153,7 +161,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
-28
View File
@@ -1,28 +0,0 @@
# To enable automatic sync of your Infix fork every day, or on dispatch,
# set the repoistory or organisation variable (not secret):
#
# SYNC_FORK = true
#
# You also need a GH_SYNC_REPO token allowed to update workflows. For
# more information on variables and secrets, see the GitHub docs.
# See https://docs.github.com/en/actions/learn-github-actions/variables
name: Synchronize your fork of Infix with upstream
on:
schedule:
- cron: 42 2 * * *
workflow_dispatch:
jobs:
sync_fork:
if: ${{github.repository_owner != 'kernelkit' && vars.SYNC_FORK == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: TobKed/github-forks-sync-action@master
with:
github_token: ${{ secrets.GH_SYNC_REPO }}
upstream_repository: KernelKit/infix
upstream_branch: main
target_branch: main
force: false
tags: true
+12 -5
View File
@@ -52,6 +52,17 @@ config INFIX_IMAGE_ID
Mandatory. When INFIX_RELEASE is set, this string is appended to
the IMAGE_ID with a '-' separator.
config INFIX_COMPATIBLE
string "Operating system compatible string"
default "${INFIX_IMAGE_ID}"
help
A lower-case string (no spaces or other characters outside of 09,
az, ".", "_" and "-"), used for image identification at upgrade.
E.g., the RAUC [system] compatible string.
Mandatory. Defaults to $INFIX_IMAGE_ID, which in turn is composed
of $INFIX_ID-$BR2_ARCH.
config INFIX_TAGLINE
string "Operating system tagline"
default "Infix -- a Network Operating System"
@@ -112,10 +123,6 @@ config INFIX_ARCH
default "riscv64" if BR2_riscv
default "x86_64" if BR2_x86_64
menu "Packages"
source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in"
endmenu
source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in.host"
source "$BR2_EXTERNAL_INFIX_PATH/board/common/Config.in"
+7 -2
View File
@@ -1,8 +1,13 @@
export BR2_EXTERNAL := $(CURDIR)
export BR2_EXTERNAL ?= $(CURDIR)
export PATH := $(CURDIR)/bin:$(PATH)
ARCH ?= $(shell uname -m)
O ?= $(CURDIR)/output
O ?= output
# If a relative output path is specified, we have to translate it to
# an absolute one before handing over control to Buildroot, which will
# otherwise treat it as relative to ./buildroot.
override O := $(if $(filter /%,$O),$O,$(CURDIR)/$O)
config := $(O)/.config
bmake = $(MAKE) -C buildroot O=$(O) $1
+8 -6
View File
@@ -5,8 +5,8 @@
Infix is a free, Linux based, immutable Network Operating System (NOS)
built on [Buildroot][1], and [sysrepo][2]. A powerful mix that ease
porting to different platforms, simplify long-term maintenance, and
provide made-easy management using NETCONF[^1] or the built-in command
line interface (CLI) from a console or SSH login.
provide made-easy management using NETCONF, RESTCONF[^2], or the
built-in command line interface (CLI) from a console or SSH login.
> Click the **▶ Example CLI Session** foldout below for an example, or
> head on over to the [Infix Documentation](doc/README.md) for more
@@ -22,7 +22,7 @@ may be appealing for other use-cases as well:
- Atomic upgrades to secondary partition
- Highly security focused
An immutable[^2] operating system enhances security and inherently makes
An immutable[^1] operating system enhances security and inherently makes
it maintenance-free. Configuration and data, e.g, containers, is stored
on separate partitions to ensure complete separation from system files
and allow for seamless backup, restore, and provisioning.
@@ -93,6 +93,7 @@ The [following boards](board/aarch64/README.md) are fully supported:
- Marvell CN9130 CRB
- Marvell EspressoBIN
- Microchip SparX-5i PCB135 (eMMC)
- StarFive VisionFive2
- NanoPi R2S
An x86_64 build is also available, primarily intended for development
@@ -105,14 +106,15 @@ more information, see: [Infix in Virtual Environments](doc/virtual.md).
>
> For *customer specific builds* of Infix, see your product repository.
[^1]: NETCONF or RESTCONF, <https://datatracker.ietf.org/doc/html/rfc8040>
[^2]: An immutable operating system is one with read-only file systems,
[^1]: An immutable operating system is one with read-only file systems,
atomic updates, rollbacks, declarative configuration, and workload
isolation. All to improve reliability, scalability, and security.
For more information, see <https://ceur-ws.org/Vol-3386/paper9.pdf>
and <https://www.zdnet.com/article/what-is-immutable-linux-heres-why-youd-run-an-immutable-linux-distro/>.
[^2]: Partial RESTCONF support, features like HTTP PATCH, OPTIONS, HEAD,
and copying between datastores are still missing.
[1]: https://buildroot.org/
[2]: https://www.sysrepo.org/
[3]: doc/cli/introduction.md
+2
View File
@@ -3,5 +3,7 @@ aarch64
Board Specific Documentation
----------------------------
- [Marvell CN9130-CRB](cn9130-crb/)
- [Microchip SparX-5i PCB135 (eMMC)](sparx5-pcb135/)
- [NanoPi R2S](r2s/)
+2 -2
View File
@@ -118,8 +118,8 @@ the device is reasonably correct, and run the provisioning script:
admin@infix:~$ sudo -i
root@infix:~$ udhcpc -i e28
root@infix:~$ date -us YYYY-MM-DD
root@infix:~$ /libexec/infix/prod/provision tftp://<PC-IP>/infix-aarch64.pkg /dev/mmcblk0
root@infix:~$ date -us YYYY-MM-DD
root@infix:~$ /usr/libexec/infix/prod/provision tftp://<PC-IP>/infix-aarch64.pkg /dev/mmcblk0
After successful completion, the device is fully provisioned. On the
next boot, the device will boot of its own accord from the primary
@@ -16,7 +16,12 @@ run ixboot
";
boot_targets = "mmc1";
ethprime = "eth1";
bootdelay = "1";
/* This is a development platform, keep
* developer mode statically enabled.
*/
ixbtn-devmode = "setenv dev_mode yes; echo Enabled";
ixbtn-factory = "echo \"No button available, use bootmenu\"";
};
};
};
+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";
@@ -36,6 +33,14 @@
};
};
/*
* RTC has no valid bit, and this board does not connect any
* backup power (e.g. supercap) to it, so it returns garbage
* after every cold reset.
*/
&cp0_rtc {
status = "disabled";
};
/* UART0 (Console) */
@@ -92,7 +97,7 @@
compatible = "atmel,24c256";
reg = <0x50>;
infix,board = "cpu";
infix,board = "product";
infix,trusted;
nvmem-layout {
@@ -260,25 +265,43 @@
};
};
#define SWP_LED(_func) \
#define SWP_LED \
leds { \
#address-cells = <1>; \
#size-cells = <0>; \
\
led@0 { \
reg = <0>; \
function = _func; \
function = "tp"; \
color = <LED_COLOR_ID_GREEN>; \
default-state = "keep"; \
}; \
led@1 { \
reg = <1>; \
function = _func; \
color = <LED_COLOR_ID_YELLOW>; \
function = "aux"; \
color = <LED_COLOR_ID_GREEN>; \
default-state = "off"; \
}; \
}
/* SFP LEDs
* Rev A. LEDs do not work at all
* Rev B. only outer-most (green) LEDs work
*/
#define SFP_LED \
leds { \
#address-cells = <1>; \
#size-cells = <0>; \
\
led@0 { \
reg = <0>; \
function = "sfp"; \
color = <LED_COLOR_ID_GREEN>; \
default-state = "keep"; \
}; \
}
#define XSWP(_n, _label, _mac_offs, _sfp) \
port@_n { \
reg = <0x ## _n>; \
@@ -287,8 +310,31 @@
nvmem-cell-names = "mac-address"; \
phy-mode = "10gbase-r"; \
managed = "in-band-status"; \
sfp = <&_sfp>; \
SWP_LED("sfp"); \
sfp = <_sfp>; \
SFP_LED; \
}
#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) \
@@ -298,8 +344,8 @@
nvmem-cells = <&base_mac _mac_offs>; \
nvmem-cell-names = "mac-address"; \
phy-mode = "gmii"; \
phy-handle = <&_phy>; \
SWP_LED("tp"); \
phy-handle = <_phy>; \
SWP_LED; \
}
#define GPHY(_n) \
@@ -332,52 +378,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 +420,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 +462,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"
+8
View File
@@ -175,9 +175,14 @@ CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_MQPRIO=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_BPF=y
CONFIG_NET_CLS_FLOWER=y
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_GACT=y
CONFIG_NET_ACT_MIRRED=y
CONFIG_NET_ACT_SKBEDIT=y
CONFIG_DCB=y
CONFIG_NETLINK_DIAG=y
CONFIG_MPLS=y
@@ -507,6 +512,7 @@ CONFIG_FUSE_FS=y
CONFIG_VIRTIO_FS=y
CONFIG_OVERLAY_FS=y
CONFIG_VFAT_FS=y
CONFIG_EXFAT_FS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_SQUASHFS=y
@@ -533,6 +539,8 @@ CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_TIMEOUT=20
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_RCU_TRACE is not set
+165
View File
@@ -0,0 +1,165 @@
FriendlyELC NanoPi R2S
======================
The [NanoPi R2S][1] is a very low-cost 64-bit ARM min router, powered by
the Rockchip RK3328, quad-core Cortex-A53.
The R2S does not have any onboard eMMC, so the only way to boot Infix on
it is using and SD card.
LEDs
----
The front system LEDs work as follows in Infix:
| **Stage** | **SYS** | **LAN** | **WAN** |
|----------------|---------|---------|---------|
| Power-on | dimmed | off | off |
| Factory reset | on | on | on |
| Linux loading | on | off | off |
| System loading | 1 Hz | off | off |
| System up | off | on | off |
| WAN address | off | on | on |
| Locate | 1 Hz | 1 Hz | 1 Hz |
| Fail safe | 5 Hz | off | off |
| Panic | 5 Hz | 5 Hz | 5 Hz |
Powering on the device the SYS LED is turned on faintly (dimmed). It
remains dimmed while U-Boot loads the kernel, and turns bright red when
the kernel starts. It remains steady on until the system has started
the LED daemon, `iitod`, which sets it blinking at 1 Hz while the rest
of the system starts up. When the system has come up successfully, the
SYS LED is turned off and the green LAN LED turns on. The WAN LED will
turn on (green) when the WAN interface is up and has an IP address.
> Compared to the `x86_64` Qemu target, it takes a while to parse all
> YANG models and load `startup-config`, but the whole process should
> not take more than 60 seconds, and usually a lot less.
If a "find my device" function exists, it will blink all LEDs at 1 Hz.
If `startup-config` fails to load Ínfix reverts to `failure-config`,
putting the device in fail safe (or fail secure) mode. Indicated by
the SYS LED blinking at 5 Hz instead of turning off.
If Infix for some reason also fails to load `failure-config`, then all
LEDs will blink at 5 Hz to clearly indicate something is very wrong.
In all error cases the console shows the problem.
Factory Reset
-------------
The reset button on the side can be used not only to safely reboot the
device, but can also be used to trigger a factory reset at power on.
At power-on, keep the reset button pressed for 10 seconds. The system
LEDs (SYS, WAN, LAN) will all blink at 1 Hz, to help you count down the
seconds. When the 10 seconds have passed all LEDs are turned off before
loading Linux.
When Linux boots up it confirms the factory reset by lighting up the
LEDs again, no blinking this time. The LEDs stay on until all files and
directories on read/writable partitions (`/cfg` and `/var`) have been
safely erased.
The system then continues loading, turning off all LEDs except SYS,
which blinks calmly at 1 Hz as usual until the system has completed
loading, this time with a `startup-config` freshly restored from the
device's `factory-config`.
How to Build
------------
```
$ make r2s_defconfig
$ make
```
Once the build has finished you will have `output/images/sdcard.img`
which you can flash to an SD card.
```
$ sudo dd if=output/images/sdcard.img of=/dev/mmcblk0 bs=1M status=progress oflag=direct
```
> **WARNING:** ensure `/dev/mmcblk0` really is the correct device for
> your SD card, and not used by the system!
Booting the Board
-----------------
1. Connect a TTL cable to three UART pins, GND is closest to the edge
2. Insert the flashed SD card
3. Power-up the board using an USB-C cable (ensure good power source!)
Worth noting, unlike many other boards, the Rockchip family of chipsets
runs the UART at 1500000 bps (1.5 Mbps) 8N1.
Secure Boot
-----------
Like other Infix builds, the R2S enjoys secure boot. Please note,
however that the default signing keys are the public!
Also, default builds allow modifying and saving the U-Boot environment
(see below), which you may want to disable to secure the device. The
device also runs in *developer mode*, allowing full U-Boot shell access,
which you may also want to disable in a full production setting.
Caveat
------
Most (all?) of these boards do not have any Vital Product Data (VPD)
EEPROM mounted. This means they do not come with unique MAC addresses
allocated to the two Ethernet ports.
The bootloader (U-Boot) default environment for the board is usually
what provides a default, the same default MAC addresses to Linux:
- 4a:dc:d8:20:0d:84
- 4a:dc:d8:20:0d:85
This is important in case you want to run multiple R2S devices on the
same LAN. Meaning you either have to change the MAC address in the
U-Boot environment (below), or use the `custom-phys-address` setting in
Infix for the interface(s).
Break into U-Boot using Ctrl-C at power-on, preferably when the text
`Press Ctrl-C NOW to enter boot menu` is displayed. Exit the menu to
get to the prompt:
```
(r2s) printenv
...
eth1addr=4a:dc:d8:20:0d:84
ethact=ethernet@ff540000
ethaddr=4a:dc:d8:20:0d:85
ethprime=eth0
...
```
Here we change both addresses, using the *Locally Administered* bit:
```
(r2s) setenv eth1addr 02:00:c0:ff:ee:01
(r2s) setenv ethaddr 02:00:c0:ff:ee:00
(r2s) saveenv
```
Boot the system, log into Linux, and inspect the MAC addresses:
```
admin@infix-00-00-00:~$ ip -br l
lo UP 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
eth0 UP 02:00:c0:ff:ee:00 <BROADCAST,MULTICAST,UP,LOWER_UP>
eth1 UP 02:00:c0:ff:ee:01 <BROADCAST,MULTICAST,UP,LOWER_UP>
```
[1]: https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R2S
-4
View File
@@ -1,4 +0,0 @@
label Infix on NanoPi R2S
kernel /boot/Image
devicetree /boot/rk3328-nanopi-r2s.dtb
append root=/dev/mmcblk0p1 rw rootwait bonding.max_bonds=0 dummy.numdummies=0 fb_tunnels=none quiet
+40 -7
View File
@@ -1,37 +1,70 @@
image cfg.ext4 {
empty = true
temporary = true
size = 16M
ext4 {
label = "cfg"
}
}
image var.ext4 {
empty = true
size = 16M
temporary = true
size = 512M
ext4 {
label = "var"
use-mke2fs = true
}
}
image sdcard.img {
hdimage {
partition-table-type = "gpt"
}
partition u-boot-tpl-spl-dtb {
in-partition-table = "no"
image = "idbloader.img"
offset = 32K
image = "idbloader.img"
}
partition u-boot-dtb {
in-partition-table = "no"
image = "u-boot.itb"
offset = 8M
image = "u-boot.itb"
}
partition rootfs {
partition-type = 0x83
partition aux {
partition-uuid = D4EF35A0-0652-45A1-B3DE-D63339C82035
offset = 16M
image = "rootfs.ext4"
image = "aux.ext4"
}
partition primary {
partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
bootable = true
size = 200M
image = "rootfs.squashfs"
}
partition secondary {
partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
bootable = true
size = 200M
image = "rootfs.squashfs"
}
partition cfg {
partition-type = 0x83
partition-uuid = 7aa497f0-73b5-47e5-b2ab-8752d8a48105
image = "cfg.ext4"
}
partition var {
partition-uuid = 8046A06A-E45A-4A14-A6AD-6684704A393F
image = "var.ext4"
}
}
# Silence genimage warnings
+176 -85
View File
@@ -3,22 +3,31 @@ CONFIG_POSIX_MQUEUE=y
CONFIG_AUDIT=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_JIT=y
CONFIG_PREEMPT=y
CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_PSI=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_NUMA_BALANCING=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_MEMCG=y
CONFIG_BLK_CGROUP=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
CONFIG_NAMESPACES=y
CONFIG_USER_NS=y
CONFIG_SCHED_AUTOGROUP=y
@@ -27,19 +36,14 @@ CONFIG_EXPERT=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PROFILING=y
CONFIG_KEXEC_FILE=y
CONFIG_CRASH_DUMP=y
CONFIG_ARCH_ACTIONS=y
CONFIG_ARCH_ROCKCHIP=y
CONFIG_ARCH_VEXPRESS=y
CONFIG_ARM64_VA_BITS_48=y
CONFIG_SCHED_MC=y
CONFIG_SCHED_SMT=y
CONFIG_NUMA=y
CONFIG_NR_CPUS=8
CONFIG_COMPAT=y
CONFIG_RANDOMIZE_BASE=y
CONFIG_HIBERNATION=y
CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
CONFIG_ENERGY_MODEL=y
# CONFIG_SUSPEND is not set
CONFIG_ARM_PSCI_CPUIDLE=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_STAT=y
@@ -48,8 +52,8 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
CONFIG_CPUFREQ_DT=y
CONFIG_ACPI_CPPC_CPUFREQ=m
CONFIG_ARM_SCMI_CPUFREQ=y
CONFIG_ACPI_CPPC_CPUFREQ=m
CONFIG_ACPI=y
CONFIG_ACPI_APEI=y
CONFIG_ACPI_APEI_GHES=y
@@ -57,6 +61,7 @@ CONFIG_ACPI_APEI_MEMORY_FAILURE=y
CONFIG_ACPI_APEI_EINJ=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
# CONFIG_GCC_PLUGINS is not set
CONFIG_MODULES=y
@@ -67,8 +72,11 @@ CONFIG_KSM=y
CONFIG_MEMORY_FAILURE=y
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_CMA=y
CONFIG_CMA_AREAS=20
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
@@ -76,24 +84,66 @@ CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_NET_IPIP=y
CONFIG_NET_IPGRE_DEMUX=y
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE_DEMUX=m
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_IPV6=m
CONFIG_SYN_COOKIES=y
CONFIG_IPV6_SIT=m
CONFIG_IPV6_GRE=m
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
CONFIG_NETFILTER=y
CONFIG_NF_CONNTRACK=m
CONFIG_BRIDGE_NETFILTER=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
CONFIG_NETFILTER_NETLINK_LOG=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_CT=m
CONFIG_NFT_CONNLIMIT=m
CONFIG_NFT_LOG=m
CONFIG_NFT_LIMIT=m
CONFIG_NFT_MASQ=m
CONFIG_NFT_REDIR=m
CONFIG_NFT_NAT=m
CONFIG_NFT_TUNNEL=m
CONFIG_NFT_QUEUE=m
CONFIG_NFT_REJECT=m
CONFIG_NFT_COMPAT=m
CONFIG_NFT_HASH=m
CONFIG_NFT_SOCKET=m
CONFIG_NFT_OSF=m
CONFIG_NFT_DUP_NETDEV=m
CONFIG_NFT_FWD_NETDEV=m
CONFIG_NFT_REJECT_NETDEV=m
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
CONFIG_NETFILTER_XT_TARGET_LOG=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
CONFIG_NETFILTER_XT_MATCH_BPF=m
CONFIG_NETFILTER_XT_MATCH_CGROUP=m
CONFIG_NETFILTER_XT_MATCH_COMMENT=m
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_NETFILTER_XT_MATCH_DSCP=m
CONFIG_NETFILTER_XT_MATCH_HELPER=m
CONFIG_NETFILTER_XT_MATCH_LIMIT=m
CONFIG_NETFILTER_XT_MATCH_MAC=m
CONFIG_NETFILTER_XT_MATCH_MARK=m
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
@@ -101,17 +151,46 @@ CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP6_NF_IPTABLES=m
CONFIG_IP6_NF_MATCH_AH=m
CONFIG_IP6_NF_MATCH_EUI64=m
CONFIG_IP6_NF_MATCH_IPV6HEADER=m
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_MANGLE=m
CONFIG_IP6_NF_RAW=m
CONFIG_IP6_NF_NAT=m
CONFIG_IP6_NF_TARGET_MASQUERADE=m
CONFIG_BRIDGE=m
CONFIG_IP6_NF_TARGET_NPT=m
CONFIG_NF_TABLES_BRIDGE=m
CONFIG_NFT_BRIDGE_META=m
CONFIG_NFT_BRIDGE_REJECT=m
CONFIG_NF_CONNTRACK_BRIDGE=y
CONFIG_BRIDGE_NF_EBTABLES=m
CONFIG_BRIDGE_EBT_BROUTE=m
CONFIG_BRIDGE_EBT_T_FILTER=m
CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_802_3=m
CONFIG_BRIDGE_EBT_AMONG=m
CONFIG_BRIDGE_EBT_ARP=m
CONFIG_BRIDGE_EBT_IP=m
CONFIG_BRIDGE_EBT_IP6=m
CONFIG_BRIDGE_EBT_LIMIT=m
CONFIG_BRIDGE_EBT_MARK=m
CONFIG_BRIDGE_EBT_PKTTYPE=m
CONFIG_BRIDGE_EBT_STP=m
CONFIG_BRIDGE_EBT_VLAN=m
CONFIG_BRIDGE_EBT_ARPREPLY=m
CONFIG_BRIDGE_EBT_DNAT=m
CONFIG_BRIDGE_EBT_MARK_T=m
CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
CONFIG_BRIDGE=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_NET_DSA=m
CONFIG_NET_DSA_TAG_OCELOT=m
CONFIG_NET_DSA_TAG_OCELOT_8021Q=m
CONFIG_VLAN_8021Q=m
CONFIG_BRIDGE_MRP=y
CONFIG_BRIDGE_CFM=y
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_NET_SCHED=y
@@ -121,13 +200,22 @@ CONFIG_NET_SCH_TAPRIO=m
CONFIG_NET_SCH_MQPRIO=m
CONFIG_NET_SCH_INGRESS=m
CONFIG_NET_CLS_BASIC=m
CONFIG_NET_CLS_BPF=m
CONFIG_NET_CLS_FLOWER=m
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_GACT=m
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_GATE=m
CONFIG_NET_ACT_GACT=y
CONFIG_NET_ACT_MIRRED=y
CONFIG_NET_ACT_NAT=y
CONFIG_NET_ACT_SKBEDIT=y
CONFIG_NET_ACT_VLAN=y
CONFIG_NET_ACT_BPF=y
CONFIG_DCB=y
CONFIG_NETLINK_DIAG=y
CONFIG_MPLS=y
CONFIG_NET_MPLS_GSO=y
CONFIG_MPLS_ROUTING=m
CONFIG_NET_PKTGEN=y
CONFIG_BT=m
CONFIG_BT_HIDP=m
# CONFIG_BT_LE is not set
CONFIG_BT_LEDS=y
# CONFIG_BT_DEBUGFS is not set
@@ -142,6 +230,7 @@ CONFIG_MAC80211_LEDS=y
CONFIG_RFKILL=y
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
# CONFIG_ETHTOOL_NETLINK is not set
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCI_IOV=y
@@ -157,6 +246,7 @@ CONFIG_PCI_EPF_TEST=m
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_VEXPRESS_CONFIG=y
CONFIG_ARM_SCMI_PROTOCOL=y
CONFIG_ARM_SCPI_PROTOCOL=y
CONFIG_EFI_CAPSULE_LOADER=y
@@ -171,6 +261,7 @@ CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_SST25L=y
CONFIG_MTD_BLOCK2MTD=y
CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_DENALI_DT=y
CONFIG_MTD_SPI_NOR=y
@@ -191,6 +282,7 @@ CONFIG_SCSI_HISI_SAS=y
CONFIG_SCSI_HISI_SAS_PCI=y
CONFIG_MEGARAID_SAS=y
CONFIG_SCSI_MPT3SAS=m
CONFIG_SCSI_VIRTIO=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y
@@ -198,24 +290,29 @@ CONFIG_AHCI_CEVA=y
CONFIG_SATA_SIL24=y
CONFIG_PATA_OF_PLATFORM=y
CONFIG_MD=y
CONFIG_BLK_DEV_MD=m
CONFIG_BLK_DEV_DM=m
CONFIG_DM_MIRROR=m
CONFIG_DM_ZERO=m
# CONFIG_MD_BITMAP_FILE is not set
CONFIG_BLK_DEV_DM=y
CONFIG_DM_INIT=y
CONFIG_DM_VERITY=y
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
CONFIG_NETDEVICES=y
CONFIG_BONDING=m
CONFIG_DUMMY=y
CONFIG_DUMMY=m
CONFIG_WIREGUARD=m
CONFIG_MACVLAN=m
CONFIG_MACVTAP=m
CONFIG_VXLAN=y
CONFIG_IPVLAN=m
CONFIG_IPVTAP=m
CONFIG_VXLAN=m
CONFIG_GENEVE=m
CONFIG_BAREUDP=m
CONFIG_TUN=y
CONFIG_MACSEC=m
CONFIG_TUN=m
CONFIG_VETH=m
CONFIG_VIRTIO_NET=m
CONFIG_VIRTIO_NET=y
CONFIG_NLMON=y
CONFIG_NET_VRF=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_VENDOR_ACTIONS is not set
# CONFIG_NET_VENDOR_ADAPTEC is not set
# CONFIG_NET_VENDOR_AGERE is not set
# CONFIG_NET_VENDOR_ALACRITECH is not set
@@ -283,15 +380,12 @@ CONFIG_STMMAC_ETH=y
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
CONFIG_LED_TRIGGER_PHY=y
CONFIG_AX88796B_PHY=y
CONFIG_MICREL_PHY=y
CONFIG_MICROSEMI_PHY=y
CONFIG_AT803X_PHY=m
CONFIG_DAVICOM_PHY=m
CONFIG_REALTEK_PHY=y
CONFIG_ROCKCHIP_PHY=y
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_BCM_UNIMAC=m
CONFIG_MDIO_THUNDER=y
CONFIG_MDIO_BUS_MUX_MULTIPLEXER=y
CONFIG_MDIO_BUS_MUX_MMIOREG=y
CONFIG_USB_RTL8150=m
@@ -299,6 +393,7 @@ CONFIG_USB_RTL8152=m
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=m
CONFIG_USB_NET_AX88179_178A=m
CONFIG_USB_NET_CDC_NCM=m
CONFIG_USB_NET_DM9601=m
CONFIG_USB_NET_SMSC75XX=m
CONFIG_USB_NET_SMSC95XX=m
@@ -306,13 +401,12 @@ CONFIG_USB_NET_NET1080=m
CONFIG_USB_NET_PLUSB=m
CONFIG_USB_NET_MCS7830=m
CONFIG_USB_NET_CDC_SUBSET=m
CONFIG_USB_NET_ZAURUS=m
# CONFIG_USB_NET_ZAURUS is not set
CONFIG_ATH10K=m
CONFIG_ATH10K_PCI=m
CONFIG_WCN36XX=m
# CONFIG_WLAN_VENDOR_ATMEL is not set
# CONFIG_WLAN_VENDOR_BROADCOM is not set
# CONFIG_WLAN_VENDOR_CISCO is not set
# CONFIG_WLAN_VENDOR_INTEL is not set
# CONFIG_WLAN_VENDOR_INTERSIL is not set
# CONFIG_WLAN_VENDOR_MARVELL is not set
@@ -355,9 +449,11 @@ CONFIG_RTW89_DEBUGMSG=y
# CONFIG_WLAN_VENDOR_TI is not set
# CONFIG_WLAN_VENDOR_ZYDAS is not set
# CONFIG_WLAN_VENDOR_QUANTENNA is not set
CONFIG_NET_FAILOVER=y
CONFIG_INPUT_FF_MEMLESS=y
# CONFIG_INPUT_KEYBOARD is not set
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_EVBUG=y
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_GPIO_POLLED=y
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_RK805_PWRKEY=y
@@ -404,47 +500,38 @@ CONFIG_PPS=y
CONFIG_DEBUG_PINCTRL=y
CONFIG_PINCTRL_RK805=y
CONFIG_PINCTRL_SINGLE=y
CONFIG_GPIO_ALTERA=m
CONFIG_GPIO_DWAPB=y
CONFIG_GPIO_MB86S7X=y
CONFIG_GPIO_PL061=y
CONFIG_GPIO_XGENE=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_GENERIC_PLATFORM=y
CONFIG_GPIO_MAX732X=y
CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_PCA953X_IRQ=y
CONFIG_POWER_RESET_XGENE=y
CONFIG_POWER_RESET_GPIO_RESTART=y
CONFIG_POWER_RESET_SYSCON=y
CONFIG_SYSCON_REBOOT_MODE=y
CONFIG_BATTERY_SBS=m
CONFIG_BATTERY_BQ27XXX=y
CONFIG_BATTERY_MAX17042=m
CONFIG_CHARGER_BQ25890=m
CONFIG_CHARGER_BQ25980=m
CONFIG_CHARGER_RK817=y
CONFIG_SENSORS_ARM_SCMI=y
CONFIG_SENSORS_ARM_SCPI=y
CONFIG_SENSORS_LM90=m
CONFIG_SENSORS_PWM_FAN=m
CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y
CONFIG_CPU_THERMAL=y
CONFIG_THERMAL_EMULATION=y
CONFIG_ROCKCHIP_THERMAL=m
CONFIG_WATCHDOG=y
CONFIG_ARM_SP805_WATCHDOG=y
CONFIG_ARM_SBSA_WATCHDOG=y
CONFIG_DW_WATCHDOG=y
CONFIG_ARM_SMC_WATCHDOG=y
CONFIG_WATCHDOG_SYSFS=y
CONFIG_SOFT_WATCHDOG=y
CONFIG_MFD_RK8XX_I2C=y
CONFIG_MFD_RK8XX_SPI=y
CONFIG_MFD_STMFX=y
# CONFIG_MFD_VEXPRESS_SYSREG is not set
CONFIG_REGULATOR=y
CONFIG_REGULATOR_DEBUG=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_USERSPACE_CONSUMER=y
CONFIG_REGULATOR_NETLINK_EVENTS=y
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_PWM=y
CONFIG_REGULATOR_RK808=y
CONFIG_REGULATOR_VCTRL=y
CONFIG_REGULATOR_VEXPRESS=m
# CONFIG_HID_GENERIC is not set
# CONFIG_USB_HID is not set
# CONFIG_HID_SUPPORT is not set
CONFIG_USB_ULPI_BUS=y
CONFIG_USB_CONN_GPIO=y
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
@@ -452,6 +539,7 @@ CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_OTG=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
@@ -460,10 +548,6 @@ CONFIG_USB_STORAGE=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC2=y
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_ISP1760=y
CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_SIMPLE=m
@@ -471,7 +555,6 @@ CONFIG_USB_SERIAL_CP210X=m
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_PL2303=m
CONFIG_USB_SERIAL_OPTION=m
CONFIG_USB_HSIC_USB3503=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_ULPI=y
CONFIG_USB_GADGET=y
@@ -488,12 +571,6 @@ CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_TYPEC=m
CONFIG_TYPEC_TCPM=m
CONFIG_TYPEC_TCPCI=m
CONFIG_TYPEC_FUSB302=m
CONFIG_TYPEC_TPS6598X=m
CONFIG_TYPEC_HD3SS3220=m
CONFIG_MMC=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_ARMMMCI=y
@@ -505,13 +582,9 @@ CONFIG_MMC_SDHCI_CADENCE=y
CONFIG_MMC_SDHCI_F_SDH30=y
CONFIG_MMC_SPI=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_EXYNOS=y
CONFIG_MMC_DW_HI3798CV200=y
CONFIG_MMC_DW_K3=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_MMC_MTK=y
CONFIG_MMC_SDHCI_XENON=y
CONFIG_MMC_SDHCI_AM654=y
CONFIG_SCSI_UFSHCD=y
CONFIG_SCSI_UFSHCD_PLATFORM=y
CONFIG_NEW_LEDS=y
@@ -527,6 +600,7 @@ CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_CPU=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_LEDS_TRIGGER_PANIC=y
CONFIG_LEDS_TRIGGER_NETDEV=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_RK808=y
CONFIG_RTC_DRV_EFI=y
@@ -541,7 +615,6 @@ CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_MMIO=y
# CONFIG_VHOST_MENU is not set
CONFIG_STAGING=y
CONFIG_PRISM2_USB=m
CONFIG_RTLLIB=m
CONFIG_RTL8192E=m
CONFIG_RTL8723BS=m
@@ -565,7 +638,6 @@ CONFIG_ROCKCHIP_IODOMAIN=y
CONFIG_ROCKCHIP_DTPM=m
CONFIG_ROCKCHIP_PM_DOMAINS=y
CONFIG_DEVFREQ_GOV_USERSPACE=m
CONFIG_EXTCON_PTN5150=m
CONFIG_EXTCON_USB_GPIO=y
CONFIG_MEMORY=y
CONFIG_IIO=y
@@ -578,6 +650,7 @@ CONFIG_IIO_ST_MAGN_3AXIS=m
CONFIG_MPL3115=m
CONFIG_PWM=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_RESET_GPIO=y
CONFIG_PHY_ROCKCHIP_DPHY_RX0=m
CONFIG_PHY_ROCKCHIP_EMMC=y
CONFIG_PHY_ROCKCHIP_INNO_HDMI=m
@@ -590,8 +663,6 @@ CONFIG_PHY_ROCKCHIP_USB=m
CONFIG_POWERCAP=y
CONFIG_ARM_SCMI_POWERCAP=y
CONFIG_DTPM=y
CONFIG_DTPM_CPU=y
CONFIG_DTPM_DEVFREQ=y
CONFIG_ARM_SMMU_V3_PMU=m
CONFIG_NVMEM_RMEM=m
CONFIG_NVMEM_ROCKCHIP_EFUSE=m
@@ -603,30 +674,48 @@ CONFIG_INTERCONNECT=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_OVERLAY_FS=m
CONFIG_AUTOFS_FS=y
CONFIG_FUSE_FS=y
CONFIG_VIRTIO_FS=y
CONFIG_OVERLAY_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_UTF8=y
CONFIG_EXFAT_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_CHILDREN=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_HUGETLBFS=y
CONFIG_EFIVAR_FS=y
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_XATTR=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
CONFIG_SQUASHFS_ZSTD=y
CONFIG_NFS_FS=y
CONFIG_NFS_V4=y
CONFIG_NFS_V4_1=y
CONFIG_NFS_V4_2=y
CONFIG_ROOT_NFS=y
CONFIG_9P_FS=y
CONFIG_NLS_DEFAULT="iso8859-15"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_UTF8=y
CONFIG_SECURITY=y
CONFIG_CRYPTO_DH=m
CONFIG_CRYPTO_CURVE25519=m
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_BLAKE2B=m
CONFIG_CRYPTO_XXHASH=m
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_USER_API_RNG=m
CONFIG_CRYPTO_GHASH_ARM64_CE=y
@@ -635,20 +724,22 @@ CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_SHA512_ARM64_CE=m
CONFIG_CRYPTO_SHA3_ARM64=m
CONFIG_CRYPTO_SM3_ARM64_CE=m
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
CONFIG_CRYPTO_AES_ARM64_BS=m
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=m
CONFIG_CRYPTO_DEV_ROCKCHIP=y
CONFIG_CRYPTO_DEV_CCREE=m
CONFIG_PACKING=y
CONFIG_INDIRECT_PIO=y
CONFIG_CRC_CCITT=m
CONFIG_CRC8=y
CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=32
CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_FTRACE is not set
CONFIG_FUNCTION_TRACER=y
CONFIG_MEMTEST=y
@@ -0,0 +1,206 @@
{
"ieee802-dot1ab-lldp:lldp": {
"infix-lldp:enabled": true
},
"ietf-interfaces:interfaces": {
"interface": [
{
"name": "lo",
"type": "infix-if-type:loopback",
"ietf-ip:ipv4": {
"address": [
{
"ip": "127.0.0.1",
"prefix-length": 8
}
]
},
"ietf-ip:ipv6": {
"address": [
{
"ip": "::1",
"prefix-length": 128
}
]
}
},
{
"name": "lan",
"type": "infix-if-type:ethernet",
"ietf-ip:ipv4": {
"address": [
{
"ip": "192.168.2.1",
"prefix-length": 24
}
]
},
"ietf-ip:ipv6": {}
},
{
"name": "wan",
"type": "infix-if-type:ethernet"
}
]
},
"ietf-keystore:keystore": {
"asymmetric-keys": {
"asymmetric-key": [
{
"name": "genkey",
"public-key-format": "ietf-crypto-types:ssh-public-key-format",
"public-key": "",
"private-key-format": "ietf-crypto-types:rsa-private-key-format",
"cleartext-private-key": "",
"certificates": {}
}
]
}
},
"ietf-netconf-acm:nacm": {
"enable-nacm": true,
"groups": {
"group": [
{
"name": "admin",
"user-name": [
"admin"
]
}
]
},
"rule-list": [
{
"name": "admin-acl",
"group": [
"admin"
],
"rule": [
{
"name": "permit-all",
"module-name": "*",
"access-operations": "*",
"action": "permit",
"comment": "Allow 'admin' group complete access to all operations and data."
}
]
},
{
"name": "default-deny-all",
"group": [
"*"
],
"rule": [
{
"name": "deny-password-read",
"module-name": "ietf-system",
"path": "/ietf-system:system/authentication/user/password",
"access-operations": "*",
"action": "deny"
}
]
}
]
},
"ietf-netconf-server:netconf-server": {
"listen": {
"endpoints": {
"endpoint": [
{
"name": "default-ssh",
"ssh": {
"tcp-server-parameters": {
"local-address": "::"
},
"ssh-server-parameters": {
"server-identity": {
"host-key": [
{
"name": "default-key",
"public-key": {
"central-keystore-reference": "genkey"
}
}
]
}
}
}
}
]
}
}
},
"ietf-system:system": {
"hostname": "r2s",
"ntp": {
"enabled": true,
"server": [
{
"name": "ntp.org",
"udp": {
"address": "pool.ntp.org"
},
"iburst": true
}
]
},
"authentication": {
"user": [
{
"name": "admin",
"password": "$factory$",
"infix-system:shell": "bash"
}
]
},
"infix-system:motd-banner": "Li0tLS0tLS0uCnwgIC4gLiAgfCBJbmZpeCAtLSBhIE5ldHdvcmsgT3BlcmF0aW5nIFN5c3RlbQp8LS4gdiAuLXwgaHR0cHM6Ly9rZXJuZWxraXQuZ2l0aHViLmlvCictJy0tLSctJwo="
},
"infix-dhcp-client:dhcp-client": {
"client-if": [
{
"if-name": "wan",
"option": [
{
"name": "broadcast"
},
{
"name": "dns"
},
{
"name": "domain"
},
{
"name": "hostname"
},
{
"name": "ntpsrv"
},
{
"name": "router"
},
{
"name": "subnet"
}
]
}
]
},
"infix-meta:meta": {
"infix-meta:version": "1.2"
},
"infix-services:mdns": {
"enabled": true
},
"infix-services:web": {
"enabled": true,
"console": {
"enabled": true
},
"netbrowse": {
"enabled": true
},
"restconf": {
"enabled": true
}
}
}
@@ -0,0 +1 @@
../available/input-event-daemon.conf
@@ -0,0 +1 @@
service [12345789] log wan-monitor.sh -- WAN Health monitor
+91
View File
@@ -0,0 +1,91 @@
{
"input": {
"path": {
"locate": { "path": "/run/led/locate" },
"status-prime": { "path": "/run/led/status-prime" },
"status-ok": { "path": "/run/led/status-ok" },
"status-err": { "path": "/run/led/status-err" },
"status-crit": { "path": "/run/led/status-crit" },
"fault-prime": { "path": "/run/led/fault-prime" },
"fault-ok": { "path": "/run/led/fault-ok" },
"fault-err": { "path": "/run/led/fault-err" },
"fault-crit": { "path": "/run/led/fault-crit" },
"wan-up": { "path": "/run/led/wan-up" },
"startup": { "path": "/run/finit/cond/run/startup/success" },
"fail-safe": { "path": "/run/finit/cond/run/failure/success" },
"panic": { "path": "/run/finit/cond/run/failure/failure" }
},
"udev": {
"power-a": { "subsystem": "power_supply" },
"power-b": { "subsystem": "power_supply" }
}
},
"output": {
"led-group": {
"port-link-act": {
"match": ["*:green:tp", "*:green:sfp", "*:green:port" ],
"rules": [
{ "if": "true", "then": { "trigger": "netdev", "link": 1, "rx": 1, "tx": 1 } }
]
},
"port-alarm": {
"match": ["*:yellow:tp", "*:yellow:sfp", "*:yellow:port" ],
"rules": [
]
}
},
"led": {
"nanopi-r2s:red:sys": {
"rules": [
{ "if": "locate", "then": "@blink-1hz" },
{ "if": "panic", "then": "@blink-5hz" },
{ "if": "fail-safe", "then": "@blink-5hz" },
{ "if": "startup", "then": "@off" },
{ "if": "true", "then": "@blink-1hz" }
]
},
"nanopi-r2s:green:lan": {
"rules": [
{ "if": "locate", "then": "@blink-1hz" },
{ "if": "panic", "then": "@blink-5hz" },
{ "if": "startup", "then": "@on" }
]
},
"nanopi-r2s:green:wan": {
"rules": [
{ "if": "locate", "then": "@blink-1hz" },
{ "if": "panic", "then": "@blink-5hz" },
{ "if": "wan-up", "then": "@on" }
]
}
}
},
"aliases": {
"on": {
"brightness": true
},
"off": {
"brightness": false
},
"blink-1hz": {
"trigger": "timer",
"delay_on": 500,
"delay_off": 500
},
"blink-5hz": {
"trigger": "timer",
"delay_on": 100,
"delay_off": 100
}
}
}
@@ -0,0 +1,5 @@
[Global]
listen = /dev/input/event1
[Keys]
RESTART = reboot
@@ -0,0 +1,2 @@
ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/ff540000.ethernet/net/eth0", NAME="wan"
ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/ff600000.usb/xhci-hcd.0.auto/usb3/3-1/3-1:1.0/net/*", NAME="lan"
+41
View File
@@ -0,0 +1,41 @@
#!/bin/sh
# Background WAN interface monitor. Lights up WAN LED
# while the interface has a DHCP address.
LED_FILE="/run/led/wan-up"
PID_FILE="/run/$(basename "$0").pid"
check_wan()
{
ip_info=$(ip a show wan)
if echo "$ip_info" | grep -q "inet .* proto dhcp"; then
[ ! -f "$LED_FILE" ] && touch "$LED_FILE"
else
[ -f "$LED_FILE" ] && rm "$LED_FILE"
fi
}
cleanup()
{
rm -f "$LED_FILE"
rm -f "$PID_FILE"
exit 0
}
trap 'cleanup' TERM INT HUP QUIT
echo $$ > "$PID_FILE"
remaining_time=$((1800 - $(awk '{print int($1)}' /proc/uptime)))
[ "$remaining_time" -lt 0 ] && remaining_time=0
while [ "$remaining_time" -gt 0 ]; do
check_wan
sleep 1
remaining_time=$((remaining_time - 1))
done
while :; do
check_wan
sleep 5
done
+16
View File
@@ -0,0 +1,16 @@
CONFIG_BUTTON=y
CONFIG_BUTTON_GPIO=y
CONFIG_LED=y
CONFIG_LED_GPIO=y
# CONFIG_MMC_PCI is not set
CONFIG_DEVICE_TREE_INCLUDES="infix-env.dtsi infix-key.dtsi r2s-env.dtsi"
CONFIG_SYS_PROMPT="(r2s) "
CONFIG_ENV_OVERWRITE=y
# CONFIG_ENV_IS_NOWHERE is not set
CONFIG_ENV_IS_IN_EXT4=y
# CONFIG_ENV_IS_IN_MMC is not set
CONFIG_ENV_EXT4_INTERFACE="mmc"
CONFIG_ENV_EXT4_DEVICE_AND_PART="1:1"
+47
View File
@@ -0,0 +1,47 @@
/ {
config {
environment {
boot_targets = "mmc1";
ethprime = "eth0";
/* This is a development platform, hard code developer mode */
ixbtn-devmode = "setenv dev_mode yes; echo Enabled";
/* Override default definitiion to add LED feedback */
ixbtn-factory = "
if button factory-reset; then
echo \"Keep button pressed for 10 seconds to engage factory reset ...\"
for tick in . . . . . . . . . .; do
led nanopi-r2s:red:sys on
led nanopi-r2s:green:lan on
led nanopi-r2s:green:wan on
sleep 0.5
led nanopi-r2s:red:sys off
led nanopi-r2s:green:lan off
led nanopi-r2s:green:wan off
sleep 0.5
echo -n \"Checking button: \"
button factory-reset || exit
done
echo -n \"Final button check: \"
if button factory-reset; then
setenv factory_reset yes
echo \"FACTORY RESET ENGAGED\"
fi
fi
";
};
};
keys {
compatible = "gpio-keys";
factory-reset {
gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
linux,code = <KEY_POWER>;
label = "factory-reset";
};
};
};
+1
View File
@@ -0,0 +1 @@
dcp-sc-28p-b.dtb
+1
View File
@@ -0,0 +1 @@
dcp-sc-28p-a.dtb
+111
View File
@@ -0,0 +1,111 @@
#!/bin/sh
# Raw switch LED Control for systems that do not run iitod
LEDS=$(find /sys/class/leds -iname '*mdio-mii*')
LINK=$(find /sys/class/leds -iname '*mdio-mii*p')
# Disable ALL switch port LEDs
clear()
{
for led in $LEDS; do
echo 0 > "${led}/brightness"
done
}
setup()
{
for led in $LINK; do
echo netdev > "${led}/trigger"
done
for led in $LINK; do
cd "$led"
# No sleep here, it's enough with the delay from previous loop
echo 1 > link
sleep 0.1
echo 1 > rx
sleep 0.1
echo 1 > tx
cd - >/dev/null
done
}
leds()
{
for led in $LINK; do
printf "%3s: %s\n" "$(cat "$led/device_name" 2>/dev/null)" "$led"
done
}
list()
{
leds | sort | while read -r port path; do
printf "%4s %s\n" "$port" "$(basename "$path")"
aux=${path%%:tp}:aux
if [ -e "$aux" ]; then
printf "%3s: %s\n" "" "$(basename "$aux")"
fi
done
}
flash()
{
sec=$1
for led in $LEDS; do
echo timer > "${led}/trigger"
done
for led in $LEDS; do
echo 84 > "${led}/delay_on"
echo 84 > "${led}/delay_off"
done
sleep "$sec"
clear
}
usage()
{
echo "usage: $0 [command]"
echo
echo "flash [SEC] Flash all LEDs to locate device in rack, default: 5 sec"
echo "list List all LEDs"
echo "setup Set up and start normal operation"
echo "start Call at system init, clears all LEDs and sets up normal op"
echo "stop Clear all LEDs, may be called at system shutdown"
echo
echo "Please ensure no other tool or daemon is already managing the LEDs."
}
cmd=$1; shift
case $cmd in
flash)
flash ${1:-5}
setup
;;
help)
usage
exit 0
;;
list | ls)
list
;;
setup)
setup
;;
start)
initctl -nbq cond clear led
clear
setup
;;
stop)
clear
;;
*)
usage
exit 1
;;
esac
@@ -0,0 +1,2 @@
# empty to disable port LED control on Styx, for details, see issue
# https://github.com/kernelkit/infix/issues/670#issuecomment-2419025575
@@ -0,0 +1 @@
/usr/libexec/styx/led.sh
+6
View File
@@ -160,3 +160,9 @@ config FIT_ARCH
config FIT_KERNEL_LOAD_ADDR
string "Kernel load address"
depends on FIT_IMAGE
config SDCARD_AUX
bool "Create SD-card aux partition"
help
Create and populate aux.ext4 with rootfs.itbh and rauc.status
For use with a static genimage.cfg for, e.g., SD-cards.
+130
View File
@@ -0,0 +1,130 @@
Welcome to Infix!
=================
Nice to meet ❤️ you! If you are reading this then you have possibly
just downloaded and unpacked a release build and are curious about how
to proceed from here.
To test Infix You need a Linux 🐧 system with Qemu or GNS3 installed.
We recommend Debian based systems, like Ubuntu and Linux Mint.
> For a pain-free experience we recommend enabling CPU virtualization in
> your BIOS/UEFI, which for many computers is disabled by default.
From this point we assume you have your x86_64/AMD64 based Linux system
up and running. Time to start your favorite terminal application! 😃
Installing Qemu
---------------
This README focus on getting you started with Qemu. From a terminal,
install (at least) the x86/x86_64 emulator. The 'virt-manager' is a
package that helps pull in other dependencies you may need:
$ sudo apt install qemu-system-x86 virt-manager
That's it.
Running Infix in Qemu
---------------------
Depending on how your Linux installation is set up, the following may
require being run with superuser privileges, i.e., you may need to
repend the command with 'sudo'.
$ ./qemu.sh
You should now see the Infix init system booting up. When the final
"Please press Enter to activate this console." is shown, press Enter
and the login: prompt is displayed.
The default credentials for the demo builds is
login: admin
password: admin
Infix -- a Network Operating System v24.09.0-rc1 (hvc0)
infix-00-00-00 login: admin
Password:
.-------.
| . . | Infix -- a Network Operating System
|-. v .-| https://kernelkit.org
'-'---'-'
Run the command 'cli' for interactive OAM
admin@infix-00-00-00:~$
You're in! Play around in your sandbox as much as you like, if you
run into problems or have questions, please see the documentation,
and don't hesitate to get in touch with us! 😃
- https://github.com/kernelkit/infix/tree/main/doc
Customizing your "Hardware"
---------------------------
For more Ethernet ports in your emulated system you need to change the
Qemu configuration used for Infix. This can be done using a menuconfig
interface, which requires the following extra package:
$ sudo apt install kconfig-frontends
We can now enter the configuration:
$ ./qemu.sh -c
Go down to *Networking*, select *TAP*, now you can change the *Number of
TAPs*, e.g. to 10. Exit and save the configuration, then you can start
Qemu again:
./qemu.sh
> Make sure to do a factory reset from the CLI, otherwise you will be
> stuck with that single interface from before.
Errors on Console
-----------------
If you see the following line printed one or more times, don't panic.
LABEL=var: Can't lookup blockdev
See the Customizing section above. To silence the error you need to
create another writable partition for Infix to store logs, container
images, etc. Look for the 'var' keyword, you can adjust the size of
the partition.
Graphical Network Simulator 3 (GNS3)
------------------------------------
GNS3 is a very powerful front-end to Qemu which takes care of creating
virtual links between network devices running in Qemu. This README is
only link to the material you need. This directory holds the appliance
file, .gns3a, that references image files also in this directory, that
you need to load into GNS3.
The necessary extra packages are available through the offical PPA. If
you don't know what a PPA is, read up on that first:
- https://launchpad.net/~gns3/+archive/ubuntu/ppa
There's a lot of tutorials and guides online, start here:
- https://docs.gns3.com/docs/
About
-----
Infix is a free, Linux based, immutable Network Operating System (NOS)
built on Buildroot, and sysrepo. A powerful mix that ease porting to
different platforms, simplify long-term maintenance, and provide easy
management using NETCONF, RESTCONF, or the built-in command line
interface (CLI) from a console or SSH login.
+6 -6
View File
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.36.0
# Thu Feb 8 08:22:32 2024
# Busybox version: 1.36.1
# Tue Oct 22 13:12:02 2024
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -957,10 +957,10 @@ CONFIG_FEATURE_NETSTAT_PRG=y
CONFIG_NSLOOKUP=y
CONFIG_FEATURE_NSLOOKUP_BIG=y
CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y
CONFIG_NTPD=y
CONFIG_FEATURE_NTPD_SERVER=y
CONFIG_FEATURE_NTPD_CONF=y
CONFIG_FEATURE_NTP_AUTH=y
# CONFIG_NTPD is not set
# CONFIG_FEATURE_NTPD_SERVER is not set
# CONFIG_FEATURE_NTPD_CONF is not set
# CONFIG_FEATURE_NTP_AUTH is not set
CONFIG_PING=y
CONFIG_PING6=y
CONFIG_FEATURE_FANCY_PING=y
+11 -2
View File
@@ -16,13 +16,22 @@ die()
# DISK_IMAGE_SIZE="512"
# etc.
#
# Nested variables, like INFIX_COMPATIBLE="${INFIX_IMAGE_ID}"
# are handled by sourcing the file in a subshell.
#
# shellcheck disable=SC1090
load_cfg()
{
tmp=$(mktemp -p /tmp)
(
. "$BR2_CONFIG" 2>/dev/null
# Set *all* matching variables
set | grep -E "^${1}[^=]*=" | while IFS= read -r line; do
echo "$line"
done
) > "$tmp"
grep -E "${1}.*=" "$BR2_CONFIG" >"$tmp"
. "$tmp"
rm "$tmp"
}
+39
View File
@@ -0,0 +1,39 @@
#!/bin/sh
rootdir=$BUILD_DIR/genimage.root
tempdir=$BUILD_DIR/genimage.tmp
cat <<EOF > /tmp/mkaux.cfg
image aux.ext4 {
mountpoint = "/aux"
size = 16M
ext4 {
label = "aux"
use-mke2fs = true
features = "^metadata_csum,^metadata_csum_seed"
}
}
# Silence genimage warnings
config {}
EOF
rm -rf "$rootdir/aux"
mkdir -p "$rootdir/aux"
cp -f "$BINARIES_DIR/rootfs.itbh" "$rootdir/aux/primary.itbh"
cp -f "$BINARIES_DIR/rootfs.itbh" "$rootdir/aux/secondary.itbh"
cp -f "$BINARIES_DIR/rauc.status" "$rootdir/aux/rauc.status"
mkenvimage -s 0x4000 -o "$rootdir/aux/uboot.env" \
"$BR2_EXTERNAL_INFIX_PATH/board/common/uboot/aux-env.txt"
rm -rf "$BINARIES_DIR/aux.ext4"
rm -rf "$tempdir"
genimage \
--rootpath "$rootdir" \
--tmppath "$tempdir" \
--inputpath "$BINARIES_DIR" \
--outputpath "$BINARIES_DIR" \
--config "/tmp/mkaux.cfg"
+12 -12
View File
@@ -2,30 +2,30 @@
set -e
GIT_VERSION=$(git -C $BR2_EXTERNAL_INFIX_PATH describe --always --dirty --tags)
GIT_VERSION=$(git -C "$BR2_EXTERNAL_INFIX_PATH" describe --always --dirty --tags)
name=$1
arch=$2
compat=$2
sign=$3
crt=$(ls $sign/*.crt)
key=$(ls $sign/*.key)
common=$(dirname $(readlink -f "$0"))
common=$(dirname "$(readlink -f "$0")")
work=$BUILD_DIR/mkrauc
mkdir -p $work
mkdir -p "$work"
cp -f $common/rauc-hooks.sh $work/hooks.sh
cp -f "$common/rauc-hooks.sh" "$work/hooks.sh"
# RAUC internally uses the file extension to find a suitable install
# handler, hence the name must be .img
cp -f $BINARIES_DIR/rootfs.squashfs $work/rootfs.img
cp -f $BINARIES_DIR/rootfs.itbh $work/rootfs.itbh
cp -f "$BINARIES_DIR/rootfs.squashfs" "$work/rootfs.img"
cp -f "$BINARIES_DIR/rootfs.itbh" "$work/rootfs.itbh"
cat >$work/manifest.raucm <<EOF
cat >"$work/manifest.raucm" <<EOF
[update]
compatible=infix-${arch}
compatible=${compat}
version=${GIT_VERSION}
[bundle]
@@ -39,7 +39,7 @@ filename=rootfs.img
hooks=post-install
EOF
rm -f $BINARIES_DIR/$name.pkg
rm -f "$BINARIES_DIR/$name.pkg"
rauc --cert=$crt --key=$key \
bundle $work $BINARIES_DIR/$name.pkg
rauc --cert="$crt" --key="$key" \
bundle "$work" "$BINARIES_DIR/$name.pkg"
+53
View File
@@ -4,6 +4,37 @@ common=$(dirname "$(readlink -f "$0")")
. "$BR2_CONFIG" 2>/dev/null
. "$TARGET_DIR/usr/lib/os-release"
# Extract list of loaded YANG modules and their features for yangdoc.html
mkyangdoc()
{
cmd="yangdoc -o $1 -p $TARGET_DIR/usr/share/yang"
# shellcheck disable=SC2155
export SYSREPO_SHM_PREFIX="yangdoc"
while IFS= read -r line; do
if echo "$line" | grep -q '^[a-z]'; then
module=$(echo "$line" | awk '{print $1}')
cmd="$cmd -m $module"
feature=$(echo "$line" | awk -F'|' '{print $8}' | sed 's/^ *//;s/ *$//')
if [ -n "$feature" ]; then
feature_list=$(echo "$feature" | tr ' ' '\n')
for feat in $feature_list; do
cmd="$cmd -e $feat"
done
fi
fi
done <<EOF
$(sysrepoctl -l; rm -f /dev/shm/${SYSREPO_SHM_PREFIX}*)
EOF
# Ignore a few top-level oddballs not used by core Infix
cmd="$cmd -x supported-algorithms"
# Execute the command
echo "Calling: $cmd"
$cmd
}
if [ -n "${ID_LIKE}" ]; then
ID="${ID} ${ID_LIKE}"
fi
@@ -24,6 +55,16 @@ else
VERSION=$GIT_VERSION
fi
if [ -n "$INFIX_IMAGE_ID" ]; then
NAME="$INFIX_IMAGE_ID"
else
NAME="$INFIX_ID"-$(echo "$BR2_ARCH" | tr _ - | sed 's/x86-64/x86_64/')
fi
if [ -f "$TARGET_DIR/etc/rauc/system.conf" ]; then
sed -i "s/compatible=.*/compatible=$INFIX_COMPATIBLE/" "$TARGET_DIR/etc/rauc/system.conf"
fi
# This is a symlink to /usr/lib/os-release, so we remove this to keep
# original Buildroot information.
rm -f "$TARGET_DIR/etc/os-release"
@@ -63,12 +104,19 @@ 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"
mkdir "$TARGET_DIR/var/lib/avahi-autoipd"
fi
# Drop Buildroot default pam_lastlog.so from login chain
sed -i '/^[^#]*pam_lastlog.so/s/^/# /' "$TARGET_DIR/etc/pam.d/login"
# Allow pdmenu (setup) and bash to be login shells, bash is added
# automatically when selected in menuyconfig, but not when BusyBox
# provides a symlink (for ash). The /bin/{true,false} are old UNIX
@@ -85,3 +133,8 @@ grep -qsE '^/bin/false$$' "$TARGET_DIR/etc/shells" \
# Allow clish (symlink to /usr/bin/klish) to be a login shell
grep -qsE '^/bin/clish$$' "$TARGET_DIR/etc/shells" \
|| echo "/bin/clish" >> "$TARGET_DIR/etc/shells"
# Create YANG documentation
if [ "$BR2_PACKAGE_HOST_PYTHON_YANGDOC" = "y" ]; then
mkyangdoc "$BINARIES_DIR/yangdoc.html"
fi
+20 -3
View File
@@ -7,11 +7,17 @@ common=$(dirname "$(readlink -f "$0")")
# shellcheck disable=SC1091
. "$TARGET_DIR/etc/os-release"
load_cfg INFIX_ID
# The INFIX_* variables may be composed from BR2_* variables,
# so we source them last.
load_cfg BR2_ARCH
load_cfg BR2_DEFCONFIG
load_cfg BR2_EXTERNAL_INFIX_PATH
load_cfg BR2_TARGET_ROOTFS
load_cfg INFIX_ID
load_cfg INFIX_COMPATIBLE
# The default IMAGE_ID is infix-$BR2_ARCH but can be overridden
# for imaage names, and compat strings, like infix-r2s
if [ -n "$IMAGE_ID" ]; then
NAME="$IMAGE_ID"
else
@@ -36,7 +42,7 @@ if [ "$SIGN_ENABLED" = "y" ]; then
$common/sign.sh $BR2_ARCH $SIGN_KEY
ixmsg "Creating RAUC Update Bundle"
$common/mkrauc.sh "$NAME$(ver)" $BR2_ARCH $SIGN_KEY
$common/mkrauc.sh "$NAME$(ver)" $INFIX_COMPATIBLE $SIGN_KEY
fi
load_cfg DISK_IMAGE
@@ -60,6 +66,14 @@ if [ "$DISK_IMAGE" = "y" ]; then
$common/mkdisk.sh -a $BR2_ARCH -n $diskimg -s $DISK_IMAGE_SIZE $bootcfg
fi
load_cfg SDCARD_AUX
if [ "$SDCARD_AUX" = "y" ]; then
ixmsg "Creating initial rauc.status"
$common/mkrauc-status.sh "$BINARIES_DIR/${NAME}.pkg" >"$BINARIES_DIR/rauc.status"
ixmsg "Creating aux.ext4 for sdcard.img"
$common/mkaux.sh
fi
load_cfg GNS3_APPLIANCE
if [ "$GNS3_APPLIANCE" = "y" ]; then
ixmsg "Creating GNS3 Appliance, $GNS3_APPLIANCE_RAM MiB with $GNS3_APPLIANCE_IFNUM ports"
@@ -81,7 +95,7 @@ if [ "$BR2_TARGET_ROOTFS_SQUASHFS" = "y" ]; then
fi
# Menuconfig support for modifying Qemu args in release tarballs
cp "$BR2_EXTERNAL_INFIX_PATH/board/common/rootfs/bin/onieprom" "$BINARIES_DIR/"
cp "$BR2_EXTERNAL_INFIX_PATH/board/common/rootfs/usr/bin/onieprom" "$BINARIES_DIR/"
cp "$BR2_EXTERNAL_INFIX_PATH/board/common/qemu/qemu.sh" "$BINARIES_DIR/"
sed -e "s/@ARCH@/QEMU_$BR2_ARCH/" \
-e "s/@DISK_IMG@/$diskimg/" \
@@ -91,3 +105,6 @@ rm -f "$BINARIES_DIR/qemu.cfg"
CONFIG_="CONFIG_" BR2_CONFIG="$BINARIES_DIR/qemu.cfg" \
"$O/build/buildroot-config/conf" --olddefconfig "$BINARIES_DIR/Config.in"
rm -f "$BINARIES_DIR/qemu.cfg.old" "$BINARIES_DIR/.config.old"
# Quick intro for beginners, with links to more information
cp "$BR2_EXTERNAL_INFIX_PATH/board/common/README.txt" "$BINARIES_DIR/"
+57 -2
View File
@@ -4,6 +4,10 @@ choice
prompt "Target Architecture"
default @ARCH@
config QEMU_riscv64
bool "risv64"
select QEMU_ARCH_IS_64
config QEMU_x86_64
bool "x86_64"
select QEMU_ARCH_IS_64
@@ -102,21 +106,27 @@ config QEMU_DTB_EXTEND
depends on QEMU_LOADER_UBOOT
default y if QEMU_aarch64
if QEMU_ROOTFS_INITRD
config QEMU_RW
string "Writable /cfg layer"
depends on QEMU_ROOTFS_INITRD
default "cfg.ext4"
config QEMU_RW_VAR_OPT
bool "Separate writable /var (256MB)"
bool "Separate writable /var"
if QEMU_RW_VAR_OPT
config QEMU_RW_VAR_SIZE
string "Size of /var"
default "256M"
config QEMU_RW_VAR
string "Writable /var layer"
default "var.ext4"
endif
endif
config QEMU_VPD
bool "Emulate a Vital Product Data (VPD) Memory"
@@ -131,6 +141,51 @@ config QEMU_APPEND
config QEMU_EXTRA
string "Extra QEMU options"
comment "RTC"
choice
prompt "Mode"
default QEMU_RTC_UTC
config QEMU_RTC_UTC
bool "UTC"
config QEMU_RTC_LOCAL
bool "Local time"
config QEMU_RTC_RANDOM
bool "Random"
endchoice
choice
prompt "Clock"
default QEMU_CLOCK_HOST
config QEMU_CLOCK_HOST
bool "Host clock"
config QEMU_CLOCK_RT
bool "Independent (monotonic)"
config QEMU_CLOCK_VM
bool "Virtual"
endchoice
config QEMU_RTC
string
default "utc" if QEMU_RTC_UTC
default "localtime" if QEMU_RTC_LOCAL
default "random" if QEMU_RTC_RANDOM
config QEMU_CLOCK
string
default "host" if QEMU_CLOCK_HOST
default "rt" if QEMU_CLOCK_RT
default "vm" if QEMU_CLOCK_VM
comment "Networking"
choice
+54 -9
View File
@@ -146,13 +146,22 @@ usb_args()
USBSTICK="usb.vfat"
if ! [ -f $USBSTICK ]; then
dd if=/dev/zero of=${USBSTICK} bs=8M count=1 >/dev/null 2>&1
mkfs.vfat $USBSTICK >/dev/null 2>&1
if command -v mkfs.vfat >/dev/null; then
mkfs.vfat -n "log" $USBSTICK >/dev/null 2>&1
else
if command -v mkfs.exfat >/dev/null; then
mkfs.exfat -L "log" $USBSTICK >/dev/null 2>&1
fi
fi
fi
echo -n "-drive if=none,id=usbstick,format=raw,file=$USBSTICK "
echo -n "-usb "
echo -n "-device usb-ehci,id=ehci "
echo -n "-device usb-storage,bus=ehci.0,drive=usbstick "
}
rw_args()
{
[ "$CONFIG_QEMU_RW" ] || return
@@ -172,7 +181,7 @@ rw_args()
if [ "$CONFIG_QEMU_RW_VAR_OPT" ]; then
if ! [ -f "$CONFIG_QEMU_RW_VAR" ]; then
dd if=/dev/zero of="$CONFIG_QEMU_RW_VAR" bs=256M count=1 >/dev/null 2>&1
dd if=/dev/zero of="$CONFIG_QEMU_RW_VAR" bs=$CONFIG_QEMU_RW_VAR_SIZE count=1 >/dev/null 2>&1
mkfs.ext4 -L var "$CONFIG_QEMU_RW_VAR" >/dev/null 2>&1
fi
@@ -252,17 +261,49 @@ EOF
wdt_args()
{
echo -n "-device i6300esb -rtc clock=host"
echo -n "-device i6300esb "
}
random_date()
{
rand=$(($(date +%_s) * $$ + $(date +%N | sed 's/^0*//')))
when=$((rand % 7258118400)) # 1970 - 2200
date -d "@$when" +"%Y-%m-%dT%H:%M:%S"
}
rtc_args()
{
rtc="${CONFIG_QEMU_RTC:-utc}"
clock="${CONFIG_QEMU_CLOCK:-host}"
if [ "$rtc" = "random" ]; then
rtc=$(random_date)
fi
echo -n "-rtc base=$rtc,clock=$clock"
}
gdb_args()
{
echo -n "-chardev socket,id=gdbqemu,path=gdbqemu.sock,server=on,wait=off "
echo -n "-gdb chardev:gdbqemu"
}
run_qemu()
{
if [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
qemu-img create -f qcow2 -o backing_file=$CONFIG_QEMU_ROOTFS -F raw $CONFIG_QEMU_ROOTFS.qcow2 > /dev/null
if ! qemu-img check "${CONFIG_QEMU_ROOTFS}.qcow2"; then
rm -f "${CONFIG_QEMU_ROOTFS}.qcow2"
fi
if [ ! -f "${CONFIG_QEMU_ROOTFS}.qcow2" ]; then
echo "Creating qcow2 disk image for Qemu ..."
qemu-img create -f qcow2 -o backing_file="$CONFIG_QEMU_ROOTFS" \
-F raw "${CONFIG_QEMU_ROOTFS}.qcow2" > /dev/null
fi
fi
local qemu
read qemu <<EOF
$CONFIG_QEMU_MACHINE -m $CONFIG_QEMU_MACHINE_RAM \
$CONFIG_QEMU_MACHINE -nodefaults -m $CONFIG_QEMU_MACHINE_RAM \
$(loader_args) \
$(rootfs_args) \
$(serial_args) \
@@ -271,15 +312,23 @@ run_qemu()
$(host_args) \
$(net_args) \
$(wdt_args) \
$(rtc_args) \
$(vpd_args) \
$(gdb_args) \
$CONFIG_QEMU_EXTRA
EOF
echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
line=$(stty -g)
stty raw
if [ "$CONFIG_QEMU_KERNEL" ]; then
$qemu -append "$(append_args)" "$@"
else
$qemu "$@"
fi
stty "$line"
}
dtb_args()
@@ -385,8 +434,4 @@ fi
generate_dot
echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
line=$(stty -g)
stty raw
run_qemu $(dtb_args)
stty "$line"
-1
View File
@@ -1 +0,0 @@
/sbin/ip
@@ -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
+28
View File
@@ -1,3 +1,4 @@
# Hey Emacs, this is -*-sh-*-
# System-wide .bashrc file for interactive bash(1) shells.
# If not running interactively, don't do anything
@@ -13,3 +14,30 @@ export PROMPT_COMMAND=prompt_command
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
log()
{
local fn="/var/log/syslog"
[ -n "$1" ] && fn="/var/log/$1"
less +G "$fn"
}
follow()
{
local fn="/var/log/syslog"
[ -n "$1" ] && fn="/var/log/$1"
tail -F "$fn"
}
_logfile_completions()
{
local cur=${COMP_WORDS[COMP_CWORD]}
local files=$(compgen -f -- "/var/log/$cur")
COMPREPLY=()
for file in $files; do
[ -f "$file" ] && COMPREPLY+=("$(basename "$file")")
done
}
complete -F _logfile_completions log
complete -F _logfile_completions follow
+1
View File
@@ -0,0 +1 @@
CONFD_TIMEOUT=60
+1
View File
@@ -0,0 +1 @@
RAUC_ARGS="-s"
@@ -1,3 +1,3 @@
run [S] log:console /libexec/infix/probe -- Probing system information
run [S] <pid/syslogd> /libexec/infix/sysctl-sync-ip-conf --
run [S] <pid/syslogd> /libexec/infix/nameif -- Probing network interfaces
task name:ixinit log:tag:ixinit [S] <pid/syslogd> \
/usr/libexec/finit/runparts -bp /usr/libexec/infix/init.d \
-- Probing system
@@ -1,4 +1,4 @@
service :%i pid:!/run/k8s-logger-%i.pid <usr/container:%i> \
[2345] k8s-logger -cni %i -f local1 /run/containers/%i.fifo -- Logger for container %i
sysv :%i pid:!/run/container:%i.pid <pid/k8s-logger:%i> kill:10 \
sysv :%i pid:!/run/container:%i.pid <!pid/k8s-logger:%i> log kill:10 \
[2345] container -n %i -- container %i
@@ -1 +1 @@
task [S] <service/confd/ready> /libexec/infix/mkcert -- Verifying self-signed https certificate
task [S] <service/confd/ready> /usr/libexec/infix/mkcert -- Verifying self-signed https certificate
@@ -0,0 +1,3 @@
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
+3 -2
View File
@@ -7,16 +7,17 @@ tmpfs /dev/shm tmpfs mode=0777 0 0
proc /proc proc defaults 0 0
tmpfs /tmp tmpfs mode=1777,nosuid,nodev 0 0
tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0
tmpfs /media tmpfs mode=1755,nosuid,nodev 0 0
sysfs /sys sysfs defaults 0 0
debugfs /sys/kernel/debug debugfs nofail 0 0
cfgfs /config configfs nofail,noauto 0 0
# The chosen backing storage for the overlays placed on /cfg, /etc,
# /home, /root, and /var, are determined dynamically by /libexec/infix/mnt
# /home, /root, and /var, are determined dynamically by /usr/libexec/infix/mnt
# depending on the available devices.
mnttmp /mnt/tmp tmpfs defaults 0 0
LABEL=aux /mnt/aux auto noatime,nodiratime,noauto 0 0
LABEL=var /mnt/var auto noatime,nodiratime,noauto 0 0
LABEL=cfg /mnt/cfg auto noatime,nodiratime,noauto 0 0
hostfs /mnt/host 9p cache=none,msize=16384,noauto 0 0
/libexec/infix/mnt# /cfg helper none 0 0
/usr/libexec/infix/mnt# /cfg helper none 0 0
+1
View File
@@ -0,0 +1 @@
/var/lib/dbus/machine-id
+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
+1 -1
View File
@@ -1,4 +1,4 @@
.-------.
| . . | Infix -- a Network Operating System
|-. v .-| https://kernelkit.github.io
|-. v .-| https://kernelkit.org
'-'---'-'
@@ -24,4 +24,6 @@ server {
root html;
index index.html index.htm;
}
include /etc/nginx/app/*.conf;
}
@@ -5,14 +5,6 @@ server {
include ssl.conf;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
include /etc/nginx/netbrowse.conf;
}
}
@@ -0,0 +1,6 @@
location /netbrowse/ {
return 301 /netbrowse;
}
location /netbrowse {
include /etc/nginx/netbrowse.conf;
}
@@ -0,0 +1,9 @@
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
@@ -0,0 +1,8 @@
# /telemetry/optics is for streaming (not used atm)
location ~ ^/(restconf|yang|.well-known)/ {
grpc_pass grpc://[::1]:10080;
grpc_set_header Host $host;
grpc_set_header X-Real-IP $remote_addr;
grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
grpc_set_header X-Forwarded-Proto $scheme;
}
@@ -0,0 +1,19 @@
#%PAM-1.0
auth requisite pam_nologin.so
auth [success=1 default=ignore] pam_unix.so nullok
auth requisite pam_deny.so
auth required pam_permit.so
account requisite pam_nologin.so
account [success=1 default=ignore] pam_unix.so
account requisite pam_deny.so
account required pam_permit.so
password [success=1 default=ignore] pam_unix.so
password requisite pam_deny.so
password required pam_permit.so
session required pam_loginuid.so
session include common-session
session optional pam_keyinit.so force revoke
session optional pam_motd.so
+19
View File
@@ -0,0 +1,19 @@
#%PAM-1.0
auth requisite pam_nologin.so
auth [success=1 default=ignore] pam_unix.so nullok
auth requisite pam_deny.so
auth required pam_permit.so
account requisite pam_nologin.so
account [success=1 default=ignore] pam_unix.so
account requisite pam_deny.so
account required pam_permit.so
password [success=1 default=ignore] pam_unix.so
password requisite pam_deny.so
password required pam_permit.so
session required pam_loginuid.so
session include common-session
session optional pam_keyinit.so force revoke
session optional pam_motd.so
@@ -1,2 +1 @@
alias cli='clish'
alias cfg='sysrepocfg -f json'
@@ -6,6 +6,7 @@ alias ls='ls --color=auto'
export EDITOR=/usr/bin/edit
export VISUAL=/usr/bin/edit
export LESS="-P %f (press h for help or q to quit)"
export LESSOPEN="|/usr/bin/lesspipe.sh %s"
alias vim='vi'
alias view='vi -R'
alias emacs='mg'
+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,2 +1,3 @@
net.ipv4.ip_forward=1
net.ipv4.ip_forward_update_priority=0
net.ipv6.conf.all.forwarding=1
+84
View File
@@ -0,0 +1,84 @@
# /etc/syslog.conf - Configuration file for syslogd(8)
#
# For information about the format of this file, see syslog.conf(5)
#
#
# First some standard log files. Log by facility.
#
auth,authpriv.* /var/log/auth.log
#*.*;auth,authpriv.none -/var/log/syslog
#cron.* /var/log/cron.log
#daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
#lpr.* -/var/log/lpr.log
mail.* -/var/log/mail.log
#user.* -/var/log/user.log
#
# Logging for the mail system. Split it up so that
# it is easy to write scripts to parse these files.
#
#mail.info -/var/log/mail.info
#mail.warn -/var/log/mail.warn
mail.err /var/log/mail.err
#mail.*;mail.!=info -/var/log/mail
#mail,news.=info -/var/log/info
# The tcp wrapper loggs with mail.info, we display all
# the connections on tty12
#
#mail.=info /dev/tty12
#
# Some "catch-all" log files.
#
#*.=debug;\
# auth,authpriv.none;\
# news.none;mail.none -/var/log/debug
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
#
# Store all critical events, except kernel logs, in critical RFC5424 format.
# Overide global log rotation settings, rotate every 10MiB, keep 5 old logs,
#
#*.=crit;kern.none /var/log/critical ;rotate=10M:5,RFC5424
# Example of sending events to remote syslog server.
# All events from notice and above, except auth, authpriv
# and any kernel message are sent to server finlandia in
# RFC5424 formatted output.
#
#*.notice;auth,authpriv.none;
# kern.none\ @finlandia ;RFC5424
# Emergencies are sent to anyone logged in
#
*.=emerg *
# Priority alert and above are sent to the operator
#
#*.alert root,joey
#
# Secure mode, same as -s, none(0), on(1), full(2). When enabled
# only logging to remote syslog server possible, with full secure
# mode, not even that is possible. We default to prevent syslogd
# from opening UDP/514 and receving messages from other systems.
#
secure_mode 1
#
# Global log rotation, same as -r SIZE:COUNT, command line wins.
#
#rotate_size 1M
#rotate_count 5
#
# Include all config files in /etc/syslog.d/
#
include /etc/syslog.d/*.conf
@@ -0,0 +1,2 @@
rotate_size 1M
rotate_count 10
@@ -0,0 +1,2 @@
# Log critical and above to console, system likely unusable.
*.=crit;*.=alert;*.=emerg /dev/console
+1 -1
View File
@@ -2,7 +2,7 @@ Reserved facilities for logging in various subsystems:
- local0: rauc
- local1: containers
- local2:
- local2: routing (frr)
- local3:
- local5:
- local6: reserved
@@ -0,0 +1 @@
local2.* -/var/log/routing
@@ -0,0 +1,3 @@
# Skip debug level messages in our /var/log/syslog, we have a dedicate
# debug log instead, as well as facility specific logs, e.g., routing
*.info;auth,authpriv.none -/var/log/syslog
@@ -0,0 +1,5 @@
KERNEL=="sd[a-z]", SUBSYSTEMS=="usb", ACTION=="add|change", RUN+="/usr/libexec/infix/media add %k"
KERNEL=="sd[a-z]", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/usr/libexec/infix/media del %k"
KERNEL=="sd[a-z][0-9]", SUBSYSTEMS=="usb", ACTION=="add|change", RUN+="/usr/libexec/infix/media add %k"
KERNEL=="sd[a-z][0-9]", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/usr/libexec/infix/media del %k"
@@ -1,17 +0,0 @@
#!/bin/sh
# When changing default IPv4/6 settings, this does not apply to
# existing interfaces. This syncs the default settings to all known
# interfaces at boot, such that physical interfaces will start from
# the same point as virtual ones.
tmp=$(mktemp)
sysctl net.ipv4.conf.default >$tmp
sysctl net.ipv6.conf.default >>$tmp
for iface in $(ip -j link show | jq -r .[].ifname); do
sed -e "s/.default./.${iface}./g" $tmp | sysctl -p -
done
rm $tmp
@@ -19,5 +19,5 @@ if [ -z "$OUTPUT" ]; then
fi
umask 0177
echo "$password" | mkpasswd > "$OUTPUT"
echo "$password" | mkpasswd -s > "$OUTPUT"
exit 0
+58
View File
@@ -0,0 +1,58 @@
#!/bin/sh
# User-friendly wrapper for sysrepocfg
# TODO: add import/export, copy, ...
# Edit YANG binary types using sysrepo, base64, and duct tape.
edit()
{
xpath=$1
if [ -z "$xpath" ]; then
echo "Usage: cfg edit \"/full/xpath/to/binary/leaf\""
exit 1
fi
if tmp=$(sysrepocfg -G "$xpath"); then
file=$(mktemp)
echo "$tmp" | base64 -d > "$file"
if /usr/bin/editor "$file"; then
tmp=$(base64 -w0 < "$file")
sysrepocfg -S "$xpath" -u "$tmp"
fi
rm -f "$file"
else
echo "Failed to retrieve value for $xpath"
exit 1
fi
}
usage()
{
echo "Usage:"
echo " cfg CMD [ARG]"
echo
echo "Command:"
echo " edit XPATH Edit YANG binary type"
echo " help This help text"
echo
echo "As a backwards compatible fallback, this script forwards"
echo "all other commands as options to sysrepocfg."
echo
exit 0
}
cmd=$1; shift
case $cmd in
edit)
edit "$1"
;;
help)
usage
;;
*)
set -- "$cmd" "$@"
exec sysrepocfg -f json "$@"
;;
esac
+27
View File
@@ -0,0 +1,27 @@
#!/bin/sh
dir()
{
path=$1
if [ -z "$COLUMS" ]; then
TTY=$(resize)
eval "$TTY"
fi
printf "\033[7m%-*s\033[0m\n" "$COLUMNS" "$path directory"
if [ -d "$path" ]; then
ls -p "$path/"
else
echo "Directory $path does not exist."
fi
echo
}
if [ -d "$1" ]; then
dir "$1"
else
dir "$HOME"
dir "/cfg"
dir "/log"
fi
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
# 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 "$@"
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
case "$1" in
*.gz)
zcat "$1"
;;
*)
cat "$1"
;;
esac
-1
View File
@@ -1 +0,0 @@
less
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
# -d ;; suppress error message "the terminal is dumb"
# -F :: exit if the entire file can be displayed on the first screen
# -I :: Ignore case, even for patterns
# -K :: exit immediately when an interrupt character (usually ^C) is typed
# -R :: Almost raw control charachters, only ANSI color escape sequences and
# OSC 8 hyperlink sequences are output. Allows veritcal scrolling
# -S :: lines longer than the screen width are chopped (truncated), not wrapped
# -X :: No termcap initialization and deinitialization set to the terminal.
# This is what leaves the contents of the output on screen.
export LESS="-P %f (press h for help or q to quit)"
less -RISKd -FX "$@"
+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

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