523 Commits
Author SHA1 Message Date
Joachim Wiberg fa6851caa6 board/common: set DHCP and ZeroConf routes using Frr/staticd
This patch changes the way Infix DHCP and ZerocConf clients set their
routes in the system.  Instead of setting them directly in the kernel
we ask FRR staticd to set them for us.

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

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

Fixes #640

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

Fixes #628

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-09-26 15:49:45 +02:00
Mattias Walström 5461a443a3 Upgrade rousette and required CPP-bindings
First release of rousette.
2024-09-26 15:05:38 +02:00
Mattias WalströmandJoachim Wiberg 0f9d429d9b confd: bump and add a migrate script for infix-routing 2024-09-21 08:47:02 +02:00
Tobias WaldekranzandJoachim Wiberg 8d94508a99 package/rousette: Addmissing select of date-cpp
Shows up when building aarch64_minimal_defconfig.
2024-09-18 18:32:03 +02:00
Henrik NordströmandJoachim Wiberg 508ff29c71 bug: Add missing " in date-cpp package reference 2024-09-18 18:31:12 +02:00
Mattias WalströmandJoachim Wiberg f5884098fb Bump rousette to latest GIT hash
Since we are using an old GCC we need to add a new requirement for rousette 'date'
this is included in GCC 14+.
2024-09-09 17:02:51 +02:00
Tobias Waldekranz f77f5852c1 confd: Use system timeout value when loading startup/failure
Now that we have a unified timeout value that all front-ends should
honor, make sure to do so when loading startup-config and
failure-config during boot.

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

Therefore, create a single definition of the timeout, which can be
included by all front-ends.
2024-09-05 23:41:19 +02:00
Mattias Walström 3c045460ef Add implementation to control test mode functions using an action
This intoduce a new sysrepo plugin to handle a new YANG
model 'infix-test'. Today only contains the actions.

This is required to run tests on infix using infamy.

This is a part of #561

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-08-30 17:40:02 +02:00
Joachim Wiberg fb00719069 package/klish: bump for droprivs refactor of script plugin
As of KernelKit Klish @ 710a631 the script plugin has been refactored to
run all commands as the logged in user instead of as root.  The default
admin user is member of the wheel group, which allows access to sysrepo
and sudo access to containers thanks to NOPASSWD rights.

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

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

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

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

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

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

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

Fixes #521

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

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

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

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

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-08-26 20:54:49 +02:00
Ahmed KaricandMattias Walström 4a325af4e4 confd: generate test-config.cfg
Currently, it's not possible to run infix tests from an external
project (based on infix) due to an incompatibility between the
configuration used in the tests (the default configuration
within the image generated by the external project) and the infix
base configuration expected by the test cases. Therefore, a simple
configuration specifically for testing purposes needs to be generated
within an image. This test-config should always be generated
but only loaded when the device is in test mode.

Part of issue #568
2024-08-23 11:15:12 +02:00
Joachim WibergandTobias Waldekranz df89b22062 board/aarch64/r2s: add support for reset button
This patch further cleans up the r2s kernel config and also enables the
input event framework for the gpio0 reset button on the device.

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

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

Issue #276

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

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

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

Fixes #536

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

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-07-11 02:47:02 +02:00
Joachim Wiberg 8f8766c340 package/python-libyang: allow building also for target
No need to lock it down solely for host build-time use.

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

 - LICENCE -> LICENSE
 - LICENCE -> COPYING

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

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

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-28 12:54:27 +02:00
Mattias Walström 91c55ddeb8 backport fix for extending timeouts in initctl 2024-06-27 15:43:06 +02:00
Joachim Wiberg 4c3a46b288 package/klish: bump for improved error message on missing command
Replaces:

    Error: Illegal command

with:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-25 17:22:36 +02:00
Joachim Wiberg 03a8ea9500 package/klish-plugin-sysrepo: fix 'show leaf-node' in configure
This patch bumps klish-plugins-sysrepo to fix the annoying issue with
the CLI not supporting, e.g. "show hostname" in system config context.

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

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

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

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

  - Add Missing YANG Module:
    - Included infix-interfaces@2024-01-15.yang in
      yang_modules_confd.inc
    - This module was missing in the non-containerized build and is now
      correctly added
2024-06-19 15:41:33 +02:00
Ahmed KaricandMattias Walström 7d9257f5f6 confd: refactor yang modules setup script for better modularity and maintainability
- Moved setup.sh and yang_modules files from infix/src/confd/scripts/ to infix/utils/ to streamline the repository structure
- Updated confd.mk to correctly reference the new location of the setup script
- Introduced yang_modules_<type>.inc file to list all YANG modules for improved clarity and maintainability
- Modified the new setup script to dynamically source module lists from yang_modules_<type>.inc
2024-06-18 18:54:18 +02:00
Tobias Waldekranz a5d98e9351 board/common: Collect all system init in a dedicated runparts dir
This makes it easier to add more scripts without having to update the
finit config file, and it clarifies which of the scripts in
/libexec/infix only execute at boot.
2024-06-07 10:10:38 +02:00
Mattias Walström d2d1562c8c sysrepo-cpp: Change to kernelkit-url 2024-06-04 13:38:03 +02:00
Mattias Walström 4f3ae3b9a4 Add new package: Rousette - a RESTConf server 2024-06-04 13:38:03 +02:00
Joachim WibergandTobias Waldekranz 90b35affe2 Drop augeas from system completely
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-06-03 23:05:04 +02:00
Mattias WalströmandTobias Waldekranz b1a6606728 confd: Add sysrepo and netopeer as a dependency.
And remove not needed environment variable
2024-05-24 11:58:47 +02:00
Joachim WibergandTobias Waldekranz 453afeb2d7 confd: simplify sysrepo datastore makedev permissions 2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz a4b1d37763 confd: Update SHM path
Do not use netopeer-created shm-path
2024-05-24 11:58:47 +02:00
Mattias WalströmandTobias Waldekranz 3354effc53 Build in required modules on buildtime
This to hopefully speed up boot, do as little as possible
during boot.

* New modules needs to be added to src/confd/scripts/setup.sh
* Permission needs to be changed post-build for YANG files,
  see CONFD_PERMISSIONS in confd.mk
2024-05-24 11:58:47 +02:00
Joachim Wiberg 1d58d2058d package/gencert: declare dependency on pkg-config and libopenssl
Plain openssl is a meta-package, gencert requires libopenssl v3.x and
later, and use pkg-config to detect its presence.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-05-16 13:32:35 +02:00
Joachim WibergandTobias Waldekranz 9d7817356f statd: support for enabling DEBUG() logs with env, like confd
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-05-13 11:42:27 +02:00
Joachim WibergandTobias Waldekranz adf37394f4 confd: follow-up to 2412fff3, simplify chown of startup-config
Instead of having a chown process started by Finit in runlevel S, we can
just chown in the confd load script instead.

Issue #415

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-05-13 11:42:27 +02:00