This patch adds latest symlinks to the curiOS containers to make system
upgrades easier. I.e., a user can now reference the bundled image with:
set image oci-archive:/lib/oci/curios-httpd-latest.tar.gz
So that when they upgrade to the latest Infix, which might include an
update of curiOS httpd, they will get a seamless upgrade also of the
container(s) running.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Reduce the amount of queues: 3 -> 1
- Simplify post hook
- Refine execd
The resulting simplification of infix_containers_post_hook(), and
touching execd, also ensure container environment variable changes
are propagated.
Fixes#822
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
To be able to handle container restarts, incl. restart policy, at
runtime, most of the container data lives in /var/lib/containers,
which on most systems is backed by a persistent store.
As of issue #823 we no longer keep a writable layer for containers,
nor should we cache container state across reboots, all containers
are recreated at boot. This task cleans up any lingering state.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Container support in Infix was released with v24.02, so this change may
unfortunately break a few use-cases out there. Regrettable as this is,
the default behavior, including how containers are started after boot,
break other use-cases that were considered more important.
As of this commit:
- all containers in Infix run in read-only mode, use volumes and
mounts for persistence across reboot/stop/start/upgrade
- all containers are now "recreated" at boot or related config changes,
this ensures an OCI image embedded in the Infix image, /lib/oci/, is
always used as the base for a running container
Fixes#823
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This update include more backports from Klish 3.1.0, including, but not
limited to:
- Syslog fixes
- Return code fixes
- Changed library and plugin paths (!)
- TTY raw mode fixes
- Use raw mode for interactive commands
- Allow single quotes (') as alternative to regular quotes for commands
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Some services launched at bootstrap must be possible to override per
product. One such service is iitod, which manages the LEDs in Infix.
This change makes allows a product specific init script to clear the
led condtion, preventing Finit from lauching iitod. Also, rename the
ixinit-done condition to match the nomenclature used already.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Backport support for saving and restoring system time from a file on
systems with broken RTC that reset to the future.
With this support a system can be sure time only ever moves forward.
Fix#794
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The string variable handling in configuring Finit did not follow the
Buildroot best practises. This patch adds stripping quotes from all
string variables before adding them as configure arguments.
This fixes issue with, e.g., this sneaky bastard:
configure --with-rtc-date=""2024-10-12 12:34:56""
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This patch fixes a upstream issue troglobit/finit#415, greatly reducing
the amount of service restarts, needlessly affecting, e.g., iitod when
services like syslogd¹ is reloaded.
____
¹) Traditional UNIX services that properly support SIGHUP.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Declare that confd-test-mode depends on confd, otherwise with 'select',
a call to `make update-defconfig` will remove BR2_PACKAGE_CONFD=y, which
we feel is very confusing -- in particular when comparing any defconfig
that does not have test-mode package.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Allow bundling dedicated nftables container in Infix images. With this
container, the /etc/nftables.conf can be kept as part of the device's
startup-config (base-64 coded binary format). Highly useful in advanced
setups, either with dedicated interfaces in the container, or when run
in host network mode.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
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>
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>
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.
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.
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>
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>
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>
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>
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>
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>
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
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>
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>
~/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>