This commit adds optional support for encrypting the tarball before it
leaves the target system. Documentation and usage text updated.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This fixes the following log message on systems w/o firewall enabled
dumping operational data:
Dec 2 09:24:57 test-00-02-00 yanger[5352]: Failed to connect to firewalld D-Bus: org.freedesktop.DBus.Error.ServiceUnknown: The name org.fedoraproject.FirewallD1 was not provided by any .service files
[skip ci]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Validate keys in gen_hostkey() before passing empty keys to shell scripts,
preventing:
Nov 04 2024 10:54:25 confd[2697]: SSH key (genkey) does not exist, generating...
Nov 04 2024 10:54:25 confd[2697]: writing RSA key
Nov 04 2024 10:54:26 confd[2697]: do_convert_from_pkcs8: /tmp/tmp.FH1Hr1 is not a recognised public key format
Also, fix base64 content formatting with proper 64-character line wrapping
using printf+fold instead of echo.
Use PKCS#1 RSA format for public keys as required by netopeer2-server, while
keeping PKCS#8 format for private keys. Use proper ssh-keygen format flag
(PKCS8) for correct conversion.
Fixes#1289
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Due to their nature we cannot read out the RPM of the pwm fans on the
BPi-R3. But we can at least show it's alive, or steering out a signal
to the fan.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The EXPIRES column was misaligned due to multiple issues:
- Column header used width 10 while data rows used width 9
- Expiry values had leading space intended for the narrower width
- CLIENT ID column width (19) was too narrow for typical client IDs
like "01:00:a0:85:00:01:05" (20 chars), causing overflow
Fixed by using consistent width for EXPIRES, removing the leading
space from expiry values, and widening CLIENT ID column to 22.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The isoformat() method already includes the timezone offset when the
datetime object has timezone info. Appending "+00:00" created an
invalid double-timezone suffix like "2025-11-30T13:13:49+00:00+00:00"
which failed YANG validation.
Error was:
admin@bpi-26-60-00:/> show dhcp-server
Error running sysrepocfg: Command '['sysrepocfg', '-f', 'json', '-X',
'-d', 'operational', '-x', '/infix-dhcp-server:dhcp-server']' returned
non-zero exit status 1.
No interface data retrieved.
With syslog showing:
statd[4291]: libyang[0]: Invalid union value
"2025-11-30T13:13:49+00:00+00:00" - no matching subtype found
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- firewall: allow traffic to be forwarded from lan to wan zone
- dhcpv6: enable client on wan interface
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Now that we've got everything working, it's just annoying, so disable it
but leave it in with a comment.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Simplify fallback MAC detection to return lowest valid MAC address.
This is the easiest to document and explain to end users.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When PR #1271 was merged (commit c34c8db4), it:
1. Created a new coverity-build target in src/Makefile
2. Updated .github/workflows/coverity.yml to call make coverity-build
3. Forgot to add coverity-build as an explicit target in the top-level Makefile
This commit also simplifies src/Makfile a lot for readability.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
SIMPLIFY, Simplify, simplify ... as my uni English professor always said.
> “Perfection is achieved not when there is nothing more to add, but when
> there is nothing left to take away.” -- Antoine de Saint-Exupéry
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This (new) test sometimes fail on HW, so let's hold off a while before
sending our log messages. Ths should allow the DUTs to settle.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Let's drop the leading IETF or Infix prefixes from tests. Initially the
idea was to mimnic the YANG models, but it's difficult to navigate and
does not provide any real benefit to developers or end-users.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Let's give Coverity Scan its own make target so we can reuse 'make check'
for our own scan-build or cppcheck needs.
[skip ci]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This is the last commit in the series that extend syslog matching and sorting
to the level of sysklogd 2.7.0 and later. Like hostname filtering, property
based filtering is not supported natively in the IETF RFC, and the modeling is
unfortunately a bit clunky. The most confusing part is probably 'negate'
which is the '!' operator that inverts the matching, e.g., !icase_regex match
everthing *not* in the regexp.
Fixes#1091
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Unlock more of the optional features in ietf-syslog.yang: select-match and
select-adv-compare, for regexp and advanced severity comparison operators.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Set LANG=C.UTF-8 in finit.conf for system-wide coverage, in profile.d
for login shells, and in bash.bashrc for interactive shells to ensure
comprehensive Unicode support across all user interactions.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Set PYTHONPYCACHEDIR=/tmp/__pycache__ in test/env to avoid permission issues
during git cleanup operations. When tests run in Docker containers as root,
__pycache__ directories and .pyc files end up owned by root, preventing the
CI user from cleaning them up.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This change exposes the macvlan mode to tests, unlocking support for running
certain types of tests on systems with only a single Ethernet port.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Devices should tell the server what they are in case an administrator
wants to group or hand out dedicated leases and information to some
devices on the lan.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This allows us to gather better product information in /run/system.json
also for x86 based systems. For Qemu x86_64 systems the 'product-name'
changes from 'VM' to 'Standard PC (i440FX + PIIX, 1996)'.
Also, add new 'product-version' field for, e.g., board revisions, and add
missing 'serial-number' value for systems like Rasperry Pi that inject it
in the device tree.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Validate that DHCP options were requested in the parameter request
list before applying them. This prevents malicious or misconfigured
DHCP servers from forcing unwanted configuration changes.
Validates: hostname (12), DNS (6), domain (15), search (119),
router (3), static routes (121), and NTP (42).
Fail-safe behavior: rejects options if config file unavailable.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The vendor-class option was previously hard-coded to "Infix vXX.YY.Z",
but since this option usually describes the type of the device asking
for a lease, the default has been changed to use the product-name.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Resolve race condition between DHCP and configured hostname by introducing
priority-based hostname management using /etc/hostname.d/ directory pattern.
Priority order (highest wins):
90-dhcp-<iface> - DHCP assigned hostname
50-configured - YANG /system/hostname config
10-default - Bootstrap/factory default
The new /usr/libexec/infix/hostname helper reads all sources and applies the
highest priority hostname. It exits early if hostname unchanged, preventing
unnecessary service restarts.
Fixes#1112
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
After some discussion we agreed that this operation is the domain of
confd (or dagger) and any DHCP client should not mess with the admin
state of the interface it runs on.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Basic DHCPv6 client, request a lease and verify Linux installs a
default route from the Router Advertisements (option not included
in DHCPv6), hence the 'enable-ra' option to dnsmasq. Also verify
DNS resolution over IPv6, including the resolvconf dance
- Prefix delegation, verifies that the client can actually request
and receives a prefix from a DHCPv6 server. We don't do anything
with it today though
Two new DHCP server implementations, the basic test relies on dnsmasq
and the prefix delegation test requires an ISC based dhcp server with
server side support for ipv6 prefix delegation. We could reuse the
latter for both tests, but this way we get compatibility testing.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Also, update docker/README, because after last confusing update I
couldn't follow my own instructions.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Basic DHCPv6 support as a per-interface ipv6 setting, not in line with
the IETF YANG model, which has this as a root container.
Note, this also fixes DHCPv4 option inference after the relocation of
/dhcp-client to /interfaces, in 764bd8e.
Fixes#1110
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Send 10 pings, expect at least one. The GRE test passes with two
received ICMP messages on the Styx test rig, while the VXLAN test
fails with -c 3, so try waiting a bit longer.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Used in Marvell Armada SOCs like the 37xx, 7k, 8k, and CN913x series.
Fixes the following kernel warnings:
[ 16.074759] crypto-safexcel f2800000.crypto: Firmware load failed.
[ 16.087330] crypto-safexcel f2800000.crypto: HW init failed (-2)
[ 16.102696] crypto-safexcel f2800000.crypto: probe with driver crypto-safexcel failed with error -2
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The put_config() retry loop was catching and printing RpcError
exceptions but never re-raising them after exhausting retries.
This caused tests to silently continue despite configuration
failures, masking validation errors.
Now properly propagates errors after all retries are exhausted,
matching the error handling behavior of the RESTCONF backend.
Fixes#1250
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
We use the infinitive, or basic form, in configure context, as do most
other network vendors, so let's do the same in admin exec context.
Also, drop the 'name' qualifier, it is not needed in configure context
so we shouldn't have to use it in admin exec either.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
In an effort to consolidate and use familiar command paths for our most
common commands, let's follow suite with Cisco, vtysh, et al.
Add deprecation warning to legacy 'show route [ip|ipv6]' command.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Since we just un-deviated this node to be able to create operational
data for ospf interfaces, we should also allow users to set it.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Collect more data from FRR to the OSPF and BFD operational datastore.
Refactor CLI commands to use the YANG datastore instead of vtysh.
Additionally, the BFD command(s) have been moved to the top level of
admin-exec, which is where vtysh has them.
Finally, preparing for future OSPFv3 support, all commands have been
given a new context under 'show ip ospf'. Deprecation warnings have
been added to the existing 'show ospf' commands.
Also, for consistency, all commands names in plural have been changed to
their singular form: routes -> route, interfaes -> interface, etc. This
is what vtysh, Cisco, and others do as well.
Fixes#1190
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Silently drop any area-type setting for ospf backbone in a migrate
script to prevent any field issues after upgrading to this fix.
Fixes#1247
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Release tarballs waste ~131MB per architecture by including both
rootfs.itb and rootfs.squashfs, even though rootfs.itb already
contains the squashfs (itb = 4096-byte header + squashfs).
This change removes rootfs.squashfs from releases and provides two
solutions for users who need it:
1. utils/extract-squashfs.sh - Full-featured utility for extracting
squashfs from release tarballs or .itb files. Includes validation
and helpful error messages.
2. board/common/qemu/qemu.sh - Auto-extraction support. When running
in initrd mode, automatically extracts rootfs.squashfs from
rootfs.itb if missing. Zero user impact - ./qemu.sh just works!
Space savings: ~262MB per release (2 architectures × 131MB)
Fixes#858
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Prevent patch releases from stealing the "latest" tag from newer minor
versions. Only vXX.YY and vXX.YY.0 releases should be marked as latest.
Fixes#1187
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Collect only the most relevant info for SBOM. The CycloneDX format seems
to be what most tools are standardizing around, and they suggest saving
manifest.csv and cpe.json files. This commit includes all *.csv files
and drops sources and licenses for release builds, as decided in #1192Fixes#1217resolves#1192
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
In bf2e739 a downgrade of Buildroot to 2025.02.6 was mistakenly merged,
this commit restores the submodule to the git revision prior to that,
Buildroot 2025.02.7-kkit, with KernelKit backports and upgrades.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Adds support for configuring TTL, ToS/DSCP, and Path MTU Discovery
on GRE and VXLAN tunnels. TTL defaults to 64 instead of inherit to
prevent issues with routing protocols like OSPF that use TTL=1.
Refactors tunnel YANG models by merging local-remote into a unified
tunnel-common grouping for cleaner organization.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Many of the example prompts used in the documentation are very long and
do not fit in generated documentation (web/pdf). This is a proposal to
shorten them, sometimes significantly, by keeping only the start and end
of an xpath, replacing everything in between with '/…/'.
This is a feature that also could be added to the klish-plugin-sysrepo
to improve usability.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The callback refactoring forgot to call ietf_interfaces_cand_init(),
breaking inference of interface types and DHCP client options.
Also fixes UPDATE event handling for ietf-keystore and infix-meta.
Fixes#1244
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Neither the IPv6 autonconf container, nor the recently moved DHCP client
container have an 'enabled' flag.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Please note, this change drops not only the global enabled flag, but also the
per-interface enabled flag, converting it to a presence container. The name
of the container is also shortened from dhcp-client -> dhcp. A pattern that
expected to be reused also for the DHCPv6 client.
Fixes#1109
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
If ping succeed but fail to check if netconf port is open,
the testsystem will hang forever.
This will allow totally broken images to be loaded at the device.
This fixes the annoying libyang warning after commit da29771.
confd[3375]: libyang[0]: Invalid argument ctx_node (lyd_find_xpath()).
This happens when the diff is used in the wrong event when it is NULL.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Check if partition/LABEL is available before trying to run tune2fs and
mount commands on it. This change masks the kernel output:
LABEL=var: Can't lookup blockdev
commne when running `make run` on x86_64 builds.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
In 45efa94 we introduced new mount options for the: 'aux', 'cfg', and
'var' partitions. To save boot time, we also disabled the periodic fsck
check, which does not affect journal replay or other Ext4 safety or
integrity checks. The latter involved calling tune2fs at runtime, but
this caused the following to appear for the 'aux' partition, which is a
reduced ext4 for systems that need to change U-Boot settings, e.g., to
set MAC address on systems without a VPD.
EXT4-fs: Mount option(s) incompatible with ext2
Note, this is a "bogus" warning, setting the fstypt to ext2 in fstab is
not the way around this one. That's been tried.
To make matters worse, the new mount option(s), e.g., 'commit=30', gave
us another set of warnings from the kernel. This was due to the fstype
being 'auto', so the kernel objected to options not being applicable to
every filesystem it tried before ending up with extfs:
squashfs: Unknown parameter 'commit'
vfat: Unknown parameter 'commit'
exfat: Unknown parameter 'commit'
fuseblk: Unknown parameter 'commit'
btrfs: Unknown parameter 'errors'
This commit explicitly sets cfg and var to ext4, leaving mnt as auto, we
also check before calling tune2fs that the partition/disk image is ext4.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Split download and MD5 computation into separate functions for clarity.
Add proper error handling for HTTP 404 and network errors. Improve help
text to mention appliances/ directory location.
[skip ci]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Allow a workflow caller to run pre-build scripts though a workflow
call variable. This is potentially dangerous as code can be injected
here. If for example a malicious actor wants to run there C2 code in
the context of someone else they could perhaps inject it here. I
assume this is protected by the same mecahism as the workflow files
themself. I.e. github users untrusted to the Infix org won't be able
to trigger workflows before being explicitly allowed to do so.
This patch also adds a checkout secret. This allows upstream callers
to fetch there own spin / fork though the infix workflows, if they
provide a checkout token with the correct permissions to do so.
Signed-off-by: Richard Alpe <richard@bit42.se>
Reduce /var image size to 128M (resized at first boot anyway) and tune
mke2fs options for faster mounting. Set ext4 'uninit_bg' feature and
use '-m 0 -i 4096' extraargs in genimage to optimize filesystem creation
and reduce overhead. The genimage tool has several tweaks enabled by
default already, the 'uninit_bg' feature speeds up the time to check
the file system.
Disable periodic fsck with tune2fs at boot while keeping safety checks
intact. Adjust mount options in fstab to reduce journal syncs and
improve boot time.
Fix severe performance regression in find_partition_by_label() that was
calling sgdisk on every block device including virtual devices (ram, loop,
dm-mapper). This caused boot delays of up to 24 seconds on systems with
many block devices. Now skip virtual devices that don't have GPT tables,
reducing the delay to ~2 seconds.
Also clean up is_mmc() function to use cached result.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit adds support to simplify sdcard.img generation by downloading the
latest bootloader build for a board from the 'latest-boot' release tag. The
tarball is saved in dl/bootloader/ and is extracted to a temporary directory
in output/build/boot-$board-xxxx on every invocation of mkimage.sh. This is
used for invoking genimage and bmaptool before copying the resulting images
to output/images/. (If $O is set, it is used instead of output/, above).
New options:
-d Download latest bootloader build for the given board
-f Force re-download even if bootlaoder tarball existgs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Update board paths to match the restructuring in commit ab56c1be.
Fixes rpi4, cn9130_crb, and aarch64_qemu bootloader builds.
[skip ci]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Wrap wpa_cli operations in try-except blocks to ensure WiFi errors don't
cause sysrepocfg to fail. Interface queries now return data for working
interfaces even when WiFi has issues.
Fixes:
admin@rpi-79-41-1d:/> show interfaces
Error running sysrepocfg: Command '['sysrepocfg', '-f', 'json', '-X', '-d', 'operational', '-x', '/ietf-interfaces:interfaces']' returned non-zero exit status 1.
No interface data retrieved.
admin@rpi-79-41-1d:/>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit consolidates mkimage.sh scripts into a unified SD card image
creation tool that works for all boards. It needs a bootloader an $ARCH
rootfs.squashfs image and a genimage.cfg.in template.
- Detects build directories from `O=` environment variable or `output/`
- Sources `.config` to discover Buildroot paths
- Uses Buildroot's `support/scripts/genimage.sh` when available
- Automatically generates `.bmap` files if `bmaptool` is available
- Fallback to direct `genimage` invocation if wrapper not found
See the online instructions for usage.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Add new interface quirk to allow skipping disabling of flow control on
all RPi 3B/4B devices that have the smsc95xx driver.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The xPi's usually don't have a VPD so the chassis mac-address probed at
boot is usually null in /run/system.json. This commit adds a fallbkack
mechanism to populate this field so it can be used for unique hostnames
even on these boards.
Ths ietf-hardware.yang model does not have a notion of physical address,
so we augment one tht is generic enought to be used for other hardware
components than Ethernet, similar to what ietf-interfaces.yang use.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Enable bridging of LAN ports in br0, default IP: 192.168.0.1/24
- Enable firewall with two zones: 'wan' and 'lan', policy: lan-to-wan
- Enable DHCP server on br0
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit drops the board specific defconfig in favor of proper BSP
support for the FriendlyARM NanoPi R2S to Infix as part of the default
Aarch64 build.
The name FriendlyARM was elected over FriendlyELEC ("new" name) to be
consistent with both kernel and Buildroot naming standards.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit consolidates all BSP support files into the Buildroot standard
board/ directory. The concept of selectable boards in menuconfig remains
as-is but now lives in board/ instead.
Drop support for board-specific post-build.sh scripts, not needed atm. and
we should really use Buildroot _POST_INSTALL_HOOKS in the board .mk files
instead.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
With the additional support for RPi3, including Zero 2W, this commit renames
all relevant directories and Config.In options to match.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
For more advanced hardware with multiple sensor types per device
(e.g., SFP modules with temperature, voltage, current, and power
sensors), use the YANG parent/child relationship to group related
sensors together for better presentation.
Changes:
- Remove parent/parent-rel-pos deviations from infix-hardware.yang
- Create parent components (class: module) for multi-sensor devices
- Add parent references to child sensor components
- Add human-readable descriptions from hwmon labels
- Extend hwmon discovery to support voltage, current, and power
- Normalize sensor names: strip vendor prefixes (mt7915_phy0 -> phy0)
- Remove redundant TYPE column, clarify units (V -> VDC, add spaces)
- Simplify child sensor display by stripping parent prefix
- Fix "show system" to only show CPU temperature and fan speed
Example output from "show hardware":
NAME VALUE STATUS
===================================================
sfp1:
Rx Power 0.000 W ok
Tx Power 0.001 W ok
Vcc 3.35 VDC ok
Bias 0.006 A ok
Temperature 30.3 °C ok
sfp2:
Rx Power 0.000 W ok
Tx Power 0.001 W ok
Vcc 3.34 VDC ok
Bias 0.006 A ok
Temperature 32.0 °C ok
cpu 42.8 °C ok
phy0 47.0 °C ok
phy1 53.0 °C ok
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit adds resource usage: memory, loadavg, and filesystem usage
by augmenting ietf-system:/system-state.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Remove class deviation to allow iana-hardware:sensor
- Populate sensor operational data from /sys/class/thermal
- Extend 'show hardware'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Usually, when upgrading a system, you want to reboot it so the upgrade
takes effect. This commit adds a 'reboot' option/flag, alongside the
'force' option, to facilitate this.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The DWC2 controller is a very common IP block in ARM and RiscV SoCs. With the
USB subsystem back to a built-in we can now enable host mode for the DWC2 (USB
2.0) ports on RPi. It also opens up for merging the NanoPi R2S into the
generic aarch64 build.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
On some boards, and in particular with a hybrid mbr/gpt partition table,
like on the RPi64, we must resize ext *after* reboot.
Also, do some cleanup and consolidation of error handling to prevent us
from entering an endless boot loop.
Follow-up to 391e9715
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit refactors USB port probing to:
- Eliminate duplicates: previously, 'authorized' and 'authorized_default'
were listed as separate USB port entries (confusing). Now each USB
port is represented once, with the path pointing to the USB device
directory, confd appends the appropriate attribute file as needed
- Add support for Raspberry Pi 4B and CM4 USB port(s) using a generic
discovery function that scans /sys/bus/usb/devices for USB root hubs.
This should work seamlessly across all platforms
- For backwards compatibility and better UX:
- Single USB port systems: Named "USB" (no number)
- Multi-port systems: Named "USB1", "USB2", etc.
- Device tree-based discovery is tried first (for boards like Alder with
explicit DT USB port definitions), with fallback to generic discovery
for boards without DT
Fixes: #315
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit adds support for the Raspberry Pi CM4 based mini DFRobot IoT
Router board, SKU:DFR0767. It comes with an additional RTL8111 PCIe NIC
hence the addidtional kernel module and firmware. The latter fixes:
r8169 0000:01:00.0: Direct firmware load for rtl_nic/rtl8168h-2.fw failed with error -2
r8169 0000:01:00.0: Unable to load firmware rtl_nic/rtl8168h-2.fw (-2)
Please note, the change in BCMGENET from module to built-in is to ensure
it is probed before any PCIe NIC, both this board and the CM4-based NVME
NAS base board enumerate the built-in MAC as eth0.
Also, unlike the RPi 3B/4B, it is not a given fact that a CM4 based board
comes with WiFi onboard, and since most compute module setups are DYI, we
take the easy way out and leave it as an exercise to the user to add WiFi
interface to the config.
https://wiki.dfrobot.com/Compute_Module_4_IoT_Router_Board_Mini_SKU_DFR0767
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The BCM2837 core is used not just in the RPi 3B but also in the Zero 2W,
both device trees have been added to the board config.
The BCM2711 support has been extended to include RPi 400 and CM4 I/O.
To support the BCM2837 family more firmware options habe been enabled,
since the RPi3 does not have bootcode.bin flashed in the SoC. The SD
card image now uses a hybrid GPT/MBR format so the RPi3 bootcode.bin
can read all files from the first VFAT partition.
The default device tree for Linux is now chosen by the U-Boot probe and
the only exception is the "laundry room" detector that looks for a RPi4
with a 7" touch screen, which then selects the DSI enabled RPi4 variant.
This is enough to properly load an RPi 3B and a CM4 based router board.
The BCM2837 does not have PCI/PCIe or a built-in MAC so it relies on the
USB to Ethernet LAN78xx which does not support disabling pause frames.
I have opted for checking for EOPNOTSUPP instead of adding yet another
quirk, because it is likely to be a common limitation of more drivers
and chipsets, and this code is best-effort anyway.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Use kernel cmdline option 'usbcore.authorized_default=2' to lock all
external/user-visible USB ports by default.
The kernel distinguishes internal vs external USB ports using ACPI
methods (_UPC and _PLD) on x86/x86_64 systems. On ACPI systems, ports
marked as non-visible but connectable are considered internal (e.g.,
hard-wired USB-to-Ethernet adapters) and are automatically authorized,
while user-visible external ports require manual authorization.
However, on device tree systems the kernel lacks a standard mechanism
for identifying internal ports. The 'authorized_default=2' setting falls
back to requiring authorization for all devices on these platforms,
We list user-accessible USB ports in the device tree ('usb-ports' and
'usb-port-names'), with unlisted ports being implicitly internal and
managed separately.
Fixes#1065
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Sysrepo lack the functionallity for if change in model A also
should demand actions of model B. Previous we have handled this by
having callbacks for keystore changes in for example infix-services
to be able to reconfigure SSH on asymmetric key changes.
This commit instead add a pass where dependencies are found and added
to the diff.
Sysrepo only care about model changes, but we want the system
configuration. Therefore add a common callback for all modules
and handle dependencies between the modules, if someone should be
run before another for example.
This will make sure to apply NACM rules for all the data. It also
makes it possible for a luser access a subset of the data, even if
they to do not have read access to /cfg/startup-config.cfg.
This will fix#1106, in time, but only allows manual trigger for now,
needs more test and verification
utils/kernel-upgrade.sh at least automate all the manual manual processes
for upgrading the kernel.
Bridge ports should not have IP addresses configured. The IP address
should be configured on the bridge interface itself, not its member ports.
Add YANG must expression to enforce this rule at configuration time.
Fixes#1122
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
A valid DHCP server setup for a subnet is one of pool and/or at least one
static host entry/lease. If pool is enabled the pool must have a start
and an end address.
To allow setting up a DHCP server with no pool and at least one static host
entry/lease, we make the pool a presence container, otherwise the pool will
always be set and trigger the below inference.
When an interactive CLI/Web user enables the address pool we infer a default
range .100-.250, but only for /24, C-class networks. This is what most users
know and expect.
The YANG model now validates that:
- If an address pool is created, both start-address and end-address must be set
- Each subnet must have either a pool or at least one static host entry
- The pool container is now a presence container, so "no pool" fully deletes it
Fixes#1121
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Addresses disk space issues in GitHub Actions for generic x86_64 builds
by removing unused tools (Android SDK, .NET, Docker images, etc.) before
the build starts. This frees up ~30GB of space.
Fixes#1210
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Multiple services can have PID 0 when stopped/done, making PID
unsuitable as a unique key. There could also be multiple services with
the same name (I would assume?).
Signed-off-by: Richard Alpe <richard@bit42.se>
This patch adds operational data support for system services. The
data is in a generic format but is intended to be able to represent
finit information (initctl) nicely.
The reason for augmenting this to ietf-system and not to
infix-services is that we consider this generic system information
which is totally disconnected from what ever services infix might
provide.
In this first state we only support pid, name, description and state.
Making the data look something like:
"infix-system:services": {
"service": [
{
"pid": 1185,
"name": "udevd",
"status": "running",
"description": "Device event daemon (udev)"
}]
Signed-off-by: Richard Alpe <richard@bit42.se>
Address two issues identified by Coverity Scan:
1. CID 550484 (TOCTOU): Remove access() check before realpath()
- realpath() already fails if file doesn't exist, making the
access() check redundant and introducing a TOCTOU race
- Simplifies code while improving security
2. CID 550483 (CHECKED_RETURN): Mark unchecked remove() calls
- Add (void) cast to two remove() calls to explicitly indicate
we don't care about the return value
- These are cleanup operations for temp files where failure
is acceptable, even expected
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Much of the content was made obsolete by recent changes, we now optimize
the experience for users, avoiding recreate at boot unless checksums for
configuration or base image have changed.
This was also a good time to explain the difference between mutable and
immutable tags, which sometimes is a cause for great confusion.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Since there is no safe way (unique hash/id) to identify unused named
volumes, we cannot automate removal of them. Since volume data, when
compared to a container image, is quite small, it was decided that we
document this instead.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Add bash completion for the common datastores, like we already do in the
CLI, and update the usage text accordingly.
Also, make sure to install to /usr/bin, not /bin since we've now merged
the hierarchies since a while back.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The regular file-to-file copy, was missing calls to cfg_adjust(), this
commit fixes that and adds some helpful comments for each use-case.
Also, drop insecure mktemp() in favor of our own version which uses the
basename of the remote source file.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This is a follow-up to PR #717 where path traversal protection was
discussed. A year later and it's clear that having a user-friendly
copy tool in the shell is a good thing, but that we proably want to
restrict what it can do when called from the CLI.
A sanitize flag (-s) is added to control the behavior, when used in the
shell without -s, both commands act like traditional UNIX tools and do
assume . for relative paths, and allow ../, whereas when running from
the CLI only /media/ is allowed and otherwise files are assumed to be
in $HOME or /cfg
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit adds config file validation to the copy command, discussed
in #373. Allowing users to test their config files before restoring a
backup. The feature could also be used for the automatic rollback when
downgrading to an earlier version of the OS.
Fixes#373
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When copying to the running datastore we cannot use sr_copy_config(),
instead we must use sr_replace_config(). This fix covers both the case
of 'copy startup-config running-config' and 'copy FILE running-config'.
Fixes#1203
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Rename test directories in infix_containers/ to remove the redundant
'container_' prefix since they already live under infix_containers/:
container_basic -> basic
container_bridge -> bridge
container_enabled -> enabled
container_environment -> environment
container_firewall_basic -> firewall_basic
container_host_commands -> host_commands
container_phys -> phys
container_veth -> veth
container_volume -> volume
Also update references in all.yaml and Readme.adoc files.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit adds four (small) container images to the Infamy test container
which are used in the new container upgrade test. The test verifies that a
mutable container can be upgraded and that old images are properly cleaned
up from the container store.
Fixes#624
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Already supported in the CLI. This makes it official, and quite handy
for users that run mutable containers.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Shell script:
- Factor out big portions of code into more logical helper functions
- Simplify calling setup script by checking for remote image first
- Simplify meta/sha up-to-date handling and clarify terminology
- Consistent use of -f instead of -e in file-exists checks
- Fix unsafe use of 'mktemp -u'
C code:
- Clarify meta/sha terminology: rename meta-sha256 -> meta-image-sha256
- Refactor weird archive_offset() function to local_path() helper
- Factor out helper function calc_sha()
- Check len of sha256 >= 64
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
One unique feature of Infix OS is that you can embed your OCI archive in
the rootfs.squashfs. This way your container instance does not need to
download anything from the network. To upgrade you drop in a new image
and rebuild Infix, when the new Infix boots the container script 'setup'
command will recognize that the OCI archive has changed and will reload
it into the container store.
This patch is an improvement of the way too generic 'podman image prune'
command used previously. Instead of looking for any dangling image, we
now surgically remove the old image.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Container instances that run with mutable images, e.g., tagged with `:latest`
or similar non-versioned tags, can be upgraded without changing the config.
This commit fixes two issues found with this support:
- force container image re-fetch on upgrade, even if the file exists locally
- surgically remove old image from container store after upgrade
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Usually, when your system is up and running properly, you want to clean
up anything unused from your previous experiments. This change alllows
that by calling the interactive 'podman image prune -a -f' command from
the CLI command 'container remove all'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When loading big OCI images at boot the `podman load` process completely
monopolizes all cores of an Arm Cortex-A72. It blocks on I/O, sure, but
with 'nice' we can get some attention at least to more critical services
at boot.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit reverts 477f7ae and bb19d06, which intended to fix an issue
with lingering old images, see #1098. However, as detailed in #1147,
this caused severe side effects while working with multiple larger
containers. Basically, the prune operation of one container removed
images of other containers that are just being created in parallel.
Instead of using the podman prune command we can use the meta datain the
start script to pinpoint exactly which image(s) to remove, including any
downloaded OCI archives when the container instance is removed.
Fixes#1147
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit adds metadata to track loaded OCI archives to allow skipping
'delete + load' of OCI images when restarting either the container or the
system as a whole. The sha256 of all loaded OCI archives is stored in a
sidecar file in our downloads directory. Then we verify the checksum of
the OCI archives against their same-named sidecar to determine if the OCI
archive is already loaded or not.
Additionally, the instance using the image is labled with metadata to detect
changes in the container configuration. This in turn allow skipping the
delete + create phase also of the instance.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The default timeout for 'podman stop foo' is 10 seconds, which for
heavily loaded systems with intricate shutdown process is *waaaay*
too short. Increase it to the container script default 30s, which
coincidentally is also the container@.conf template's kill delay.
Fixes#1149
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Not only great for debugging, but also allows users to start their
containers manually in another way. But yeah, mostly for debug.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This rectifies an omission from the initial yang model. Not all
charachters are supported in container and volume names. E.g.,
simply attempting to create a volume or container with a space
in the name causes this error message from podman:
podman: Error: running volume create option: names must match [a-zA-Z0-9][a-zA-Z0-9_.-]*: invalid argument
In addition to the regexp, the new 'ident' type also enforces a
minimum and maximum length. Sure, technically a single char is
allowed, but let's be reasonable, and who in their right mind
wants an identifier > 64 chars? We have description for that.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Slight refactor of page, adding another badge for the latest release,
and restructuring the Technical Details section a bit.
[skip ci]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The curl.sh wrapper script had several issues:
- Used 'shift 2' incorrectly without proper argument validation
- Required hostname as enviroment variable instead of option
- Lacked proper option parsing, should behave like a cross between
curl and sysrepocfg
All examples have been updated to match the refactored script, and
a local copy in utils/curl.sh has been added.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Fixes a minor regression after merge of BPi-R3. The RPi4 device tree,
specifically regulator-sd-io-1v8 in bcm2711-rpi-4-b.dts, requires the
GPIO voltage regulator be built-in for the SD card controller.
Fixes#1197
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Coverity scan detected a memory leak in the new firewall change() cb
where allocated memory from ietf_interfaces_get_all_l3() was not freed
on error paths when srx_get_diff() failed or returned NULL.
This commit consolidates all cleanup paths to use the 'done:' label,
ensuring ifaces, diff, and cfg are properly freed in all exit scenarios.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Add supoprt for infix-firewall.yang, modeled on the zone-based firewalld
The terminology is a mix of firewalld, classic netfilter and inspired by
Ubiquity. E.g., zone 'policy' -> 'action', and the zone matrix overview.
- Port forwarding allows forwarding a range of ports
- Operational data comes from firewalld active rules
- Firewall logging goes to /var/log/firewall.log
- Show implicit/built-in rules and zones (HOST) in firewall matrix,
includes "locked" policy for the default-drop behavior
- The zone services field in admin-exec 'show firewall' shows ANY when
the zone default action is set to 'accept'
- Zone 'forwarding' and 'masquerade' settings live in Infix in the
policys instead, meaning users need to explicitly add a policy
to allow both intra-zone and inter-zone forwarding
- Support for emergency lockdown (kill switch)
- Pre-defined services (xml+enums) are filtered and included as a
separate YANG model, extensions added for netconf and restconf
- Includes initial support for firewalld rich rules
firewalld policy rules, including rich rules, have an obnoxious priority
field which is extremely hard to get right, so in Infix we use the far
superior YANG construct 'ordered-by user;'. This ensure all rules are
generated in that order by setting the priority field, on read-back from
firewalld (operational) the priority field is used to sort the output
of rules in the CLI.
Fixes#448
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Used by infix-firewall.c when figuring out interfaces that are not
explicitly assigned to any zone. Placing them in the default zone
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The 'brief' keyword has been gone for a while now. Also, update the
ouput to match the "new" cli-pretty formatting.
Fixes#1174
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
With all jobs now depending on check-trigger we can do the evaluations
there and set some variables that can be reused later.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Here we use a check-trigger job that all the others depend on, which
should prevent duplicate workflows starting a bit more elegantly than
killing one of them with the concurrency checker.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
In setups like this...
CPU
eth0
|
.----0----.
| dst0sw0 |
'-1-2-3-4-'
|
.----0----.
| dst1sw0 |
'-1-2-3-4-'
...both eth0 and dst0sw0p4 are DSA ports. But the latter is _also_ a
physical port as far as devlink is concerned. As a result, it would
first be marked as "internal" and is then instantly reclassified as a
"port".
Catch this condition and stick with the initial "internal"
classification.
In addition to matching on interface names, add support for matching
on ethtool information.
Example:
{
"@ethtool:driver=st_gmac": {
"broken-mqprio": true
}
}
This would mark any interface using the "st_gmac" driver as having a
broken mqprio implementation. Whereas this:
{
"@ethtool:driver=st_gmac;bus-info:30bf0000.ethernet": {
"broken-mqprio": true
}
}
Only matches an st_gmac-backed interface at the specified location.
As matching becomes more complicated, use the shell implementation
from confd as well, to make sure that they are always in agreement.
Fix a bug where systems with OSPF enabled on some, but not all,
interfaces would cause the OSPF iterator to fail when accessing
iface['area'], which was missing. This caused the ospf_status.py
tool to return {}, resulting in empty OSPF data in sysrepo.
Fixes#1169 Expected neighbors not shown in sysrepocfg
Signed-off-by: Richard Alpe <richard@bit42.se>
The xpath_to_uri() method only processed the first predicate in XPath
expressions with multiple [key='value'] patterns. Each re.sub() call
was performed on the original xpath instead of the result the previous
substitutions, causing subsequent predicates to be ignored.
Example XPath that would fail:
/infix-firewall:firewall/zone[name='untrusted']/interface[.='e2']
Would incorrectly convert to:
/infix-firewall:firewall/zone[name='untrusted']/interface=e2
Instead of the correct RESTCONF URL:
/infix-firewall:firewall/zone=untrusted/interface=e2
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Before this change:
ok 2 - Configure basic end-device firewall
not ok 3 - Verify unused interface assigned to default zone
# Exiting (2025-09-25 11:33:00)
# Traceback (most recent call last):
# File "/home/jocke/src/x-misc/test/./case/infix_firewall/basic/test.py", line 127, in <module>
# assert unused_if not in public_zone["interface"], \
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# AssertionError: Unused interface e4 should be in default zone 'public', got interfaces: ['e2', 'e3', 'e5', 'e7', 'e8']
After this change:
ok 2 - Configure basic end-device firewall
not ok 3 - Verify unused interface assigned to default zone
# Exiting (2025-09-25 11:35:00)
# File "/home/jocke/src/x-misc/test/./case/infix_firewall/basic/test.py", line 127, in <module>
# assert unused_if not in public_zone["interface"], \
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Unused interface e4 should be in default zone 'public', got interfaces: ['e2', 'e3', 'e5', 'e7', 'e8']
Slightly shorter and arguably easier to read for a non-pythonic human.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
A very common pattern in our tests is:
if (condition):
print(f"the condition failed with {output}")
test.fail()
This change allows us to write:
if (condition):
test.fail(f"the condition failed with {output}")
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The rauc event logger is a separate glib logger that by default logs to
the system console, with annoying ANSI escape sequences. This commit
drops the default stdout/stderr redirect of these log messages and adds
a more exhaustive bundle install and event log, in json format, instead.
For more information about event logging, see the rauc documentation:
https://rauc.readthedocs.io/en/latest/advanced.html
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Drop 'local', not available in POSIX shell scripts
- Check for an assortment of backup file combos
- Simplify nested if-statements, skip whitelist first
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The default 'trace' log level is quite verbose for our production systems.
This commit changes the default to 'info' and adds a command line option
to control the log level if needed.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
To be able to maintain our own set of patches on top rousette, a kkit
branch have been set up with a reduced set of backported fixes.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- cli: add '-r' to log/pager/follow for "raw" control chars, including unicode
- sysklogd: backport unicode fix for em-dash character (—) in slogan
- sysklogd: drop old patches
- sysklogd: run in 8-bit safe mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This is currently a standalone workflow that needs manual trigger via
workflow_dispatch, but the end goal here is to chain it to the release
job.
Signed-off-by: Richard Alpe <richard@bit42.se>
Add concurrency control to trigger workflow to cancel in-progress builds
when new events (like adding ci:main label) occur on the same PR. This
prevents resource waste from duplicate builds and handles the common
workflow where developers add the ci:main label after PR creation.
Fixes#1154
Adjust DHCP client retry behavior:
-t 3 (was -t 10) : Maximum discovery attempts per cycle
-T 5 (was -T 3) : Seconds to wait between attempts
-A 30 (was -A 10) : Seconds to wait after all attempts fail
Before: 10 attempts × 3 seconds = 30 seconds of rapid trying, then 10
second pause = 40 second total cycle
After: 3 attempts × 5 seconds = 15 seconds of trying, then 30 second
pause = 45 second total cycle
=> 70% fewer log messages during active attempts, with longer quiet
periods between cycles.
Fixes#1100
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Add HISTCONTROL=ignoreboth to ignore duplicate commands and those
starting with space, enable histappend, and improve tab completion
behavior. Also add /etc/inputrc for better readline key bindings.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
To reduce the duplication of effort between 9pm and the Infamy framework
this change consolidates the move from local 'infamy: title:' extension
to 9pm 'name:'.
For the parameterized tunnel tests we leverage the 9pm dynamic test-spec
variable, which looks for a correspodning <case>.adoc instead of static
Readme.adoc, when generating the test report.
Each test documentation should cover all aspects of the test, much like
the usage text of a UNIX program. To this end, the tunnel test docs are
now more spelled out, including all invariants.
Some refactoring of these tests were also necessary, e.g., replacing any
reserved Python keywords like 'type', and other PEP-8 fixes.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Import new 9pm version for improved test report generation. With this
in place we can take the opportunity to also refactor and simplify the
test spec. generation.
Fixes#1129
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit greatly simplifies AsciiDoc image references in generated
Readme.adoc files. The two focused use-cases that remain after this
change are working references in:
- Generated output/images/test-report.pdf
- Viewing test's Readme.adoc from GitHub
Previously we aimed to have working images also when the test's Readme
was included in the parent directory's Readme.adoc. This, however, is
not supported as of this commit. It seems unlikely also to ever be a
supported feature of AsciiDoc on GitHub, for details, see the following
issue: <https://github.com/github/markup/issues/1095>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
It should be possible to create test reports manually, so logically
the GitHub workflow should call a make rule in test.mk
Untested: branding, or any case where Infix is used as a BR2_EXTERNAL
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The Banana Pi R3 is a high-performance networking board featuring:
- MediaTek MT7986 ARM Cortex-A53 quad-core processor
- 4x Gigabit LAN ports (lan1-lan4)
- 1x Gigabit WAN port
- 2x SFP ports (sfp1, sfp2) for fiber connectivity
- Dual WiFi interfaces (wifi0 for 2.4GHz, wifi1 for 5GHz)
- USB support
- SD card boot support
The motd-banner was behind on the new slogan:
.-------.
| . . | Infix OS — Immutable.Friendly.Secure
|-. v .-| https://kernelkit.org
'-'---'-'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit completes the collection. We now have small, medium, and
large sizes. Useful for easy conversion to other formats, e.g., bmp.
[skip ci]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
You need first to clone gns3-registry from https://github.com/GNS3/gns3-registry
Follow this steps:
1. ./utils/bump-gns3.py 25.08.0 ../../gns3/gns3-registry/appliances/infix.gns3a
2. TEST in gns3, just add the new version, start it.
3. run python3 check.py inside gns3-registry, verify infix is ok.
4. Create a pull request to gns3-registry
This fix#1107
This branch can be used to test push events which is especially
useful when working on the CI infrastructure.
Signed-off-by: Richard Alpe <richard@bit42.se>
For a heavily loaded system, 10 seconds/retries is not enough time to
expect containers to have started up. Particularly after the changes
done recently to do prune before and after a container is started.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Usually the CNI bridge plugin "takes care" of enabling IPv4 forwarding
on all interfaces, see issue #1125, but when the container tests are run
in a different order from the infix_containers.yaml, Infix may reset the
IPv4 forwarding on this critical interface.
This change is both future proof and also ensures the test works as it
was intended even if tests are run out-of-order.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- the port-mapping plugin supports iptables or nftables
- the firewall plugin support only iptables or firewalld
Enforce use of iptables wrapper for nftables, for now, in both plugins.
This all needs to be refactored to run podman with "unmanaged" networks
in the future.
Related to issue #1125
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When a container's image is on an inaccessible remote server, the
container wrapper script waits in the background for any netowrk
changes to retry download of the image.
This change avoids the dangerous previous construct, and is also
easier to read: timeuot after 60 seconds unless ip monitor reads
at least one event before that.
Fixes#1124
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The extended kill delay (10 sec) is sometimes not enough for complex
system containers. Also, podman sometimes take the opportunity to do
housekeeping tasks when stopping a container. So, allow for up to 30
sec. grace period before we send SIGKILL.
With the latest image prune extension, set a 60 sec. timeout for the
cleanup task, in case podman gets stuck. This to prevent any future
mishaps.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Highlights:
- fixes to systemd and s6 type services
- bare-bones libsystemd replacement with #include <systemd/sd-daemon.h>
- new reload:script mimicking systemd ExecReload, and
- new stop:script mimicking systemd ExecStop
- exit status/signal info when a process dies
- service kill:SEC now support up to 300 sec.
- the /tmp/norespawn trick now also covers service_retry()
- the sysv 'stop' command process environment is now same as 'start'
- State machine ordering issue: enter new config generation after
services disabled in previous generation have been stopped
Full changelog at:
- <https://github.com/troglobit/finit/releases/tag/4.13>
- <https://github.com/troglobit/finit/releases/tag/4.14>
Fixes#1123
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
As Infix matures as an operating system it is quickly becoming more and
more useful also for end-device use-cases. The README should reflect
this change in focus.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
From the documentation:
> 'podman image prune' removes all dangling images from local storage.
> With the all option, all unused images are deleted (i.e., images not
> in use by any container).
>
> The image prune command does not prune cache images that only use
> layers that are necessary for other images.
So, when the container script is called in the cleanup phase of the
lifetime of a container, we can use the '--all' option to ensure we also
remove this container's loaded image. In the case this happens before
a reboot of the system, there will be no old version of the image loaded
to /var/lib/containers after boot.
Issue #1098
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
There are 2 main reasons for this:
1) It's almost impossible to write complex logical expressions in GH
workflows. I wanted to pass "" as flavor when not building _minimal.
So that the end target string would become TARGET + FLAVOR where
FLAVOR is empty, making it x86_64 for example.
As it turns out "" is false in GH workflow logical expressions, this
in conjunction with the limitations the interpreter has made it hard
to actually write sane expressions in the "with:" variables when
calling downstream jobs via workflow calls.
Here's an example of what I was trying to do and could not:
with:
flavor: ${{ (
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'ci:main')
) && '' || '_minimal' }}
As '' is false, the first sets of expressions always evaluates to
false making the string "_minimal". I tried bracing this in various
ways and to use "null" or various JSON objects, all in vain.
2) It reduces complexity instead of adding additional.
Signed-off-by: Richard Alpe <richard@bit42.se>
Previously, upgrading Podman containers with the same tag left
behind dangling images, causing overlay storage to grow and fill
disk space.
This change ensures dangling images are cleaned up using
podman image prune. The command is run without -a, so only
unreferenced images are removed. This provides safe cleanup while
preventing unnecessary overlay growth.
Fixes#1098
Signed-off-by: Richard Alpe <richard@bit42.se>
The defconfigs for all architectures other than x86_64 has this
enabled, so align it with the rest.
This has no on-target impact, but it enables us to attach to a live VM
instance and debug it, or do offline debugging like resolving stack
trace lines from oops messages to source locations.
The board/common/uboot/extras.config was updated with CONFIG_MMC_PCI
*after* we last built the SparX5i bootloader, and this was really only
needed for the Qemu build, so let's move the requirement there.
Also, we now (Buildroot 2025.02) need to update the dependencies for the
Fireant bootloader with libbsd (for some reason) and dtc, of course.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit migrates the bootloader build from Raspberry Pi 4 board
package to a dedicated bootloader defconfig. The idea is to set up
dedicated wokflows for building bootloaders, which change rarely,
streamlining the Infix image builds.
A dedicated workflow, or job in an existing workflow, can then do
the composition to minimal SD-card images useful for starting up
Infix on boards where SD-card is the primary boot source.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Prior to this commit yanger looked at the running system using
os.path..., this meant that the static reply / capture data wasn't
used properly. This resulted in strange behavior during unit testing
on GitHub runners where USB ports are missing.
Signed-off-by: Richard Alpe <richard@bit42.se>
The execd runner has not been used since Nov, 2024, ca0e54b. This
weekend it started triggering a warning from Coverity Scan, so let
us drop it for good this time.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commits tweaks the material orange theme to use the exact color hue
of Jackys footies. To match this and give a slightly better contrast we
also change Jacksy border and logo text color to a slightly darker tone.
The original logo.svg is retained for reference, the new logo is logo2,
which all the .png variants have now been updated to.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
In the spirit of my uni English teacher; "simplify, Simplify, SIMPLIFY!"
This commit collapses the About and Introduction into a single document,
doc/index.md.
Also, relocate the System Boot section to doc/boot.md, which we alrady
have and covers the initial bootloader part of it.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Lot of work still remains, but this new disposition should serve as a
more representative template.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Files in doc/cli/*.md are used in and displayed as help text in the CLI
admin-exec level. So we cannot use standard admonitions (yet) since the
terminal markdown converter (lowdown) doesn't support the syntax.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
We want to discourage people to use sysrepocfg and instead move to use
NETCONF, or even better, RESTCONF. When something's missing we should
add it to these two official, and standardized, interfaces.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
And make the ASCII image more generic to ease any branding work we may
need to do for certain customers later on.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- custom cover page for pdf
- Center and resize logo
- Place slogan just below logo
- Ensure all text on cover page is in matching grey
Please note, the mkdocs-to-pdf plugin works, but it has a bug in the
enumeration of sections. We may need to fork it to make it work the
way users expect.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Way too long. By splitting it in multiple files we can also user
simpler (shorter) headings, which makes navigation easier.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The Python tool 'mike'[1] helps manage multiple versions of MkDocs-powered
documentation. Only required when building the kernelkit.org site docs!
For each new tag, that steps year or month, a new version of is created of
the documentation, in a separate sub-directory on the gh-pages branch.
Strategy - Version Grouping with Early Publishing:
- Extract YEAR.MONTH from tag
E.g., v25.06.0-beta1, v25.06.0-rc1, v25.06.0, v25.06.1 → become version 25.06
- From first pre-release onwards:
- v25.06.0-beta1 → creates docs version 25.06
- v25.06.0-rc1 → updates docs version 25.06
- v25.06.0 (GA) → updates docs version 25.06
- v25.06.1 (patch) → updates docs version 25.06
- New major/minor series:
- v25.07.0-beta1 → creates new docs version 25.07
Benefits:
- Users get docs as soon as beta/rc is available
- Patches update existing docs (logical since patches rarely change docs significantly)
- Clean version grouping by YEAR.MONTH
- Mike handles create vs update automatically
[1]: https://github.com/jimporter/mike
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Major overhaul and simplification of both language and structure to
improve accessibility and UX in new documentation framework.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Note, this change breaks some links on GitHub due to the difference in
how MkDocs and GitHub implement "autolinking" and anchors. Since the
idea is to make MkDocs our primary documentation framework, breaking
links on GitHub in favor of MkDocs is the best compromise.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This makes it a lot easier to find relevant information on how to
perform a system upgrade. Further consolidation may come later.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Redesign how GH actions are triggered. This new design uses a
self-trigger to start jobs which are only started via workflow_calls.
The main benefit of this is to be able to start workflows from various
Infix Spins without needing to duplicate the workflow files in them.
Upcoming patches are intended to parameterize to allow Spins to pass
different architectures, brand names and such.
Signed-off-by: Richard Alpe <richard@bit42.se>
We was missing the firmware required for this, and for this to work
cfg80211 needs to be as module since the rootfs is not loaded when it
is loaded if compiled in kernel.
And add iw since it very useful for debugging.
Add test to verify a container on Infix can execute commands on the
host by mounting a script to `/etc/rc.local` with proper permissions.
The test confirms host hostname change using `nsenter` from inside
a privileged container.
Resolves#1024
- Fix by-word movement, detect word barrier using non-alphanum chars
- Fix delete word left/right, make sure to save word in kill buffer
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Buildroot updated to v25.02.3
- Tefactor of nftables container
The nftables container now includes BusyBox, a shell with vi and some
basic filesystem tools, as well as nsenter and unshare, suitable for
testing and other more advanced tasks.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Support implemented:
* WPA2/3 support
* scanning (in background, results in operational)
* Unencrypted networks
No certificate support, only PSK
*only* client so far, no AP
If a extra infix feature require features to be added to an already
loaded module. Instead of have the exact module definition in multiple
places (with date), this will allow a much more flexible sytax:
MODULES=(
"infix-interfaces -e containers"
)
This require that the infix-interfaces is loaded *before* this file
is run.
This since the feature is called 'wifi' in Infix, this makes the naming
consistent over the system.
Also trigger start of a wpa_supplicant, for scanning in the background.
The scanning results is available operational.
Some CLI commands where inadvertently moved from the global CLI
context into the show context.
For example the upgrade command.
As a result, commands like upgrade were unavailable at the top-level
prompt:admin@ix-00-00-00:/> upgrade ?
Error: Command not found, or incomplete.
However, these commands remained accessible under the "show" context
as a temporary workaround:
admin@ix-00-00-00:/> show upgrade ?
URI [(ftp|tftp|http|https|ftp)://(dns.name | ip.address)/path/to/]upgrade-bundle.pkg
This patch restores the affected commands to the global CLI context so
that commands like upgrade function as intended at the root prompt.
Fixes: 9c0a8e39 klish-plugin-infix: fix indentation in infix.xml
Signed-off-by: Richard Alpe <richard@bit42.se>
- relying on config version and files backed up during
configuration is not enough.
- storing a configuration file before upgrading, to be used
when downgrading, is more reliable.
[skip ci]
Apparently the BCM2835 watchdog driver does not hook into /dev/watchdog
but creates its own /dev/watchdog0, and is very picky about interval and
timeout as well it seems.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- switch to 6.12 LTS, same as other Infix boards
- trim down kernel config a bit
- sync defconfig with r2s to switch to Finit
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
If an invalid mount source path is specified, the container logs a
"file not found" error and subsequently crashes.
Adding a check inside the SR_EV_CHANGE event handler performs an
early validation of the mount source path, allowing to reject
configurations that reference non-existent or unreadable files before
they are committed to the datastore.
This change ensures configuration correctness by enforcing that each
container mount has either a source or content set. Without this, the
system may generate invalid runtime arguments (src=(null)), leading
to container startup failures.
- relying on config version and files backed up during
configuration is not enough.
- storing a configuration file before upgrading, to be used
when downgrading, is more reliable.
[skip ci]
This to get quick turnaround development -> test when
doing PRs main branch builds and release builds are still
build sequentially.
Signed-off-by: Mattias Walström <lazzer@gmail.com>
- Add section on upgrading/downgrading and boot-order to system.md
- Add or update references on upgrading from other pages
- boot.md (update ref)
- cli/upgrade.md (add ref)
- management.md (add ref)
[skip ci]
Libyang is smart, it "fixes" the timezone for you, this was overriden by a
hack in netconf.py and restconf.py, but what you really want is to see
in operational what the current timezone is.
Non-privileged users in the sys-cli group can now access sysrepo data.
The data is now solely protected by the NCAM rules and not Unix file
permissions. Any stray user that's not part of the (default) sys-cli
group still can't access syrepo, like users added from the shell.
Fixes#932
Signed-off-by: Richard Alpe <richard@bit42.se>
Use new buildroot branching strategy where all our commits are placed
on top of a buildroot release on a branch named BR_RELEASE-kkit.
Signed-off-by: Richard Alpe <richard@bit42.se>
When running a DHCP test `resolvconf -l` looked like this:
admin@client:~$ resolvconf -l
search example.com # e5
admin@client:~$
This resulted in broken result when reading operational data from
system-state (which used resolvonf -l)
Sysrepo, netopeer etc are still responsible to install the modules in
target directory, this will make that we will discover quickly if something
is updated.
Also this enables rm -rf output/target/etc/sysrepo/data/* && make confd-rebuild
This will reinstall all modules again.
This allows a user to run in on any system which has the Infix source
code that contains the modification scripts.
Signed-off-by: Richard Alpe <richard@bit42.se>
The software list from sysrepo is no longer reversed, the reverse now
happens in cli-pretty. This commit reflects that.
Signed-off-by: Richard Alpe <richard@bit42.se>
The reason for this is:
1) We want to use the same fetch tool for all operational data, to
avoid having duplicated xpaths scattered across the repo.
2) We want to call this directly from the CLI, which means it need to
be escape safe. A unprivileged user shall be able to use it but not
escape into a shell or do other malicious stuff.
Signed-off-by: Richard Alpe <richard@bit42.se>
There's several reasons for this. The main reason is that it was
developed as an intermediate way of getting system information when
the operational datastore was almost empty. There's not a lot of data
available in the operational datastore and we shall rely on that data
primarily. This command isn't safe to run from a jailed CLI as i
doesn't validate input and run commands directly in the shell, making
it hard to protect against a CLI jail break.
In upcoming patches we will introduce a new show tool that relies
solely on operational data and which sanitize the user input.
Signed-off-by: Richard Alpe <richard@bit42.se>
- Update usage text for readability, add example
- Reindent getopts case and add -h
- Allow 'git rm -f' to remove already staged patches
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Bump kernel to 6.12.21, same as other tier one boards
- Fix#1006 byt enabling netlink for ethtool (now works!)
- Sync defconfigs:
- LIBXCRYPT now in an rdep of another package
- Disable FORCE check hashes for now
- Drop patches for 6.10 tree (r2s kernel)
- Port RTL8153b patch for R2S LAN LED support
Fixes#1006
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This silences a bogus warning in the log when runparts is called with no
argument. I.e., when there is no product specific init files available.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
There is no such loglevel 'critical', only 'crit' is defined.
For some reason this issue has not been spotted until the upgrade to
Buildroot 2025.02, which includes sysklogd v2.7.0, and Finit v4.11.
Introduced in 3e48af6, when the concept of failure-config was added.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When stopping a container that is (stuck) in setup state, e.g., fetching
its container image, we need to send SIGTERM to the container wrapper
script rather than forwarding the 'stop' command to podman.
With this fix, and the Finit upgrade, there is no longer a 10 second
timeout before Finit sends SIGKILL to the PID. Instead, the script now
immediately react to the initial SIGTERM.
Related to issue #980
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The code assumes both SRC and DST is passed, here we ensure this
early.
Prior to this patch:
root@host:~$ copy foo
Segmentation fault (core dumped)
Signed-off-by: Richard Alpe <richard@bit42.se>
Prior to this patch the errno value was overwritten by getgrgid()
making the printouts invalid:
Error: setting group owner wheel (10) on /cfg/startup-config.cfg:
Success
Signed-off-by: Richard Alpe <richard@bit42.se>
Avoid a theoretical race between getting the number of groups a user
belongs to and actually processing them. We should not need to check
the return value of getgrouplist() as we know the number of groups fit
inside the buffer.
Signed-off-by: Richard Alpe <richard@bit42.se>
As per earlier decsision, the .cfg suffix is no longer implied when a
user copy to a regular file, so we should allow tab completion in the
copy command to show foo.cfg, otherwise the copy command will fail.
Skip /cfg/startup-config.cfg since it's treated as a special case and
added to the list by the infix_datastore() plugin function.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When copying a file to a directory, the file should be accessible (read
+ write) by all members of the group that are allowed write access.
E.g., an 'admin' level user creating a new file /cfg/foo.cfg should
result in the file being owned by $LOGNAME:wheel with 0660 perms,
because /cfg is root:wheel.
Writing to already existing file, e.g., created by 'root' at first boot,
say /cfg/startup-config.cfg should be possible by all members of the
'wheel' group. In this case thef file already exists as root:wheel and
any user trying to chgrp it will fail, this is fine.
Fixes#977
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
For future readers, the user paramenter to the copy() function is
actually the remote user in any curl command.
Also, realign columns in infix_config[].
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
{topdoc} is needed for asciidoctor to find the image during test
report generation.
This is the same functional change as 02d8288863 but with the
generation script actually updated. This was forgotten in the last
commit.
Signed-off-by: Richard Alpe <richard@bit42.se>
Turns out the root cause for the odd log message in #896 was that the
system did not properly call `resolvconf -u` when starting in failure
mode.
This patch simplifies the code by moving all `resolvconf -u` calls to
the same Finit task. Ensuring it is first launched when confd has
successfully consumed any configuration at boot, and then every time
a static DNS server is added. (The udhcpc client script already call
`resolvconf -u` when dynamic DNS servers are learned.)
Fixes#896
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The following log message does not stem from an error in setting up the
chroot, but from the internal communication with the chroot. This patch
adds the crucial missing file name in the log message.
avahi-daemon[3590]: chroot.c: open() failed: No such file or directory
So that when the user sees this message, e.g., with "/etc/resolv.conf"
as the arg. to open(), they can be certain; "ah, no a biggie, we have
not created that file yet!"
Issue #896
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Either indent by four spaces or use backticks. Depending on the output
generator they may apply different styling though.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Enabled by user enabling IPv6 forwarding on any interface. This change
also enables net.ipv6.conf.all.accept_ra (=2) to accept any IPv6 route
advertisements even when acting as a router.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The phys container test verifies custom mounts, so let's refine and
consolidate this test to focus on docker bridge features.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Add new test step that adds a content mount to /var/www/index.html to
verify that changes to a running container are activated.
This test pass was previously part of the container bridge test, but
was moved here to allow that test to focus on bridge specific checks.
Issue #930
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
For tasks like upgrade we need, e.g., the image URI. Instead of
guessing where on the container command line the image is, use a
meta-data field in the container shell script.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- More logging when deleting a container
- Update 'exec' and 'shell' commands to support running commands
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Containers in Infix are read-only, any persistent data is either stored
in volumes or content mounts. To prevent lingering containers, as have
been seen on some test systems, we move cleanup stage from confd to use
the Finit cleanup:script mechanism.
The resulting code is simpler, shorter, and easier to debug and use.
As an added benefit, confd no longer prunes "unused" volumes by itself
on (any!) reconfiguration event, which with the new container life cycle
in Infix was quite fragile. Instead the CLI command 'container prune'
is extended with 'podman volume prune', which coincidentally the help
text already alluded to.
This patch requires Finit v4.10-rc1, or later.
Fixes#902
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When updating a container configuration we need to rerun the setup stage
of the container. However, a run/task in Finit only runs once for each
runlevel, meaning changes at runtime of a container was broken.
This is a refactor of the container script to allow it to also run as a
pre:script in the Finit setup stage of a sysv/service. Also included is
a fix to the timeout/retry handling in case the container setup fails.
We must call `read -t 60` *before* calling `ip monitor`, otherwise it
will not be called until `ip monitor` returns.
This patch requires Finit v4.9, or later.
Fixes#930
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Rename local variables
- Extract image name, using basename, for podman image exists
Fixes the following syslog error message:
root@foo:~$ podman image exists docker://ghcr.io/kernelkit/curios:edge
Error: unsupported transport "docker" for looking up local images
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Add missing tool: timeout
- Add extra flags to sync
- Allow wc to work with large files
- Update defconfig sync -> enable PAM
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Future Infix defconfigs for smaller system may exclude Frr and set all
routes directly in the kernel. So failing to add a user to the frrvty
group should not cause an error, hence the new group_exists().
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Some netdev drivers, e.g. the FEC found on many i.MX SoCs from NXP,
will detach from their PHYs when configured down.
This means that when confd tries to configure L1 settings for the link
before bringing it up, ethtool fails - since there is no PHY to talk
to.
For interfaces that behave this way, delay the configuration until
after NETDAG_INIT, when the interface is brought up. This is not
optimal, since we are generating needless noise for the link partner,
which is why we only fall back to it as a last resort.
Fix#951
Ideally, all drivers should behave the same. Alas, that is not the
world we live in. For quirks that we can not reliably probe for in any
other way, let products supply a JSON file that declares them.
CID 507415 from coverity was the origin for this change. As it turns
out, the unreachable MAC address generation for VXLANs was hidden by
the generic setup (netdag_gen_link_addr()) saving the day. That is
likely something we want to phase out though, so the VXLAN code should
stand on its own.
Align the GRE code while we're here, because why not? :)
Primarily fixes issue with DHCP server multiple subnets test, which
triggers an ordering issue between reconfiguration of dnsmasq and the
`initctl reload` command.
For the full ChangeLog, please see:
https://github.com/troglobit/finit/releases/tag/4.9
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Do not allow the topology matcher to setup a LAG where one link is
running at 10G while the other one runs at 1G, since the bond will
never use the 1G port as long as there the 10G link is up.
To run LAG tests on hardware, we have to make sure that the chosen
links are running at the same speed. We do not want to require a
specific link speed from the logical topology, as the real requirement
is merely that the two (or however many) links are of the _same_
speed, not any _particular_ speed.
Rather than having to complicate the topology matcher, let it take
care of the common pattern of matching requirements to provided
features, then let tests pass custom node/edge matchers for the
complicated cases.
Verify connectivity from host to the second DUT via the first, over a
link aggregate. Both aggregate member links are connected to a TPMR
link breaker to hide link down from the DUTs.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Verify connectivity from host to the second DUT via the first, over a
link aggregate. The lag starts in static mode and then changes to an
LACP aggregate. This verifies not just basic aggregate functionality,
but also changing mode, which is quite tricky to get right.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Unclear if the libyang merge operation actually does it's job of merging
all the data properly in the restconf backend.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When first starting up the YANG models are downloaded. Initially all
were printed on the test console, so this was later changed to become
a sort of progress output. However, that broke tap output, causing a
missing leading '#' for the final "YANG models downloaded." message.
Thist patch drops the output entirely from the netconf transport, it
was never added to the restconf transport.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Example use:
@infamy.test_argument("--mode", help="one of 'static' or 'lacp'")
class TestArgs(infamy.ArgumentParser):
pass
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit adds two SVGs for previewing the virtual test topologies.
quad: fix a lot of copy-paste mistakes, rename nodes and ports to their
correct names. Replace shell comments with C++ style comments,
not all tools, e.g., dotty, support shell comments. The neato
absolute positioning has also been fixed to make it possible to
see all the edges, to facilitate this the used ports have been
swapped around a abit. Colors are used according to the schema
agreed on for tests. Finally, a second link for lag tests have
been added between dut2 and dut3.
dual: coloring similar to quad, update to new edge attribute matcher.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When reading lag status, like LACP actor system prio, port key,
etc., we need CAP_NET_ADMIN. See net/bonding/bond_netlink.c
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Some callbacks may run twice, e.g., lag_gen_ports(). Check if the link
already exists, and is the same, then we can exit silently. However, in
case the link exists and does *not* point to the same target, we log an
error with current target for the post mortem.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The speed/duplex of a virtio interface is not eenforced in any way. The
driver initializes them to unknown/unkown:
https://github.com/torvalds/linux/blob/dccbe2047a5b0859de24bf463dae9eeea8e01c1e/drivers/net/virtio_net.c#L5375-L5381
It is however possible to set them since there are kernel subsystems
that rely on them, e.g., miimon in the bond driver, which in turn is
required for use with the 802.3ad (lacp) mode.
If we do not initialize speed/duplex the miimon will complain in the log
on virtual test systems every second:
Dec 13 22:34:08 laggy kernel: lag0: (slave e1): failed to get link speed/duplex
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The management of custom-phys-address was made more complicated by the
fact that physical interfaces require restoring the permanent address
when a custom setting is removed.
Simplify this by moving the restoration to the delete path, so we only
have to worry about if there is a custom mac or not during interface
setup.
Also:
- Fix some legacy naming on *_gen() functions
- Fix custom-phys-address on dummy interfaces
Fix#938
Before this change, interface dependencies were only setup when
interfaces were created. This led to problems in flows like this:
1.
configure
set interface br0
set interface br0.10
leave
2.
configure
set interface dummy0
leave
2.
configure
no interface br0
no interface br0.10
leave
Since neither br0 nor br0.10 was created in (2), no dependencies were
setup. Because of that, when the deletion scripts from generation (2)
are generated when entering (3), dagger is free to execute them in any
order. This means that it may choose to remove br0 before br0.10,
which will mean that br0.10 is already gone when we try to remove it.
Therefore, make sure that we generate the full dependency graph on
every iteration.
Also, get rid of the need to keep on-disk state for VETH pairs, and
use the name as a descriminator for which side to create/delete.
With the new iftype enum, we see that configuring an existing dummy or
gre interface types was wrongly classified as an error rather than as
a NOP.
Example, before this change, this was OK:
configure
set interface foo
set interface foo ipv4 address 10.0.0.1 prefix-length 24
leave
However, this was not:
configure
set interface foo
+leave
+configure
set interface foo ipv4 address 10.0.0.1 prefix-length 24
leave
+<KABOOM>
This has multiple advantages:
- Less chances of typos is repeated "infix-if-type:foo" strings
scattered throughout the code
- We can lean on GCC's `-Werror=switch` to make sure that iface
specific logic always handles all types (which was not always the
case - see follow-up commits)
- We can potentially create a `struct afspec_ops` in the future, which
could then be indexed by this enum
The only interfaces that would be in difs, but not in cifs, are
deleted interfaces. But these will be removed from the exit action of
the previous generation, and will never be referenced in the new
generation.
Pointer authentication emulation is expensive. By default, QEMU use the
standard cryptographic algorithm (QARMA5), which is very time consuming.
This commit switches to the fast implementation.
[skip ci]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2025-02-03 16:06:19 +01:00
1562 changed files with 52957 additions and 26183 deletions
title: `Upgrade to kernel ${{ steps.check.outputs.current_version }}`,
head: '${{ steps.branch.outputs.name }}',
base: 'main',
body: `Automated kernel upgrade to version ${{ steps.check.outputs.current_version }}.\n\n**Previous version:** ${{ steps.check.outputs.infix_version }}\n**New version:** ${{ steps.check.outputs.current_version }}\n**Source:** https://www.kernel.org/\n\nThis PR was automatically created by the kernel release monitoring workflow.`
echo "> **Try Infix in GNS3!** Download the appliance from the [GNS3 Marketplace](https://gns3.com/marketplace/appliances/infix) to test Infix in a virtual network environment without hardware." >> release.md
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.