Compare commits

...
541 Commits
Author SHA1 Message Date
Tobias Waldekranz 1854bca98b [DEBUG] Debug image settings 2024-04-19 14:18:11 +02:00
Tobias Waldekranz 00261fb120 [DEBUG] Increase critical temperature trip point to 115C
For testing purposes.
2024-04-19 14:13:25 +02:00
Tobias Waldekranz 4a69d1564d [DEBUG] Add temperature related load and monitoring scripts
Also enable the required packages.
2024-04-19 14:13:25 +02:00
Mattias Walström 0c917ab37e Revert "Change toolchaing from bleeding edge => stable"
This reverts commit 66ec55b7e8.

Whit this, crun failed in mysterius ways. Revert to bleeding edge.
2024-04-16 12:47:16 +02:00
Mattias Walström 8c9c432847 Add a new packet python-statd
Actually a part of statd, but had to make
a separarate package to get it to work.

Statd helper-scripts are now pre-compiled instead of doing it
in runtime.

Fixes #379
2024-04-16 12:47:16 +02:00
Mattias Walström 635acd504f Update Changelog for upcoming release 2024-04-16 12:47:16 +02:00
Mattias Walström 204e681b3a buildroot: Backport new package poetry-core 2024-04-16 12:47:16 +02:00
Mattias Walström 4f40db6ee8 confd: Infer VID when create a VLAN interface called vlan<vid>
This fixes #391
2024-04-16 12:47:16 +02:00
Mattias Walström 82236b7f5a confd: Fix memory leak on candidate config changes 2024-04-16 12:47:16 +02:00
Mattias Walström 5e9975f4c9 YANG: Allow any name for a routing protocol instance
Remove old limitation that only allow default

Fixes #369
2024-04-16 12:47:16 +02:00
Mattias Walström d3e653d480 Change toolchaing from bleeding edge => stable
This fixes #383
2024-04-16 12:47:16 +02:00
Joachim Wiberg e06bcb64a5 configs: run Finit getty on @console instead of /dev/console
The Finit @console construct detects what your actual serial console is
by looking it up in /sys/class/tty/console/active.  This to avoid any
weird problems that might occur when using /dev/console.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg c5015faafe dnsmasq: only listen on loopback :53, as local resolver
Even though dnsmasq only listened to requests from 127.0.0.1, port 53
was visible using nmap.  We only use dnsmasq as a local resolver, so
we can safely change the config to bind to loopback instead, and at
the same time get less noise from nmap scans.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 76cf464a01 ttyd: run on 127.0.0.1:8801 to allow nginx on 0.0.0.0:7681
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg e5e97719e8 board/common: override default nginx landing page
This commit adds a landing page, generated from the top README.md.  It
is a temporary fix before adding a proper web ui.

Run ./gen.sh from the directory to update index.html using the template.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 9605252be8 package/mdns-alias: replace with lightweight C daemon
The replacement is a complete rewrite in C using the Avahi client API.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 34fa6a327d confd: refactor, stop announcing netbrowse cname when disabled
Refactor mDNS service record generation for improved control of
announcing services.  All to add support for modifying the cname
aliases we announce.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 551f1ae548 libsrx: two new helpers, unquoute() and fgetkey()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 76c8c69231 confd: refactor, relocate mdns record generation to infix-services
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 4ad2948b9b confd: add deviation for /system/hostname, max 64 chars on Linux
Both IETF and POSIX allow longer hostname, 253 and 255, which Linux does
not support.  Since Linux 1.0 the maximum has been 64 US-ASCII characters.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 0c0b7f0532 confd: introduce secondary/monitor change callbacks
These callback are not the primary responisble for the property, but
want to be informed of any changes.  E.g., /system/hostname changes
should also update the adminurl in all mDNS records.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 4ae641d65f confd: refactor services stop/start and add web netbrowse
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg da67ea3695 libsrx: factor out new function lydx_vdescend()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 8bf78c2fbb board/common: relocate mkcert and fix openssl v3 x509 output
Not for public consumption.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg b3bb8a3075 confd: enable/disable nginx servers using available/enabled symlinks
Relocate all nginx .conf files to board/common/rootfs/etc/nginx/ and
introduce available/*.conf with symlinks to enabled/*.conf

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg fdf3056a93 board/common: add fallback to tcg acceleration in make run
Align both qemu targets for 'make run' to use kvm with tcg as fallback
and -cpu max instead of guessing.  This allows running Infix on systems
that do not have, or do not allow, kvm acceleration.

This is a temporary fix before we refactor 'make run', see issue #388

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 6bf1c346d7 doc: start documenting tools/services needed for testing Infix
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 4acfec3d41 test/console: fix dut port detection
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg acef9aecde test: replace hard-coded 'podman' with discovered $(runner)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg e18ddcf0c8 test: disable web server for container tests
The container tests utilize the bundled curios-httpd, which clashes with
the new web services provided by nginx.  So we need to disable it while
testing all the containers.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg efec5f57cd confd: make web server and web console interface configurable
This commit adds an initial YANG model for Infix web services under the
infix-services.yang umbrella.  For now the nginx server statements in
/etc/nginx/nginx.conf are always on, but the backend ttyd, and the
entire nginx server can be disabled.

The default in the YANG model for both is disabled, the factory-config
has been updated to enable these services by default.

The Web Console Interface mDNS service has been updated to advertise
on port 7681, which nginx is set to forward to ttyd.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg fc7d9bacac board/common: enable ttyd, web console app
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 874873e727 board/common: add nginx HTTPS server, with dependency on mkcert
Refactor setup to automatically redirect http -> https, dropping
the /browse location for now.

Also, log to syslog, which has log rotation.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 28cf5525bf board/common: add mkcert, generates self-signed HTTPS certificate
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg d1fe3b1311 confd: generate mDNS service records on hostname changes
This commit implements Infix mDNS TXT records, version 1, for available
services.  Hard coded for the moment.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg b33294950f netbrowse: prestudy of available txt records, use adminurl for Infix
This commit includes a small prestudy, done over a period of two weeks,
to gather information about common txt records used by hosts.  The most
well-documented is the Apple Printing Spec, which among other things
defines adminurl.  A proposed version 1 of the Infix txt record spec is
included in the document.  I'm recommending alternative 2:

"vv=1" "vendor=Qemu" "product=VM" "ty=x86-64" "vn=KernelKit" "on=Infix" "ov=v24.03.0"

Including this information would enable quickly scanning a network to
see if the latest version of the software has been deployed.  Please
note, I've not included the U-Boot firmware version in this proposal,
but it could be included as "vs=2023.10-kkit3", or similar.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 92d3db46a7 netbrowse: convert to gunicorn and factor out mdns-alias app
Converting to gunicorn, which is the recommended production server for
Flask apps, means app main() function is no longer called at startup, so
we have to factor out the mDNS CNAME functionality for infix.local and
network.local to a separate app.

We take this opportunity to collapse the structure, move non-class
methods to __init.py__, and rename the AvahiAlias class.  A prototype
for replacing the overhead of mdns-alias with a C daemon is in its
early stages.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 5d128d74f5 netbrowse: migrate from setup.py to pyproject.toml
This change also requires another restructure for netbrowse itself, hence
the relocation of files in the tree.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg d2b370b44d netbrowse: open links to mDNS hosts in new tab
Also, disable debug logging.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg eef60de999 netbrowse: add cool little favicon
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 83d18eb988 netbrowse: convert to jinja2 templates and address review comments
- Convert to use jinja2 templates instead of HTML/CSS inline
 - Address review comments:
   - Support for a foldout of details with link being key
   - Support for a Show All checkbutton
 - Styling and neat background by kjpargeter[1]

[1]: https://www.freepik.com/free-vector/network-connections-background_2533758.htm

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 64d63c08df netbrowse: convert to flask
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 282e7b08a3 netbrowse: drop misc services, keep http/https, ssh/sftp, netconf
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg bff0417be8 confd: reload netbrowse on hostname changes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg c1836af7cc package/netbrowse: new package
- Advertises the build-time $hostname.local as a CNAME to the A and
   AAAA records already advertised by Avahi
 - Advertises a special network.local CNAME and provides a fastcgi
   service on unix:/tmp/netbrowse.sock for browsing mDNS services

This commit also activates netbrowse by default with nginx listeing
to port 80 on IPv4 and IPv6 /browse by default but also / if called
with server name network.local.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg 1a99118a78 cli: ensure admin user can scp to & from /cfg/startup-config.cfg
With an increase in requests to confine users to the CLI, access using
SSH/SCP/SFTP to the configuration is becoming more and more important.
The admin role in Infix is mapped to the UNIX group 'wheel', meaning we
want all users in that group to be able to read and write files with
that ownership.

This patch fixes the initial ownership of startup-config, and /cfg, and
ensures the copy command in the CLI retain wheel group permissions.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 15:36:41 +02:00
Joachim Wiberg c3e3a58af0 package/k8s-logger: bump to v1.4
This fixes the 100% CPU load issue seen when stopping containers.

For details, see https://github.com/kernelkit/k8s-logger/releases/tag/v1.4

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-15 13:36:39 +02:00
Joachim Wiberg 280190ac24 confd: drop redundant (and wrong) strlcpy(), found by Coverity Scan
The new strdupa() code handles copying the new->xpath.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-12 07:54:05 +02:00
Joachim Wiberg e612014662 configs: fix obvious mistake when dropping board/netconf for common
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg a4a1673f0f board/common: add route by named protocol
As the UNIX gods originally intended.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg c4d436a2fd board/common: drop unused schema mount
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg 985a76c567 patches/clixon: drop, unused since migration to sysrepo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg 5ac7899f37 package/finit: relocate local patches so they show up in pkg-stats
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg 1a5224481d package: add missing upstreal url to local packages
Mandatory per packaging guide https://nightly.buildroot.org/#_config_files

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg 5653f298df Update ChangeLog for next release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg 140379190c confd: fix segfault when calling 'no dhcp-client'
Fixes #384

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg c182fd43a8 .github: add sbom to list of release artifacts
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg b55f74395b board/netconf: simplify and relocate to board/common
With Classic builds out of the way we can move everything back to common
again to simplify and reduce our collective cognitive overhead a bit.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg 493be97769 Drop legacy Classic builds
The Classic builds served for a while as an introduction to classic
embedded systems, with a user managed read-writable /etc.  Today we
decided to firmly take the plunge into the future with NETCONF and
focus on our core platforms aarch64 and x86_64 (for Qemu).

The reasons are several: reduce overhead, simplify build and release
work, as well as manual testing, since Classic builds do not have any
automated regression testing.

The Classic builds may be resurrected later in a dedicated project.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg d34e852574 Hook into toolchain-external for legal-info extraction
External pre-built toolchains are usually distrubuted as binary-only and
currently (Buildroot 2023.02) do not have a license file.  Infix use the
Bootlin toolchains, built from Buildroot, which contains a summary.csv
file with all packages, and licenses, used.

This commit adds that csv, under the name toolchain-external-bootlin.csv,
to the legal-info output directory.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg 14418725f4 Wrap Buildroot 'legal-info' build target to include Linux license
When building a Linux kernel that does not match the latest kernel known
by Buildroot, the license file is disabled and nothing is extracted.
For an introduction to this see Buildroot gaf33b1c.

To work around this in Infix we wrap the 'legal-info' build target to
set the license file variable and trigger the license extraction anyway.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg bb498043e4 test: bump version of bundled sample container image
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg a313ea354c package/curios-httpd: bump to v24.03, add license file + hash
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg ab777333dc package/libsrx: add LICENSE hash
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg b5103b216e package/statd: add LICENSE hash
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg 9b7c977c82 package/execd: add LICENSE hash
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg 014eb0a98e package/confd: add LICENSE hash
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Joachim Wiberg 512da8c3f3 package/keyack: add missing license file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-11 06:19:07 +02:00
Mattias WalströmandJoachim Wiberg cc8221a22a Refactor cli-pretty for show bridge mdb 2024-04-09 20:22:26 +02:00
Joachim Wiberg 50359b0808 statd: filter mdb entries per vid *and* bridge
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-09 20:22:26 +02:00
Joachim Wiberg daa57a8a69 package/mcd: bump to v2.1
For details, see https://github.com/kernelkit/mcd/releases/tag/v2.1

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-09 20:22:26 +02:00
Joachim Wiberg a48edc74d8 statd: always use mctl -p (plain) output mode
The plain output mode prevents garbled JSON output due to the built-in
pretty-printer in mctl.  Fixed in v2.1

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-09 20:22:26 +02:00
Joachim Wiberg c7e8b8f33d confd: bump infix-if-bridge version and add revision
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-09 20:22:26 +02:00
Mattias Walström 4f6b810cc2 Remove patches/sysrepo-plugin-system
Not used anymore
2024-04-09 19:38:39 +02:00
Mattias Walström 1caedbfe6f Upgrade to buildroot 2024.02 2024-04-09 19:38:39 +02:00
Mattias Walström f6f52bcf16 Upgrade qeneth to change the root= argument to the kernel
Instead of /dev/ram, use /dev/ram0
2024-04-09 19:38:39 +02:00
Mattias Walström 6a84f334db Remove packages already inside buildroot 2024-04-09 19:38:39 +02:00
Mattias WalströmandJoachim Wiberg 320410b950 yanger: Allow manufactering date to be day 1-9
When the day of month is 1-9 the format did not match the
yang model
2024-04-06 13:00:13 +02:00
Mattias WalströmandJoachim Wiberg c72bc34df1 test: Add test for static multicast filters 2024-04-05 15:34:21 +02:00
Mattias WalströmandJoachim Wiberg f9e9822b52 Implement MDB and IGMP status in operational 2024-04-05 15:34:21 +02:00
Mattias WalströmandJoachim Wiberg b350483617 Always enable coredumps
They will be availible in /var/crash/ (maximum one per process name)
2024-04-05 15:34:21 +02:00
Joachim WibergandTobias Waldekranz 84c32ac435 kernel: import drop initial multicast filtering delay
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-05 11:01:28 +02:00
Mattias Walström 3d376dc57f Update changelog for multicast filters. 2024-04-04 17:27:11 +02:00
Mattias Walström 81745a1625 Add configuration of static multicast entries
Both L2 and L3 is supported.

With VLAN-filtering:
admin@infix-00-00-00:/config/interface/br0/> set bridge vlans  vlan 1  multicast-filter 224.1.3.4 ports e0

Without VLAN-filtering:
admin@infix-00-00-00:/config/interface/br0/> set bridge multicast-filter 224.1.2.3 ports e0
2024-04-04 17:27:11 +02:00
Mattias Walström c7ab09cb73 infix-if-bridge: Major refactor regarding multicast
- Rename mdb -> multicast-filters
- Add support for L2 multicast groups
- Change vlan, multicast and mulitcast-filters containers to presence
  containers. This will result in that snooping will be disabled when
  creating a bridge (or a vlan if vlan-filtered)
- Force the user to choose between VLANs and Multicast on top level bridge configuration
- Force L2 multicast to be state permanent
2024-04-04 17:27:11 +02:00
Tobias WaldekranzandJoachim Wiberg 080dc6b591 kernel: Import PHY startup fix and 6393 indirect access improvements 2024-04-04 13:40:53 +02:00
Tobias WaldekranzandJoachim Wiberg e32334cc4a utils: kernel-refresh.sh: Fix sourcing kernel version from config
Off-by-one :(
2024-04-04 13:40:53 +02:00
Joachim Wiberg 3c75608839 klish-plugin-infix: allow absolute UNIX paths in copy command
If an absolute path contains '../' we disallow it because what are you
doing, possible security violation.

Built-ins for running, startup, etc. remain as-is.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 1dcbea52b9 confd: handle ip/route additions to container networks at runtime
On any change to a container network interface we should schedule a
restart of the container to activate the changes.  This code triggers
also at boot, when applying the whole startup-config, which initctl
handles by queuing any create/touch events for services.

This patch depends on the two previous commtis backporing fixes to
Finit's initctl tool and an upgrade of the k8s-logger.

Fixes #375

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 1baa1c5716 package/k8s-logger: bump to v1.3
Fixes issues with logger not exiting gracefully on signals (at all)
and busy-looping on stale FIFO.

Related to issue #375

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 34203db00a patches/finit: backport upstream fixes to initctl
Patches in queue for upcoming v4.8 release of Finit fixes:

 - initctl touch does not respect -n flag, returning error
 - initctl touch does not support template services

Related to issue #375

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg f47da7c249 doc: spice up breaking-out-of container security warning
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 817ec4675b doc: focus on Infix defaults
That factory-config and failure-config can be overridden by customer
specific requirements is documented in the branding document.  Focus
on Infix native defaults in general documentation.

Move most of customer specifics to foot note.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg d86374e8fa doc: rephrase how factory reset condition is detected
Also, untabify

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg cb0fdc0ab4 doc: factory-config is generated at boot, every time
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 7828636dd7 doc: when logging in you now land in UNIX shell by default
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 3611d881ff doc: untabify OCI example and add missing newline to output
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 05af71eafe doc: update changelog for v24.03
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 596edd23aa confd: minor, whitespace
Add whitespace for readability, and as hinted by in the kernel coding style.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 761fae8d03 confd: fix "no bridge-port" regression from 4bfedf7a9
In 4bfedf7a9 support for disabling IPv6/IPv4 link-local addresses was
added, which in turn caused this regression.

Regression in the v24.03 release cycle, not released -- low severity.

Fixes #353

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 84c28aab00 src: ensure 'make dep' is called first for 'make check'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 528671c4cd confd: save updated system time also to RTC
Fixes #367

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 814d5f6a4d test: update "show interfaces" template, bridge now has ethernet mac
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg efc4ea20d6 test: update .PHONY rule after test-unit relocation
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg d112f0bb29 statd: xlate LOWER-LAYER-DOWN -> LOWER-DOWN in CLI "show interfaces"
Translate LOWER-LAYER-DOWN -> LOWER-DOWN in "show interfaces" overview
and keep LOWER-LAYER-DOWN in detailed "show interfaces name eth0".

Issue #358

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg b400a6aaa9 statd: restore MAC address for bridges in CLI "show interfaces"
Fixes #358

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 24ce5cbc62 .github: clean up unused containers and images before starting
Error: error creating container storage: the container name "infamy0" is already in use by "2011c2d7cb1737b788b854a8bd08e519f3cbd6e36dae4975784978cff1f238fc". You have to remove that container to be able to reuse that name.: that name is already in use
make[1]: *** [/home/github-runner/actions-runner/_work/infix/infix/test/test.mk:6: test-unit] Error 125

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg ae86473675 Update ChangeLog for upcoming v23.03 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg ea3bfda2de board/common: fix issue where containers without network get network
Also, log the actual `podman create` arguments to the container log so
we can see what the script actually does when customers report bizarre
happenings with containers.

Fixes #370

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg fad75575e4 confd: add limited support for container capabilities
This change adds limited support for container capabilities.  It allows
a more fine-grained control than priviliged mode does.

Fixes #365

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg da56c95930 doc: add advanced section to container document
Fixes #361

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg ea956026da doc: use same prompt 'admin@example:/>' as other documentation
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 9575e03dc9 board/common: fix container upgrde for oci-archive:/ images
Add exception for local images, the "pull" step must be handled by the
operator, i.e., wget of the latest image to the same location as set up
in the image configuration, e.g., for oci-archive:/tmp/foo.tar.gz that
/tmp/foo.tar.gz exists when issuing the upgrade command.

Fixes #368

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg dd5ace4d3f doc: add system Introduction about *-config and failure modes
Fixes #360

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 74dd8d3644 doc: add section on Container Images and update container upgrade
OCI archives are a bit special.  Mention how to load, reference, and
upgrade system using such images.

Fixes #368

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 431805c1cd doc: add default route example for static container interfaces
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Joachim Wiberg 662719a47f confd: fix static routes from container host interfaces (static)
In a host interface setup, i.e., moving an interface from the host to a
container, often using VETH pairs, any route should only be set when an
IP address has been set.  This because the CNI ipam plugin, which we
use, require routes be part of ipam, which in turn requires an address.

For details, see <https://www.cni.dev/plugins/current/ipam/static/>

Fixes #366

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-04-03 16:08:37 +02:00
Tobias WaldekranzandJoachim Wiberg 3a73ce3cfb kernel: Import EtherType based priority override support 2024-03-25 15:00:22 +01:00
Tobias WaldekranzandJoachim Wiberg 7574ad864d utils: kernel-refresh.sh : Automate refreshing kernel patches 2024-03-25 15:00:22 +01:00
Joachim Wiberg c9d4105d85 Add status badge for Bob
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-23 09:58:13 +01:00
Joachim Wiberg b6d661e40b confd: fix invalid printf argument, found by Coverity Scan
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-23 09:54:23 +01:00
Joachim Wiberg 12ab32c9d2 confd: fix resource leak, found by Coverity Scan
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-23 09:54:01 +01:00
Joachim WibergandTobias Waldekranz e140d5917a klish-plugin-infix: add "show ip multicast" command
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-22 13:15:35 +01:00
Joachim WibergandTobias Waldekranz c16f8890a5 confd: adapt bridge multicast support to mcd v2.0
All querier functionality for IGMP now handled by mcd, even if there are
no VLAN interfaces on top of the bridge.  Also, mcd now handles unique
query interval per interface, or per VLAN, so we no longer need multiple
daemons running.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-22 13:15:35 +01:00
Joachim WibergandTobias Waldekranz 793cff3d2f package/mcd: bump to v2.0
For details, see https://github.com/kernelkit/mcd/releases/tag/v2.0

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-22 13:15:35 +01:00
Joachim WibergandTobias Waldekranz a4176ce4d0 klish-plugin-infix: fix copy-paste in "show bridge vlan" command
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-22 13:15:35 +01:00
Joachim WibergandTobias Waldekranz 3ebbd0bf4f confd: handle small changes to bridge port properties
This patch adds support for small incremental changes to bridge ports.
Changes where the libyang diff does not include a bridge reference so
that it will have to be synthesized from the current configuration.

For example, forgetting to set a port's PVID in a VLAN filtering bridge
setup, changing a bridge port's multicast flooding properties, or any
other per-bridge-port setting after the fact.

Fixes #349.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-22 13:15:35 +01:00
Joachim WibergandTobias Waldekranz ce2e15e4d2 libsrx: new function, traverse the void to find an interface
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-22 13:15:35 +01:00
Tobias WaldekranzandJoachim Wiberg 29158ed2ef doc/container: Fix dead links in table of contents
[skip ci]
2024-03-22 08:20:12 +01:00
Tobias WaldekranzandJoachim Wiberg 25d7b84bde doc/qos: Start to document default QoS policy of mv88e6xxx
[skip ci]
2024-03-22 08:20:12 +01:00
Joachim Wiberg 3867db633b doc: new document, Scripting Infix
Some common remote commands that do not use XML or NETCONF.

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-22 05:34:36 +01:00
Joachim Wiberg d9cf3adaff package/klish-plugin-infix: disable 'shell' access from CLI
After the pivot from having the CLI as default login to Bash (for remote
scripting and production purposes) there is no need for "user friendly"
access to a UNIX shell from the CLI.  This provides the possiblity of
limiting users to only the CLI, e.g. a user with only guest or operator
privileges.

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-22 05:34:36 +01:00
Joachim Wiberg 3f06e107f6 doc: initial System Configuration user guide
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-22 05:34:36 +01:00
Joachim Wiberg 2b81f34fcd doc: cleanup and harmoize yang model linking
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-22 05:34:36 +01:00
Joachim Wiberg 2eb487ebcd doc: refactor, let first page be table of contents
- Drop doc/README.md symlink to variant.md
 - Make doc/README.md the table of contents
 - Clean up variant.md, OSPF and containers now fully supported

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-22 05:34:36 +01:00
Mattias WalströmandJoachim Wiberg b2fef1585f Change to self-hosted runner 2024-03-21 09:17:07 +01:00
Tobias Waldekranz 69c2ffcc5f doc: Note kernel upgrade in ChangeLog
[skip ci]
2024-03-20 14:41:25 +01:00
Tobias Waldekranz 2bd3b508ee kernel: Bump to 6.6.22 + kkit-linux-6.6.y 2024-03-20 14:41:25 +01:00
Mattias Walström 3a740ff049 Build python cryptography
Required to generate certificate with specific start/end date

Not possible to do with openssl (mentioned as bug in manpage)
2024-03-20 14:19:52 +01:00
Mattias Walström a0f09a1c06 Add script that generates a certificate with unlimited expiredate
Primary use is to generate default HTTPS certificate.

Sample usage:
/bin/gencert --country SE --state Vastmanland --city Vasteras --organisation ACME --organisation-unit Second  --common-name switch.local --out-certificate /tmp/out.cert --out-key /tmp/out.key
2024-03-20 14:19:52 +01:00
jovatnandGitHub 4b7c97083f Update networking.md
Updating VLAN interface doc inline with current implementation

Mathias has fixed the syntactic sugar when creating eth0.20 interfaces, thus the associated documentation example is updated accordingly.
2024-03-20 13:57:11 +01:00
Tobias Waldekranz 873de8d0b7 board/netconf: Properly format disks of non-MiB-aliged sizes
awk(1) will dutifully represented the size as a float, but test(1) was
not at all amused.
2024-03-19 15:07:44 +01:00
Tobias WaldekranzandJoachim Wiberg f1b8599afb buildroot: bump to latest kkit branch for mdio-tools upgrade
Needed to correct mvls operation on newer kernels.
2024-03-19 14:27:18 +01:00
Mattias Walström d9ffff2b5a cli-pretty: Refactor to not take model as argument
Instead focus on the task to do 'show hardware', 'show interfaces' and more,
this to make it more logical.
2024-03-18 16:32:18 +01:00
Tobias WaldekranzandJoachim Wiberg 3519f748e5 board/aarch: styx: Fix SERDES connection to management CPU
Only port 2 has an SGMII compatible SERDES. When referencing the
SERDES (comphy), the second argument must contain the port number in
order for the comphy driver to pick the correct configuration.
2024-03-14 19:55:01 +01:00
Joachim Wiberg 68fac03f09 patches/finit: resync hwrng support and tmpfiles.d logging fix
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-13 12:08:54 +01:00
Tobias Waldekranz 8bd8195660 kernel: Import fix for 6393X PPU initialization timeout 2024-03-13 11:01:15 +01:00
Tobias Waldekranz 8fa910e8d9 klish-plugin-infix: Prettify 'show ip brief'
- Version sort interfaces ("e2" is listed before "e10")
- Remove "@dsa" from switch interfaces
2024-03-13 11:01:15 +01:00
Tobias Waldekranz 2e3d8881cc test: Allow unit tests to be run from non-x86 builds
Since there is no dependency on anything being built, move the
test-unit target to an architecture-neutral location.
2024-03-13 11:01:15 +01:00
Tobias Waldekranz 4e93e35c86 statd: cli-pretty: Version sort interfaces
Before this change:

e1
e10
e2
...
e9

After this change:

e1
e2
...
e9
e10
2024-03-13 11:01:15 +01:00
Tobias Waldekranz 736a23ccae probe: Fix crash on systems without USB
While __get_phandle_array returns the empty set when the property is
not available, str_array would return None, unless instructed
otherwise. Make sure that it also returns the empty set.
2024-03-13 11:01:15 +01:00
Tobias Waldekranz d602e48d0f patches/uboot: Sync with u-boot-2023.07.y-kkit for multi-chip fixes
- Add upstream patch that fixes multi-chip management in the mv88e6xxx
  driver

- Fix detection of 6393X in multi-chip configuration
2024-03-13 11:01:15 +01:00
Tobias Waldekranz 592f89e1f7 board/aarch64: styx: Initial device tree 2024-03-13 11:01:15 +01:00
Tobias Waldekranz 2a1c3010f8 board/aarch64: cn9130: Specify XMDIO clock names
This lets the driver adjust the clock according to the rate specified
in the device tree.
2024-03-13 11:01:15 +01:00
Joachim Wiberg 049f8d18f9 confd: only start mcd if there is a VLAN upper on the bridge
Temporary fix to prevent odd log messages.  The fix is to add RAW VLAN
support to mcd so it can run as a proxy querier even if there is no
upper VLAN interface or IP address.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-13 10:24:02 +01:00
Joachim Wiberg 65d393d491 Update ChangeLog, issue #328
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-13 10:24:02 +01:00
Joachim Wiberg 7230c3532a confd: improve bridge port validation for VLAN filtering bridges
This patch adds validation of bridge port VLAN memberships and IP
addressing for VLAN filtering bridges:

  1. Ports must be a member of this bridge
  2. Ports cannot be tagged and untagged member at the same time
  3. A VLAN filtering bridge does not support IP addressing

A VLAN filtering bridge can only be a tagged member of a VLAN.  Any IP
addressing needs to be done using an upper VLAN interface.

NOTE: while technically possible break up these long must expressions
      into multiple must expressions per node (split at 'and'), it will
      break libyang in interesting ways that in turn make the confd
      inference functionality stop working.  E.g., creating VETH pairs.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-13 10:24:02 +01:00
Joachim Wiberg 21fd1e9442 Fix #328: drop default value for bridge-port PVID
A bridge port in a VLAN filtering bridge should be possible to configure
as "tagged only", i.e., to not assign ingressing untagged frames a VLAN
and instead drop them.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-13 10:24:02 +01:00
Joachim Wiberg 11c862bbd5 doc: nftables container fixes
- Must run in privileged mode
 - Fix copy-paste container name: system -> nftables
 - Point out the important settings

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-12 11:34:11 +01:00
Joachim Wiberg 88ca959a61 doc: update container documentation, set -> text-editor
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-12 11:21:10 +01:00
Joachim WibergandTobias Waldekranz b4690f3850 statd: skip container interfaces in status output, for now
This patch prevents statd from failing and logging errors on interfaces
currently in another network namespace.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-12 09:26:23 +01:00
Joachim WibergandTobias Waldekranz 8ca2d74566 confd: ensure we always return cni status
This patch fixes a runtime error triggered by modifying an interface
currently used by a container.  The CNI code must always return the
CNI status (reserved for container or not).

How to trigger:
 - Create veth pair
 - Make one end container-network and add to container
 - Leave
 - Return to configure and set an IP address on container interface
 - Leave - BOOM

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-12 09:26:23 +01:00
Joachim WibergandTobias Waldekranz 8ea9dd2c55 patches/finit: backport random seed and rtc fixes
- rtc, already does the best it can, fix occasional duped message
 - urandom, check if seed file empty, try using hwrng

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-12 09:18:38 +01:00
Joachim WibergandTobias Waldekranz 938230c103 patches/finit: reboot-hang-fix and improved bootstrap log message
Backports of fixes for two issues:

 - Finit sometimes locks-up without input on serial console on reboot
 - Improved logging of unsupported initctl commands at bootstrap

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-12 09:18:38 +01:00
Joachim Wiberg 6f185cdfb5 confd: refactor gen-interfaces for hybrid bridge/iface setups
Simplify interface generation by collapsing eth_ and ethlike_ifaces to a
single list.  Let gen_iface_json() determine interface type by querying
each interface.  This allows us to create bridge setups also for qemu
use-cases.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-11 14:37:49 +01:00
Joachim Wiberg 5faefb2b51 doc: adjust image spacing
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-10 16:15:34 +01:00
Joachim Wiberg e8c54b190d doc: add introduction and minor spellecheck
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-10 16:02:27 +01:00
Joachim Wiberg b8f8d50fa6 doc: update images for better color contrast on white/dark bg
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-10 13:26:51 +01:00
Joachim Wiberg 8437a17353 doc: refactor container documentation slightly
Drop all mention of "CNI" and update text to not use, e.g., `cni-bridge`
when this was changed in the model before the merge to main.

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-10 11:58:23 +01:00
Joachim Wiberg 5b7d6c9b65 doc: document VETH pairs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-10 11:51:18 +01:00
Joachim Wiberg ad9060e99c confd: minor, grammar fix
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-10 11:37:17 +01:00
Joachim Wiberg 857e028730 doc: minor, whitespace only
Fill paragraphs to fit standard width.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-10 11:36:35 +01:00
Mattias WalströmandJoachim Wiberg 5ced70435b Replace querierd with mcd in defconfigs 2024-03-09 11:58:40 +01:00
Joachim Wiberg 32635364aa package/mcd: new package, replaces querierd
Update all package references and confd:ietf-interfaces

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-09 11:58:40 +01:00
Joachim WibergandMattias Walström f2cc620941 confd: restrict mdb group to iana-rt-types:ip-multicast-group-address
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström 65fd68797b patches/iproute: backport bridge mdb replace support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Mattias Walström 89bcf7346f test: igmp_basic: Speed up test and some renaming
Rename to more distinct names for netns and hostports
2024-03-07 12:45:55 +01:00
Mattias Walström f91d36b8d1 test: igmp_vlan: Speed up test significantly
Remove a lot of extra sleeps.
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström b19047e320 confd: detect bridge per-VLAN interfaces and start querierd
In a VLAN filtering bridge setup we want to be able to support an
external IGMP/MLD querier running from userspace, because the bridge
multicast code can only generate proxy/NULL querys per VLAN.

This patch is a refactor to allow just that.  If a VLAN on the bridge
has an upper interface, matching the bridge name and VID, we generate
a profile for querierd and enable the service.

For all other cases we try to disable any running querierd.  It is up
to the daemon to figure out if it has a usable IP address to use as
the query source IP or use 0.0.0.0.

Since the logic for selecting a proper IP address must be handled by
the daemon in the per-VLAN setup, we revert back to also use it for
the stand-alone unfiltered bridge case as well.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström 944024f394 package/querierd: add per-interface service template
Since Infix supports per-VLAN querier parameters, like query interval,
we currently need to run a separate querierd per VLAN interface.  The
replacement, mcd, will handle this automatically in its .conf file.

Also, ensure we install the daemon configuration file as an example, and
thus creating the /etc/querierd/ directory for where .conf files for
each interface will be generated.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Mattias Walström 400ae6ce1c test: Add new test igmp_vlan and add igmp tests to suite 2024-03-07 12:45:55 +01:00
Mattias Walström 43d67044d0 test: igmp_basic: speed up test, remove unnecessary long timeout
And cleanup ASCII picture
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström cb0954ec19 confd: always flood unknown IP/MAC multicast according to mcast_flood
An RFC conforming multicast snooping bridge should forward all unknown
multicast (IP & MAC) on ports where the mcast_flood flag is set.  The
upstream kernel does not (yet) support this, but the KernelKit branch
of the kernel and iproute2 now support it.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström 798602d087 patches/iproute2: add support for bridge mcast_flood_always
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström 967d951231 patches/linux: ignore router ports when forwarding MAC multicast
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström 2202555b28 patches/linux: forward port bridge flood unknown multicast
This is a forward-port of one of my bridge patches to handle RFC4541
style flooding of unknown multicast.

https://lore.kernel.org/netdev/20220411133837.318876-9-troglobit@gmail.com/

Changes since this thread: use inferred mctx (VLAN multicast context)
from br_handle_frame_finish() and br_dev_xmit(), which should fix the
per-VLAN multicast handling issue pointed out by Nikolay.

Todo before next patch series, add new option instead of breaking the
existing functionality for the current mcast_flood flag.  E.g., add a
mcast_flood_always, since the current flag stops flooding when there is
a known querier on the LAN.

See the above thread for details.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström cde9feadd7 test: allow test container to run tcpdump (cap-net-raw)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström 4bfedf7a98 confd: disable IPv4LL & IPv6LL on bridge port interfaces
A bridge port cannot communicate on layer-3 while acting as a bridge
port.  Removing the port from the bridge re-enables the link-local
addresses, if any, from the configuration.

Fix #327

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Mattias Walström c21f37c241 test: add new test igmp_basic
Simple test that tests (without VLAN):
* Multicast flooding works
* Join works as expected
2024-03-07 12:45:55 +01:00
Mattias Walström d0485fb077 test: Add a new topoligy to test IGMP
With 3 data connections between host and DUT.
2024-03-07 12:45:55 +01:00
Mattias Walström 68af24adcf infamy: Add new class to test multicast
Depends on having mtools v3+ on test PC, so add it to the docker.
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström 12eae1ec2b confd: initial mdb support, per bridge and per VLAN
Note, no VLAN id, or other VLAN specific information is contained in the
MDB entries, only forwarding information and per-port state.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström ec3b08524c confd: add support for bridge port flooding control
This patch adds BUM flooding control per port.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström 6d65eff33d confd: improve debug messages, include ifname everywhere
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström afdc6fe582 confd: disable bridge's dumpster diving when vlan filtering
With VLAN filtering on a bridge we cannot use the mcast_query_use_ifaddr
mechanism.  This because even if the bridge may have an address it is
likely not on the same subnet as that of the VLAN, and the multicast
code in the kernel does not look at VLAN interfaecs on top of bridge
for a relevant adddress.

For these cases we have to use querierd, or a multicast router.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Joachim WibergandMattias Walström 1782b12514 confd: initial multicast filtering support for bridge model
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-07 12:45:55 +01:00
Mattias WalströmandJoachim Wiberg c5d53d10a4 yang: Bump infix-routing revision 2024-03-06 18:39:27 +01:00
Mattias WalströmandJoachim Wiberg 28846dd332 Fix inconsistent naming in infix-routing model
in container: default-route-advertise
Obsolete leaf: enable
Add new leaf: enabled

enable is preferred if exist, else it use enabled.

Also update klish-plugin-sysrepo to not show the obsoleted node
in autocompletion.

This fixes #331
2024-03-06 18:39:27 +01:00
Joachim Wiberg e8ff54cb67 Revert "confd: check return value on failure to read pvid from a bridge-port"
This reverts commit f5e37bba58 because it
causes a regression in setting up VLAN filtering bridges.  The bridge
itself, e.g., br0 currently does not have a bridge-port context at the
same time as it being bridge.  The model does not account for that and
thus srx_get_int() for the br0 PVID will always fail.

Reverting this commit allows br0 to be tagged member in all VLANs by
default, for now.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-06 10:51:19 +01:00
Joachim Wiberg 3151db6f61 Open v24.03.0 release cycle
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-06 09:27:24 +01:00
Joachim Wiberg 3ab33cebe4 confd: fix bogus warning about not updating /etc/motd properly
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-06 09:12:36 +01:00
Joachim Wiberg 6ce44b0788 libsrx: reduce noise in syslog
The srx_*() family of APIs are for some callbacks in confd used to check
if a setting exists or not.  The root helper function srx_vaget() always
logged an error if sr_get_items() failed.  This has now been fixed and
only the srx_enabled() function still triggers this, because it has no
way of determining an error condition -- otoh it should never fail.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-06 08:54:59 +01:00
Joachim Wiberg c4f3cbf5e1 libsrx: minor, rename function argument, result -> value
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-06 08:53:50 +01:00
Joachim Wiberg f5e37bba58 confd: check return value on failure to read pvid from a bridge-port
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-06 08:49:23 +01:00
Mattias WalströmandJoachim Wiberg c3e707788d Fix VLAN infer when using interface name IFNAME.VID for naming
Then set all VLAN settings properly as well

This fixes #329
2024-03-06 06:59:46 +01:00
Joachim Wiberg eec5546100 board/common: add missing newline at end of /etc/motd
With the changes in 9847a8f we can keep the /etc/motd file with a proper
newline at EOF so that also Classic builds make sense.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 20:19:17 +01:00
Joachim Wiberg 4451e70ba8 .github: adjust release tag variables
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 18:38:22 +01:00
Joachim Wiberg 1f29bfa5a6 .github: set 'latest' flag for non-pre-release builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 16:03:26 +01:00
Joachim Wiberg aea6ef3961 doc: update release notes for v24.02
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 14:17:20 +01:00
Joachim Wiberg 1e4a88e0b9 doc: new text-editor topic for cli
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 14:14:33 +01:00
Joachim Wiberg ba25914cbe confd: add support for changing text-editor backend
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 14:13:43 +01:00
Joachim Wiberg 84391c18a4 board/common: introduce Debian-like alternatives system
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 14:13:06 +01:00
Joachim Wiberg c73b3b59c2 doc: update CLI introduction and tutorial with new commands
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 11:30:51 +01:00
Joachim Wiberg b3e6a38d76 package/klish: bump for motd-like Banner="" extension for klish.conf
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 10:04:19 +01:00
Joachim Wiberg 9847a8fdd1 confd: migrate infix-system:motd -> infix-system:motd-banner
Inspired by openconfig-system[1], except the infix-system type is binary
to allow encoding an entire file, with optional control characters.

The openconfig-system model also carries login-banner, which is displayed
before login.  This could be added later to infix-system to let the user
set an OpenSSH login Banner.

[1]:  https://openconfig.net/projects/models/schemadocs/yangdoc/openconfig-system.html

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 10:04:19 +01:00
Joachim Wiberg 87bffb3816 confd: import base64 encode/decode functions, 3-clause BSD licensed
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-03-01 10:04:19 +01:00
jovatnandGitHub 8b44a42424 Update ChangeLog.md
Remote trailing dot (.)

[skip ci]
2024-02-29 14:33:13 +01:00
jovatnandGitHub 2e408d2ee1 Update ChangeLog.md
Include IETF Hardware data in news section.

[skip ci]
2024-02-29 14:31:03 +01:00
Joachim Wiberg 300734872c doc: minor fixups and clarfiy new port counters as augments
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 14:19:41 +01:00
jovatnandGitHub 6b91a6765c Update ChangeLog.md
Proposed changes to description of ietf-hardware and infix-hardware models.

[skip ci]
2024-02-29 14:08:37 +01:00
Joachim Wiberg 9ab8bd5bc9 doc: restore lost diff link
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 12:44:33 +01:00
Joachim Wiberg 955de32ea8 doc: prepare v24.02 release notes
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 12:39:42 +01:00
Joachim Wiberg b449b7ea82 Revert ".github: temporarily disable Infix Classic builds"
This reverts commit 2bcb02d3ef and thus
reeneables classic builds again.  Since we build on /mnt on the runner
there should be enough room also for them.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 12:16:14 +01:00
Mattias Walström f0c23ca048 Update revision for infix-if-type 2024-02-29 10:22:32 +01:00
Mattias WalströmandJoachim Wiberg c6626b6520 test: Increase timeouts for OSPF tests
This since when running the test in the cloud with github
supplied runner, everthing sometimes gets really slow.
2024-02-29 09:46:08 +01:00
Joachim Wiberg 9c203f614b confd: log error when failing to record changes to NTP client
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 09:14:53 +01:00
Joachim Wiberg 1df1df7096 .github: new package requirement for coverity runs
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 08:54:58 +01:00
Joachim Wiberg 92744b7318 statd: fix string length comparison
Calling strlen() returns a size that's one byte less than what's needed
to store the string, so when comparing with sizeof(), which returns the
number of available bytes, we must compare >= and not just >.

Found by GCC using 'make check'.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 08:45:23 +01:00
Joachim Wiberg be7b434d74 Update list of 'make check' packages
- new: execd, keyack
 - statd has been converted to autotools

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 08:44:08 +01:00
Joachim Wiberg a47e8b6d4a statd: fix library ordering for linker
When building for cppcheck/coverity we may get a stupid linker that can
wind up not finding, e.g., fexist() in libite (-lite) if it's not added
last in the list of libraries.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 08:42:07 +01:00
Joachim Wiberg b004f081a1 .github: check disk usage in $HOME
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 07:55:31 +01:00
Joachim Wiberg 06365fa3da .github: sync release job with latest changes
- Cleanup any docker images to free up space
 - Build on /mnt
 - Update artifacts: pattern after API changes
 - Add .sha256 checksums to each release tarball

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 07:47:54 +01:00
Joachim Wiberg 75b47b8a7a .github: adapt to new artifact action behavior
No more artifact/ subdirectory with upload/download-artifact v4,
artifacts are already in the working directory.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-29 07:17:24 +01:00
Joachim Wiberg aa039449da .github: fake it, let qemu target build in $HOME
Apparently, running "make test-qeneth" from an output directory that's
not in $HOME does not work in Azure.  This patch adds an exception for
the x86_64-netconf target that ensures regression tests run just as if
nothing had changed.

Other platform//variants will be built on /mnt for the time being since
we're running out of space in the runner:

df -h =================================================================
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        73G   58G   16G  80% /
tmpfs           7.9G  172K  7.9G   1% /dev/shm
tmpfs           3.2G  1.1M  3.2G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda15      105M  6.1M   99M   6% /boot/efi
/dev/sdb1        74G  4.1G   66G   6% /mnt
tmpfs           1.6G   12K  1.6G   1% /run/user/1001
=======================================================================

This is the output of the new "Manny" investigator, it revealed that we
only have 16 GiB of space, after checkout and cache donwload, to build
and upload *all* platforms/variants.  Hence the cheat with /mnt, which
we honestly don't know will remain mounted on these runners.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 20:57:14 +01:00
Joachim Wiberg cd7412aea4 .github: use correct build directory variable
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 18:45:56 +01:00
Joachim Wiberg 2564d2597b .github: sudo make me a build directory
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 18:42:33 +01:00
Joachim Wiberg cb1054e4a3 .github: use /mnt as output directory for builds
- Clean up any lingering docker images
 - Redirect output to /mnt/$arch-$flavor

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 18:39:48 +01:00
Joachim Wiberg 24549d149c .github: split into multiple selectable jobs
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 18:33:22 +01:00
Mattias WalströmandJoachim Wiberg 2bf6ec7d1a test: ipv4_autoconf: Fix racecondition on slow test-PCs
Refactor test, remove fragile solution with tcpdump started AFTER
the linklocal was activated, this opened for a race condition since
it was listening for a message sent once.

Now wait for the linklocal address instead.
2024-02-28 18:25:43 +01:00
Mattias WalströmandJoachim Wiberg ac97ce01a5 test: iface: Fix bug in function address_exist()
did not allow any other protocol to checked except DHCP
2024-02-28 18:25:43 +01:00
Joachim Wiberg a730cc0439 .github: peek & poke
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 18:24:35 +01:00
Joachim Wiberg 3c8879cbdf .github: take inventory also after checkout & cache restore
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 18:18:40 +01:00
Joachim Wiberg c9dc5b928a .github: check disk
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 17:01:01 +01:00
Joachim Wiberg a9458f79b1 .github: run cleanup *after* taking inventory
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 15:35:49 +01:00
Joachim Wiberg 1b1ca208e1 .github: give Manny a broom
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 15:34:03 +01:00
Joachim Wiberg 5ee342849d .github: add warehouse manager
TODO: add optional cleanup input argument.

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 15:09:41 +01:00
Joachim WibergandMattias Walström 2bcb02d3ef .github: temporarily disable Infix Classic builds
Debugging build/runner problems with GitHub Actions.  Resolution pending
self-hosted runner becoming operational.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 13:55:57 +01:00
Joachim WibergandMattias Walström c1787622a1 test: fix running on systems without /dev/kvm
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 13:55:57 +01:00
Joachim WibergandMattias Walström e0f97b1840 .github: run regression tests only once, either push or pull-request
Currently the regression tests runs twice when branches and PR:s originate
from the same repo.  This commit adopts a fix suggested at

https://wildwolf.name/github-actions-how-to-avoid-running-the-same-workflow-multiple-times/

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 13:55:57 +01:00
Mattias Walström d1b9f1fb45 Add new test start_from_startup.py to just see that the device can boot from startup config
Useful to run in a loop.
2024-02-28 13:18:51 +01:00
Mattias Walström e77772e8c5 test: usb: Refactor to use a common function to wait boot 2024-02-28 13:18:51 +01:00
Mattias Walström c6d9c68726 Add new function that only waits for boot (reboot) to complete
This since it can take an undefined time to reboot the DUT.
2024-02-28 13:18:51 +01:00
Mattias Walström 103398f070 make run: Increase default memory for qemu
This since the image has gotten larger.
2024-02-28 13:13:32 +01:00
Joachim WibergandMattias Walström 2f844f9ac7 Revert ".github: switch regression test to self-hosted runner"
This reverts commit 4b2acdedc5 since the
self-hosted runner(s) are not yet working properly.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-28 11:21:53 +01:00
Richard AlpeandMattias Walström 27a4278cce statd: add good-octets counters
This patch adds out-good-octets and in-good-octets as augment in
the infix-ethernet-interface yang model. These counters represents
OctetsTransmittedOK and OctetsReceivedOK from ethtool.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-28 11:21:53 +01:00
Joachim Wiberg 3a04bec92d test: drop --interactive in non-interactive docker sessions
With a self-hosted runner we get the following classic error when
calling `make test-unit`:

    make[1]: Entering directory '/home/runner/_work/infix/infix/buildroot'
    /home/runner/_work/infix/infix/test/env /home/runner/_work/infix/infix/test/9pm/9pm.py /home/runner/_work/infix/infix/test/case/all-repo.yaml /home/runner/_work/infix/infix/test/case/all-unit.yaml
    the input device is not a TTY
    make[2]: *** [/home/runner/_work/infix/infix/board/x86_64/board.mk:14: test-unit] Error 1

This patch drops interactive from all non-interactive docker sessions.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 12:33:20 +01:00
Joachim Wiberg 9aa9a60aca test: replace hard-coded dependency on podman in Infamy
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 12:05:31 +01:00
Joachim Wiberg 954d26a7e2 statd: fix build without containers
Some customers do not need, or do not want, to be able to run
containers, so all NETCONF related daemons and applications
need to take this into consideration.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 11:47:07 +01:00
Joachim Wiberg 4b2acdedc5 .github: switch regression test to self-hosted runner
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 11:46:44 +01:00
Joachim Wiberg 0741d2a655 .github: simplify PR template slightly add reminder of YANG changes
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 10:39:22 +01:00
Joachim Wiberg e38063c0ac Minor update/clarification now that content has shifted downwards
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 10:27:19 +01:00
Joachim Wiberg a2bc3bef61 .github: reduce number of caches required by CI builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 10:08:20 +01:00
Joachim Wiberg eceeb8c59f confd: fix cni_popen() when building without container support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 08:14:41 +01:00
Joachim Wiberg d12d66b013 package/klish-plugin-sysrepo: display default value in help text
When available, show the default value of a leaf node after the
description when issuing 'help leaf-node'.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 08:14:41 +01:00
Joachim Wiberg e73742504d Add new intro blurb from homepage to README
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 08:14:41 +01:00
Joachim Wiberg 6cde353029 Drop unicode from tagline, does not survive syslog
The tagline is read by Finit at boot, from /etc/os-release, and
logged when changing runlevel.  The unicode charachter does not
survive the trip via syslog to log file.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 08:14:41 +01:00
Joachim Wiberg a9e78aa329 patches/iproute2: backport ip address 'accept symbolic names'
This change completes the backport of symbolic names for ip address
protocol field:

    ip addr add IFADDR proto 5
=>
    ip addr add IFADDR proto dhcp

Ref:
https://lore.kernel.org/netdev/20230602155419.8958-1-stephen@networkplumber.org/

Fix #286

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 08:14:41 +01:00
Joachim Wiberg 7a52f49c7d execd: fix printf format specifier for systemf()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 08:14:41 +01:00
Joachim Wiberg ba76103c7f execd: refactor to autotools
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 08:14:41 +01:00
Joachim Wiberg b0b1a79aa5 statd: refactor to autotools, same as confd
Fix issue #299

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 08:14:41 +01:00
Joachim Wiberg 5762a73c45 package/confd: reduce sysrepo default log level
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 08:14:41 +01:00
Joachim Wiberg 4909a9e553 patches: backport finit silence udevd by default
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-27 08:14:41 +01:00
Joachim WibergandTobias Waldekranz 83821def3b confd: always create bridge with default_pvid 0
Fix #310
2024-02-26 16:36:29 +01:00
Richard AlpeandJoachim Wiberg f1ab05a86f yanger: remove stray variables and brackets (cosmetic)
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-26 13:01:06 +01:00
Richard AlpeandJoachim Wiberg 412ee33f09 yanger: fix indentation (cosmetic)
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-26 13:01:06 +01:00
Richard AlpeandJoachim Wiberg 0f3433e9a0 yanger: remove stray semicolons (cosmetic)
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-26 13:01:06 +01:00
Richard AlpeandJoachim Wiberg 807b113d4e yanger: refactor test backend
Simplify the code a bit by passing the test file to the runner
function instead of checking it in every caller.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-26 13:01:06 +01:00
Richard AlpeandJoachim Wiberg 5f25c063d5 yanger: introduce main function
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-26 13:01:06 +01:00
Joachim Wiberg 5038cd47e5 .github: proposed pull request template/checklist
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 5386ec9a3a test,doc,board: Infamy Made Easy
As of 4768cae6, we can use conserver/telnet to connect to the docker0
bridge IP:90XX, where XX is DUTXX.  This was a great UX improvement
and this patch set aims to further the experience by:

 - allow running Infamy (infix-test container) completely rootless¹
 - reduce the expsed port range 50->10 (can be improved further)
 - use 'podman --publish-all' ports, which allocates ten random
   ports for the exposed Qemu telnet ports
 - add Quick Start Guide to doc/testing.md

This restores the possiblity of running multiple "make test-sh"
instances, e.g., when multiple users share the same server.

The 'console' script included in this commit uses 'podman inspect' to
find the port number for a given DUT, and optional instance.  It takes
either the console/dut number (1-N), or the dut name from the topology.

Also in this commit:
 - set hostname for easy identification (for console script)
 - set conatainer --name to hostname
 - adjust workdir from buildroot to infix/test
 - simplify PS1 and add time to prompt (when did the test finish?)

When running 'make test-sh' the prompt now tells you which instance you
are running, e.g., infmay10.  Calling 'console 1 infamy10' connects to
console 1 (port 9001) on the infamy10 instance.

For more information, see the Quick Start Guide in doc/testing.md.  It
shows how to use the new helper scripts: console and shell.

Fix #227

_______
¹) devs using podman, instead of docker, with slirp4netns installed, can
   run the infix-test container completely rootless.  We like this, and
   as of today podman is our recommendation.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 00c2c0c608 test/case: new test, container connected using physical interface
Verifies that a regular/physical port/interface can be handed over to a
container.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 4856705803 test/case: new test, plain bridge + veth connection for container
Vanilla bridge and veth pair managed entirely by Infix.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg a38f5902c8 test/case: new test, verify connectivity behind docker0 masquerade
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg ec4c1b1d70 test/case: new test, basic container test
- New helper class for container testing
 - New helper class to urllib, Furl

Due to extremely weak Python-fu in the undersigned, this patch changes
the __init__.py file to add new helper classes for container tests.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg bdbbfcb50f test/infamy: improved logging for connect + factory-default
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg f8b4a858bc test/infamy: pep-8 cleanup and simplification
- Fix most of what pylint complains about
 - Simplify constructs and add missing whitespace
 - Simplify output of YANG model downloader

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 3da045dd40 test/infamy: handle empty NETCONF reply from remote
This patch handles a corner case we for some reason have not run into
yet.  With the new container operational data it was triggered almost
immediately, so let's add some basic guards around it and return None

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 72a86301f0 test/infamy: save location data for Device and add address() method
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Tobias WaldekranzandJoachim Wiberg fcc9fe84f4 test/infamy: Support calling arbitrary functions from within a netns
Add a helper that lets you call a Python function (or lambda) in the
context of a network samespace.

Example:

    with infamy.IsolatedMacVlan("eth0") as ns:
        res = ns.call(lambda: subprocess.run(["ip", "link"],
	                                     capture_output=True))
	print(res.stdout, f"\n[exitcode:{res.returncode}]")

    The call to subprocess.run will be executed in the context of the
    network namespace, and thus only list "lo" and the "iface"
    macvlan.

The return value of the function passed to ns.call() is passed back
over a multiprocessing.Pipe, which requires that the object be
"picklable". This is true for most objects (even more complex ones
like the CompletedProcess object seen in the example above). Some
notable exceptions are things like file objects, sockets, etc.

The setns(2) syscall is unfortunately not available in current
versions of Python shipped with neither Ubuntu nor Alpine at the time
of this writing. Therefore, shoot from the hip, assume that we're
running on an x86_64 CPU, and just hotwire the syscall directly with
some constants we found in a dumpster.
2024-02-25 19:49:27 +01:00
Joachim Wiberg 9ce763662f package/curios-httpd: new package, bundle a demo container
This is an example of how to create a package that downloads an OCI
archive and installs it to /lib/oci

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 257636d997 package/klish: bump for __ptype -> xml param.name fix
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 25c31ce218 src/klish-plugin-infix: improve log message on failed copy
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg bcdd311cb8 src/klish-plugin-infix: support for copying remote files with auth
This patch adds the optional 'user name' argument to the 'copy' command,
enabling using curl scp/sftp protocols for fetching and uploading files.

Changes to cfg_adjust() allow saving and referencing files in the user's
home directory.  Useful for both fetching upgrade bundles and container
images.

The 'dir' command now lists files in both $HOME and /cfg.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 3159d6c042 src/klish-plugin-infix: new symbol shell@infix with user tracking
This patch adds a new klish symbol, shell@infix, which performs proper
droprivs before calling the configured shell.

Fix #298: track user id so shell command gets correct user

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 8354997104 src/klish-plugin-infix: break out shell to optional shell.xml
Some customers don't want unprivileged CLI users to be able to exit to
a shell.  The shell is currently hard-coded to bash, but should be one
of the ietf-system shells, configurable --with-shell=foo.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg b0a0b31e68 src/klish-plugin-infix: refactor copy@infix, allow file -> file copy
This refactor is basically only an extra step after

   copy source-ds -> dest-ds

to also

   copy source-file -> dest-file

Which in the case of factory-config and startup-config is relevant.  We
want to update the startup datastore, in case of additional commands,
but also the file /cfg/startup-config.cfg in case of consecutive reboot.

Fix #259 copy factory-config startup-config

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 686f0bec03 confd: refactor, relocate container network code to cni.[ch]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 360d3b322d confd: use podman stop/start to prevent container corruption
Sending SIGTERM to conmon is not a safe shutdown of a podman container.
To handle gracefully handle shutdown, restarting and provide an orderly
start of dependencies, we use the Finit sysv trick via container script
wrapper to call 'podman stop foo'.

However, since podman does not support syslog as output for containers
we employ an old FIFO trick with another program, k8s-logger, to allow
logs to reach syslog.  Please note that k8s-logger must have properly
started before we call `podman start` -- this makes us fully dependent
on the 'container' wrapper script.  Hence the documentation update.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 6fa1eb9e00 package/k8s-logger: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg a530db9ae5 board/common: confine containers in their own parent cgroup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 337f39a74d board/common: quiet flag and check if running for start/stop
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 3b5c0248d7 confd: handle factory-default RPC better wrt. container networks
Because sysrepo callbacks are threaded and factory-default RPC is called
from a separate subscription (to prevent blocking), we cannot prevent
ietf-intefaces.c from being called before infix-containers.c, regardless
of the priority we set for our subscriptions.

When assigning a physical network interface this becomes a bit of a pain
during factory-default RPC since the physical interface is hidden from
the host network namespace.

So, when applying factory to running, we check each interface if it was
a container-network previously, if so we call on the container script in
the exit of the current dagger generation to move the interface back to
the host netns.

This affects all other functions that assume interfaces only live in the
host netns.  To that end a set of new helper functions have been added
to wrap iproute2 commands in nsenter when the interface lives elsewhere.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 168fb24957 confd: handle building without containers
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg ec3e3b3322 confd: minor refactor, split hook, improve log messages
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 67bb7e5928 confd: simplify container network naming
The interface name is already a unique qualifier, so we can simplify CNI
network naming to ease the burden when debugging.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 214ca82bd6 confd: allow host container interfaces without IP address
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg a05a3609c5 confd: add sloppy inference of container-network type
"Sloppy" because, for some reason, we don't get sysrepo update callbacks
for presence containers.  I.e., when calling 'set container-network'
compared to 'edit container-network'.

Yes, I've gone over klish-plugins-sysrepo with a fine-toothed comb to
see if it's the culprit, but no, it seems to be sysrepo.  Hence the
defaulting of the type also in the change path.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg e4aa36dfe7 confd: tighten up container data validation in YANG model
Review found quite a few strings that could be given an obvious pattern
or specialized sub-type, e.g. inet:ip-address, to restrict the input
data validation.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 34b06fa448 confd: update container documentation and YANG models
Due to the deprecation of CNI i Podman[1], and its upcoming removal in
Podman v5.0, we decided to cut our losses and modify all documentation
and models to become backend neutral.  We will continue to use CNI as
long as possible -- it gives us host interfaces, for instance, that is
not part of netawark yet, it seems.

Also, sync mount and volume documentation with YANG model changes.

[1]: https://blog.podman.io/2023/11/cni-deprecation-and-removal-from-podman-5-0/

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 81d8643a6f confd: rename container 'file' to 'mount', add more mount types
After discussions in the development team, and an external demo, we
decided to rename file mounts to just mounts and adopt established
nomenclature.

With this change we now allow mounting any type of file or directory
from the host to the container, for regular files/directories a bind
mount is used.  We also introduce 'source' and 'type', to support
mounting of host files and directories, the destination path has been
renamed to 'target'.  The mount cousin, 'volume', which basically is a
specialized mount, has also been updated to use 'target'.

The 'source' and 'content' are now hidden behind a YANG choice to ensure
users can only use them the intended way (either/or not both).

Initial models had 'destination' (path) as mandatory, with this change
we can reintroduce that to ensure this proper configurations.

The documentation in both YANG model and markdown has been updated,
significantly, to provide lots of examples.

Please note, glob style mounts have not been tested, at all.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 8edf238b68 confd: handle active but unsaved containers in unclean shutdowns
When container configurations are not saved to startup-config and the
user reboot the system (or lose power) we will have lingering active
containers cached on persistent storage.

This patch adds a cleanup() function to the post hook, right before
we try to launch any new containers.  This callback must be run for
all cases, even if the running-config has no containers configured.

Also, a minor amendment to volume pruning.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 61cba2615f confd: make container privileged mode configurable
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg a6f6fcac6a confd: add support for oci: and oci-archive: images
1. add support for extracting, and finding the directory holding the
    index.json metadata file in, OCI images.  An archive in Infix is either
    a .tar or .tar.gz archive, which we need to unpack for this version of
    podman to be able to load them.
 2. new RPC '/infix-containers:oci-load' calls 'container load' of an
    OCI archive (tarball), optionally gzipped.  The resulting image uses
    the directory name of the unpacked tarball, so the container script
    offers a way to retag the image after loading it.

First class citizens in container transport are docker:// and the OCI
family of URI:s.  A docker:// URL, or a local docker-archive:path, is
assumed to be well formed, in which case we leave it up to podman to
handle.

Note: 'podman import' does not fully understand OCI formats.  It drops
      ENTRYPOINT and COMMAND, while 'podman load' handles things a lot
      better.  Only letdown is it does not support nameing the image.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 8ea159ce5d confd: add feature flag for containers
Not all customers want Container support in their Ínfix builds.  This
patch adds build-time support for detecting if podman is enabled in
the configuration.

 - Klish container commands have been broken out to their own xml file
 - infix-interfaces have been given a 'containers' feature
 - ietf-interfces.c enables 'containers' feature on an #ifdef
 - infix-container.c is only built if --enable-containers

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 235d3e46e6 confd: major refactor of infix-containers after team review
- Rename container/container -> containers/container
 - Collapse containers-state into containers
 - Complete refactor of network/host-network for improved UX.  A new
   must expression ensure mutual exclusion between host and networks
 - Rename entrypoint -> command, for consistency (overrides ENTRYPOINT)
 - Move nodes around a bit for more logical placement in model
 - Clean out all traces of a container on removal
 - Rename container image_id -> image-id for consistency

The active queue is for tracking currently running containers, ensuring
only relevant changes are applied, and also for container image upgrade,
at the end of which these scripts are re-run to activate the new image

Also, fix misplaced '-f' when pruning unused volumes.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg a9a7b7016d statd: initial support for container-state information
Also, add missing dependency on libite to packaging.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg ed86a29bfc doc: initial container documentation
Brief overview of configuration support.  Need to add admin-exec level
commands, but since operational and actions still are missing, we keep
it out until after the code review.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 580599f549 confd: misc. fixes and cleanup
- drop debug logs
 - no need to restart upgraded containers, they restart automatically
 - fix ordering in volume prune (when containers are removed)
 - skip directories in container activation (inbox -> execd queue)
 - Fix 'container pull IMG creds USER[:PASS]' bug, extra '=' variable
   assignment inside infix.xml
 - Fix 'container run IMG CMD ARGS' to actually put the CMD in
   ENTRYPOINT and append ARGS to image.  The podman run and create
   commands are *not* behaving the same way
 - Rename 'attach' to 'exec', execute command inside an running container
 - Add 'container [shell | connect]' to start shell in -- " -- " -- " --
 - Add 'container [stat | cleanup | usage stats]' commands
 - Add in="tty" to commands thay may end up being interactive
 - Split <ACTION> line into multiple lines for readability
 - Fix container shift logic:

     root@infix-00-00-00:/> show container
     /usr/sbin/container: line 361: shift: shift count out of range

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg b7d119b23f confd: add NETCONF actions to start/stop/restart containers
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg ff32314676 confd: rename volume dir -> path, same as bind-mounted files
Also, update container YANG model descriptions and ensure 'path' is
mandatory for each list element and attach a regexp pattern to fix
the mountpoint to an absolute path inside the container.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg cd4e8b0a9f confd: add support for mounting read-only files in containers
In the container configuration context:

    edit file ntp.conf
    set path /etc/ntp.conf
    set content

The last command opens a text editor where you can paste the contents
of the file.  This is stored base64 encoded in the datastore as well
as in JSON/XML.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 31502c8aab confd: add support for upgrading container images
This patch adds a new CLI command 'container upgrade foo', where 'foo'
is the name of the container.  If more than one container use the same
image, multiple upgrades must be done because a container runs not on
the 'image:tag' but on the hash of the 'image:tag' it was created from.

Rename "done" queue to "active", since we want to recreate an active
container after fetching an updated base image.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg aafa88b648 confd: add support for container volumes
This commit adds support for writable container volumes.  A volume, when
compared to a mount, is a writable directory created when the container
starts and is automatically rsync'ed with the underlying directory it
is mounted on on first use.  A mount otoh does not rsync so it results
only in an empty directory inside the container.

The podman/docker mount feature will be used later to bind mount single
files or sharing directories from the host, e.g., /sys/class/leds/ to
one of more containers.

Note: unused volumes are automatically pruned.  Hence, a volume
      currently cannot be moved to another container.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 414703e851 confd: minor refactor, /run/container/env -> /run/container/args
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 256c462c0c confd: add support for read-only containers
This creates a container without a writable layer.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 679a6671ed confd: do not recreate existing containers that are unchanged
This patch allows containers created with "podman create" to surivce
rebots, and even reconfigurations at runtime, as long as their config
has not changed.  Allowing some level of persistence in the writable
layer given to containers.

For even more persistency, support for volumes (they sync with dir in
container on first use) and mounts (creates empty writable dirs in the
container) must be added.  A third option, a variant of mounts, is to
allow a leaf-list "file", where binary content can be added and then
mounted into the container, e.g.

/run/containers/files/$name/file.ext -> container://$name/etc/file.ext

None of this is available yet, but seems likely we need to add in the
very near term.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg d8dde9cde2 confd: add support for custom container ENTRYPOINT
This was a tough nut to crack.  Turns out the trick to changing the
ENTRYPOINT is to set --entrypoint=command and then call 'podman create
... command args'.  Not entirely obvious since the documented approach
is to use a JSON array as the argument: podman create
--entrypoint='["command", "args" ]'.

Admittedly, encoding this in C to transfer it via a POSIX shell script
to the command line, is not the easiest task I've undertaken.  So I gave
up and found this workaround.

Worth noting, however, is that one *must* set `--entrypoint`, it is not
enough to just append the command to the 'podman create' command line.
Due to differences in docker and podman, we cannot supply the full args
to an alternate entrypoint command.  But for the command to actually run
we need to override the image's ENTRYPOINT and send the command and args
as the last arguments on the command line to podman create.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg f1bf02eda5 confd: refactor how container networks are sent to container helper
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg aa7ea66a0d confd: add support for setting container hostname
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 7a57d4f0fa confd: add support for container environment variables
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 3d85eba3fc confd: add support for publishing container ports
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg b04c81199d confd: add support for host containers, shares host's interfaces
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg ffd2128614 confd: add support for container restart and restart policy
Also, ensure the deleted container is actually deleted before recreating
it with a new configuration.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 2b19b61068 confd: add support for manual start of containers
This commit adds 'manual:yes' to the container's Finit service
configuration and changes from pod: to container: prefix for a
unique namespace to prevent collision with regular services.

The prefix container: is more correct that pod:, which should
be reserved for any future pod support.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>

confd: fix missing variable in container script condition

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 0f0c119553 configs: sync r2s defconfig with latest changes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 5fdc408ade configs: add libssh2 to NETCONF builds, needed by libcurl
libcurl use libssh2 for scp/sftp access

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 9e801dfa2f confd: initial support for Docker containers using podman
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 0bda0727b7 confd: minor, whitespace only
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 0b6f7a6b93 package/execd: new local package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg ad0463e96c libsrx: minor, constify since we don't modify these args
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 3bdf360b2e libsrx: minor, coding style
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 58ebae5624 yanger: pep-8 style fixes and cleanup
- reserved words: map -> xlate
 - add missing docstrings
 - convert to recommended constructs: proto in (foo, bar)
 - drop unused 'f' format strings: f""
 - too short exception vars: e -> err, d -> entry
 - drop unnecessary () in if expressions
 - add whitespace for readability and navigation

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg b3e418c6a7 board/common: let qemu.sh take kernel/init args on command line
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg f0f0e737a9 board/common: BusyBox ash != bash, set bash as root default shell
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 84f83d635b board/common: fix #294: drop 'v' from version in filenames
The files inside a release tarball, as well as the tarball name itself,
should not have the leading 'v', that's just for the tag.

Also, add -ver to GNS3 disk.img file as well.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg e5dd01ffcc patches/finit: fix out-of-place [OK] messages at shutdown/reboot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 4f98b0b761 package/podman: install bash completion
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 074754d42d package/podman: minor, drop helper scripts
To be replaced with native support for generating container network
interfaces and running under finit.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 51dc940059 package/klish-plugin-sysrepo: new commands 'change' + 'text-editor'
This bump adds support for 'set foo' to set foo=true, but also two new
commands from srp_helper@: 'change password', 'text-editor content'.

 - ietf-system: 'change password' now starts an interactive session that
   results in a random-salted sha512 encrypted hash.
 - 'text-editor <node-of-binary-type>', starts 'editor file | base64'
 - 'set <node-of-bool-type>', sets node=true

A prototype askpass script has been added as a proof-of-concept.  It
follows the design of other askpass style programs, like ssh-askpass,
that pass the resulting password on stdout.  With the additional support
for also writing it to an output file, e.g., a pipe.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 4793cf0770 package/skeleton-init-finit: silence mdev/mdevd/udevd log notices
On every system reconf (initctl reload) the .conf files are evaluated
again and log notices about skipping alternative syslogd enties are
logged.

We know that we run the udevd dependend syslogd entry, and everything
else basically in runlevel S depends on it, so not much else would work
if syslogd didn't start.  So we can safely set 'nowarn'.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 0468f35fb6 cli: minor, whitespace and fix 'show' subcommand help
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Joachim Wiberg 1e87a30147 confd: skip ethtool command for etherlike interfaces
When "plopping" back an interface from another network namespace, e.g.,
when removing a container network interface, we cannot just rely on the
'ethernet' node *not* being available for an interface.

Experience shows that sysrepo might send us a curve ball (see comment)
which we interpret to be a true Ethernet interface.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-25 19:49:27 +01:00
Mattias Walström 83effa6fd4 Use common CFLAGS in all src-packages.
And fix bugs that the new CFLAGS find.
2024-02-23 14:01:23 +01:00
Mattias Walström 8f996859dc Add infix CFLAGS, used when building src/ (confd, statd....) 2024-02-23 14:01:23 +01:00
Mattias Walström 4869b73b14 test: usb: test startup with no hardware configuration
In this case the USB ports shall be locked.
2024-02-23 14:01:23 +01:00
Mattias Walström c1309da10b infamy: Add support to copy running to startup
Also add support for rebooting unit.
2024-02-23 14:01:23 +01:00
Mattias Walström acc39b1b15 yanger: usb: Refactor to only check authorized_default if locked/unlocked
authorized is unreliable on boot.
2024-02-23 14:01:23 +01:00
Mattias Walström ddd0fc5a35 yanger: vpd: set class to vpd for all vpd nodes
class is mandatory in the standard.
2024-02-23 14:01:23 +01:00
Mattias Walström afa243cd2f confd: core: keep one instance of /run/system.json open
Add entry in struct confd to keep it accessable for all callbacks.
2024-02-23 14:01:23 +01:00
Mattias Walström b66b56f504 probe: rename usb-ports-names => usb-port-names 2024-02-23 14:01:23 +01:00
Mattias Walström d4a1a7c91c doc: Add USB documentation 2024-02-23 14:01:23 +01:00
Mattias Walström c57a4655b8 ietf-routing: Handle return value from touch() 2024-02-23 14:01:23 +01:00
Mattias Walström 30e2a814eb factory: getchar() returns integer not char 2024-02-23 14:01:23 +01:00
Mattias Walström caea3132c9 probe: Change to return the sysfs path for authorized and authorized_default
Leave it to confd to check if the file exist.
2024-02-23 14:01:23 +01:00
Mattias Walström 746392cac5 x86_64: Update linux_defconfig with USB as module
This to be able to control USB ports in infix using authorized in /sys
2024-02-23 14:01:23 +01:00
Mattias Walström 5afaeae46c Update qeneth to support USB 2024-02-23 14:01:23 +01:00
Mattias Walström 15b32cfcc2 infamy: Add a simple USB test 2024-02-23 14:01:23 +01:00
Mattias Walström 8e0db4c7e4 topology: virt: Add usb-sticks 2024-02-23 14:01:23 +01:00
Mattias Walström 420e0d5b36 qeumu: Add USB ports 2024-02-23 14:01:23 +01:00
Mattias Walström 69eae34203 probe: Add support for virtual USB ports (qemu) 2024-02-23 14:01:23 +01:00
Mattias Walström c0a071e87a Add 'show hardware' only show USB port status for now 2024-02-23 14:01:23 +01:00
Mattias Walström 2011f5cbf2 modprobe.d: Unauthorize all USB ports on boot 2024-02-23 14:01:23 +01:00
Mattias Walström a6ff416401 confd: Add support for ietf-hardware
Add supports to enable disable USB port
2024-02-23 14:01:23 +01:00
Mattias Walström 66c20aa79d bootstrap: Enable states feature to ietf-hardware 2024-02-23 14:01:23 +01:00
Mattias Walström b0f2388153 probe: Add support for multiple /sys nodes for a of-node 2024-02-23 14:01:23 +01:00
Mattias Walström 5e707753e9 ietf-hardware: YANG: Deviate everything not supported yet 2024-02-23 14:01:23 +01:00
Mattias Walström 6099ac79e2 Add script to generate entries for external ports
For the user to be able to enable them in runtime
2024-02-23 14:01:23 +01:00
Mattias Walström 6f41ea5ccb probe: Read information about external ports (usb)
from Device tree and put it into system.json
2024-02-23 14:01:23 +01:00
Mattias Walström c58bd5ead4 aarch64: Configure USB_CORE as a module
This to be able to control the USB ports in infix using authorized in /sys
2024-02-23 14:01:23 +01:00
Mattias Walström bd9acd003d Alder: DTS: Add information about external ports (USB) 2024-02-23 14:01:23 +01:00
Richard AlpeandTobias Waldekranz 0cb1459f43 cli-pretty: only print stp state if oper status is up
Only print bridge port stp state if operational status of the
interface is up.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Richard AlpeandTobias Waldekranz 1827b65182 test: update cli-output to reflect new bridge output
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Richard AlpeandTobias Waldekranz 1807306178 cli-pretty: print vlan filtering bridge
Handle printing a vlan filtering bridge in "show interfaces".

Example output:
br0             bridge     DOWN        vlan:10u,20t
│               ipv4                   192.168.1.1/24 (static)
├ e0            bridge     DISABLED    vlan:10u,20t pvid:10
└ e1            bridge     DISABLED    vlan:10t,20u pvid:20
br1             bridge
└ e2            bridge     FORWARDING  vlan:30u pvid:30
e3              ethernet   UP          02:00:00:00:00:03
                ipv6                   fe80::ff:fe00:3/64 (link-layer)
e4              ethernet   UP          02:00:00:00:00:04
                ipv6                   fe80::ff:fe00:4/64 (link-layer)
lo              ethernet   UP          00:00:00:00:00:00
                ipv4                   127.0.0.1/8 (static)
                ipv6                   ::1/128 (static)

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Richard AlpeandTobias Waldekranz 475a3a2919 yanger: add bridge vlan, pvid and stp-state
This patch adds information about a vlan filtering bridge to the
operational datastore.

The information included is vlans, pvid and stp-state. These changes
reflects what can be configured though confd.

NOTE: pvid is still missing for bridge interfaces. Discussions on how
to best add this is ongoing. It's currently not configurable due to an
existing self check in the infix-if-bridge yang model.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Richard AlpeandTobias Waldekranz 0937921cbc test: add br1 to sysrepo emulator
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Richard AlpeandTobias Waldekranz 6ad80c80ab test: make e2 into br1 bridge port in system output
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Richard AlpeandTobias Waldekranz 4150f45cc4 test: add system output for vlan filtering bridge
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Richard AlpeandTobias Waldekranz 1da00a9764 yang: add stp-state to infix-if-bridge
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-20 21:43:48 +01:00
Tobias Waldekranzandjovatn 015215073a doc: Initial documention of VPD 2024-02-13 15:45:29 +01:00
Richard AlpeandJoachim Wiberg d73d5440c5 test: remove hardcoded interface type
This can now a days be inferred and isn't needed. Also, the interface
type in virtual testing is now etherlike not ethernet.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-05 18:01:30 +01:00
Richard AlpeandJoachim Wiberg 104a70d46c confd: handle etherlike delete as ethernet
This resolves the regression where configured etherlike interface mac
addresses where not deleted from the system.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-05 18:01:30 +01:00
Richard AlpeandJoachim Wiberg 795f2615cb test: update cli output test to reflect etherlike changes
* Remove bogus ethernet statistics for br0
* Change parentbus for e0 and e1 to make them ethernet devices (not
  virtio -> etherlike).

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-05 18:01:30 +01:00
Richard AlpeandJoachim Wiberg debcf81a7a yanger: only fill eth info for Ethernet interfaces
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-05 18:01:30 +01:00
Richard AlpeandJoachim Wiberg ee50a7c061 yanger: identify new interface type "etherlike"
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-05 18:01:30 +01:00
Richard AlpeandJoachim Wiberg f35f176860 confd: identify virtio interfaces as "etherlike"
Instead of "ethernet". Prior to this patch virtio interfaces where
identified as "ethernet", which resulted in /run/net trying to enable
autoneg on them. Which isn't supported and resulted in an ABANDONED
"default config".

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-05 18:01:30 +01:00
Richard AlpeandJoachim Wiberg 198be2a9c6 confd: add new interface type "etherlike"
Needed for devices that share a lot of properties with an ethernet
device but doesn't support "ethtool" and such. An example is TAP
interfaces.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-05 18:01:30 +01:00
Richard AlpeandJoachim Wiberg 79ce152abb confd: fix indentation in gen-interfaces
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-05 18:01:30 +01:00
Tobias WaldekranzandJoachim Wiberg 870d41644f confd: ethtool: Condense logic around autoneg configuration
Rely on the interface diff to figure out if any autoneg related config
has changed; if so, generate the resulting configuration based on the
current interface config.

- Remove loopback check, the model only allows ethernet config on
  interfaces of type "ethernet".

- Split up the input validation of speed/duplex to give the user an
  error message with as much specificity as possible.

- Validate that the configured speed/duplex is supported.

- Move the generated script to execute earlier to avoid unnecessary
  link flapping.

- Use negative POSIX error codes, these are (or at least should be)
  mapped to sysrepo errors in netdag_gen_iface.
2024-02-05 18:01:30 +01:00
Richard AlpeandJoachim Wiberg 43017cc79f confd: add the ability to set speed, duplex and autoneg
Add the ability to configure interface speed, duplex and autoneg.
Initially this was pared with YANG model deviations that restricted
explicit interface speed and duplex when autoneg was enabled. But due
to conflicting default states in YANG, this code was dropped.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-02-05 18:01:30 +01:00
Joachim Wiberg a6a480cbf9 .github: add missing $ in variables
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-02 10:15:13 +01:00
Joachim Wiberg f4f62e1c02 .github: fix syntax error in workflows, missing 'with:' for params
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-02 09:08:44 +01:00
Joachim Wiberg cd521ca789 .github: only run Coverity Scan for KernelKit org.
The Infix scan token we have is only valid for KernelKit, so for any
downstream forks we must not attempt to run this workflow.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-02-02 08:53:02 +01:00
Tobias WaldekranzandMattias Walström a97dc8b870 defconfig: Enable keyack for NETCONF builds 2024-02-01 14:18:14 +01:00
Tobias WaldekranzandMattias Walström 583881c1f9 keyack: Add program to wait for key press and release
Useful for testing buttons bound to a gpio-key, e.g. a factory reset
button.
2024-02-01 14:18:14 +01:00
Mattias Walström 8e0caed530 Bump github actions version 2024-02-01 13:20:57 +01:00
Mattias Walström 2240be50c5 Revert "Bump github actions version"
This reverts commit 3155a99cab.
2024-01-31 16:56:37 +01:00
Mattias Walström 3155a99cab Bump github actions version 2024-01-31 14:27:57 +01:00
Mattias Walström 6b23a2b432 confd: infix-dhcp: Remove dead code 2024-01-31 14:27:57 +01:00
Mattias Walström cabb9ea6a5 Add badge to the kernelkit discord 2024-01-31 14:27:57 +01:00
Mattias Walström ef5d5d21a0 statd: Free sub when exit on error 2024-01-31 14:27:57 +01:00
Mattias Walström 0d31f501e1 Run coverity check each day 2024-01-31 14:27:57 +01:00
Joachim WibergandTobias Waldekranz 307cdb02b4 confd: bump infix-dhcp-client YANG model version for release
The DHCP client YANG model saw a lot of changes added in the 23.12
sprint, fortunately there was never an official release.

This commit bumps the model version for v24.01.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-30 15:32:38 +01:00
Joachim WibergandTobias Waldekranz fbe6accdf3 Clarify what happens without /plen
Co-authored-by: Tobias Waldekranz <tobias@waldekranz.com>
2024-01-30 15:32:38 +01:00
Joachim WibergandTobias Waldekranz 228891935d dhcp-client: allow setting hostname, and update /etc/hosts
This should be the last outstanding issue to fix #278.  Please note,
it is undefined what happens if you have two DHCP clients that request
hostname, and changing hostname from NETCONF at runtime will overwrite
any hostname set by the DHCP client.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-30 15:32:38 +01:00
Joachim WibergandTobias Waldekranz 12f5a88b3b confd: infer default DHCP client options
For maximum flexibility we allow the user to full control over the DHCP
options the client requests.  For this to work we must tell udhcpc to
not set any of its defaults behind the scenes, so we call it with '-o'.

This commit adds support for inferring these udhcpc default options in
NETCONF.  So when enabling the DHCP client we now get the same set of
sane options as udhcpc otherwise hides from us.

Fixes #278, at least wrt. the lack of sent options.  Allowing the client
script to set the hostname will be added in a later commit.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-30 15:32:38 +01:00
Joachim WibergandTobias Waldekranz faa6ce849b dhcp-client: don't assume we got option 1 (subnet)
If we don't get subnet, then just set the IP address.

Issue #278

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-30 15:32:38 +01:00
Joachim WibergandTobias Waldekranz 08cec2e9bc confd: add exception for hostname DHCP client option
No need to guard the hostname option in quotes, it must not contain
whitespace.  If user configured more than one word, use first.

Fixes #283

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-30 15:32:38 +01:00
Jon-Olov VatnandMattias Walström 94dd57a741 Extending and updating OSPF documentation
- Adding information on OSPF interface settings
- Adding CLI example to Debug OSPFv2 section
- and some additional minor changes

[skip ci]
2024-01-30 13:49:31 +01:00
Henrik NordstromandJoachim Wiberg 4c5d5fb045 board/aarch64: alder: Remove Micro-SD support
There is no Micro-SD slot on the alder board. Not even an
optional one.
2024-01-29 18:05:07 +01:00
Mattias Walström 6d0f666ae1 CLI: OSPF: Add database and routes as show ospf subcommands 2024-01-29 14:49:28 +01:00
Mattias WalströmandTobias Waldekranz 051658d36a Add test to se that it is possible to get all operational data
Unlikley to fail though.
2024-01-27 23:56:31 +01:00
Mattias WalströmandTobias Waldekranz 0aeae9d8e8 dts: Add factory reset button as keybord (button)
Also add a tool useful to test the reset button.
2024-01-27 23:53:54 +01:00
Richard AlpeandTobias Waldekranz 0549de0eec infix-*.yang: fix indentation (2 spaces)
Align indentation in all infix yang models to be 2 spaces.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-01-23 21:25:39 +01:00
Mattias Walström 9c466b84df clang-format: Fix correct linux-formatting 2024-01-23 15:30:40 +01:00
Mattias Walström 0033a92c80 qemu.sh: Fix bug when emulate VPD
Wrong date format for manufacture-date
2024-01-23 15:30:40 +01:00
Mattias Walström c4320cd036 ietf-hardware: Add infix deviations 2024-01-23 15:30:40 +01:00
Mattias Walström c1d616159f Add ietf-hardware and iana-hardware yangfiles 2024-01-23 15:30:40 +01:00
Mattias Walström c826e06311 statd: Listen for ietf-hardware requests 2024-01-23 15:30:40 +01:00
Mattias Walström e73b3afe8c statd: Refactor subscription callbacks
Add a new generic callback to reduce code duplication.
2024-01-23 15:30:40 +01:00
Mattias Walström 8a2bc3dae9 statd: Coding style 2024-01-23 15:30:40 +01:00
Mattias Walström 22269b6057 Yanger: Implement ietf-hardware
Wrap all VPD data and show them as components in ietf-hardware.
2024-01-23 15:30:40 +01:00
Richard AlpeandJoachim Wiberg 641d328238 infix-eth-if.yang: update revision
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-01-22 16:50:36 +01:00
Richard AlpeandJoachim Wiberg 7657b49b2b infix-eth-if.yang: deviate negotiation-status not-supported
Signed-off-by: Richard Alpe <richard@bit42.se>
2024-01-22 16:50:36 +01:00
Richard AlpeandJoachim Wiberg 2d38896cd5 infix-eth-if.yang: remove comment about deviating eth
This is now supported by Infix.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-01-22 16:50:36 +01:00
Joachim WibergandTobias Waldekranz 236f3ec183 board/aarch64/r2s: patch device tree for factory-password-hash
Since the Nanopi R2S does not have a VPD, we use this mechanism to set
the default admin password.  Without one, Infix will refuse to generate
the factory- and failure-config files, and thus refuse to start.

On custom boards in production we have VPD in ONIE format that contains
a per-device unique SHA256 hashed admin user password.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-22 11:20:01 +01:00
Joachim WibergandTobias Waldekranz 2ade7fd9ab configs/r2s_defconfig: resort/make update-defconfig
Loss of BusyBox "show others", uboot-tools, and e2fsprogs, are likely
due to resolved dependencies from other packages.  E.g., Frr requires
bash.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-22 11:20:01 +01:00
Joachim WibergandTobias Waldekranz 10ec9089bc Initial support for Nanopi R2S from FriendlyELEC
Support for this is based on the upstream Buildroot R2S defconfig and
the myLinux extensions and stripped-down kernel defconfig.  For more
information about the Nanopi R2S, see the FriendlyELC wiki at:

    https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R2S

Please note, due to the lack of a VPD on the board, and some very poor
devicetree skills by yours truly, Infix currently refuse to boot on this
board.  An in-devicetree factory-password-hash node has to be added, and
will be done soon.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-22 11:20:01 +01:00
Joachim WibergandTobias Waldekranz 000811fced board/common: skip if not SIGN_ENABLED
All Infix builds should be signed, but for some test equipment, and
during board bringup, this may be too much of a hassle.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-22 11:20:01 +01:00
Joachim WibergandTobias Waldekranz 234527319e patches/uboot: move to sub-directory, does not apply to older u-boot
The Nanopi R2S currently only works with an older U-Boot v2021.10.  This
commit only relocates the CN9130 patches to a sub-directory.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-22 11:20:01 +01:00
Mattias Walström 3b87a077f9 ietf-routing: Add limitation on supported routing-protocols
Only OSPFv3 and Static routes is currently allowed in infix.
2024-01-18 14:20:13 +01:00
Mattias Walström b6d802c46f Update OSPF documentation
Remove now no longer needed prefix of keys.
2024-01-18 14:20:13 +01:00
Mattias Walström 2ea2ff5c83 Update klish to allow identityref as keys properly 2024-01-18 14:20:13 +01:00
Tobias WaldekranzandMattias Walström 7081934473 Promote all members of wheel to sudoers
Install the sudo command, and let all members of the "wheel" group run
any command as the superuser.

This ensures that administrators have full access to the system,
primarily for troubleshooting, diagnostics, and remote scripting
purposes.
2024-01-18 10:28:32 +01:00
Tobias WaldekranzandJoachim Wiberg 74ed929873 confd: Change the default shell of the admin user to bash
This let's users script infix devices without needing any special
NETCONF tools installed - ssh is enough. E.g. you can get the running
version with something like:

    ssh INFIX-HOST sysrepocfg -X -fjson -d operational \
    	-x "/system-state/platform/os-release" | jq .

It also means that SCP works as expected, by default.
2024-01-18 00:02:55 +01:00
Tobias WaldekranzandJoachim Wiberg f3678ac93f Provide a hint of how to access the CLI when other shells are used
For users with a shell other than clish, such as bash, print out a
hint of how to enter clish, when logging in.
2024-01-18 00:02:55 +01:00
Tobias WaldekranzandJoachim Wiberg 6ef80d5847 Add a default message of the day (/etc/motd)
This is injected to the factory-config during bootstrap, and can then
be changed as usual via /system/motd.
2024-01-18 00:02:55 +01:00
Mattias WalströmandJoachim Wiberg 43fbe4e8b1 OSPF: Add operational support to se router state per interface 2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg aa68cd73c7 OSPF: Fix nasty bug when router-ids was converted to host routes
Caused collision with the key (prefix) in the list
2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg c9f426763a Add new test to test suite 2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg d3a61b5161 Add new physical topology for virtual tests with 4 duts
Also add a matching standard topology.
2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg b799366d0a infamy: route: Add function to check if an area is NSSA 2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg 9788046c64 OSPF: Add area-type to operational 2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg c906236be5 OSPF: Add support for setting explicit-router-id 2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg 4801c1f060 OSPF: Fix bug with ospf-status script did not work with NSSA or Stub areas
For some reason FRR put [NSSA] and [Stub] in the key with the area id
2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg b48798b23a test: Set hostname for OSPF tests to detect the role 2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg 15aaa70d63 test: infamy: route: Fix logic when checking if route exist 2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg ad7c4fc737 OSPF: Implement interface setting to set cost 2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg 388c02b29a test: Create a larger OSPF test
This will test, multiple areas with cost and BFD (requires link
breakers in infamy, not yet implemented there yet)

Also test NSSA-areas.
2024-01-15 16:29:06 +01:00
Mattias WalströmandJoachim Wiberg 95e9334812 OSPF: Add support to generate a default route inside OSPF 2024-01-10 17:51:46 +01:00
Mattias WalströmandJoachim Wiberg 34c807e955 OSPF: Add test case for unnumbered interfaces 2024-01-10 17:51:46 +01:00
Mattias WalströmandJoachim Wiberg b469a6a260 OSPF: Add passive interface and interface type to operational 2024-01-10 17:51:46 +01:00
Mattias WalströmandJoachim Wiberg 72dc0f87f5 infamy: route: Add support to read ospf status 2024-01-10 17:51:46 +01:00
Mattias WalströmandJoachim Wiberg 94ae818895 OSPF: add support to change network type for interface
Implemented types are broadcast and point-to-point
2024-01-10 17:51:46 +01:00
Mattias WalströmandJoachim Wiberg 3240de833f OSPF: Add support for passive interface 2024-01-10 17:51:46 +01:00
Joachim WibergandTobias Waldekranz d70abc5f21 board/common: let dagger script set LOG_PID with parent PID
This adds [PPID] to the syslog lines to the dagger script.  After all,
the dagger script is a proxy for confd, so when reading the logs it
seems natural to see the PID of confd rather than a script that will
die soon anyway.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-09 21:24:41 +01:00
Joachim WibergandTobias Waldekranz 504f0d53de package/finit: bump for v4.7 release
LICENSE hash changed due to udpated copyright years.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-09 21:24:41 +01:00
Mattias WalströmandJoachim Wiberg 4c33641667 Bump infix routing version 2024-01-09 11:06:41 +01:00
Mattias WalströmandJoachim Wiberg 21ce43031c OSPF: Fix bug when BFD is not enabled on all OSPF interfaces
Enable bfdd if bfd is enabled on any OSPF interface.
2024-01-09 11:06:41 +01:00
Mattias WalströmandJoachim Wiberg 54e97dbbd5 infix-routing: Deviate everything that is not currently supported 2024-01-09 03:56:17 +01:00
Mattias WalströmandJoachim Wiberg b503afe67b Fix regression after 35d74cecd4
Show normal next-hops also, not only next-hop-list routes
2024-01-09 03:56:17 +01:00
Mattias WalströmandJoachim Wiberg 7cce19d45c test: Add show routes (ipv4 and ipv6) to test CLI test suite 2024-01-09 03:56:17 +01:00
Mattias WalströmandJoachim Wiberg 35d74cecd4 Operational: Add support for multiple next-hop for routes 2024-01-08 10:04:44 +01:00
Mattias WalströmandJoachim Wiberg c0e7a6c03c OSPF: Add possibility to check status in CLI
Use vtysh for now.
2024-01-08 10:04:44 +01:00
Mattias WalströmandJoachim Wiberg 20cc36864a OSPF: Enable BFD integration
admin@example:/config/> edit routing control-plane-protocol ietf-ospf:ospfv2 name default
    admin@example:/config/routing/control-plane-protocol/ietf-ospf:ospfv2/name/default/ospf/> set area 0.0.0.0 interface e0 bfd enabled true
    admin@example:/config/routing/control-plane-protocol/static/name/default/> leave
    admin@example:/>
2024-01-08 10:04:44 +01:00
Mattias WalströmandJoachim Wiberg 729652469f infix-routing: Remove comments 2024-01-08 10:04:44 +01:00
Mattias WalströmandJoachim Wiberg 17409d1686 Add limitation on one area/interface
Since this is a limitation in FRR.
2024-01-08 10:04:44 +01:00
Mattias WalströmandJoachim Wiberg c8f7d0ee1c Check if OSPF is enabled not only if the node exist 2024-01-08 10:04:44 +01:00
Joachim WibergandMattias Walström 40c42c8fc1 dnsmasq.conf: D-Bus is not enabled in Classic builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-27 06:36:48 +01:00
Joachim WibergandMattias Walström 86dc560482 configs: sync classic with netconf defconfig essentials
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-27 06:36:48 +01:00
Joachim WibergandMattias Walström e821db57ce package/skeleton-init-finit: start sysklogd on classic builds
Classic builds don't have udev but rather mdev or mdevd.  This patch
imports support from myLinux for conditionally starting sysklogd on
classiic builds.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-27 06:36:48 +01:00
Joachim WibergandMattias Walström 2305f6adfd board: relocate prod scripts to netconf builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-27 06:36:48 +01:00
Joachim WibergandMattias Walström 4b6b90a79b board: fix breakage in classic builds
- Relocate python based probe to netconf builds, and
 - Restore basic shell script based probe for classic builds

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-27 06:36:48 +01:00
Mattias WalströmandJoachim Wiberg dd26838098 Documentation: Add information about OSPF stub areas 2023-12-26 12:11:37 +01:00
Mattias WalströmandJoachim Wiberg 79eefdec03 OSPF: Implement NSSA/Stub areas
admin@infix-00-00-00:/config/> edit routing control-plane-protocol ietf-ospf:ospfv2 name default
set ospf area 0.0.0.1 area-type nssa-area
set ospf area 0.0.0.1 area-type stub-area
set ospf area 0.0.0.1 summary true
set ospf area 0.0.0.1 default-cost 100
2023-12-26 12:11:37 +01:00
Mattias WalströmandJoachim Wiberg 2e8ba44abc libsrx: add lydx_get_bool to parse bool values 2023-12-26 12:11:37 +01:00
Mattias WalströmandJoachim Wiberg 2b154c1825 infix-routing: Add support for operational data
Now these are implemented:
* OSPF Router ID
* Neighbor status
* OSPF routing table
2023-12-26 12:11:37 +01:00
Mattias WalströmandJoachim Wiberg b5d0e2b007 ospf-status: Reimplement in python
This to be more flexible when adding operational data.
Also add support for neighbors.
2023-12-26 12:11:37 +01:00
Mattias WalströmandJoachim Wiberg 6db8c2bc75 infamy:netns: Add traceroute support 2023-12-26 12:11:37 +01:00
Joachim WibergandTobias Waldekranz 70c640fe48 configs: add htop, useful for debugging and monitoring
Better than Busybox top, and can attach strace to services.  So very
useful for debugging and monitoring a system.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-18 17:32:27 +01:00
Joachim WibergandTobias Waldekranz a36338f222 package/skeleton-init-finit: watchdogd must be in root cgroup
Since watchdogd may need to run with SCHED_RR, when the supervisor is enabled,
which is not supported by cgroupsv2, we ask Finit to always runs it in the
root cgroup.  We must also raise the limit for rtprio to all possible values
for SCHED_RR that a user can set in /etc/watchdogd.conf

Finally, add support for reading extra args from /etc/default/watchdogd

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-18 17:32:27 +01:00
Joachim WibergandTobias Waldekranz a6043ba4bc package/skeleton-init-finit: minor, add comment explaining the name
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-18 17:32:27 +01:00
Joachim WibergandTobias Waldekranz 871a536b1b Minor, add comment for Buildroot package overrides
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-18 17:32:27 +01:00
Joachim WibergandTobias Waldekranz 812b7748bb package/finit: sync package description with myLinux
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-18 17:32:27 +01:00
Mattias WalströmandJoachim Wiberg fc301201c6 ietf-ospf: Deviate everything thats not supported 2023-12-18 17:28:00 +01:00
Mattias WalströmandJoachim Wiberg 4e7bdc58d4 Add OSPFv2 support
A very limited part of the YANG model is implemented so far, basicly it is OSPFv2 with multiple areas and you can change timers
for the interfaces. Limited operational support.

admin@infix-00-00-00:/config/> edit routing control-plane-protocol ietf-ospf:ospfv2 name default
admin@infix-00-00-00:/config/routing/control-plane-protocol/ietf-ospf:ospfv2/name/default/> set ospf area 0.0.0.0 interface e0 enabled true
admin@infix-00-00-00:/config/routing/control-plane-protocol/ietf-ospf:ospfv2/name/default/> leave
2023-12-18 17:28:00 +01:00
Joachim WibergandMattias Walström 95c3e5c67c test: new test, verify dhcp option 121 is preferred over option 3
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 6b84bb4b13 test: new test, verify dhcp option 3 (router)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström a61b3b8aef test: minor refactor to check for nexthop (gw) in routes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström cb5419c84c test: new test, basic DHCP client
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 5056424867 test: new infamy DHCP server class
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 6244777f8e test: disable yang validation before sending config to target
This should probably be an optional argument to this method instead.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 556a7d884e test: two new methods to fetch ietf-ip ipv4 addresses
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström a745642ba2 confd: refactor, let default options to use same code path
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström a944923c6c test: add method, print all data for a given interface
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 4b08ccf842 test: rename method
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 0f7cee8192 test: minor, update module description
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 2b372dda28 test: fix regression in starting qeneth from e644d87c
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 62ef3e3fe8 board/netconf: add 'cfg' alias for 'sysrepocfg -f json'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 95bcc1d902 cli: for consistency with YANG model, rename METRIC --> PREF(ERENCE)
In review discussions we have decided, for resonsons of consistency over
correctness, to rename this column to match the YANG model node name
rather than the Linux kernel name.

Also, right align the values.  Numbers should always be right-aligned.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström eb89f14ea3 confd: add netlink condition to dhcp-client, <net/IFNAME/running>
This patch ensures that the DHCP client is not started until the
interface is up and running (link).  If the interface goes down,
or loses link, the client is stopped and everything learned from
the server (address, routes, DNS/NTP servers, etc.) is remvoed.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström e2e36d6439 patches/finit: backport silencing of noisy log messages
When an optional service doesn't exist, and the run/task/service stanza
clearly list `nowarn`, we should not log missing/skipping messages. This
patch-set is backported from the upcoming Finit v4.7

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström b6f8ec04b8 patches/finit: drop old v4.4 patches (on v4.6 now)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 6d3d49d7fd cli: add 'show dns' command to display DNS client status
This includes locally configured DNS and any learned from DHCP.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 993844d7b0 confd: refactor infix-dhcp-client options from leaf-list to list
This commit changes the DHCP options from plain flags to customizable
options with optional values.  This works for most key:value options,
but not for the more complex ones, e.g. option 81.  For this we have
dedicated handling to use `udhcpc -F fqdn` instad.

Additionally, the inference a default option list has been removed in
favor of a set of generic default options: router, dns, domain, address,
broadcast, ntpsrv, search, staticroutes, msstaticroutes.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 282fb1e74e confd: initial support for extended dhcp client settings
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 8eff9e6d6a confd: add support for arping (1 ARP w/ 1 sec timeout)
This should be longer, there are devices out there (in the industry)
that may drop the ball on a single ARP, or may be in deep sleep (IoT),
so we should send like 5 ARP with at least 1 sec between them before
timing out.

However, this requires patching BusyBox a bit, so skipping for now.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström c10e5797e9 confd: update DHCP YANG model, new options, arping, and route metric
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström eb0022b39d doc: list supported DHCP client options
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström c14b4e4152 confd: initial enhancements to DHCP client
- Add support for option 12, provide current hostname to server for
   registering the lease with -- this allows registering in local DNS
   for some DHCP servers.
 - Add support for option 50, request any previously cached IP address
 - Override option 60, vendor class identifier, with Infix vYY.MM
 - Adjust timers and retry options to be more persistant
 - Include initial metric as environment variable to client
 - Disable all default options, set a hard-coded subset, which will be
   replaced in a later commit by a generated list.
 - Ensure udhcpc creates a pid file, in case we may need to start any
   other service/task in sync with the DHCP client

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 2fa5dcfea0 board/common: major refactor of udhcpc script
- New log() function replaces stdout logging
 - New set_dhcp_routes() and clr_dhcp_routes() functions
   - Set all option 121 routes with same metric
   - Set all option 3 routers with increasing metric (this is what the
     reference udhcpc scripts do, and RFC says the routers should be
     listed in order of preference ...)
   - Clearing routes must, like IP addresses, be done both by interface
     and protocol.  This refactor makes sure to delete any DHCP routes
     set on the given interface (in case options change)
 - Use resolvconf per-interface search+nameserver
 - Cache IP lease so we can ask for it back later
 - On deconfig|leasefail|nak, make sure to clean up anything that might
   be lingering from this interface.  E.g., we can get leasefail when a
   server denies our request to prolong a lease.
 - On renew|bound, refresh routes, and set search+dns + NTP servers

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 49aec29a8d board/common: add support for acquiring NTP server from DHCP server
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 945716bdf1 confd: refactor ntp client setup
Move from everything in a single /etc/chrony.conf to a split up with
configuration and server snippets.  The latter comes in the form of
configured (static) and DHCP client (dynamic) server setup.

To accomodate this new scheme we need to detect when serves are removed
from the configuration, so not only have the whole change_ntp() been
refactored, it has been extended with a new pass.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Joachim WibergandMattias Walström 66037ae2de cli: add 'show ntp [sources]' command to admin-exec
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-14 16:40:41 +01:00
Mattias WalströmandTobias Waldekranz 5adff79ad7 netopeer2: Add upstream patch to get submodules when listing modules 2023-12-11 09:10:52 +01:00
Mattias WalströmandTobias Waldekranz 797d69e774 Add support for downloading required yang models automatic 2023-12-11 09:10:52 +01:00
Mattias WalströmandJoachim Wiberg 86557e447f Routing: Fix regression when adding static routes
Add autotest to regresssion suite to catch this
2023-12-07 14:52:00 +01:00
Mattias WalströmandJoachim Wiberg 4bea414f08 IPv6 Static routing: Update documentation 2023-12-07 14:52:00 +01:00
Mattias WalströmandJoachim Wiberg eab3c4d191 Add support for IPv6 static routing
admin@example:/> configure
admin@example:/config/> edit routing control-plane-protocol static name default
admin@example:/config/routing/control-plane-protocol/static/name/default/> set ipv6 route 2001:db8:3c4d:200::/64 next-hop next-hop-address 2001:db8:3c4d:1::1
admin@example:/config/routing/control-plane-protocol/static/name/default/> leave
admin@example:/>

admin@infix-00-01-00:/> show routes ipv6
PREFIX                        NEXT-HOP                      METRIC    PROTOCOL
2001:db8:3c4d:50::/64         eth4                          256       kernel
2001:db8:3c4d:200::1/128      lo                            256       kernel
fe80::/64                     eth3                          256       kernel
fe80::/64                     eth2                          256       kernel
fe80::/64                     eth1                          256       kernel
fe80::/64                     eth0                          256       kernel
fe80::/64                     eth5                          256       kernel
fe80::/64                     eth4                          256       kernel
::/0                          2001:db8:3c4d:50::1           20        static
2023-12-07 14:52:00 +01:00
Mattias WalströmandJoachim Wiberg a31b907bc0 Enable net.ipv6.conf.all.forwarding=1
This since the per interface setting does not work as in ipv4
The only way to limit forward (per interface) for ipv6 is by
using netfilter.
2023-12-07 14:52:00 +01:00
Richard AlpeandMattias Walström 734cc18919 test: change iface e4 state to down in cli unit test
This commit illustrates how to update the system output and
corresponding cli output.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-12-05 10:02:51 +01:00
Richard AlpeandMattias Walström 2661225aeb test: break out unit test and run early in GH actions
Break out unit tests to separate make target as they don't require all
the built code and infrastructure that the normal tests does.

Run the unit tests early in the Github action stage. They don't
require a full build. This will give early feedback to the users.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-12-05 10:02:51 +01:00
Richard AlpeandMattias Walström a9fd58c772 test: add offline unit test for yanger and cli-pretty
In this patch we add some arbitrary system output files which contains
interface data. Such as the output from "ip link" and "ethtool". These
files are used by yanger instead of running the actual commands.

Yanger then generates a lot of YANG json data, which are merged using
jq into something that looks like the sysrepo operational data on
a running system. This data is then passed though cli-pretty and its
ouput is compared to the static expected output in the .txt files in
cli-output.

Here's a basic flow overview.
* system-output/foo.json -> yanger ->> data
* system-output/bar.json -> yanger ->> data
* data -> merge -> sysrepo-operational-data
* sysrepo-operational-data -> cli-pretty -> output.txt
* compare output.txt too cli-output/show-foobar.txt

The result of this is that if something changes in yanger OR in
cli-pretty. The corresponding system-output file needs to be updated
for the test to pass. This is indented to catch regression where the
output is unintentionally changed.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-12-05 10:02:51 +01:00
Richard AlpeandMattias Walström ce37b33390 yanger: use argparse in yanger
This should be a non-functional change in preparation for upcoming
patches.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-12-05 10:02:51 +01:00
Joachim WibergandMattias Walström 415632f3b7 Fix #177: ensure bridge is not bridge port to itself
admin@infix-00-00-00:/> configure
admin@infix-00-00-00:/config/> edit interface br0
admin@infix-00-00-00:/config/interface/br0/> set bridge-port bridge br0
admin@infix-00-00-00:/config/interface/br0/> leave
Error: Must refer to a bridge interface (and not itself). (Data location "/ietf-interfaces:interfaces/interface[name='br0']/infix-interfaces:bridge-port/bridge".)
Failed committing candidate to running: Validation failed

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-05 10:02:25 +01:00
Joachim WibergandTobias Waldekranz d69f51a173 Fix #224: relocate /lib/infix to /libexec/infix
The /lib directory is not intended for executable scripts and programs.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-04 10:24:35 +01:00
Joachim WibergandTobias Waldekranz e644d87c31 Relocate qeneth and 9pm submodules to test/
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-01 20:57:54 +01:00
Joachim Wiberg 531bea0523 Fix #238: disable history in bash wrapper for klish
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-01 16:59:11 +01:00
Joachim Wiberg 5e26c82787 buildroot: bump to latest kkit branch for ugprades of sysrepo et al
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-01 16:45:07 +01:00
Mattias WalströmandTobias Waldekranz b29df19478 infamy: Add support for devices with other default password 2023-12-01 15:58:27 +01:00
Mattias WalströmandTobias Waldekranz 2cdb0a3d18 ietf_routing/static_routing: Fix test stability
Remove all sleeps and replace them with util.until()
2023-12-01 15:58:27 +01:00
Joachim Wiberg 978d08b19a package/klish-plugin-sysrepo: drop developer debug in 'set' command
Also, slight update of error messages in same command.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-01 14:28:16 +01:00
541 changed files with 37780 additions and 13422 deletions
+37
View File
@@ -0,0 +1,37 @@
<!--- **Summarize** your changes in the title above -->
## Description
<!--
-- A description of changes, detailing *why* changes are made.
-- 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:
- [ ] Bugfix
- [ ] Regression tests
- [ ] ChangeLog updates (for next release)
- [ ] Feature
- [ ] YANG model change => revision updated?
- [ ] Regression tests added?
- [ ] ChangeLog updates (for next release)
- [ ] Documentation added?
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (please detail in commit messages)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):
## References
<!-- Please list references to related issue(s) -->
+33 -27
View File
@@ -8,66 +8,69 @@ on:
jobs:
build:
name: Build ${{ matrix.platform }} ${{ matrix.variant }}
name: Build Infix ${{ matrix.platform }}
runs-on: ubuntu-latest
strategy:
matrix:
platform: [aarch64, x86_64]
variant: [netconf, classic]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Maintenance
run: |
docker image prune -af
docker volume prune -f
docker container prune -f
- uses: actions/checkout@v4
- name: Set Build Variables
id: vars
run: |
if [ "${{ matrix.variant }}" = "netconf" ]; then
target=${{ matrix.platform }}
else
target=${{ matrix.platform }}-${{ matrix.variant }}
fi
target=${{ matrix.platform }}
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
if [ "$target" = x86_64 ]; then
echo "out=$PWD/output" >> $GITHUB_OUTPUT
else
echo "out=/mnt/x-$target" >> $GITHUB_OUTPUT
fi
- name: Restore Cache of dl/
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dl/
key: dl-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-${{ matrix.platform }}-${{ matrix.variant }}-
dl-${{ matrix.platform }}-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .ccache/
key: ccache-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
key: ccache-${{ matrix.platform }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.platform }}-${{ matrix.variant }}-
ccache-${{ matrix.platform }}-
ccache-
- name: Configure & Build
run: |
if [ "${{ matrix.variant }}" = "netconf" ]; then
target=${{ matrix.platform }}_defconfig
else
target=${{ matrix.platform }}_${{ matrix.variant }}_defconfig
fi
echo "Buildring $target ..."
target=${{ matrix.platform }}_defconfig
echo "Building $target ..."
sudo mkdir ${{ steps.vars.outputs.out }}
sudo chown $(id -un):$(id -gn) ${{ steps.vars.outputs.out }}
export O=${{ steps.vars.outputs.out }}
make $target
make
- name: Prepare Artifact
run: |
cd output
cd ${{ steps.vars.outputs.out }}
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.platform == 'x86_64' && matrix.variant == 'netconf'
if: matrix.platform == 'x86_64'
run: |
export O=${{ steps.vars.outputs.out }}
make test-qeneth
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: output/${{ steps.vars.outputs.tgz }}
path: ${{ steps.vars.outputs.out }}/${{ steps.vars.outputs.tgz }}
name: artifact-${{ matrix.platform }}
release:
if: ${{github.repository_owner == 'kernelkit' && github.ref_name == 'main'}}
name: Upload Latest Build
@@ -76,7 +79,10 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
pattern: "artifact-*"
merge-multiple: true
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
@@ -86,7 +92,7 @@ jobs:
prerelease: true
tag: "latest"
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "artifact/*"
artifacts: "*.tar.gz"
- name: Summary
run: |
cat <<EOF >> $GITHUB_STEP_SUMMARY
+8 -4
View File
@@ -1,6 +1,8 @@
name: Coverity Scan
on:
schedule:
- cron: '5 0 * * *'
workflow_dispatch:
env:
@@ -9,6 +11,7 @@ env:
jobs:
coverity:
if: ${{github.repository_owner == 'kernelkit'}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -21,7 +24,7 @@ jobs:
--post-data "token=$TOKEN&project=${PROJECT_NAME}&md5=1" \
-O coverity-latest.tar.gz.md5
echo "md5=$(cat coverity-latest.tar.gz.md5)" | tee -a $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
path: coverity-latest.tar.gz
@@ -47,8 +50,9 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install pkg-config libjansson-dev libev-dev libite-dev \
libaugeas-dev libglib2.0-dev libpcre2-dev
sudo apt-get -y install pkg-config libjansson-dev libev-dev \
libaugeas-dev libglib2.0-dev libpcre2-dev \
libuev-dev libite-dev
- name: Build dependencies
run: |
git clone https://github.com/CESNET/libyang.git
@@ -75,7 +79,7 @@ jobs:
--form description="${PROJECT_NAME} $(git rev-parse HEAD)" \
https://scan.coverity.com/builds?project=${PROJECT_NAME}
- name: Upload build.log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverity-build.log
path: cov-int/build-log.txt
+100
View File
@@ -0,0 +1,100 @@
name: Manny the Manager
on:
workflow_dispatch:
inputs:
checkout:
required: true
type: boolean
cleanup:
required: true
type: boolean
peek:
required: true
type: boolean
jobs:
inventory:
runs-on: ubuntu-latest
steps:
- name: Disk usage ...
run: |
cd
du -hs .[^.]*
- name: Disk inventory (1/2) ...
run: |
echo "df -h ========================================================================="
df -h
echo "mounts ========================================================================"
mount
- name: File inventory (1/2) ...
run: |
echo "Current directory: $(pwd)"
echo "Files in $HOME ================================================================"
ls $HOME
echo "Find $HOME ===================================================================="
find $HOME
- name: Container inventory ...
run: |
echo "Available container images: ==================================================="
docker images
echo "Available containers: ========================================================="
docker ps -a
checkout:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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-netconf-
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-x86_64-
ccache-
- name: Disk inventory (2/2) ...
run: |
echo "df -h ========================================================================="
df -h
echo "mounts ========================================================================"
mount
- name: File inventory (2/2) ...
run: |
echo "Current directory: $(pwd)"
echo "Files in $HOME ================================================================"
ls $HOME
echo "Find $HOME ===================================================================="
find $HOME
peeky:
if: ${{ inputs.peek }}
runs-on: ubuntu-latest
steps:
- name: Peek & Poke ...
run: |
whoami
ls -l /mnt/
cat /mnt/DATALOSS_WARNING_README.txt
sudo mkdir /mnt/x-aarch64
sudo chown $(id -un):$(id -gn) /mnt/x-aarch64
ls -l /mnt/
cleanup:
if: ${{ inputs.cleanup }}
needs: [inventory, peeky]
runs-on: ubuntu-latest
steps:
- name: Cleaning up cruft ...
run: |
docker image prune -af
docker volume prune -f
docker container prune -f
+16 -10
View File
@@ -16,11 +16,15 @@ concurrency:
jobs:
build:
name: Regression Testing
runs-on: ubuntu-latest
runs-on: self-hosted
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Clean up cruft ...
run: |
./test/env -c
- name: Set Build Variables
id: vars
run: |
@@ -28,26 +32,28 @@ jobs:
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
- name: Restore Cache of dl/
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dl/
key: dl-x86_64-netconf-${{ hashFiles('.git/modules/buildroot/refs/heads/master', 'package/*/*.hash') }}
key: dl-netconf-${{ hashFiles('.git/modules/buildroot/refs/heads/master', 'package/*/*.hash') }}
restore-keys: |
dl-x86_64-netconf-
dl-x86_64-
dl-netconf-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .ccache/
key: ccache-x86_64-netconf-${{ hashFiles('.git/modules/buildroot/refs/head/master', 'package/*/*.hash') }}
key: ccache-x86_64-${{ hashFiles('.git/modules/buildroot/refs/head/master', 'package/*/*.hash') }}
restore-keys: |
ccache-x86_64-netconf-
ccache-x86_64-
ccache-
- name: Configure NETCONF
run: |
make x86_64_defconfig
- name: Unit Test
run: make test-unit
- name: Build
run: |
make
@@ -58,7 +64,7 @@ jobs:
ln -s ${{ steps.vars.outputs.dir }} images
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: output/${{ steps.vars.outputs.tgz }}
+70 -39
View File
@@ -20,17 +20,21 @@ on:
jobs:
build:
if: github.repository == 'kernelkit/infix' && startsWith(github.ref, 'refs/tags/')
name: Build Infix ${{ github.ref_name }} [${{ matrix.platform }}-${{ matrix.variant }}]
name: Build Infix ${{ github.ref_name }} [${{ matrix.platform }}]
runs-on: ubuntu-latest
strategy:
matrix:
platform: [aarch64, x86_64]
variant: [netconf, classic]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Maintenance
run: |
docker image prune -af
docker volume prune -f
docker container prune -f
- uses: actions/checkout@v4
- name: Set Release Variables
id: build
id: vars
run: |
if [ -n "${{ inputs.version }}" ]; then
ver=${{ inputs.version }}
@@ -38,65 +42,91 @@ jobs:
ver=${GITHUB_REF#refs/tags/}
fi
echo "ver=${ver}" >> $GITHUB_OUTPUT
if echo $ver | grep -qE 'v[0-9\.]+(-alpha|-beta|-rc)[0-9]*'; then
echo "pre=true" >> $GITHUB_OUTPUT
else
echo "pre=false" >> $GITHUB_OUTPUT
fi
fver=${ver#v}
if [ "${{ matrix.variant }}" = "netconf" ]; then
target=${{ matrix.platform }}-${fver}
else
target=${{ matrix.platform }}-${{ matrix.variant }}-${fver}
fi
target=${{ matrix.platform }}-${fver}
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
echo "out=/mnt/x-$target" >> $GITHUB_OUTPUT
- name: Restore Cache of dl/
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dl/
key: dl-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-${{ matrix.platform }}-${{ matrix.variant }}-
dl-${{ matrix.platform }}-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .ccache/
key: ccache-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
key: ccache-${{ matrix.platform }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.platform }}-${{ matrix.variant }}-
ccache-${{ matrix.platform }}-
ccache-
- name: Configure & Build
env:
INFIX_RELEASE: ${{ steps.build.outputs.ver }}
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
run: |
if [ "${{ matrix.variant }}" = "netconf" ]; then
target=${{ matrix.platform }}_defconfig
else
target=${{ matrix.platform }}_${{ matrix.variant }}_defconfig
fi
echo "Buildring $target ..."
target=${{ matrix.platform }}_defconfig
echo "Building $target ..."
sudo mkdir ${{ steps.vars.outputs.out }}
sudo chown $(id -un):$(id -gn) ${{ steps.vars.outputs.out }}
export O=${{ steps.vars.outputs.out }}
make $target
make
- name: Prepare Artifact
- name: Generate SBOM from Build
run: |
cd output
mv images ${{ steps.build.outputs.dir }}
ln -s ${{ steps.build.outputs.dir }} images
tar chfz ${{ steps.build.outputs.tgz }} ${{ steps.build.outputs.dir }}
- uses: actions/upload-artifact@v3
make legal-info
- name: Prepare Artifacts
run: |
cd ${{ steps.vars.outputs.out }}
mv images ${{ steps.vars.outputs.dir }}
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
- uses: actions/upload-artifact@v4
with:
path: output/${{ steps.build.outputs.tgz }}
name: artifact-${{ matrix.platform }}
path: ${{ steps.vars.outputs.out }}/*.tar.gz
release:
name: Release Infix ${{ github.ref_name }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- name: Set Release Variables
id: rel
run: |
if [ -n "${{ inputs.version }}" ]; then
ver=${{ inputs.version }}
else
ver=${GITHUB_REF#refs/tags/}
fi
echo "ver=${ver}" >> $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
else
echo "pre=false" >> $GITHUB_OUTPUT
echo "latest=false" >> $GITHUB_OUTPUT
fi
echo "pre=${{ steps.rel.outputs.pre }}"
echo "latest=${{ steps.rel.outputs.latest }}"
- uses: actions/download-artifact@v4
with:
pattern: "artifact-*"
merge-multiple: true
- name: Create checksums ...
run: |
for file in *.tar.gz; do
sha256sum $file > $file.sha256
done
- name: Extract ChangeLog entry ...
run: |
awk '/^-----*$/{if (x == 1) exit; x=1;next}x' doc/ChangeLog.md \
@@ -105,9 +135,10 @@ jobs:
- uses: ncipollo/release-action@v1
with:
name: Infix ${{ github.ref_name }}
prerelease: ${{ needs.build.outputs.pre }}
prerelease: ${{ steps.rel.outputs.pre }}
makeLatest: ${{ steps.rel.outputs.latest }}
bodyFile: release.md
artifacts: artifact/*
artifacts: "*.tar.gz*"
- name: Summary
run: |
cat <<EOF >> $GITHUB_STEP_SUMMARY
+2 -2
View File
@@ -2,8 +2,8 @@
path = buildroot
url = ../buildroot.git
[submodule "9pm"]
path = 9pm
path = test/9pm
url = ../9pm
[submodule "qeneth"]
path = qeneth
path = test/qeneth
url = ../qeneth.git
+1 -20
View File
@@ -54,7 +54,7 @@ config INFIX_IMAGE_ID
config INFIX_TAGLINE
string "Operating system tagline"
default "Infix a Network Operating System"
default "Infix -- a Network Operating System"
help
Mandatory. Used for identifying the OS, e.g. as PRETTY_NAME in
/etc/os-release and description in the GNS3 appliance.
@@ -112,25 +112,6 @@ config INFIX_ARCH
default "riscv64" if BR2_riscv
default "x86_64" if BR2_x86_64
# For /etc/os-release, VARIANT & VARIANT_ID used, e.g., in mnt script
choice
prompt "Select variant/flavor"
default INFIX_VARIANT_NETCONF
config INFIX_VARIANT_NETCONF
bool "NETCONF"
help
Managed NETCONF mode, /etc is a ramdisk, all configuration is
generated by sysrepo plugins using NETCONF (xml) or RESTCONF.
config INFIX_VARIANT_CLASSIC
bool "Classic /etc mode"
help
User managed mode, read-write configuration files in /etc that
is saved across reboots.
endchoice
menu "Packages"
source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in"
+8 -3
View File
@@ -22,12 +22,17 @@ $(config):
@echo "'make <board>_defconfig' before building an image."
@exit 1
%: | buildroot/Makefile
@+$(call bmake,$@)
legal-info: | buildroot/Makefile
$(call bmake,legal-info LINUX_LICENSE_FILES=COPYING)
# Workaround, see board/x86_64/board.mk
test:
@+$(call bmake,$@)
buildroot/Makefile:
@git submodule update --init
.PHONY: all check
.PHONY: all check test
+48 -22
View File
@@ -1,27 +1,43 @@
[![License Badge][]][License] [![Coverity Status][]][Coverity Scan]
[![License Badge][]][License] [![GitHub Status][]][GitHub] [![Coverity Status][]][Coverity Scan] [![Discord][discord-badge]][discord-url]
<img align="right" src="doc/logo.png" alt="Infix - Linux <3 NETCONF" width=480 border=10>
<details><summary><b>Documentation</b></summary>
- **Infix In-Depth**
- [Infix Variants](doc/variant.md)
- [Boot Procedure](doc/boot.md)
- [Containers in Infix](doc/container.md)
- [Developer's Guide](doc/developers-guide.md)
- [Discover Your Device](doc/discovery.md)
- [Virtual Environments](doc/virtual.md)
- [Origin & Licensing](doc/license.md)
- **CLI Topics**
- [Introduction to the CLI](doc/cli/introduction.md)
- [CLI User's Guide](doc/cli/tutorial.md)
- [Quick Overview](doc/cli/quick.md)
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.
</details>
> Click the **▶ Example CLI Session** foldout below for an example, or
> head on over to the [Infix Documentation](doc/README.md) for more
> information on how to set up the system.
Infix is a Linux Network Operating System (NOS) based 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] (remote) or the built-in [command
line interface (CLI)][3] (click the foldout for an example).
Although primarily focused on switches and routers, the core values
may be appealing for other use-cases as well:
- Runs from a squashfs image on a read-only partition
- Single configuration file on a separate partition
- Built around YANG with standard IETF models
- Linux switchdev provides open switch APIs
- Atomic upgrades to secondary partition
- Highly security focused
An immutable[^2] 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.
In itself Infix is perfectly suited for dedicated networking tasks and
native support for Docker containers provides a versatile platform that
can easily be adapted to any customer need. Be it legacy applications,
network protocols, process monitoring, or edge data analysis, it can run
close to end equipment. Either directly connected on dedicated Ethernet
ports or indirectly using virtual network cables to exist on the same
LAN as other connected equipment.
The simple design of Infix provides complete control over both system
and data, minimal cognitive burden, and makes it incredibly easy to get
started.
<details><summary><b>Example CLI Session</b></summary>
@@ -77,6 +93,7 @@ The [following boards](board/aarch64/README.md) are fully supported:
- Marvell CN9130 CRB
- Marvell EspressoBIN
- Microchip SparX-5i PCB135 (eMMC)
- NanoPi R2S
An x86_64 build is also available, primarily intended for development
and testing, but can also be used for evaluation and demo purposes. For
@@ -88,13 +105,22 @@ 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>,
for more information, see [Infix Variants](doc/variant.md).
[^1]: NETCONF or RESTCONF, <https://datatracker.ietf.org/doc/html/rfc8040>
[^2]: 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/>.
[1]: https://buildroot.org/
[2]: https://www.sysrepo.org/
[3]: doc/cli/introduction.md
[License]: https://en.wikipedia.org/wiki/GPL_license
[License Badge]: https://img.shields.io/badge/License-GPL%20v2-blue.svg
[GitHub]: https://github.com/kernelkit/infix/actions/workflows/build.yml/
[GitHub Status]: https://github.com/kernelkit/infix/actions/workflows/build.yml/badge.svg
[Coverity Scan]: https://scan.coverity.com/projects/29393
[Coverity Status]: https://scan.coverity.com/projects/29393/badge.svg
[discord-badge]: https://img.shields.io/discord/1182652155618918411.svg?logo=discord
[discord-url]: https://discord.gg/6bHJWQNVxN
+19 -49
View File
@@ -6,6 +6,7 @@
* Device tree for Alder board
*/
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
@@ -13,6 +14,10 @@
#include "alder-mpp.h"
&ap_crit {
temperature = <115000>;
};
/ {
model = "Alder";
compatible = "alder,alder",
@@ -24,6 +29,8 @@
infix {
vpds = <&vpd_cpu &vpd_product &vpd_power>;
usb-ports = <&cp0_usb3_1>;
usb-port-names = "USB";
};
};
@@ -195,53 +202,6 @@
};
/* CP SDHCI (Micro-SD) */
/ {
cp0_reg_sd_vccq: cp0_sd_vccq@0 {
compatible = "regulator-gpio";
regulator-name = "cp0_sd_vccq";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
/* gpios = <&CP_SD_HST_18_EN>; */
states = <1800000 0x1
3300000 0x0>;
};
cp0_reg_sd_vcc: cp0_sd_vcc@0 {
compatible = "regulator-fixed";
regulator-name = "cp0_sd_vcc";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
/* gpio = <&CP_SD_CRD_PWR_OFF>; */
enable-active-high;
regulator-always-on;
};
};
&cp0_pinctrl {
cp0_sdhci_pins: cp0-sdhi-pins-0 {
marvell,pins = \
CP_SD_CRD_PWR_OFF(MPP_ID), CP_SD_HST_18_EN(MPP_ID), \
CP_SD_CRD_DT(MPP_ID), CP_SD_LED(MPP_ID), \
CP_SD_CLK(MPP_ID), CP_SD_CMD(MPP_ID), \
CP_SD_D0(MPP_ID), CP_SD_D1(MPP_ID), \
CP_SD_D2(MPP_ID), CP_SD_D3(MPP_ID);
marvell,function = "sdio";
};
};
&cp0_sdhci0 {
status = "disabled";
pinctrl-names = "default";
pinctrl-0 = <&cp0_sdhci_pins>;
bus-width = <4>;
/* cd-gpios = <&CP_SD_CRD_DT>; */
vqmmc-supply = <&cp0_reg_sd_vccq>;
vmmc-supply = <&cp0_reg_sd_vcc>;
};
/* SPI1 (Boot FLASH) */
&cp0_pinctrl {
@@ -314,7 +274,7 @@
};
&cp0_usb3_1 {
status = "disabled";
status = "okay";
usb-phy = <&cp0_usb3_0_phy1>;
phys = <&cp0_utmi1>, <&cp0_comphy3 1>;
phy-names = "usb", "usb3";
@@ -647,9 +607,19 @@
};
};
/* Reset button */
/ {
gpio-keys {
compatible = "gpio-keys";
up {
label = "factory-reset";
linux,code = <KEY_RESTART>;
gpios = <&GPIO_RESET_BUTTON>;
};
};
};
/* System LEDs */
/ {
power-a {
compatible = "gpio-charger";
@@ -6,3 +6,7 @@
compatible = "marvell,cp115-standalone-pinctrl";
};
};
&cp0_xmdio {
clock-names = "gop_clk", "mg_clk", "mg_core_clk", "axi_clk";
};
+76
View File
@@ -0,0 +1,76 @@
#ifndef _STYX_MPP_H
#define _STYX_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)
#define SFP2_TX_DISABLE(X) X( "mpp2", cp0_gpio1, 2, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)
#define SFP3_TX_DISABLE(X) X( "mpp3", cp0_gpio1, 3, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)
#define SFP0_RS0(X) X( "mpp4", cp0_gpio1, 4, GPIO_ACTIVE_HIGH)
#define SFP1_RS0(X) X( "mpp5", cp0_gpio1, 5, GPIO_ACTIVE_HIGH)
#define SFP2_RS0(X) X( "mpp6", cp0_gpio1, 6, GPIO_ACTIVE_HIGH)
#define SFP3_RS0(X) X( "mpp7", cp0_gpio1, 7, GPIO_ACTIVE_HIGH)
#define SFP0_RS1(X) X( "mpp8", cp0_gpio1, 8, GPIO_ACTIVE_HIGH)
#define SFP1_RS1(X) X( "mpp9", cp0_gpio1, 9, GPIO_ACTIVE_HIGH)
#define SFP2_RS1(X) X("mpp10", cp0_gpio1, 10, GPIO_ACTIVE_HIGH)
#define SFP3_RS1(X) X("mpp11", cp0_gpio1, 11, GPIO_ACTIVE_HIGH)
/* mpp12: Unused */
#define CP_SPI1_MISO(X) X("mpp13", none, 0, 0)
#define CP_SPI1_CS0(X) X("mpp14", none, 0, 0)
#define CP_SPI1_MOSI(X) X("mpp15", none, 0, 0)
#define CP_SPI1_SCK(X) X("mpp16", none, 0, 0)
/* mpp17: Unused */
/* mpp18: Unused */
/* mpp19: Unused */
/* mpp20: Unused */
/* mpp21: Unused */
/* mpp22: Unused */
/* mpp23: Unused */
/* mpp24: Unused */
/* mpp25: Unused */
/* mpp26: Unused */
#define SFP0_RX_LOS(X) X("mpp27", cp0_gpio1, 27, GPIO_ACTIVE_HIGH)
#define SFP1_RX_LOS(X) X("mpp28", cp0_gpio1, 28, GPIO_ACTIVE_HIGH)
#define SFP2_RX_LOS(X) X("mpp29", cp0_gpio1, 29, GPIO_ACTIVE_HIGH)
#define SFP3_RX_LOS(X) X("mpp30", cp0_gpio1, 30, GPIO_ACTIVE_HIGH)
#define SFP0_TX_FAULT(X) X("mpp31", cp0_gpio1, 31, GPIO_ACTIVE_HIGH)
#define SFP1_TX_FAULT(X) X("mpp32", cp0_gpio2, 0, GPIO_ACTIVE_HIGH)
#define SFP2_TX_FAULT(X) X("mpp33", cp0_gpio2, 1, GPIO_ACTIVE_HIGH)
#define SFP3_TX_FAULT(X) X("mpp34", cp0_gpio2, 2, GPIO_ACTIVE_HIGH)
#define CP_I2C1_SDA(X) X("mpp35", none, 0, 0)
#define CP_I2C1_SCK(X) X("mpp36", none, 0, 0)
#define CP_I2C0_SCK(X) X("mpp37", none, 0, 0)
#define CP_I2C0_SDA(X) X("mpp38", none, 0, 0)
/* mpp39: Unused */
#define CP_SMI_MDIO(X) X("mpp40", none, 0, 0)
#define CP_SMI_MDC(X) X("mpp41", none, 0, 0)
/* mpp42: Unused */
/* mpp43: Unused */
/* mpp44: Unused */
/* mpp45: Unused */
/* mpp46: Unused */
#define CP_UA1_TXD(X) X("mpp47", none, 0, 0)
/* mpp48: Unused */
#define SW1_RESETn(X) X("mpp49", cp0_gpio2, 17, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SW2_RESETn(X) X("mpp50", cp0_gpio2, 18, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SW3_RESETn(X) X("mpp51", cp0_gpio2, 19, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
/* mpp52: Unused */
#define CP_UA1_RXD(X) X("mpp53", none, 0, 0)
#define SFP0_MOD_ABS(X) X("mpp54", cp0_gpio2, 22, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SFP1_MOD_ABS(X) X("mpp55", cp0_gpio2, 23, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SFP2_MOD_ABS(X) X("mpp56", cp0_gpio2, 24, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SFP3_MOD_ABS(X) X("mpp57", cp0_gpio2, 25, GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)
#define SW1_INTn(X) X("mpp58", cp0_gpio2, 26, IRQ_TYPE_LEVEL_LOW)
#define SW2_INTn(X) X("mpp59", cp0_gpio2, 27, IRQ_TYPE_LEVEL_LOW)
#define SW3_INTn(X) X("mpp60", cp0_gpio2, 28, IRQ_TYPE_LEVEL_LOW)
/* mpp61: Unused */
#define DDR_TEN(X) X("mpp62", cp0_gpio2, 30, GPIO_ACTIVE_HIGH)
/* Macros to extract MPP info in different formats */
#define MPP_ID(_mpp, _chip, _no, _flags) _mpp
#define MPP_GPIO_CHIP(_mpp, _chip, _no, _flags) _chip
#define MPP_GPIO_REF(_mpp, _chip, _no, _flags) <&_chip _no (_flags)>
#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 */
+9
View File
@@ -0,0 +1,9 @@
// 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"
+566
View File
@@ -0,0 +1,566 @@
// 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 <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include "../marvell/cn9130-patched.dtsi"
#include "styx-mpp.h"
/ {
model = "Styx";
compatible = "styx,styx",
"marvell,armada-ap807-quad",
"marvell,armada-ap807";
chosen {
stdout-path = "serial0:115200n8";
infix {
/* "admin" */
factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A";
vpds = <&vpd>;
};
};
memory@0 {
device_type = "memory";
reg = <0x0 0x0 0x0 0x80000000>;
};
};
/* UART0 (Console) */
&uart0 {
status = "okay";
};
/* UART1 (Auxiliary) */
&cp0_pinctrl {
cp0_uart1_pins: cp0-uart1-pins {
marvell,pins = CP_UA1_RXD(MPP_ID), CP_UA1_TXD(MPP_ID);
marvell,function = "uart1";
};
};
&cp0_uart1 {
/* TODO: Figure out how to enable this without affecting
* /chosen/stdout-path
*/
status = "disabled";
pinctrl-names = "default";
pinctrl-0 = <&cp0_uart1_pins>;
};
/* GPIO */
&cp0_gpio1 {
status = "okay";
};
&cp0_gpio2 {
status = "okay";
};
/* I2C0 (EEPROM) */
&cp0_pinctrl {
cp0_i2c0_pins: cp0-i2c0-pins {
marvell,pins = CP_I2C0_SCK(MPP_ID), CP_I2C0_SDA(MPP_ID);
marvell,function = "i2c0";
};
};
&cp0_i2c0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_i2c0_pins>;
vpd: eeprom@50 {
compatible = "atmel,24c256";
reg = <0x50>;
infix,board = "cpu";
infix,trusted;
nvmem-layout {
compatible = "onie,tlv-layout";
base_mac: mac-address {
#nvmem-cell-cells = <1>;
};
};
};
spd: eeprom@53 {
compatible = "spd";
reg = <0x53>;
};
eeprom@57 {
compatible = "atmel,24c256";
reg = <0x57>;
};
};
/* I2C1 (Mux) */
&cp0_pinctrl {
cp0_i2c1_pins: cp0-i2c1-pins {
marvell,pins = CP_I2C1_SCK(MPP_ID), CP_I2C1_SDA(MPP_ID);
marvell,function = "i2c1";
};
};
&cp0_i2c1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_i2c1_pins>;
i2cmux@77 {
compatible = "nxp,pca9548";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x77>;
i2c_sfp0: i2c@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
};
i2c_sfp1: i2c@1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
};
i2c_sfp2: i2c@2 {
#address-cells = <1>;
#size-cells = <0>;
reg = <2>;
};
i2c_sfp3: i2c@3 {
#address-cells = <1>;
#size-cells = <0>;
reg = <3>;
};
};
};
/* SPI1 (Boot FLASH) */
&cp0_pinctrl {
cp0_spi1_pins: cp0-spi-pins-0 {
marvell,pins = \
CP_SPI1_MISO(MPP_ID), CP_SPI1_CS0(MPP_ID), \
CP_SPI1_MOSI(MPP_ID), CP_SPI1_SCK(MPP_ID);
marvell,function = "spi1";
};
};
&cp0_spi1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_spi1_pins>;
/* Boot flash */
spi-flash@0 {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "jedec,spi-nor", "spi-flash";
reg = <0x0>;
spi-max-frequency = <90000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot0@0 {
label = "boot0";
reg = <0x0 0x200000>;
};
boot1@200000 {
label = "boot1";
reg = <0x200000 0x200000>;
};
};
};
};
/* AP SDHCI (eMMC) */
&ap_sdhci0 {
status = "okay";
bus-width = <8>;
mmc-ddr-1_8v;
mmc-hs400-1_8v;
};
&cp0_crypto {
status = "okay";
};
&cp0_ethernet {
status = "okay";
};
/* ETH1 (Connection to BMC) */
&cp0_eth2 {
status = "okay";
phy-mode = "sgmii";
phys = <&cp0_comphy5 2>;
managed = "in-band-status";
nvmem-cells = <&base_mac 0>;
nvmem-cell-names = "mac-address";
};
/* ETH0 (DSA connection to switch tree) */
&cp0_eth0 {
status = "okay";
phy-mode = "10gbase-r";
phys = <&cp0_comphy2 0>;
managed = "in-band-status";
nvmem-cells = <&base_mac 0>;
nvmem-cell-names = "mac-address";
};
/* MDIO (Switch Tree) */
&cp0_pinctrl {
cp0_mdio_pins: cp0-mdio-pins-0 {
marvell,pins = CP_SMI_MDIO(MPP_ID), CP_SMI_MDC(MPP_ID);
marvell,function = "ge";
};
};
#define SWP_LED(_func) \
leds { \
#address-cells = <1>; \
#size-cells = <0>; \
\
led@0 { \
reg = <0>; \
function = _func; \
color = <LED_COLOR_ID_GREEN>; \
default-state = "keep"; \
}; \
led@1 { \
reg = <1>; \
function = _func; \
color = <LED_COLOR_ID_YELLOW>; \
default-state = "off"; \
}; \
}
#define XSWP(_n, _label, _mac_offs, _sfp) \
port@_n { \
reg = <0x ## _n>; \
label = _label; \
nvmem-cells = <&base_mac _mac_offs>; \
nvmem-cell-names = "mac-address"; \
phy-mode = "10gbase-r"; \
managed = "in-band-status"; \
sfp = <&_sfp>; \
SWP_LED("sfp"); \
}
#define GSWP(_n, _label, _mac_offs, _phy) \
port@_n { \
reg = <0x ## _n>; \
label = _label; \
nvmem-cells = <&base_mac _mac_offs>; \
nvmem-cell-names = "mac-address"; \
phy-mode = "gmii"; \
phy-handle = <&_phy>; \
SWP_LED("tp"); \
}
#define GPHY(_n) \
ethernet-phy@_n { \
compatible = "ethernet-phy-ieee802.3-c22"; \
reg = <_n>; \
eee-broken-100tx; \
eee-broken-1000t; \
}
&cp0_mdio {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_mdio_pins>;
sw3: switch@6 {
compatible = "marvell,mv88e6190";
#address-cells = <1>;
#size-cells = <0>;
reg = <6>;
reset-gpios = SW3_RESETn(MPP_GPIO_REF);
interrupts-extended = SW3_INTn(MPP_IRQ_REF);
interrupt-controller;
dsa,member = <0 0>;
ports {
#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);
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
sw3phy1: GPHY(1);
sw3phy2: GPHY(2);
sw3phy3: GPHY(3);
sw3phy4: GPHY(4);
sw3phy5: GPHY(5);
sw3phy6: GPHY(6);
sw3phy7: GPHY(7);
sw3phy8: GPHY(8);
};
};
sw2: switch@4 {
compatible = "marvell,mv88e6190";
#address-cells = <1>;
#size-cells = <0>;
reg = <4>;
reset-gpios = SW2_RESETn(MPP_GPIO_REF);
interrupts-extended = SW2_INTn(MPP_IRQ_REF);
interrupt-controller;
dsa,member = <0 1>;
ports {
#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);
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
sw2phy1: GPHY(1);
sw2phy2: GPHY(2);
sw2phy3: GPHY(3);
sw2phy4: GPHY(4);
sw2phy5: GPHY(5);
sw2phy6: GPHY(6);
sw2phy7: GPHY(7);
sw2phy8: GPHY(8);
};
};
sw1: switch@2 {
compatible = "marvell,mv88e6190";
#address-cells = <1>;
#size-cells = <0>;
reg = <2>;
reset-gpios = SW1_RESETn(MPP_GPIO_REF);
interrupts-extended = SW1_INTn(MPP_IRQ_REF);
interrupt-controller;
dsa,member = <0 2>;
ports {
#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);
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
sw1phy1: GPHY(1);
sw1phy2: GPHY(2);
sw1phy3: GPHY(3);
sw1phy4: GPHY(4);
sw1phy5: GPHY(5);
sw1phy6: GPHY(6);
sw1phy7: GPHY(7);
sw1phy8: GPHY(8);
};
};
};
/ {
sfp0: sfp@0 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp0>;
mod-def0-gpios = SFP0_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP0_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP0_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP0_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP0_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP0_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
sfp1: sfp@1 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp1>;
mod-def0-gpios = SFP1_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP1_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP1_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP1_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP1_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP1_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
sfp2: sfp@2 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp2>;
mod-def0-gpios = SFP2_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP2_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP2_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP2_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP2_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP2_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
sfp3: sfp@3 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp3>;
mod-def0-gpios = SFP3_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP3_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP3_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP3_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP3_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP3_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
};
+25 -38
View File
@@ -21,7 +21,6 @@ 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
@@ -32,7 +31,6 @@ CONFIG_SCHED_AUTOGROUP=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PROFILING=y
CONFIG_SMP=y
CONFIG_ARCH_SPARX5=y
CONFIG_ARCH_MVEBU=y
CONFIG_ARCH_VEXPRESS=y
@@ -49,12 +47,6 @@ CONFIG_CPUFREQ_DT=y
CONFIG_ARM_ARMADA_37XX_CPUFREQ=y
CONFIG_ARM_ARMADA_8K_CPUFREQ=y
CONFIG_ACPI=y
CONFIG_ARM64_CRYPTO=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y
CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
# CONFIG_GCC_PLUGINS is not set
@@ -67,10 +59,8 @@ CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_CMA=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
@@ -112,7 +102,6 @@ CONFIG_NFT_MASQ=m
CONFIG_NFT_REDIR=m
CONFIG_NFT_NAT=m
CONFIG_NFT_TUNNEL=m
CONFIG_NFT_OBJREF=m
CONFIG_NFT_QUEUE=m
CONFIG_NFT_REJECT=m
CONFIG_NFT_COMPAT=m
@@ -186,9 +175,7 @@ CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBQ=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_TCINDEX=y
CONFIG_NET_CLS_BPF=y
CONFIG_NET_CLS_FLOWER=y
CONFIG_NETLINK_DIAG=y
@@ -236,7 +223,6 @@ CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y
CONFIG_AHCI_MVEBU=y
CONFIG_PATA_PLATFORM=y
CONFIG_PATA_OF_PLATFORM=y
CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
@@ -325,6 +311,7 @@ CONFIG_8139CP=y
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
CONFIG_SFP=y
CONFIG_AX88796B_PHY=y
CONFIG_MARVELL_PHY=y
CONFIG_MARVELL_10G_PHY=m
CONFIG_MICREL_PHY=y
@@ -332,12 +319,12 @@ CONFIG_MICROCHIP_PHY=y
CONFIG_MICROCHIP_T1_PHY=y
CONFIG_MICROSEMI_PHY=m
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_MVUSB=y
CONFIG_MDIO_MVUSB=m
CONFIG_MDIO_MSCC_MIIM=y
CONFIG_MDIO_BUS_MUX_MMIOREG=y
CONFIG_USB_RTL8152=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_CDC_EEM=y
CONFIG_USB_RTL8152=m
CONFIG_USB_USBNET=m
CONFIG_USB_NET_CDC_EEM=m
# CONFIG_USB_NET_CDC_NCM is not set
# CONFIG_USB_NET_NET1080 is not set
# CONFIG_USB_NET_CDC_SUBSET is not set
@@ -371,7 +358,6 @@ CONFIG_I2C_MV64XXX=y
CONFIG_I2C_SLAVE=y
CONFIG_SPI=y
CONFIG_SPI_ARMADA_3700=y
CONFIG_SPI_NXP_FLEXSPI=y
CONFIG_SPI_ORION=y
CONFIG_SPI_PL022=y
CONFIG_SPI_MUX=y
@@ -427,30 +413,31 @@ CONFIG_REGULATOR_S2MPS11=y
# CONFIG_HID_LOGITECH is not set
# CONFIG_HID_MICROSOFT is not set
# CONFIG_HID_MONTEREY is not set
CONFIG_USB=y
CONFIG_USB_ULPI_BUS=y
CONFIG_USB=m
CONFIG_USB_OTG=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_MVEBU=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_STORAGE=y
CONFIG_USB_XHCI_HCD=m
CONFIG_USB_XHCI_MVEBU=m
CONFIG_USB_EHCI_HCD=m
CONFIG_USB_EHCI_HCD_PLATFORM=m
CONFIG_USB_OHCI_HCD=m
CONFIG_USB_OHCI_HCD_PLATFORM=m
CONFIG_USB_STORAGE=m
CONFIG_USB_DWC3=y
CONFIG_USB_DWC2=y
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA=m
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
CONFIG_USB_ISP1760=y
CONFIG_USB_HSIC_USB3503=y
CONFIG_USB_HSIC_USB3503=m
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_ULPI=y
CONFIG_USB_GADGET=y
CONFIG_USB_SNP_UDC_PLAT=y
CONFIG_TYPEC=y
CONFIG_TYPEC_TCPM=y
CONFIG_TYPEC_TCPCI=y
CONFIG_TYPEC_RT1711H=y
CONFIG_TYPEC_TCPM=m
CONFIG_TYPEC_TCPCI=m
CONFIG_TYPEC_RT1711H=m
CONFIG_MMC=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_ARMMMCI=y
@@ -462,7 +449,6 @@ CONFIG_MMC_SPI=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_EXYNOS=y
CONFIG_MMC_DW_K3=y
CONFIG_MMC_CQHCI=y
CONFIG_MMC_SDHCI_XENON=y
CONFIG_SCSI_UFSHCD=y
CONFIG_SCSI_UFSHCD_PLATFORM=y
@@ -503,7 +489,6 @@ CONFIG_EXTCON_USB_GPIO=y
CONFIG_IIO=y
CONFIG_TI_ADC081C=y
CONFIG_PWM=y
CONFIG_PHY_XGENE=y
CONFIG_PHY_MVEBU_CP110_COMPHY=y
CONFIG_PHY_MVEBU_CP110_UTMI=y
CONFIG_PHY_SAMSUNG_USB2=y
@@ -512,13 +497,11 @@ CONFIG_MUX_MMIO=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_AUTOFS4_FS=y
CONFIG_FUSE_FS=y
CONFIG_VIRTIO_FS=y
CONFIG_OVERLAY_FS=y
@@ -536,17 +519,21 @@ CONFIG_SECURITY=y
CONFIG_CRYPTO_CCM=m
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_ANSI_CPRNG=y
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y
CONFIG_CRYPTO_SHA2_ARM64_CE=y
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=0
CONFIG_IRQ_POLL=y
CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=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_DEBUG_PREEMPT is not set
# CONFIG_RCU_TRACE is not set
CONFIG_FUNCTION_TRACER=y
# CONFIG_STRICT_DEVMEM is not set
+4
View File
@@ -0,0 +1,4 @@
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
+38
View File
@@ -0,0 +1,38 @@
image cfg.ext4 {
ext4 {
label = "cfg"
}
empty = true
size = 16M
}
image sdcard.img {
hdimage {
}
partition u-boot-tpl-spl-dtb {
in-partition-table = "no"
image = "idbloader.img"
offset = 32K
}
partition u-boot-dtb {
in-partition-table = "no"
image = "u-boot.itb"
offset = 8M
}
partition rootfs {
partition-type = 0x83
offset = 16M
image = "rootfs.ext4"
}
partition cfg {
partition-type = 0x83
image = "cfg.ext4"
}
}
# Silence genimage warnings
config {}
+654
View File
@@ -0,0 +1,654 @@
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_AUDIT=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=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_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_NUMA_BALANCING=y
CONFIG_MEMCG=y
CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_NAMESPACES=y
CONFIG_USER_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_BLK_DEV_INITRD=y
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_COMPAT=y
CONFIG_RANDOMIZE_BASE=y
CONFIG_HIBERNATION=y
CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
CONFIG_ENERGY_MODEL=y
CONFIG_ARM_PSCI_CPUIDLE=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
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=y
CONFIG_ACPI_APEI=y
CONFIG_ACPI_APEI_GHES=y
CONFIG_ACPI_APEI_MEMORY_FAILURE=y
CONFIG_ACPI_APEI_EINJ=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
CONFIG_JUMP_LABEL=y
# CONFIG_GCC_PLUGINS is not set
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_KSM=y
CONFIG_MEMORY_FAILURE=y
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_CMA=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
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_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_NETFILTER=y
CONFIG_NF_CONNTRACK=m
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
CONFIG_NETFILTER_XT_TARGET_LOG=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP6_NF_IPTABLES=m
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_MANGLE=m
CONFIG_IP6_NF_NAT=m
CONFIG_IP6_NF_TARGET_MASQUERADE=m
CONFIG_BRIDGE=m
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_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBS=m
CONFIG_NET_SCH_ETF=m
CONFIG_NET_SCH_TAPRIO=m
CONFIG_NET_SCH_MQPRIO=m
CONFIG_NET_SCH_INGRESS=m
CONFIG_NET_CLS_BASIC=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_BT=m
CONFIG_BT_HIDP=m
# CONFIG_BT_LE is not set
CONFIG_BT_LEDS=y
# CONFIG_BT_DEBUGFS is not set
CONFIG_BT_HCIBTUSB=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIUART_BCM=y
CONFIG_BT_HCIUART_QCA=y
CONFIG_CFG80211=y
CONFIG_MAC80211=y
CONFIG_MAC80211_LEDS=y
CONFIG_RFKILL=y
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCI_IOV=y
CONFIG_PCI_PASID=y
CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=y
CONFIG_PCI_HOST_GENERIC=y
CONFIG_PCIE_ROCKCHIP_HOST=m
CONFIG_PCIE_ROCKCHIP_DW_HOST=y
CONFIG_PCI_ENDPOINT=y
CONFIG_PCI_ENDPOINT_CONFIGFS=y
CONFIG_PCI_EPF_TEST=m
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_ARM_SCMI_PROTOCOL=y
CONFIG_ARM_SCPI_PROTOCOL=y
CONFIG_EFI_CAPSULE_LOADER=y
CONFIG_MTD=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_SST25L=y
CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_NAND_DENALI_DT=y
CONFIG_MTD_SPI_NOR=y
CONFIG_OF_OVERLAY=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=m
CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_NVME=m
CONFIG_SRAM=y
CONFIG_PCI_ENDPOINT_TEST=m
CONFIG_EEPROM_AT24=m
CONFIG_EEPROM_AT25=m
CONFIG_UACCE=m
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_SAS_ATA=y
CONFIG_SCSI_HISI_SAS=y
CONFIG_SCSI_HISI_SAS_PCI=y
CONFIG_MEGARAID_SAS=y
CONFIG_SCSI_MPT3SAS=m
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_SATA_AHCI_PLATFORM=y
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_NETDEVICES=y
CONFIG_BONDING=m
CONFIG_DUMMY=y
CONFIG_WIREGUARD=m
CONFIG_MACVLAN=m
CONFIG_MACVTAP=m
CONFIG_VXLAN=y
CONFIG_GENEVE=m
CONFIG_BAREUDP=m
CONFIG_TUN=y
CONFIG_VETH=m
CONFIG_VIRTIO_NET=m
# 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
# CONFIG_NET_VENDOR_ALTEON is not set
# CONFIG_NET_VENDOR_AMAZON is not set
# CONFIG_NET_VENDOR_AMD is not set
# CONFIG_NET_VENDOR_AQUANTIA is not set
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_ASIX is not set
CONFIG_ATL2=m
CONFIG_ALX=m
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CADENCE is not set
# CONFIG_NET_VENDOR_CAVIUM is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_CISCO is not set
# CONFIG_NET_VENDOR_CORTINA is not set
# CONFIG_NET_VENDOR_DEC is not set
# CONFIG_NET_VENDOR_DLINK is not set
# CONFIG_NET_VENDOR_EMULEX is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_GOOGLE is not set
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_LITEX is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MELLANOX is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_MICROSEMI is not set
# CONFIG_NET_VENDOR_MICROSOFT is not set
# CONFIG_NET_VENDOR_MYRI is not set
# CONFIG_NET_VENDOR_NI is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETERION is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NVIDIA is not set
# CONFIG_NET_VENDOR_OKI is not set
# CONFIG_NET_VENDOR_PACKET_ENGINES is not set
# CONFIG_NET_VENDOR_PENSANDO is not set
# CONFIG_NET_VENDOR_QLOGIC is not set
# CONFIG_NET_VENDOR_BROCADE is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_RDC is not set
CONFIG_8139CP=m
CONFIG_8139TOO=m
# CONFIG_8139TOO_PIO is not set
CONFIG_R8169=m
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SILAN is not set
# CONFIG_NET_VENDOR_SIS is not set
# CONFIG_NET_VENDOR_SOLARFLARE is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_SOCIONEXT is not set
CONFIG_STMMAC_ETH=y
# CONFIG_DWMAC_GENERIC is not set
# CONFIG_NET_VENDOR_SUN is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_TEHUTI is not set
# CONFIG_NET_VENDOR_TI is not set
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_NET_VENDOR_XILINX is not set
CONFIG_AX88796B_PHY=y
CONFIG_MICREL_PHY=y
CONFIG_MICROSEMI_PHY=y
CONFIG_AT803X_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
CONFIG_USB_RTL8152=m
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=m
CONFIG_USB_NET_AX88179_178A=m
CONFIG_USB_NET_DM9601=m
CONFIG_USB_NET_SMSC75XX=m
CONFIG_USB_NET_SMSC95XX=m
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_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
# CONFIG_WLAN_VENDOR_MEDIATEK is not set
CONFIG_RTL8180=m
CONFIG_RTL8187=m
CONFIG_RTL_CARDS=m
CONFIG_RTL8192CE=m
CONFIG_RTL8192SE=m
CONFIG_RTL8192DE=m
CONFIG_RTL8723AE=m
CONFIG_RTL8723BE=m
CONFIG_RTL8188EE=m
CONFIG_RTL8192EE=m
CONFIG_RTL8821AE=m
CONFIG_RTL8192CU=m
CONFIG_RTL8XXXU=m
CONFIG_RTL8XXXU_UNTESTED=y
CONFIG_RTW88=m
CONFIG_RTW88_8822BE=m
CONFIG_RTW88_8822BS=m
CONFIG_RTW88_8822BU=m
CONFIG_RTW88_8822CE=m
CONFIG_RTW88_8822CS=m
CONFIG_RTW88_8822CU=m
CONFIG_RTW88_8723DE=m
CONFIG_RTW88_8723DS=m
CONFIG_RTW88_8723DU=m
CONFIG_RTW88_8821CE=m
CONFIG_RTW88_8821CS=m
CONFIG_RTW88_8821CU=m
CONFIG_RTW88_DEBUG=y
CONFIG_RTW89=m
CONFIG_RTW89_8851BE=m
CONFIG_RTW89_8852AE=m
CONFIG_RTW89_8852BE=m
CONFIG_RTW89_8852CE=m
CONFIG_RTW89_DEBUGMSG=y
# CONFIG_WLAN_VENDOR_RSI is not set
# 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_MOUSE is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_RK805_PWRKEY=y
# CONFIG_SERIO_SERPORT is not set
CONFIG_SERIO_AMBAKMI=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_LEGACY_PTY_COUNT=16
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DW=y
CONFIG_SERIAL_8250_RT288X=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SERIAL_AMBA_PL010=y
CONFIG_SERIAL_AMBA_PL010_CONSOLE=y
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_DEV_BUS=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_TCG_TPM=y
CONFIG_TCG_TIS_I2C_INFINEON=y
CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_PCA954x=y
CONFIG_I2C_DESIGNWARE_PLATFORM=y
CONFIG_I2C_GPIO=m
CONFIG_I2C_RK3X=y
CONFIG_I2C_SLAVE=y
CONFIG_SPI=y
CONFIG_SPI_BITBANG=m
CONFIG_SPI_CADENCE_QUADSPI=y
CONFIG_SPI_DESIGNWARE=m
CONFIG_SPI_DW_DMA=y
CONFIG_SPI_DW_MMIO=m
CONFIG_SPI_PL022=y
CONFIG_SPI_ROCKCHIP=y
CONFIG_SPI_SPIDEV=m
CONFIG_SPMI=y
CONFIG_PPS=y
# CONFIG_PTP_1588_CLOCK is not set
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_MAX732X=y
CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_PCA953X_IRQ=y
CONFIG_POWER_RESET_XGENE=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_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_MFD_RK8XX_I2C=y
CONFIG_MFD_RK8XX_SPI=y
CONFIG_MFD_STMFX=y
CONFIG_REGULATOR_DEBUG=y
CONFIG_REGULATOR_FIXED_VOLTAGE=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_USB_CONN_GPIO=y
CONFIG_USB=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_OTG=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_ACM=m
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
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
CONFIG_USB_SNP_UDC_PLAT=y
CONFIG_USB_BDC_UDC=y
CONFIG_USB_CONFIGFS=m
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
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
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_ACPI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_OF_ARASAN=y
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
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_CLASS_FLASH=y
CONFIG_LEDS_CLASS_MULTICOLOR=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_PWM=y
CONFIG_LEDS_SYSCON=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_CPU=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_LEDS_TRIGGER_PANIC=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_RK808=y
CONFIG_RTC_DRV_EFI=y
CONFIG_RTC_DRV_PL030=y
CONFIG_RTC_DRV_PL031=y
CONFIG_DMADEVICES=y
CONFIG_PL330_DMA=y
CONFIG_SYNC_FILE=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
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
CONFIG_R8712U=m
CONFIG_RTS5208=m
# CONFIG_SURFACE_PLATFORMS is not set
CONFIG_COMMON_CLK_SCMI=y
CONFIG_COMMON_CLK_SCPI=y
CONFIG_COMMON_CLK_PWM=y
CONFIG_HWSPINLOCK=y
# CONFIG_FSL_ERRATUM_A008585 is not set
# CONFIG_HISILICON_ERRATUM_161010101 is not set
# CONFIG_ARM64_ERRATUM_858921 is not set
CONFIG_ARM_MHU=y
CONFIG_PLATFORM_MHU=y
CONFIG_IOMMU_IO_PGTABLE_ARMV7S=y
CONFIG_ROCKCHIP_IOMMU=y
CONFIG_ARM_SMMU=y
CONFIG_ARM_SMMU_V3=y
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
CONFIG_MAX9611=m
CONFIG_ROCKCHIP_SARADC=m
CONFIG_IIO_ST_LSM6DSX=m
CONFIG_SENSORS_ISL29018=m
CONFIG_VCNL4000=m
CONFIG_IIO_ST_MAGN_3AXIS=m
CONFIG_MPL3115=m
CONFIG_PWM=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_PHY_ROCKCHIP_DPHY_RX0=m
CONFIG_PHY_ROCKCHIP_EMMC=y
CONFIG_PHY_ROCKCHIP_INNO_HDMI=m
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY=m
CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=m
CONFIG_PHY_ROCKCHIP_PCIE=m
CONFIG_PHY_ROCKCHIP_TYPEC=y
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
CONFIG_NVMEM_ROCKCHIP_OTP=m
CONFIG_TEE=y
CONFIG_OPTEE=y
CONFIG_MUX_MMIO=y
CONFIG_INTERCONNECT=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_OVERLAY_FS=m
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_HUGETLBFS=y
CONFIG_EFIVAR_FS=y
CONFIG_SQUASHFS=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_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=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_ANSI_CPRNG=y
CONFIG_CRYPTO_USER_API_RNG=m
CONFIG_CRYPTO_GHASH_ARM64_CE=y
CONFIG_CRYPTO_SHA1_ARM64_CE=y
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_INDIRECT_PIO=y
CONFIG_CRC_CCITT=m
CONFIG_CRC8=y
CONFIG_DMA_CMA=y
CONFIG_CMA_SIZE_MBYTES=32
CONFIG_PRINTK_TIME=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_FTRACE is not set
CONFIG_MEMTEST=y
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
BOARD_DIR="$(dirname $0)"
install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
@@ -0,0 +1,14 @@
--- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts 2023-11-08 14:09:07.000000000 +0100
+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts 2024-01-22 07:31:14.949550828 +0100
@@ -20,6 +20,11 @@
chosen {
stdout-path = "serial2:1500000n8";
+
+ infix {
+ /* Default admin user password: 'admin' */
+ factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A";
+ };
};
gmac_clk: gmac-clock {
-8
View File
@@ -1,8 +0,0 @@
#!/bin/sh
. "$BR2_CONFIG"
# Prevent regen of host key at every boot, /etc is saved across reboots
if [ -L "$TARGET_DIR/etc/dropbear" ]; then
rm "$TARGET_DIR/etc/dropbear"
mkdir "$TARGET_DIR/etc/dropbear"
fi
-684
View File
@@ -1,684 +0,0 @@
#!/bin/sh
# 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
h1()
{
STR="$*"
if [ -n "$plain" ]; then
echo "$STR" | tr '[:lower:]' '[:upper:]'
echo "$STR" | sed 's/./=/g'
else
printf "\033[7m%-${COLUMNS}s\033[0m" "$STR"
fi
}
h2()
{
STR="$*"
if [ -n "$plain" ]; then
echo "$STR"
echo "$STR" | sed 's/./-/g'
else
printf "\033[1m%-${COLUMNS}s\033[0m" "$STR"
fi
}
ul()
{
if [ -n "$plain" ]; then
echo "__${*}__"
else
printf "\033[54%s\033[0m" "$*"
fi
}
em()
{
if [ -n "$plain" ]; then
echo "**${*}**"
else
printf "\033[5m%s\033[0m" "$*"
fi
}
overview()
{
cat <<EOF
$(h1 "Help System Press 'Q' to quit | Arrow keys and PgUp/PgDn to scroll")
$(h2 "See Also")
help edit Tutorial on VI and Mg editors
help net Network set up introduction
setup User friendly setup and diagnostic tool
$(h2 "General Syntax")
cmd [optional arg] E.g., use 'date -h' to get help for date command
$(h2 "File system")
pwd | ls | cd Show directory, contents, or change directory
cat file Show file contents
vi | mg [file] Edit file with the VI or Micro Emacs editor
$(h2 "Services")
initctl list Lists all configurable services (svc's)
initctl enable svc Enable a service 'svc'
initctl reload Reload init process' state, start/stop svc's
initctl start svc Start a stopped service 'svc'
initctl stop svc Stop 'svc'
initctl restart svc Restart a running 'svc'
initctl status [svc] Display running status of all services, or one 'svc'
$(h2 "Tools")
setup User friendly setup and diagnostic tool
date [-h] Display current time, or sets the system date
factory Factory reset the device (on the next boot)
hwclock [-h] Query or set the hardware clock (RTC)
logout | Ctrl-D Log out from TTY
mdio | mvls Low-level MDIO access, also for Marvell switch status
tail -F file Continuously read from a file Useful for monitoring the
health of services, see 'ls /var/log/' for log files
less [file] Pagers provding easily scrollable content (q quits) >
more [file] > e.g., 'cat very-long-file | less'
most [file] > e.g., 'cat very-long-file | most'
passwd Change user password
pwgen Password generator
reboot Restart the device
reset Reset the shell prompt if it gets garbled
$(h2 "Network Tools")
ethtool [-h] Ethernet stats, and low-level MAC/PHY settings
traceroute [-h] Trace the route ip packets follow going to a host
tcpdump [-h] Display network packet headers in real-time
arping [-h] Ping hosts by ARP requests/replies
fping [-h] Send ICMP ECHO_REQUEST packets to multiple hosts
ping [-h] Send ICMP ECHO_REQUEST packets to a network host
lynx URL [-h] The text mode web browser
netcalc [-h] Calculate IP network settings from a IP address
netcat [-h] NetCat - TCP/IP swiss army knife (alias: nc)
socat [-h] Multipurpose socket relay program
ttyd [-h] Sharing a terminal over the web
ifconfig [--help] See/Reconfigure available network interfaces
route [--help] Edit the kernel's routing tables
ifup | ifdown IFACE Bring up/down interfaces in /etc/network/interfaces
ip [link|addr] Manage available network interfaces
ip [rule|route] Manage routing tables
bridge [link|vlan] Manage bridge ports and VLANs
scp Securely copy a file to a remote host file system
tftp Copy a file to/from a remote host
ftpput Store a local file on a remote machine via FTP
ftpget Retrieve a remote file via FTP
wget Get a file using HTTP or FTP from a remote host
$(h2 "Overview Commands")
df -h List disk usage (in human readable format)
free List memory usage
ps List running processes
show [arg] Show system status, see 'show help' for more info
top Displays CPU usage and top list of running tasks
$(h2 "Interesting Files")
/etc/default/svc Command line args for service 'svc' (see above)
/etc/rc.local Local setup, runs after all services have started
/etc/network/ Directory of networking setup, see 'help net'
$(h2 "Example Commands")
cd /tmp; wget ftp://192.168.55.43/file && cat file
cd /var/log; tftp -p -l messages 192.168.55.43
cat /proc/net/arp
edit /etc/network/interfaces
$(h2 "See Also")
help edit Tutorial on VI and Mg editors
help net Network set up introduction
setup User friendly setup and diagnostic tool
EOF
}
vi()
{
cat <<EOF
$(h1 "Visual Editor (vi)")
Vi is the de facto standard editor in UNIX systems. It comes with two modes:
- $(em "Command mode (default):") administrative tasks such as saving files,
executing commands, moving the cursor, cutting and pasting lines or words,
as well as finding and replacing. $(em "Return to command mode with Esc")
- $(em "Insert mode:") Everything that's typed in this mode is interpreted as
input and placed in the file.
$(h2 "Navigation commands")
h - move the cursor one character to the left
j - move the cursor down one character
k - mode the cursor up one character
l - move the cursor right one character
b - move to beginning of word, or previous word
w - move to next word
0 - move to beginning of line
$ - move to end of line
:0 - move to beginning of file
G - move to end of file
$(h2 "Editing commands")
u - undo last operation
x - delete the character the cursor is on
cw - change word, from position of cursor
dw - delete to end of word
dd - delete the line the character is on
p - paste (line, word, or char) after cursor
P - paste (line, word, or char) before cursor
$(h2 "Saving and quit commands")
:w - save the current file
:w filename - save a copy of the file named filename
:w! - try to save the file, even if it is read only
:wq - save and quit vi
ZZ - save and quit vi
:wq! - try to save the file if it is read only, quit if successful
:wq filename - save a copy of the file named filename and quit
:wq! filename - save a copy of the file named filename and quit,
override read only permissions if possible
:q - quit vi
:q! - quit vi even if the file has unsaved changes
$(h2 "Enter insert mode")
a - append new text after the cursor
i - insert text before the cursor
o - open a new line below the cursor
O - open a new line above the cursor
> Return to command mode with Esc
EOF
}
emacs()
{
cat <<EOF
$(h1 "Micro Emacs (mg)")
Mg is a bit more user-friendly than vi. It has the same familiar interface
as Notepad, but with slightly different keybindings.
$(h2 "Introduction")
Most commands involve using the Control ("Ctrl") or the Meta ("Alt") key.
The following conventions are used in the online help:
C-<chr> means hold down the Control key while typing the character <chr>
M-<chr> means hold down the Alt key while typing the character <chr>
If you don't have a Meta/Alt key, you can use Esc instead. Press and release
the Esc key and then type <chr>. This is equivalent to M-<chr>.
$(h2 "Navigation")
Though arrow keys, Home/End, and PgUp/PgDn usually work, using Mg over serial
console can sometimes cause these keys to be mismapped by terminal program.
C-f Move forward one character (can also use right arrow key)
C-b Move backward one character (can also use left arrow key)
C-p Move up one line (can also use up arrow key)
C-n Move down one line (can also use down arrow key)
M-f Move forward one word
M-b Move backward one word
C-a Move to beginning of line (can also use Home key)
C-e Move to end of line (can also use End key)
C-v Move forward one page (can also use PgDn/Page Down key)
M-v Move backward one page (can also use PgUp/Page Up key)
M-< Move to beginning of file
M-> Move to end of file
C-x g Move to line number
$(h2 "Editing")
All edit commands that kill (cut) text is placed in a kill ring (clipboard).
Note: when marking text, there is no visual mark.
C-_ Undo, also C-x u
M-% Replace word/string in file, from cursor position
M-q Reformat paragraph (set fill column with C-x f)
C-s Search forward (type C-s again to find next)
C-r Reversed search
C-Space Set beginning of mark (beginning of selected text)
C-x C-x Jump back and forth between mark and cursor position
C-x h Mark whole buffer
C-w Wipe (cut) region from mark to cursor position
M-w Copy region from mark to cursor position
C-y Yank (paste) text from kill ring
C-k Kill (cut) to end of line
M-Backspace Kill (delete) previous word
M-d Kill (delete) next word
C-d Delete character to the right
C-o Open new line at cursor
$(h2 "General Commands")
C-g Abort current command
C-l Recenter buffer on current line
C-h b List all keybindings
M-! Run shell command, output in new buffer
C-z Suspend Mg, return to shell, use 'fg' to get back
C-x C-f Open file
C-x C-i Insert file at cursor position
C-x C-s Save file
C-x s Save file (interactive)
C-x k Kill (close) file
C-x C-b List open buffers (files)
C-x b Switch to another buffer
C-x C-c Exit
$(h2 "Window Commands")
C-x 0 Unsplit, keep other window
C-x 1 Unsplit, keep this window
C-x 2 Split window in two
C-x o Go to other window
C-x p Go to previous window
C-x n Go to next window
C-x ^ Enlarge this split
EOF
}
editor()
{
case $1 in
vi)
vi
;;
ed* | em* | mg)
emacs
;;
*)
vi
emacs
cat <<EOF
$(h1 "Summary")
Use Mg or GNU Nano if you are a beginner. The system is set up to so you can
use the 'edit' command, which will start GNU Nano:
edit /etc/rc.local # Starts GNU Nano
EOF
;;
esac
}
networking()
{
cat <<EOF
$(h1 "Networking")
This section details how to set up everything from basic to advanced networking.
Topics covered include:
- Static vs Dynamic Addresses
- VLAN Interfaces
- Bridging Interfaces
- Link Aggregation (bonding)
- Persistent Configuration
Please note, the terms 'port' and 'interface' may be used interchangably in
the following text (and elsewher online as well). Usually the term 'port' is
reserved for Ethernet links attached to a switch or bridge, while the term
'interface' more generically refers to the physical interface in a system.
$(h2 "Static vs Dynamic Addresses")
An IPv4 address consists of four "octets" separated by periods. A static IPv4
address can look like this:
192.168.1.42
However, for networking to function properly, a device usually needs a netmask,
default route, NTP server, and at least one DNS address. Setting all these up
statically is a lot of work to maintain, in particular with many devices.
For both IPv4 and IPv6 there is an alternative called DHCP. It is a dynamic
protocol where a server on request from a client device hands out a "lease" of
an IP address, as well as lot of other network parameters, including but not
limited to the ones already mentioned. A client device can give hints to the
server, e.g., its hostname, MAC address (default), or other client identifier.
It is up to the server to honor these hints or not, but it is very common to
set up the server to honor the client's hostname and automatically update the
central name server (DNS) when the client is online.
| There are many other interesting aspects to DHCP not covered here.
| For instance, DHCP relay servers (proxies), that can be used to
| forward DHCP requests from very large networks to a central server.
| Some relay "agents" even support something called Option 82, which
| when running on a simple switch, can attach port and relay info to
| the client's DHCP request -- allowing the server to assign an IP
| address per port, even on remote switches (with a relay agent).
When your interface is setup with DHCP, use the 'ifconfig' or 'ip addr' tools
to see which address you got, if needed (see next section).
In cases when the DHCP client cannot find a DHCP server, and thus not obtain a
lesae, the system falls back to set a link-local address (169.254.*.*). This
can be disabled by editing the file /etc/dhcpcd.conf, adding:
noipv4ll
A link-local address is however very useful, in particular in combination with
mDNS to discover and access a device you do not know, or do not want to know,
the IP address to. See more in the next section.
$(h2 "DNS and mDNS")
Managing a central DNS is both painful and time consuming, most networks, and
in particular industrial, therefore only set up a DNS for static servers and
resources. Leaving end devices, switches, and in many cases even routers,
without a human-friendly name on the network. This have misled many to think
that they need to know the IP address, and often opt for static addresses on
equipment. Meaning many devices out-of-the-box have a static address set that
need to be manually changed before the device is deployed on the network.
A less time consuming, and human-friendly, way is to enable mDNS (multicast
DNS). With this protocol the device notifies all neighbors on the same LAN
of how to reach it:
"Hello everyone, my address is 169.254.47.11, you can call me device.local"
Any other device that also has mDNS enabled can then automaticall update a
local database of name-to-address mappings. Usually the name sent out is
the device's hostname. (It is up to the device manufacturer to set a useful
default hostname, i.e., model-01-02-03, where the suffix is the last octets
of the base MAC address, from the product label on the case.)
As you can see, in combination with a link-local address (previous section)
mDNS is a very attractive combination that greatly simplify device management.
Tools:
avahi-browse -a
ping foo.local
mDNS, or more correctly mDNS-SD, is also used for *Service Discovery*. E.g.,
a printer can publish IPP records with meta data on the printer type and model
or donwload URL for drivers. Switches and routers usually publish how they
can be reached: HTTP/HTTPS and SSH.
mDNS is supported in this product and should be enabled by default. To
verify that it works, in Windows, macOS, or Linux, open your web browser
and point it to <https://hostname-01-02-03.local>. This is the hostname
and three last octets of the device's base MAC address. You can also use
mDNS browsers or command line tools like mdns-scan
$(h2 "VLAN Interfaces")
A VLAN interface in Linux is an "upper" interface, e.g., 'eth0.1'. It is
where you set an IP address and interact with th rest of the world. The
base/raw/lower interface, here 'eth0', is the physical interface on which
Ethernet packets ingress and egress with a VLAN tag. To create 'eth0.1':
ip link add eth0.1 link eth0 vlan id 1
In Linux a VLAN interface is a "stackable" entity. Many VLAN interfaces
can be built on top of each other. When injecting a packet on the top
most interface, the kernel adds the corresponding VLAN "tag" when the
packet goes down the order of stacked interfaces, and then finally hits
the physical interface and proceeds to egress onto the media.
ip link add eth0.1.2 link eth0.1 vlan id 2
Injecting a packet on 'eth0.1.2' creates a double-tagged VLAN frame when
the packet egresses 'eth0'. The outermost tag has VID 1 and the inner
VID is 2.
VLAN interfaces can be used for many things, here we will focus on their
use as upper interface on a bridge.
$(h2 "Bridging Interfaces")
A bridge is the correct name for a switch. In the context of this text,
however, we will use the term to refer to the Linux bridge module in the
kernel, which implements an advanced software switch. The Linux bridge
supports "offloading" many switching functions to an underlying switching
chipset, when available. This greatly simplifies managing that switch since
the same tools one use to manage the bridge will, by extension, also be used
to manage the switch.
To create a bridge in Linux:
ip link add br0 type bridge
To add three ports (interfaces) to the bridge we use:
ip link set eth0 master br0
ip link set eth1 master br0
ip link set eth2 master br0
Bring all ports and the bridge 'up' and you have a working switch! Any frame
injected on eth0 (from the outside) can be switched to either of eth1, eth2,
*or* br0. As soon as the bridge has learned where end devices are connected,
none of the other ports will see the traffic -- like a regular switch.
Note: these ports should not (cannot) have any IP address. Instead, any IP
address is set on 'br0'. To disable IPv6 link-local address, set the
/proc/sys/net/ipv6/conf/eth0/disable_ipv6 sysctl file to '1'.
$(h2 "Bridging and VLANs")
A VLAN-aware bridge works the same way, only with VLAN separation taken into
account. All communication, as well as MAC address learning, is limited to
ports in the same VLAN. The syntax is slightly different and requires a few
more steps:
ip link add br0 type bridge vlan_filtering 1
ip link set eth0 master br0
ip link set eth1 master br0
ip link set eth2 master br0
ip link set eth3 master br0
To assign ports to different VLANs, and make sure they are regular "access"
ports (untagged). We assign eth0 and eth1 to VLAN 1 and the others to VLAN 2:
bridge vlan add vid 1 dev eth0 pvid untagged
bridge vlan add vid 1 dev eth1 pvid untagged
bridge vlan add vid 2 dev eth2 pvid untagged
bridge vlan add vid 2 dev eth3 pvid untagged
Here's the twist, to be able to reach the bridge (switch) itself from each
VLAN, we need to ensure the bridge itself is a tagged member of each VLAN:
bridge vlan add vid 1 dev br0 self
bridge vlan add vid 2 dev br0 self
This way we can add VLAN interfaces on top of br0, which we in turn can set
a static or dynamic IP address on:
ip link add vlan1 link br0 type vlan id 1
ip link add vlan2 link br0 type vlan id 2
The resulting stack of interfaces look like this:
:
vlan1 : vlan2 Layer-3 :: IP Networking
\\ : / _________________________
.-------------.
| br0 | Layer-2 :: Switching
'-------------' _________________________
/ | : | \\
eth0 eth1 : eth2 eth3 Layer-1 :: Link layer
:
$(h2 "Persistent Configuration")
A simple end device can get by with the following in /etc/network/interfaces:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
This brings up both the loopback (required for UNIX networking to function),
and the (presumed only) Ethernet interface. The loopback gets its standard
address, 127.0.0.1, and eth0 will request its IP address using DHCP.
To set up the bridge example (above), is actually quite a lot easier than
using the command line ip and bridge tools. Create the file 'bridge':
edit /etc/network/interfaces.d/bridge
Paste in the following content:
iface e0
bridge-access 1
iface e1
bridge-access 1
iface e2
bridge-access 2
iface e3
bridge-access 2
auto br0
iface br0
bridge-ports e0 e1 e2 e3
bridge-vlan-aware yes
bridge-stp on
bridge-vids 1 2
auto vlan1
iface vlan1 inet dhcp
vlan-id 1
vlan-raw-device br0
auto vlan2
iface vlan2 inet static
vlan-id 2
vlan-raw-device br0
address 192.168.2.1/24
Notice how 'vlan1' only has a DHCP and 'vlan2' uses a static address. It is
possible to combine the two if needed. Use 'inet dhcp' and add an 'address'
statement to the iface stanza.
$(h2 "Port Classification")
The bundled 'show' script is a very handy tool. It use several tricks to make
information about the system more accessible. On switching capable hardware
products, switch ports are identified early at system bootstrap and placed in
the 'port' group. See 'ip link' output:
...
4: e0: <BROADCAST,MULTICAST> master br0 state UP $(em "group port")
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
...
When running in Qemu or other hardware it may be useful to manually classify
certain interfaces as ports. This can be achieved in many ways, here we show
two. First /etc/mactab, which is read at boot to rename interfaces according
their matching MAC address, one interface per line:
e0 52:54:00:12:34:56
e1 52:54:00:12:34:57
e2 52:54:00:12:34:58
e3 52:54:00:12:34:59
Another way is to add something like this to /etc/rc.local:
for port in eth0 eth1 eth3 eth4; do
ip link set \$port group port
done
$(h2 "Interesting Files")
- /etc/dhcpcd.conf General DHCP and ZeroConf (LL) settings
- /etc/network/interfaces The original, useful for small setups
- /etc/network/interfaces.d/* Snippets, useful for non-trivial setups
- /etc/mactab Rename interfaces: 'NAME16CHARS WHITESPACE MAC'
- /etc/sysctl.conf Interface and TCP/IP settings, e.g., routing
- /etc/sysctl.d/* Snippets, useful for per-subsystem settings
$(h1 "Summary")
All persistent networking is set up in /etc/network/interfaces using the
program ifupdown-ng. The tools to reconfigure networking at runtime are:
ifup [-a] [IFACES]
ifdown [-a] [IFACES]
When changing the configuration at runtime you usually have to bring the
affected interfaces down (ifdown e0 e1 e2 e3), if they were set up with
/etc/network/interfaces before. Then do the change, and bring it all up
again.
Both tools understand dependencies between interfaces, so when a 'ifup -a'
command is received it brings up all interfaces: adding links to br0 before
adding VLANs, the vlan1 and vlan2 interfaces on top so it of it all. Then
finally it can start the DHCP client on vlan1 and set the static IP address
on vlan2.
$(em ">>> Be careful with these tools when logged in remotely! <<<")
EOF
}
topic()
{
topic=$1
[ -n "$1" ] && shift
case $topic in
ed*)
# shellcheck disable=SC2068
editor $*
;;
net*)
networking
;;
*)
overview
;;
esac
}
if [ "$1" = "-p" ]; then
shift
pager="cat"
plain="yes"
else
if command -v most; then
pager=most
elif command -v less; then
pager="less -R"
elif command -v more; then
pager="more"
else
pager="cat"
fi
fi
if [ -t 1 ] ; then
fn=$(mktemp /tmp/system-help.XXXXXX)
# shellcheck disable=SC2086,SC2068
topic $@ >"$fn"
$pager "$fn"
rm "$fn"
else
topic "$*"
fi
-16
View File
@@ -1,16 +0,0 @@
#!/bin/sh
# Changes hostname in /etc/hostname and /etc/hosts
current=$(cat /etc/hostname)
newname=$1
[ -n "$newname" ] || exit 1
sed -i "s/$current/$newname/" /etc/hosts
sed -i "s/$current/$newname/" /etc/hostname
hostname $newname
initctl touch sysklogd
initctl touch dnsmasq
initctl reload
-3
View File
@@ -1,3 +0,0 @@
#!/bin/sh
pdmenu
clear
-327
View File
@@ -1,327 +0,0 @@
#!/bin/sh
# Displays basic information about the system
# shellcheck disable=SC2048,SC2086
. /etc/os-release
bopt="-c"
opt="-br"
all=""
plain=""
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
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 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 && [ -z "$all" ]; 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()
{
h1 "INTERFACE STATE ADDRESS"
if [ -n "$all" ]; then
ip $opt addr show
elif grep -q iface /etc/iproute2/group; then
ip $opt addr show group iface
else
ip $opt addr show |awk '{ if ($1 !~ /eth[0-9]*/ && $1 !~ /.*@NONE/) { print }}'
fi
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
dm "______________________________________________________________________________"
dm "See: 'ip --help' and 'ip address help' for more details."
fi
}
log()
{
if [ -n "$1" ] && [ -r "/var/log/$1" ]; then
fn="/var/log/$1"
else
fn="/var/log/syslog"
fi
if [ -n "$all" ]; then
cat $fn
else
tail -$LINES $fn
fi
if [ -z "$plain" ] && [ -z "$nofoot" ]; then
dm "______________________________________________________________________________"
dm "See: 'tail -25 /log/FILE', 'tail -F /log/FILE' to continuously monitor files."
fi
}
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()
{
ip $opt route show
}
igmp()
{
querierctl $@
}
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
;;
-n)
nofoot="yes"
;;
-p)
plain="yes"
opt="$opt -color=never"
bopt="$bopt -color=never"
;;
-h)
usage
exit 0
;;
*)
break
esac
shift
done
cmd=$1
if [ -n "$cmd" ]; then
shift
fi
case $cmd in
help)
usage
;;
port*)
ports $*
;;
vlan*)
vlans
;;
fdb)
fdb
;;
mdb)
mdb
;;
if*)
ifaces
;;
ip)
cmd=$1
shift
case $cmd in
addr*)
ifaces
;;
route*)
routes
;;
igmp*)
igmp $*
;;
*)
usage
;;
esac
;;
log)
log $1
;;
rmon)
rmon $*
;;
route*)
routes
;;
span*)
rstp
;;
sys*)
system
;;
ver*)
version
;;
*)
usage
exit 1
;;
esac
-55
View File
@@ -1,55 +0,0 @@
#!/bin/sh
#set -x
usage()
{
cat <<EOF
usage:
yorn [-h] ["Do you want to run command?" command]
options:
-h Show this help text
-p Show plain output, no bells or whistles
Displays the yes-or-no question and runs command on yes.
EOF
}
if [ -z "$1" ]; then
usage
exit 1
fi
case $1 in
-h)
usage
exit 0
;;
-p)
plain=1
shift
;;
*)
;;
esac
question=$1
shift
command=$*
if [ -z "$command" ]; then
usage
exit 1
fi
if [ -z "$plain" ]; then
if dialog --erase-on-exit --colors --defaultno --yesno "\Zb$question\ZB" 0 0; then
yorn=y
fi
else
# shellcheck disable=SC2162,SC3045
read -n 1 -p "$question (y/N): " yorn
fi
if [ "$yorn" = "y" ] || [ "$yorn" = "Y" ]; then
$command
fi
-18
View File
@@ -1,18 +0,0 @@
# System-wide .bashrc file for interactive bash(1) shells.
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# Reevaluate for each line, in case hostname changes
function prompt_command
{
PS1="\u@$(hostname):\w\$ "
}
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
# Disble built-ins
enable -n help
-51
View File
@@ -1,51 +0,0 @@
# Infix's configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
#hostname
# Use the hardware address of the interface for the Client ID.
#clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
duid
# Persist interface configuration when dhcpcd exits.
persistent
# vendorclassid is set to blank to avoid sending the default of
# dhcpcd-<version>:<os>:<machine>:<platform>
vendorclassid
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu
# Request a hostname from the network
option host_name
# Most distributions have NTP support.
#option ntp_servers
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private
# Background immediately, do not wait for DHCP lease (speed up boot process)
background
-144
View File
@@ -1,144 +0,0 @@
#
# Run-time configuration file for dialog
#
# Automatically generated by "dialog --create-rc <file>"
#
#
# Types of values:
#
# Number - <number>
# String - "string"
# Boolean - <ON|OFF>
# Attribute - (foreground,background,highlight?,underline?,reverse?)
# Set aspect-ration.
aspect = 0
# Set separator (for multiple widgets output).
separate_widget = ""
# Set tab-length (for textbox tab-conversion).
tab_len = 0
# Make tab-traversal for checklist, etc., include the list.
visit_items = OFF
# Shadow dialog boxes? This also turns on color.
use_shadow = ON
# Turn color support ON or OFF
use_colors = ON
# Screen color
screen_color = (WHITE,BLUE,OFF)
# Shadow color
shadow_color = (BLACK,BLACK,OFF)
# Dialog box color
dialog_color = (BLACK,CYAN,OFF)
# Dialog box title color
title_color = (BLACK,CYAN,ON)
# Dialog box border color
border_color = dialog_color
# Active button color
button_active_color = (CYAN,BLACK,ON)
# Inactive button color
button_inactive_color = dialog_color
# Active button key color
button_key_active_color = (WHITE,BLACK,ON)
# Inactive button key color
button_key_inactive_color = (WHITE,CYAN,ON)
# Active button label color
button_label_active_color = button_active_color
# Inactive button label color
button_label_inactive_color = dialog_color
# Input box color
inputbox_color = (BLACK,CYAN,OFF)
# Input box border color
inputbox_border_color = inputbox_color
# Search box color
searchbox_color = inputbox_color
# Search box title color
searchbox_title_color = (BLUE,WHITE,ON)
# Search box border color
searchbox_border_color = (WHITE,WHITE,ON)
# File position indicator color
position_indicator_color = searchbox_title_color
# Menu box color
menubox_color = dialog_color
# Menu box border color
menubox_border_color = dialog_color
# Item color
item_color = inputbox_color
# Selected item color
item_selected_color = button_key_active_color
# Tag color
tag_color = button_inactive_color
# Selected tag color
tag_selected_color = (CYAN,BLACK,OFF)
# Tag key color
tag_key_color = button_key_inactive_color
# Selected tag key color
tag_key_selected_color = (WHITE,BLACK,ON)
# Check box color
check_color = inputbox_color
# Selected check box color
check_selected_color = button_key_active_color
# Up arrow color
uarrow_color = (GREEN,WHITE,ON)
# Down arrow color
darrow_color = uarrow_color
# Item help-text color
itemhelp_color = (WHITE,BLACK,OFF)
# Active form text color
form_active_text_color = button_key_active_color
# Form text color
form_text_color = (WHITE,CYAN,ON)
# Readonly form item color
form_item_readonly_color = (CYAN,WHITE,ON)
# Dialog box gauge color
gauge_color = searchbox_title_color
# Dialog box border2 color
border2_color = dialog_color
# Input box border2 color
inputbox_border2_color = inputbox_color
# Search box border2 color
searchbox_border2_color = inputbox_color
# Menu box border2 color
menubox_border2_color = dialog_color
@@ -1 +0,0 @@
run [S] /lib/infix/swup --
-112
View File
@@ -1,112 +0,0 @@
# NetBox mdev.conf based on https://github.com/slashbeast/mdev-like-a-boss/
# Syntax:
# [-]devicename_regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]$ENVVAR=regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
# [-]@maj,min[-min2] user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
#
# [-]: do not stop on this match, continue reading mdev.conf
# =: move, >: move and create a symlink
# !: do not create device node
# @|$|*: run cmd if $ACTION=remove, @cmd if $ACTION=add, *cmd in all cases
# support module loading on hotplug
$MODALIAS=.* root:root 660 @modprobe -b "$MODALIAS"
# null may already exist; therefore ownership has to be changed with command
null root:root 666 @chmod 666 $MDEV
zero root:root 666
full root:root 666
random root:root 444
urandom root:root 444
hwrandom root:root 444
grsec root:root 660
# Kernel-based Virtual Machine.
#kvm root:kvm 660
# vhost-net, to be used with kvm.
#vhost-net root:kvm 660
kmem root:root 640
mem root:root 640
port root:root 640
# console may already exist; therefore ownership has to be changed with command
console root:tty 600 @chmod 600 $MDEV
ptmx root:tty 666
pty.* root:tty 660
# Typical devices
tty root:tty 666
tty[0-9]* root:tty 660
vcsa*[0-9]* root:tty 660
ttyS[0-9]* root:dialout 660
# block devices
ram([0-9]*) root:disk 660 >rd/%1
loop([0-9]+) root:disk 660 >loop/%1
sr[0-9]* root:cdrom 660 @ln -sf $MDEV cdrom
fd[0-9]* root:floppy 660
#SUBSYSTEM=block;.* root:disk 660 */lib/infix/storage-device
# Run settle-nics every time new NIC appear.
# If you don't want to auto-populate /etc/mactab with NICs,
# run 'settle-nis' without '--write-mactab' param.
#-SUBSYSTEM=net;DEVPATH=.*/net/.*;.* root:root 600 @/lib/infix/settle-nics --write-mactab
net/tun[0-9]* root:netdev 660
net/tap[0-9]* root:root 600
# alsa sound devices and audio stuff
#SUBSYSTEM=sound;.* root:audio 660 @/lib/infix/sound-control
adsp root:audio 660 >sound/
audio root:audio 660 >sound/
dsp root:audio 660 >sound/
mixer root:audio 660 >sound/
sequencer.* root:audio 660 >sound/
# raid controllers
cciss!(.*) root:disk 660 =cciss/%1
ida!(.*) root:disk 660 =ida/%1
rd!(.*) root:disk 660 =rd/%1
fuse root:root 666
card[0-9] root:video 660 =dri/
agpgart root:root 660 >misc/
psaux root:root 660 >misc/
rtc root:root 664 >misc/
# input stuff
SUBSYSTEM=input;.* root:plugdev 660
# v4l stuff
vbi[0-9] root:video 660 >v4l/
video[0-9] root:video 660 >v4l/
# dvb stuff
dvb.* root:video 660
# drm etc
dri/.* root:video 660
# Don't create old usbdev* devices.
usbdev[0-9].[0-9]* root:root 660 !
# Stop creating x:x:x:x which looks like /dev/dm-*
[0-9]+\:[0-9]+\:[0-9]+\:[0-9]+ root:root 660 !
# /dev/cpu support.
microcode root:root 600 =cpu/
cpu([0-9]+) root:root 600 =cpu/%1/cpuid
msr([0-9]+) root:root 600 =cpu/%1/msr
# Populate /dev/bus/usb.
#SUBSYSTEM=usb;DEVTYPE=usb_device;.* root:root 660 */lib/infix/dev-bus-usb
# Catch-all other devices, Right now useful only for debuging.
#.* root:root 660 */lib/infix/catch-all
-1
View File
@@ -1 +0,0 @@
Note: use help, show, and setup commands to set up and diagnose the system.
@@ -1,6 +0,0 @@
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
source-directory /etc/network/interfaces.d
-75
View File
@@ -1,75 +0,0 @@
#!/usr/bin/pdmenu
title:Setup & Diagnostics
color:desktop:blue:blue
color:title:blue:white
color:base:blue:white
menu:main:Main Menu:Use arrow keys, Enter, Escape, and Q to navigate
show:_System Settings..::system
show:_Network Settings..::network
show:_Tools..::tools
nop
exec:Show _fdb:truncate:show -p fdb
exec:Show _mdb:truncate:show -p mdb
exec:Show _ports:truncate:show -p ports
exec:Show _vlans:truncate:show -p vlans
exec:Show _interfaces:truncate:show -p iface
exec:Show _routes:truncate:show -p route
nop
exec:Show _online users:truncate:w
exec:Show _CPU Load::top
nop
show:_Help..::help
exit:_Quit
menu:help:Help:Help Menu
exec:Introduction:truncate:/bin/help -p
exec:Editors:truncate:/bin/help -p edit
exec:Networking:truncate:/bin/help -p net
nop
exit:_Main menu..
menu:network:Network:Network Settings
exec:Show all _links:truncated:ip -br link
exec:Show all _addresses:truncated:ip -br address
exec:Show managed _interfaces:truncated:ifparse --all
nop
exec:Take _interface down:edit:ifdown ~Enter name of interface to take down:~
exec:Take _interface up:edit:ifup ~Enter name of interface to take up:~
nop
exec:Edit _dhcpcd.conf::edit /etc/dhcpcd.conf
exec:Edit _dnsmasq.conf::edit /etc/dnsmasq.conf
exec:Edit _interfaces::edit /etc/network/interfaces
exec:Edit _mactab::edit /etc/mactab
exec:Edit _sysctl.conf::edit /etc/sysctl.conf
nop
exit:_Main menu..
menu:system:System:System Settings
exec:List _log files:truncate:ls -l /var/log
exec:Show _log file:edit,truncate:show -p -a log ~Show logfile, Enter for syslog:syslog~
exec:Change _hostname:edit:hostnm ~Enter new hostname \[-a-zA-Z0-9\]:~
exec:Change your _password::passwd
exec:Edit _rc.local::edit /etc/rc.local
nop
exec:_Show State of Services:truncate:initctl -p
exec:_Reload services:truncate:initctl reload;sleep 2;initctl -p
exec:Show _available services:truncate:initctl -p ls
exec:_Enable service:edit:initctl enable ~Enter name of service (filename) to enable:~
exec:_Disable service:edit:initctl disable ~Enter name of service (filename) to disable:~
nop
exec:_Factory Reset::yorn "Factory reset device (reboots), are you sure?" factory -y
nop
exit:_Main menu..
menu:tools:Tools:Tools
exec:_Ping:edit,pause:ping ~Enter address (IP or name) to ping:~
exec:_Shell Prompt::/bin/bash --login
exec:_SSH:edit,pause:ssh ~Enter [username@]address (IP or name) to SSH to:~
exec:_Telnet:edit,pause:telnet ~Enter address (IP or name) to telnet to:~
exec:_Traceroute:edit,pause:mtr ~Enter address (IP or name) to traceroute to:~
exec:Browse _WWW:edit,pause:lynx ~Enter URL to browse:~
nop
exit:_Main menu..
-19
View File
@@ -1,19 +0,0 @@
#!/bin/sh
# This file is run at the very end of runlevel S (bootstrap)
#
# Note: 1) not all initctl commands are allowed here
# 2) to enable IP forwarding, use /etc/sysctl.conf, or /etc/sysctl.d/
# 3) ensure the script calls `exit 0` at the end
#
# Uncomment to classify all interfaces starting with 'eth' as ports.
#for port in $(ip -br link |awk '/eth/{print $1}'); do
# ip link set $port group port
#done
# Uncomment to enable IP masquerading (NAT) of all traffic egressing
# the WAN interface, here eth0. E.g., if you are a router for your
# LAN on eth1.
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
exit 0
-62
View File
@@ -1,62 +0,0 @@
#!/bin/sh
# Factory default:
# 1) all switch ports in VLAN 1 of br0
# 2) no switch ports => DHCP on eth0
# 3) no eth0
create_bridge()
{
nm=$1
shift
ports=$@
touch "/etc/network/interfaces.d/$nm"
for port in $ports; do
cat <<-EOF >>"/etc/network/interfaces.d/$nm"
iface $port
bridge-access 1
post-up ip link set $port group port
EOF
done
cat <<-EOF >> "/etc/network/interfaces.d/$nm"
auto $nm
iface $nm
bridge-ports $ports
bridge-vlan-aware yes
bridge-stp on
bridge-vids 1
auto vlan1
iface vlan1 inet dhcp
vlan-id 1
vlan-raw-device $nm
post-up ip link set vlan1 group iface
EOF
ip link set vlan1 group iface
}
# Check if already set up
[ -z "$(ls -A /etc/network/interfaces.d/)" ] || exit 0
# Check for custom hostname from Qemu/Qeneth
nm=$(cat /sys/firmware/qemu_fw_cfg/by_name/opt/hostname/raw)
if [ -n "$nm" ]; then
hostnm "$nm"
fi
# need to check for 'length > 0' because ip command
# outputs empty json objects for non-port group ifs
ports=$(ip -json link show group port | jq -r '.[].ifname | select(length > 0)' | tr "\n" " ")
if [ -n "$ports" ]; then
create_bridge br0 $ports
else
ifaces=$(ip -json addr show |jq -r '.[] | select(.link_type=="ether").ifname')
for iface in $ifaces; do
cat <<-EOF > "/etc/network/interfaces.d/$iface"
auto $iface
iface $iface inet dhcp
pre-up ip link set $iface group iface
EOF
done
fi
+3 -3
View File
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.36.0
# Tue Oct 3 18:00:40 2023
# Thu Feb 8 08:22:32 2024
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -1132,9 +1132,9 @@ CONFIG_SV_DEFAULT_SERVICE_DIR=""
CONFIG_SH_IS_ASH=y
# CONFIG_SH_IS_HUSH is not set
# CONFIG_SH_IS_NONE is not set
CONFIG_BASH_IS_ASH=y
# CONFIG_BASH_IS_ASH is not set
# CONFIG_BASH_IS_HUSH is not set
# CONFIG_BASH_IS_NONE is not set
CONFIG_BASH_IS_NONE=y
CONFIG_SHELL_ASH=y
CONFIG_ASH=y
CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
+2
View File
@@ -1,3 +1,4 @@
ifeq ($(SIGN_ENABLED),y)
include $(BR2_EXTERNAL_INFIX_PATH)/board/common/uboot/uboot.mk
define RAUC_POST_BUILD_INSTALL_CERT
@@ -7,3 +8,4 @@ define RAUC_POST_BUILD_INSTALL_CERT
cp $(crt) $(TARGET_DIR)/etc/rauc/keys/$(shell openssl x509 -hash -noout <$(crt)).0;)
endef
RAUC_POST_BUILD_HOOKS += RAUC_POST_BUILD_INSTALL_CERT
endif
+1 -1
View File
@@ -60,7 +60,7 @@ cat <<EOF >"$BINARIES_DIR/${NM}.gns3a"
"status": "stable",
"maintainer": "$VENDOR_NAME",
"maintainer_email": "${SUPPORT_URL#mailto:}",
"usage": "Default login, user/pass: admin/admin\n\nType 'help' for an overview of commands and relevant configuration files.\n\nFor Classic builds the following applies: the /etc directory is writable, use the passwd tool after login as part of your set up.\nFor networking, classify interfaces as switchports with /etc/mactab, syntax: 'MAC-address eN', where N is the port number (1-MAX).\nTo set up bridging and management interfaces, use /etc/network/interfaces, and /etc/network/interfaces.d/",
"usage": "Default login, user/pass: admin/admin\n\nType 'cli' (and Enter) followed by 'help' for an overview of commands and relevant configuration files.",
"port_name_format": "eth{0}",
"linked_clone": true,
"qemu": {
+12 -7
View File
@@ -1,5 +1,6 @@
#!/bin/sh
# shellcheck disable=SC1090,SC1091
common=$(dirname "$(readlink -f "$0")")
. "$BR2_CONFIG" 2>/dev/null
. "$TARGET_DIR/usr/lib/os-release"
@@ -31,6 +32,7 @@ rm -f "$TARGET_DIR/etc/os-release"
echo "ID=$INFIX_ID"
echo "PRETTY_NAME=\"$INFIX_TAGLINE $VERSION\""
echo "ID_LIKE=\"${ID}\""
echo "DEFAULT_HOSTNAME=$BR2_TARGET_GENERIC_HOSTNAME"
echo "VERSION=\"${VERSION}\""
echo "VERSION_ID=${VERSION}"
echo "BUILD_ID=\"${GIT_VERSION}\""
@@ -40,13 +42,6 @@ rm -f "$TARGET_DIR/etc/os-release"
if [ -n "$INFIX_RELEASE" ]; then
echo "IMAGE_VERSION=\"$INFIX_RELEASE\""
fi
if [ "$INFIX_VARIANT_NETCONF" = "y" ]; then
echo "VARIANT=\"Managed NETCONF\""
echo "VARIANT_ID=netconf"
else
echo "VARIANT=\"Classic, writable /etc\""
echo "VARIANT_ID=classic"
fi
echo "ARCHITECTURE=\"${INFIX_ARCH}\""
echo "HOME_URL=$INFIX_HOME"
if [ -n "$INFIX_VENDOR" ]; then
@@ -68,6 +63,12 @@ rm -f "$TARGET_DIR/etc/os-release"
echo "$INFIX_TAGLINE $VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version"
# 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
# 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
@@ -80,3 +81,7 @@ grep -qsE '^/bin/true$$' "$TARGET_DIR/etc/shells" \
|| echo "/bin/true" >> "$TARGET_DIR/etc/shells"
grep -qsE '^/bin/false$$' "$TARGET_DIR/etc/shells" \
|| echo "/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"
+2 -2
View File
@@ -22,7 +22,7 @@ diskimg=disk.img
ver()
{
if [ -n "$INFIX_RELEASE" ]; then
printf -- "-%s" "$INFIX_RELEASE"
printf -- "-%s" "${INFIX_RELEASE#v}"
return
fi
}
@@ -42,7 +42,7 @@ fi
load_cfg DISK_IMAGE
if [ "$DISK_IMAGE" = "y" ]; then
ixmsg "Creating Disk Image"
diskimg="${NAME}-disk.img"
diskimg="${NAME}-disk$(ver).img"
bootcfg=
if [ "$DISK_IMAGE_BOOT_DATA" ]; then
bootcfg="-b $DISK_IMAGE_BOOT_DATA -B $DISK_IMAGE_BOOT_OFFSET"
+6 -6
View File
@@ -63,8 +63,8 @@ endchoice
config QEMU_MACHINE
string "Select emulated machine"
default "qemu-system-aarch64 -M virt -cpu cortex-a72" if QEMU_aarch64
default "qemu-system-x86_64 -M q35,accel=kvm -cpu host" if QEMU_x86_64
default "qemu-system-aarch64 -M virt,accel=kvm:tcg -cpu max" if QEMU_aarch64
default "qemu-system-x86_64 -M pc,accel=kvm:tcg -cpu max" if QEMU_x86_64
help
You should not have to change this setting, although you may
want to tweak it, or change the acceleration.
@@ -75,11 +75,11 @@ config QEMU_MACHINE
config QEMU_MACHINE_RAM
string "RAM size (k/M/G)"
default "256M"
default "384M"
help
The default, 255 MiB, works for most configurations, even less for
the Infix Classic builds. However, if you get kernel panic with:
"System is deadlocked on memory", try increasing this one.
The default, 384 MiB, works for most configurations. However,
if you get kernel panic with: "System is deadlocked on memory",
try increasing this one.
config QEMU_KERNEL
string
+32 -5
View File
@@ -24,11 +24,22 @@ prognm=$(basename "$0")
usage()
{
echo "usage: $prognm [opts]"
echo "Usage:"
echo " $prognm [opts] [ARGS]"
echo
echo " -c Run menuconfig to change Qemu settings"
echo " -h This help text"
echo "Options:"
echo " -c Run menuconfig to change Qemu settings"
echo " -h This help text"
echo
echo "Arguments:"
echo " ARGS1 Args before the '--' separator are for kernel space"
echo " -- Separator"
echo " ARGS2 Args after the '--' separator are for the init process"
echo " Also, qemu.cfg has QEMU_APPEND which can affect this."
echo
echo "Example:"
echo " qemu.sh -- finit.debug"
echo "___________________________________________________________________"
echo "Note: 'kconfig-frontends' package (Debian/Ubuntu) must be installed"
echo " for -c to work: sudo apt install kconfig-frontents"
@@ -130,6 +141,18 @@ serial_args()
echo -n "-device virtconsole,nr=1,name=gdbserver,chardev=gdbserver "
}
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
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
@@ -208,7 +231,7 @@ vpd_args()
cat <<EOF | "$onieprom" -e >"$vpd_file"
{
"manufacture-date": "$(date +"%d/%m/%Y %H:%M:%S")",
"manufacture-date": "$(date +"%m/%d/%Y %H:%M:%S")",
"vendor-extension": [
[
61046,
@@ -235,6 +258,7 @@ run_qemu()
$(rootfs_args) \
$(serial_args) \
$(rw_args) \
$(usb_args) \
$(host_args) \
$(net_args) \
$(wdt_args) \
@@ -346,6 +370,10 @@ else
load_qemucfg qemu.cfg
fi
if [ -z "$QEMU_EXTRA_APPEND" ]; then
QEMU_EXTRA_APPEND="$*"
fi
generate_dot
echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
@@ -353,4 +381,3 @@ line=$(stty -g)
stty raw
run_qemu $(dtb_args)
stty "$line"
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
# shellcheck disable=SC3045
OUTPUT=$1
read -r -s -p "New password: " password
>&2 echo
read -r -s -p "Retype password: " password_again
>&2 echo
if [ "$password" != "$password_again" ]; then
echo "Passwords do not match, try again."
exit 1
fi
if [ -z "$OUTPUT" ]; then
echo "$password"
exit 0
fi
umask 0177
echo "$password" | mkpasswd > "$OUTPUT"
exit 0
@@ -1,3 +1,3 @@
#!/bin/bash -li
#!/bin/sh
# Source settings, aliases, and probe terminal size, then hand over to klish
exec /usr/bin/klish
exec env CLISH=yes bash -ilc /usr/bin/klish
+67
View File
@@ -0,0 +1,67 @@
#!/usr/bin/env python3
# Generate a self signed certificate with unlimited expire time
import argparse
from cryptography import x509
from cryptography.x509.oid import NameOID
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend
from datetime import datetime, timedelta
# Generate private key
private_key = rsa.generate_private_key(
public_exponent=65537,
key_size=2048,
backend=default_backend()
)
parser = argparse.ArgumentParser(description="Generate a self signed certificate")
parser.add_argument('--country', required=True, help="Set country")
parser.add_argument('--state', required=True, help="Set state or province name")
parser.add_argument('--city', required=True, help="Set city name")
parser.add_argument('--organisation', required=True, help="Set organisation name")
parser.add_argument('--organisation-unit', required=True, help="Set organisation unit name")
parser.add_argument('--common-name', required=True, help="Set common name")
parser.add_argument('--out-certificate', required=True, help="Output certificate")
parser.add_argument('--out-key', required=True, help="Output key")
args = parser.parse_args()
# Builder for certificate
subject = issuer = x509.Name([
x509.NameAttribute(NameOID.COUNTRY_NAME, args.country),
x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, args.state),
x509.NameAttribute(NameOID.LOCALITY_NAME, args.city),
x509.NameAttribute(NameOID.ORGANIZATION_NAME, args.organisation),
x509.NameAttribute(NameOID.ORGANIZATIONAL_UNIT_NAME, args.organisation_unit),
x509.NameAttribute(NameOID.COMMON_NAME, args.common_name),
])
certificate = x509.CertificateBuilder().subject_name(
subject
).issuer_name(
issuer
).public_key(
private_key.public_key()
).serial_number(
x509.random_serial_number()
).not_valid_before(
datetime(2000, 1, 1)
).not_valid_after(
datetime(9999, 1, 1)
).add_extension(
x509.SubjectAlternativeName([x509.DNSName(args.common_name)]),
critical=False,
).sign(private_key, hashes.SHA256(), default_backend())
# Serialize certificate and private key
with open(args.out_certificate, "wb") as f:
f.write(certificate.public_bytes(serialization.Encoding.PEM))
with open(args.out_key, "wb") as f:
f.write(private_key.private_bytes(
encoding=serialization.Encoding.PEM,
format=serialization.PrivateFormat.PKCS8,
encryption_algorithm=serialization.NoEncryption()
))
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
sleep 30
stress-ng --cpu 8 --io 4 --vm 2 --vm-bytes 128M --fork 4 -t 0
+76
View File
@@ -0,0 +1,76 @@
#!/bin/sh
tstamp()
{
if [ "$1" = "head" ]; then
printf '%9s' time
else
printf '%9s' $(date +%T)
fi
}
thermal()
{
for th in /sys/class/thermal/thermal_zone*; do
if [ "$1" = "head" ]; then
printf '%5s' $(cat $th/type | \
sed -e 's/-thermal//' -e 's/ap-cpu/cpu/' -e 's/-ic//')
else
printf '%5d' \
$((($(cat $th/temp) + 500) / 1000))
fi
done
}
hwmon()
{
for hw in /sys/class/hwmon/*; do
[ -f $hw/temp1_input ] || continue
if [ "$1" = "head" ]; then
printf '%5s' \
$(cat $hw/name | sed -e 's/cp0configspacef2000000mdio12a200switch0mdio0/p/' -e 's/f212a600mdiomii0/xp/')
else
printf '%5d' \
$((($(cat $hw/temp1_input) + 500) / 1000))
fi
done
}
xphys()
{
for xphy in 4 5; do
mdio f212a6* $xphy:31 0xf08a 0x4d00
if [ "$1" = "head" ]; then
printf '%5s' \
p$((xphy + 5))
else
printf '%5d' \
$(($(mdio f212a6* $xphy:31 0xf08a) & 0xff - 75))
fi
done
}
if [ "$1" != "-H" ]; then
# tstamp head
thermal head
hwmon head
# xphys head
echo
fi
while :; do
# tstamp
thermal
hwmon
# xphys
echo
if [ "$1" == "-n" ]; then
sleep ${2:-10}
else
break
fi
done
+1
View File
@@ -0,0 +1 @@
/usr/bin/mg
@@ -43,7 +43,7 @@ if [ -x /bin/ip -o -x /sbin/ip ] ; then
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 ||:
ip route add default dev "$2" metric "$METRIC" scope link proto zeroconf ||:
;;
CONFLICT|UNBIND|STOP)
@@ -0,0 +1,27 @@
# This file defines default behavior and a skeleton for including config
# snippets from both confd, i.e., ietf-system.yang, and DHCP clients.
# Default values taken from Debian /etc/chrony/chrony.conf
# *.conf when acting as an NTP server
confdir /etc/chrony/conf.d
# *.sources from DHCP clients, e.g., /run/chrony-dhcp/$ifname.sources:
# server 192.0.2.1 iburst
sourcedir /run/chrony/dhcp-sources.d
# *.sources for NTP servers generated by confd:ietf-system.c
sourcedir /etc/chrony/sources.d
# Where to store the system clock rate information across reboots.
driftfile /var/lib/chrony/chrony.drift
# Stop bad estimates upsetting machine clock.
maxupdateskew 100.0
# Enables kernel synchronisation (every 11 minutes) of the real-time
# clock. Note that it cant be used along with the 'rtcfile' directive.
rtcsync
# Step the system clock instead of slewing it if the adjustment is
# larger than one second, but only in the first three clock updates.
makestep 1 3
+1
View File
@@ -0,0 +1 @@
CHRONY_ARGS="-f /etc/chrony/chrony.conf"
+6 -2
View File
@@ -2,8 +2,12 @@
# managed by openresolv. DHCP lease, VPN tunnel establishment,
# and similar events feed servers and configuration to dnsmasq.
domain-needed
#interface=lo
listen-address=127.0.0.1
# Only listen to loopback (local system)
interface=lo
bind-dynamic
#listen-address=127.0.0.1,::1
enable-dbus
# Generated by openresolv
+1
View File
@@ -1 +1,2 @@
set COLORTERM=yes
rlimit soft core infinity
@@ -1,3 +1,3 @@
run [S] log:console /lib/infix/probe -- Probing system information
run [S] <pid/syslogd> /lib/infix/sysctl-sync-ip-conf --
run [S] <pid/syslogd> /lib/infix/nameif -- Probing network interfaces
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
@@ -0,0 +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 \
[2345] container -n %i -- container %i
@@ -0,0 +1 @@
task [S] <service/confd/ready> /libexec/infix/mkcert -- Verifying self-signed https certificate
@@ -0,0 +1,3 @@
service [2345789] log:/var/log/temp.log /bin/temp.sh -n 10 -- Temperature monitor
service [2345789] log:/var/log/load.log /bin/load.sh -- CPU load generator
service [2345789] log:/var/log/memtester.log /usr/bin/memtester 1G -- Memory load generator
@@ -0,0 +1 @@
service [2345] <!> ttyd -i lo -p 8001 login -- Web terminal daemon (ttyd)
+1
View File
@@ -0,0 +1 @@
../available/mkcert.conf
+1
View File
@@ -0,0 +1 @@
../available/temp.conf
+2 -2
View File
@@ -12,11 +12,11 @@ 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 /lib/infix/mnt
# /home, /root, and /var, are determined dynamically by /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
/lib/infix/mnt# /cfg helper none 0 0
/libexec/infix/mnt# /cfg helper none 0 0
+6
View File
@@ -0,0 +1,6 @@
# Sourced by mkcert at boot
country=SE
state=Vastmanland
city=Vasteras
org=KernelKit
unit=Infix
@@ -0,0 +1,3 @@
# Do not authorize usb ports before they have been checked in in the device-tree
options usbcore authorized_default=0
+4
View File
@@ -0,0 +1,4 @@
.-------.
| . . | Infix -- a Network Operating System
|-. v .-| https://kernelkit.github.io
'-'---'-'
@@ -0,0 +1,27 @@
server {
listen 80;
listen [::]:80;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name _;
include ssl.conf;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location / {
root html;
index index.html index.htm;
}
}
@@ -0,0 +1,18 @@
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name network.local;
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;
}
}
@@ -0,0 +1,19 @@
server {
listen 7681 ssl;
listen [::]:7681 ssl;
server_name _;
include ssl.conf;
location / {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:8001;
proxy_redirect off;
}
}
+1
View File
@@ -0,0 +1 @@
../available/default.conf
+24
View File
@@ -0,0 +1,24 @@
user www-data www-data;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/enabled/*.conf;
access_log syslog:server=unix:/dev/log,nohostname,facility=local7,severity=info;
error_log syslog:server=unix:/dev/log,nohostname,facility=local7 info;
}
+9
View File
@@ -0,0 +1,9 @@
ssl_certificate /etc/ssl/certs/self-signed.crt;
ssl_certificate_key /etc/ssl/private/self-signed.key;
ssl_protocols TLSv1.3 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
@@ -0,0 +1,2 @@
alias cli='clish'
alias cfg='sysrepocfg -f json'
@@ -0,0 +1,7 @@
if [ -z "$CLISH" ]; then
cat <<EOF
Run the command 'cli' for interactive OAM
EOF
fi
+1
View File
@@ -0,0 +1 @@
%wheel ALL=(ALL:ALL) NOPASSWD: ALL
@@ -0,0 +1 @@
kernel.core_pattern=/var/crash/core-%e
@@ -1,4 +1,5 @@
net.ipv6.conf.all.forwarding=0
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.default.forwarding=0
net.ipv6.conf.all.autoconf=0
net.ipv6.conf.default.autoconf=0
net.ipv6.conf.default.keep_addr_on_down=1
@@ -0,0 +1 @@
local1.* -/var/log/container
@@ -1 +1,3 @@
d /var/lib/chrony 0755 chrony chrony
d /var/lib/chrony 0750 chrony chrony
d /run/chrony 0750 chrony chrony
d /run/chrony/dhcp-sources.d 0755 chrony chrony
+42
View File
@@ -0,0 +1,42 @@
#!/bin/sh
KEY=/cfg/ssl/private/self-signed.key
CRT=/cfg/ssl/certs/self-signed.crt
country=US
state=California
city=Berkeley
org="Acme, Inc."
unit=Second
if [ -f /etc/mkcert.conf ]; then
. /etc/mkcert.conf
fi
if [ -z "$cn" ]; then
cn=$1
if [ -z "$cn" ]; then
cn=$(hostname).local
fi
fi
generate()
{
mkdir -p /cfg/ssl/private /cfg/ssl/certs
chmod 700 /cfg/ssl/private
gencert --country "$country" --state "$state" --city "$city" --organisation "$org" \
--organisation-unit "$unit" --common-name "$cn" \
--out-certificate $CRT --out-key $KEY
}
CN=$(openssl x509 -noout -subject -in "${CRT}" 2>/dev/null |sed 's/.*CN=//')
if [ -z "$CN" ] || [ "$CN" != "$cn" ]; then
generate "$cn"
fi
cp "${KEY}" "/etc/ssl/private/"
cp "${CRT}" "/etc/ssl/certs/"
initctl cond set mkcert
exit 0
@@ -33,11 +33,11 @@ check_factory()
fi
# Add to your br2-external to extend factory-reset check
if [ ! -x /lib/infix/check-factory ]; then
if [ ! -x /libexec/infix/check-factory ]; then
return 1;
fi
/lib/infix/check-factory
/libexec/infix/check-factory
}
factory_reset()
@@ -126,11 +126,6 @@ if ! mount_rw cfg >/dev/null 2>&1; then
# Even if /mnt/var isn't available, if /mnt/cfg isn't either, then
# there's no point in overlaying one ramdisk on top of another.
vlibsrc=
else
# Classic Infix has read-write /etc across boots
if [ "$VARIANT_ID" != "netconf" ]; then
etcsrc=/mnt/cfg
fi
fi
if check_factory; then
@@ -40,10 +40,13 @@ class DTSystem:
continue
ph, = struct.unpack(">L", open(phandle, "rb").read())
sys[ph] = root
if ph not in sys:
sys[ph] = []
sys[ph].append(root)
phs = set(list(dt.keys()) + list(sys.keys()))
self.devs = { ph: Device(ph, dt.get(ph), sys.get(ph)) for ph in phs }
self.devs = { ph: [Device(ph, dt.get(ph), s if s is not None else "") for s in (sys.get(ph) or []) if ph is not None] for ph in phs }
self.base = Device(0, None, DTSystem.BASE)
self.infix = Device(0, None, DTSystem.INFIX)
@@ -56,7 +59,7 @@ class DTSystem:
elems = len(data) // struct.calcsize(">L")
return struct.unpack(">" + elems * "L", data)
def device_from_ph(self, ph):
def devices_from_ph(self, ph):
return self.devs.get(ph)
def into_vpd(self, dev):
@@ -79,12 +82,23 @@ class DTSystem:
"data": parse(),
}
def infix_usb_devices(self, out):
names=self.infix.str_array("usb-port-names", ())
phs=self.__get_phandle_array("usb-ports")
data=dict(zip(names,phs))
if data != {}:
out["usb-ports"] = []
for name,ph in data.items():
[out["usb-ports"].extend([{"name": name, "path": dev.attrpath("authorized")}, {"name": name, "path": dev.attrpath("authorized_default")}]) for dev in self.devices_from_ph(ph)]
def infix_devices(self, kind):
phs = self.__get_phandle_array(kind)
return [self.device_from_ph(ph) for ph in phs]
return [[d for d in self.devices_from_ph(ph)] for ph in phs]
def infix_vpds(self):
return [self.into_vpd(dev) for dev in self.infix_devices("vpds")]
flat_devices = [device for sublist in self.infix_devices("vpds") for device in sublist]
return [self.into_vpd(device) for device in flat_devices]
class QEMUSystem:
BASE = "/sys/firmware/qemu_fw_cfg"
@@ -109,6 +123,28 @@ class QEMUSystem:
def vpds(self):
return [self.product_vpd()]
def usb_ports(self):
ports = [
{
"name": "USB",
"path": "/sys/bus/usb/devices/usb1/authorized"
},
{
"name": "USB",
"path": "/sys/bus/usb/devices/usb1/authorized_default"
},
{
"name": "USB2",
"path": "/sys/bus/usb/devices/usb2/authorized"
},
{
"name": "USB2",
"path": "/sys/bus/usb/devices/usb2/authorized_default"
}]
return ports
class Device:
def __init__(self, ph, dtpath, syspath):
self.ph, self.dtpath, self.syspath = ph, dtpath, syspath
@@ -143,6 +179,9 @@ class Device:
val = self.attr(attr)
return val.decode("utf-8").strip("\0") if val else default
def str_array(self, attr, default=None):
val = self.attr(attr)
return val.decode("utf-8").strip("\0").split("\0") if val else default
def dtattrpath(self, attr):
return os.path.join(self.dtpath, attr)
@@ -199,8 +238,9 @@ def probe_qemusystem(out):
qsys = QEMUSystem()
vpds = qsys.vpds()
usb_ports = qsys.usb_ports()
vpd_inject(out, vpds)
out["usb-ports"] = usb_ports
for (attr, default) in (
("vendor", "QEMU"),
("product-name", "VM"),
@@ -221,7 +261,7 @@ def probe_qemusystem(out):
def probe_dtsystem(out):
dtsys = DTSystem()
vpds = dtsys.infix_vpds()
dtsys.infix_usb_devices(out)
model = dtsys.base.str("model")
if model:
out["product-name"] = model
@@ -8,7 +8,7 @@ bootoffs=$2
bootsize=8M
auxsize=8M
total=$(awk -vdisk="$(basename $disk)" '$4 == disk { print($3 / 1024); }' /proc/partitions)
total=$(awk -vdisk="$(basename $disk)" '$4 == disk { print(int($3 / 1024)); }' /proc/partitions)
if [ "$total" -ge 4096 ]; then
imgsize=1024M
cfgsize=512M
@@ -63,7 +63,7 @@ ok
step "Formatting $blk"
[ -b $blk ] || { echo "$blk is not a block device" >&2; err; }
/lib/infix/prod/fdisk $blk || err
/libexec/infix/prod/fdisk $blk || err
sleep 1
ok
+1 -1
View File
@@ -7,7 +7,7 @@ inform()
local level="$1"
shift
logger -p "daemon.$level" -t dagger -c $LOGGER_STDOUT "$@"
logger -p "daemon.$level" -I $PPID -t dagger -c $LOGGER_STDOUT "$@"
}
abort()
+1 -1
View File
@@ -1 +1 @@
mg
/etc/alternatives/editor
+1 -1
View File
@@ -1 +1 @@
mg
/etc/alternatives/editor
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
# Helper script to chronyc, checks if daemon is running
if ! chronyc serverstats >/dev/null; then
echo "NTP client not enabled."
exit 1
fi
case $1 in
tracking)
chronyc tracking
;;
sources)
chronyc sources -v
;;
*)
echo "Unknown NTP command."
;;
esac
+15
View File
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.</p>
</body>
</html>
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
# Generate index.html from Infix README.md
BASE=../../../../..
TITLE="Welcome to Infix :-)"
cp $BASE/doc/logo.png .
cat $BASE/README.md \
| tail +2 \
| sed 's/doc\/logo.png/logo.png/' \
| pandoc -f markdown+implicit_figures+link_attributes -o index.html \
--metadata pagetitle="$TITLE" --template=hpstr-template.html

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