Commit Graph
428 Commits
Author SHA1 Message Date
Joachim WibergandRichard Alpe 8ab2bdc625 package/querierd: don't enable service by default
In normal use-cases querierd needs a bridge with multicast-snooping
enabled to run.  No point in attempting to start querierd by default.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-04 09:35:47 +02:00
Joachim WibergandRichard Alpe 45466bcbc7 package/skeleton-init-finit: smcrouted default changes
- allow custom options sourced from optional /etc/default/smcrouted
 - don't enable smcrouted by default when enabled in Buildroot .config
   because normal use-cases require an /etc/smcroute.conf

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-04 09:35:47 +02:00
Joachim WibergandRichard Alpe d5c28bc454 package: replace TARGET_FINALIZE_HOOKS with POST_INSTALL
When calling `make foo-rebuild` one expects all the registered hooks in
the foo package to have been called by Buildroot.  The Buildroot manual
has this to say about the target-finalize hook:

> These hooks are run after all packages are built, but
> before the filesystem images are generated.  They are
> seldom used, and your package probably do not need them.

The correct hook to use for target packages is POST_INSTALL_TARGET_HOOK.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-03 13:51:30 +02:00
Joachim WibergandRichard Alpe de24d0389a package: relocate PROFINET packages to customer repo.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-03 13:51:30 +02:00
Tobias WaldekranzandJoachim Wiberg c4b7b2aa65 rauc: Enable service
The RAUC service exports a D-Bus API that fits well with NETCONF's
notion of RPCs and notifications.
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg 31760e1c96 sysrepo-plugind: Require all plugins to load without error
If confd or statd fails to initialize, we want Finit to know about it.
2023-06-30 15:33:10 +02:00
Joachim WibergandTobias Waldekranz e4a1261ad8 Fix #57: unneccesary lldpd restarts on configuration change
Instead of restarting lldpd we can call lldpcli to inform lldpd of the change.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim Wiberg cfa220a043 package/podman: log any console output from podman to syslog
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-25 13:11:46 +02:00
Tobias Waldekranz 3784d769ca netopeer: Increase timeout to 60s
Empirical data shows response times of over 10s for even simple config
changes on heavily loaded systems (non-accelerated VMs with lots of
stress on the host). So we choose a really large number, hoping that
we won't be back here for a while.
2023-06-22 00:12:43 +02:00
Joachim WibergandTobias Waldekranz c00ff6daf5 confd: bootstrap sysrepo+netopeer yang models with factory defaults
To set up proper factory defaults in Infix we need to drop the default
/etc/sysrepo datastores, initialized at compile-time by Buildroot when
installing netopeer2.  The pre-initialized datastores cannot be set up
with new {factory} data in any other way.

The system factory-config is constructed from two parts: static data and
generated data.  The latter is:

 - hostname (product name + the three last octets of the base MAC)
 - interface defaults (depends on number of ports on the device) that
   enable IPv6 link-local on all interfaces, and
 - per-device unique SSH hostkey for remote NETCONF access, requires
   openssl binary on target.  Can maybe use openssh for this (TODO).
   The hostkeys are saved in /cfg/factory.d/ to prevent them from being
   regenerated on every boot.

The script gen-hostkeys and the update of 10-netconf-server.json are
inspired by the netopeer2 scripts merge_hostkey.sh and merge_config.sh,
which do just about the same thing for regular systems.

We bootstrap sysrepo early with all the required models, netopeer2 as
well as our own, by calling sysrepoctl with initial data for {factory}
and {startup} datastores.  A local patch to sysrepo is used to allow it
to look for an /etc/factory-default.json instead of compile-time default
data, the patch allows us to have variable amount of objects in the init
data, e.g. number of interface objects.

A system startup-config is generated, if one is mising, from {running}.

We then drop the initial {running} datastore before starting the daemons
sysrepo-plugind and netopeer2-server so that they, and our plugins, are
ready when we load the system startup-config.

Some sanity checks and debug possibilities:

 - Ensure /etc/sysrepo exists before copying factory-config
 - Keep factory-default.json for debug

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 19df588fe4 package/querierd: bump to version 0.10
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-02 18:19:50 +02:00
Joachim WibergandTobias Waldekranz 0e48a847b9 buildroot: bump libyang, sysrepo, and netopeer2 to latest versions
Changes to netopeer2-server required refactoring our foreground patch.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-26 15:10:26 +02:00
Joachim WibergandTobias Waldekranz 8addf469bf package/podman: add tool to create CNI profiles
Currently only supports creating host-device profiles, e.g. from veth
pairs or physical interfaces.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Joachim WibergandTobias Waldekranz 56677fb1d6 package/podman: helper script to create supervised Finit service
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Joachim WibergandTobias Waldekranz 65d170985c package/podman: new package
Podman (POD manager) is an open source tool for developing, managing,
and running containers on your Linux systems.

Based on work by Christian Stewart and Nathaniel Husted.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Joachim WibergandTobias Waldekranz 1624c88708 package/conmon: new package
Conmon is an OCI container runtime monitor.  It sits between container
runtimes, e.g., crun and runc, and userland managers, e.g., podman.

Based on work by Christian Stewart and Nathaniel Husted.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Joachim Wiberg 8aed30552f package/finit: bump for Finit v4.4 (GA)
Full release notes: https://github.com/troglobit/finit/releases/tag/4.4

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-15 19:17:23 +02:00
Joachim Wiberg 8ab2f5f9da src/confd: system users, like admin, have no shell by default
Rudimentary support for setting login shell for new users.  Currently
hard-coded from what's selected in the Buildroot config, if Bash is
available or not.

Follow-up to f5866ee

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-15 18:45:37 +02:00
Joachim Wiberg b2191d0c20 package/finit: bump for 4.4-rc2 + kill process group fix
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-14 09:37:49 +02:00
Tobias WaldekranzandJoachim Wiberg 82d11112a6 avahi-autoipd: Default to always assigning a LL address
Without --force-bind, the address is removed if another routable
address is added to the interface.

While this is likely something that should be configurable in the
future, we choose this mode as the default so that IPs used for
NETCONF connections are not dropped because other addresses are added.
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 03e44dd5b1 confd: Dynamically generate factory-config
This allows you to define a single "logical" config that can be
tailored to the specific system based on the available interfaces,
base MAC address etc.
2023-05-12 14:24:41 +02:00
Joachim Wiberg e7e22c4a13 package/finit: bump for fixes to 'initctl enable' regression
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-05 06:04:45 +02:00
Joachim Wiberg f19d1fc06f package/skeleton-init-finit: take "new" runlevel 0 into account
Some critical services must never be stopped, and with the unfortunate
separation of runlevel S and 0 in Finit recently, all affected service
definitions must be updated.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-02 00:00:04 +02:00
Joachim WibergandTobias Waldekranz 8158d3bffb Simplify and refine NETCONF and Classic build variants
- board/common: drop everything not needed by NETCONF mode
 - board/classic: most board/common helpers relocated here
 - Simplify Finit scripts for critical services
 - Source variant from /etc/os-release to select ramdisk /etc

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 65afece50a package/confd: update factory-config, zeroconf for IPv4/IPv6 on eth0
Still ways to go here, eth0 should be in a bridge with a vlan1 interface
on top, which in turn should have this config.  But let's start here, it
works! :-)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 0fffb1296f package/confd: allow avahi (mDNS/SD) and sshd to be enabled by default
The idea is to, as a plain Infix default, start up devices with DHCP and
IPv4LL/ZeroConf and IPv6 link-local address.  Using mDNS the user can
then and push a NETCONF configuration over SSH.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 7dde00c6b0 package/confd: rename factory.cfg -> factory-config.cfg
Consistent naming to match startup-config.cfg and running-config.cfg

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 85f67f6a0f configs: enable avahi-autoipd for use as ZeroConf agent
With the new templating support in Finit, and this patch, we can now
very easily enable a ZeroConf service on, e.g., eth0:

    $ initctl enable zeroconf@eth0

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz e789738a64 package/finit: bump for S vs 0 runlevel fixes and templating support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 3cd3d04bae package/skeleton-init-finit: fix make skeleton-init-finit-rebuild
When calling 'make skeleton-init-finit-rebuild' to (re)install any new
or modified services, we cannot remove everything installed already.
That breaks what other packages may have installed already and is not
the Buildroot way.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz dd96583ce2 package/net: depends also on iproute2
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz cd00a3d2be package/net: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 8a73c31f91 package/confd: update package dependencies
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 4e4b6f2a7b package/{ifupdown2,python-templating}: drop unused packages, replaced by ifupdown-ng
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 12:22:29 +02:00
Joachim WibergandTobias Waldekranz 4d835ff808 package/{sysrepo*,umgmt}: drop unused packages, replaced by confd
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 12:22:29 +02:00
Joachim WibergandTobias Waldekranz 73892ea6f0 package/cli*: drop cligen and clixon after migration to sysrepo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 12:22:29 +02:00
Joachim WibergandTobias Waldekranz 41b17fc64d package/mech: drop, unused after migration to sysrepo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 12:22:29 +02:00
Richard AlpeandJoachim Wiberg 02ac6a7ea7 src/confd: add the ability to change MotD in cli
Add the ability to set and delete system MotD (Message Of The Day)
using the cli.

This patch augments the standard ietf-system yang schema with
a new infix-system schema which contains a new motd leaf.

The default value is hard coded in two places, confd and the rootfs
file /etc/motd. The intention is to fix this in upcoming patches.

Introduces:
exec> configure> set system motd STRING
exec> configure> delete system motd
2023-04-12 16:51:08 +02:00
Joachim Wiberg 015f1b7a87 package/finit: add support for setting RTC plugin fallback datetime
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-10 16:36:32 +02:00
Joachim Wiberg 36ff60f99c package/confd: support for customer factory startup-config.cfg
When researching the systemd tmpfiles.d implementation I discovered the
effort to standarize on /usr/share/factory as a generic factory defaults
for Linux systems.  This patch adds a small example factory.cfg file
that is installed as /usr/share/factory/cfg/startup-config.cfg.  The
tmpfiles.d backend will then install it as /cfg/startup-config.cfg if
that file is missing at boot.  Confd does the rest to bootstrap our
(by default) empty sysrepo db with this startup-config.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-03 06:00:54 +02:00
Joachim Wiberg 79eb5fd5f4 confd: startup-config hook with support for merging in at bootstrap
This change adds a hook to the startup datastore, we use the ietf-system
module because the module argument is mandatory.  The hook runs when all
changes have been saved to the internal store.  Since sysrepo has many
startup files in /etc/sysrepo, we saving a JSON copy of all these files
in /cfg/startup-config.cfg, which is persistent.  On system bootstrap
this file is merged into the (empty) running datastore, which is what
the sysrepo maintainers recommend to be independent of any yang model
updates that might occur on image upgrades.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-02 16:24:08 +02:00
Tobias Waldekranz e729c82c32 klinfix: Initial add
Infix integration of klish and klish-plugin-sysrepo.

Initially we add:

More flexible management of running vs. startup: Instead of always
committing changes both to running and startup, commit only modifies
running. To persist changes to startup, the copy command is
introduced. This lets the user copy from factory/startup/running to
startup/running at any time.

Well-known verbs like abort, leave, end, etc.
2023-03-31 17:31:34 +02:00
Joachim Wiberg abd001f57d package/confd: start netopeer2-server along with sysrepo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-31 11:03:44 +02:00
Tobias Waldekranz d66dc16600 package/klish-plugin-sysrepo: Bump to latest master
This adds completion support for nodes nested under choice and case
nodes.
2023-03-29 11:32:09 +02:00
Joachim Wiberg d1444b900a package/confd: allow klishd to run in NETCONF mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:53:55 +02:00
Joachim Wiberg 737f99e35e package/klish: make sure to enable libxml2 in configure
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:53:41 +02:00
Tobias WaldekranzandJoachim Wiberg b549ddd88a package/klish-plugin-sysrepo: Add version 1.0.0
Adds a klish interface to local datastores managed by sysrepo.
2023-03-28 20:29:31 +02:00
Tobias WaldekranzandJoachim Wiberg 5d8e0ec123 package/klish: Add version 3.0.0
Extensible CLI application
2023-03-28 20:29:31 +02:00
Tobias WaldekranzandJoachim Wiberg fdfcac70eb package/faux: Add version 2.1.0
Used by the upcoming klish package
2023-03-28 20:29:31 +02:00
Joachim Wiberg b1be357a41 package/confd: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:27:18 +02:00