Compare commits

..
686 Commits
Author SHA1 Message Date
Joachim Wiberg 52023e918a confd: regenerate factory-config if factory-config.gen is missing
Regenerate if either factory-config.gen or failure-config.gen is missing.
This should not happen, but is better to check for the result rather than
the intermediate result.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-17 16:32:41 +02:00
Joachim Wiberg c6fae88268 Fix #166: drop SSDP entirely from Infix
mDNS-SD was added in Windows 10 Creators Update[1] (build 1703), relased
April 11, 2017.  This makes SSDP no longer critical for finding an Infix
device in Windows, both ping infix-01-02-03.local and using Chrome work.

Since all major operating systems now support mDNS-SD[2] we've decided
to standardize on that and LLDP for Infix and its derivatives.  Other
reasons for dropping it include, but is not limited to: lack of IPv6 in
the implementation we use, and potential security implications[3].

[1]: https://en.wikipedia.org/wiki/Windows_10,_version_1703
[2]: https://techcommunity.microsoft.com/t5/networking-blog/mdns-in-the-enterprise/ba-p/3275777
[3]: https://blog.cloudflare.com/ssdp-100gbps/

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-17 16:32:41 +02:00
Joachim Wiberg aa655abdc7 Fix #159: hacky generation of /etc/resolv.conf at boot
To be able to run "resolvconf -u" at boot we need dnsmasq up and running
and startup-config having been loaded successfully.  (No point when we
hare in fail secure mode.)

If this bugs out it can be pinpointed by an empty /etc/resolv.conf

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-17 13:26:26 +02:00
Joachim Wiberg cefe24c467 confd: support mixed bridge/router use-case in inteface generator
Fix #160

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-17 13:26:26 +02:00
Joachim Wiberg b4d760906f .github: disable actions by default [skip ci]
Enable actions by setting local variables in your fork of Infix.

Fix #170

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-17 13:26:26 +02:00
Joachim Wiberg acecbe7e5d Allow custom image filename being set in menuconfig
This adds support for the two /etc/os-release variables:

 - IMAGE_ID
 - IMAGE_VERSION

The former is configurable, with fallback to name-arch, and the latter
is only set for relase builds.  During releae builds the release will
be appended to the image name.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-17 13:26:26 +02:00
Joachim WibergandGitHub f6acc44104 doc: add Integration section [skip ci]
Detail operational experience with integrating 3rd party software, PROFINET.
2023-10-17 13:20:11 +02:00
Henrik NordstromandJoachim Wiberg 7b09b2524d greenpak-programmer: Bump to v1.1 which adds LICENSE.txt 2023-10-16 15:07:03 +02:00
Henrik NordstromandJoachim Wiberg 62131528ba Use single-word for CONFIG_PACKAGE.. bool 2023-10-16 15:07:03 +02:00
Henrik NordstromandJoachim Wiberg 5eb25e968b Add greenpak-programmer package 2023-10-16 15:07:03 +02:00
Joachim Wiberg 1698c6645c Disable bridge multicast snooping (IGMP/MLD) by default
The Marvell mv88e6xxx switch driver currently used in active projects do
not support multicast router ports properly yet.  Considering that Infix
do not yet have YANG support for configuring IGMP/MLD snooping, we have
decided to disable it in bridge setups by default.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-13 13:38:09 +02:00
Joachim Wiberg 830c885c2e confd: minor, fix comment
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-13 12:50:02 +02:00
Joachim Wiberg 17b6c234c1 confd: fix copy-paste error in runtime condition [skip ci]
We should only call 'error' in case loading failure-config fails, not if
loading startup-config fails. Unclear how this passed testing, must have
been a last minute change that got untested.

Found during integration in customer's br2-external.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 17:22:49 +02:00
Joachim Wiberg b44e303775 board/common: basic feature probe
Currently does not need any conditions, but may later need to check for
loaded modules and other capabilities.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 16:35:00 +02:00
Joachim Wiberg 3a3274c371 confd: ensure "word splitting" otherwise gen-interfaces fails
Overzealous shellcheck application lead to gen-intefaces not creating a
bridge when GEN_IFACE_OPTS was uncommented in /etc/confdrc

Verified in customer br2-external.

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 14:56:00 +02:00
Joachim Wiberg 46bd3df13e board/common: fix string comparison operator [skip ci]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 14:28:18 +02:00
Joachim WibergandTobias Waldekranz 138c9f3378 Update board/common/mkgns3a.sh
As @wkz says, better to use this construct if/when we add more archs.

[skip ci]

Co-authored-by: Tobias Waldekranz <tobias@waldekranz.com>
2023-10-12 11:22:55 +02:00
Joachim Wiberg 8c20bb2829 configs: enable disk image and update metadata for /etc/os-release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 11:22:55 +02:00
Joachim Wiberg 606b87b4b3 configs: sync aarch64 classic build with changes from cbaa599 & C:o
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 11:22:55 +02:00
Joachim Wiberg 230c2adae7 board/common: rename disk.img and update .gns3a
- Create per-arch unique distribution file names
 - Source .gns3a information from /etc/os-release

Instead of attempting to create unique file names by hard-coding an
'infix-' prefix and extracting the "board" or "arch" part from the
defconfig, let's use the branding information from /etc/os-release
along with $BR2_ARCH.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 11:22:55 +02:00
Joachim Wiberg 09d48b35ee board/common: parameterized branding using menuconfig
This makes it possible for projects using Infix as a br2-external to
override lots of OS-specific strings and contact information that
previously was hard coded.

The generated /etc/os-release now takes most of its data from .config
Worth noting is the changes in VERSION and BUILD_ID fields.  The former
will be INFIX_RELEASE, during release builds, and the latter is always
the output from `git descibe ...`, or rather GIT_VERSION.  This variable
can be overloaded as well.

See the help text and the new doc/branding.md document for details.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 11:22:55 +02:00
Joachim Wiberg f2e30943ee board/common: generate images/Config.in and reduce x86 ram
The default arch and disk image filename needs to be generated
to be unique per, at least, each architecture build.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 11:22:55 +02:00
Joachim Wiberg f852afc9c6 Enable GNS3 appliance file for all builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 11:22:55 +02:00
Joachim Wiberg c6d4fbf341 board/common: generate a simplified .gns3a for aarch64 builds
Due to problems with using u-boot as loader¹ we decided to start the
system by calling the kernel image directly.  The downside to that is
that, even though RAUC upgrades would work, the kernel would remain
the same.

Improvements to this are of course welcome.

________
¹) Must extract the built-in .dtb and merge with the Qemu .dtb at runtime
   to be able to boot primary (or secondry) image.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 11:22:55 +02:00
Joachim Wiberg b40484e262 board/common: fix load_cfg key=value extraction
Calling `load_cfg BR2_EXTERNAL_INFIX_PATH` from post-image.sh caused
warnings due to multiple hits in the .config file:

post-image.sh: 12: /tmp/tmp.5a3xhQQVc8: BR2_EXTERNAL_INFIX_PATH: not found
post-image.sh: 13: /tmp/tmp.5a3xhQQVc8: BR2_EXTERNAL_INFIX_PATH: not found

Let's grep for a "key.*=" instead of "key" to drop those warnings, while
still acting as a catch-all for partial matches.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-12 11:22:55 +02:00
Richard AlpeandJoachim Wiberg 7d8b876cc7 cli: handle missing oper-status
Use known data from .self to avoid crashing if the oper-status is
missing for a interface.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-10-12 10:10:30 +02:00
Jon-Olov VatnandJoachim Wiberg fdcc6d35a4 Doc: Fixing hostname in examples
Fixing hostname to state admin@example where this was missed.
And some typos.
2023-10-11 13:17:11 +02:00
Jon-Olov VatnandJoachim Wiberg 2c21943ebf Doc: Updating IP address config examples after origin fixes
Fixes to IPv6 address origin (type 'random' rather than 'other')
now reflected in documentation.
Also using 'admin' instead of 'root' user in examples.
2023-10-11 13:17:11 +02:00
Tobias WaldekranzandJoachim Wiberg 2f1c383602 board/aarch64: alder: Initial add
- Device tree
- Enable needed drivers
- Include in aarch64_defconfig
- 88X3310P Firmware
2023-10-10 14:54:50 +02:00
Tobias WaldekranzandJoachim Wiberg 5f37b8acd3 board/aarch64: Build kernel and modules with debug info
This costs nothing on target, and it means that we always have debug
symbols ready when we need them, without having to do a complete
rebuild.
2023-10-10 14:54:50 +02:00
Tobias WaldekranzandJoachim Wiberg 5891c0f2b3 board/aarch64: Build all network related drivers as modules
As we may need to load firmware to the PHYs, we can't load those
modules until we have access to the rootfs. In order for that to work,
the MDIO driver must not be built-in, as that will cause the kernel to
bind devices with missing (built-in) drivers to bind to the genphy
driver.

Therefore, build everything as modules and let udev load it during
boot.
2023-10-10 14:54:50 +02:00
Tobias WaldekranzandJoachim Wiberg 7d1580ca21 board/common: nameif: Make switch port marking more robust
Let's operate on JSON data, so that we're less vulnerable to output
changes in devlink.
2023-10-10 14:54:50 +02:00
Tobias WaldekranzandJoachim Wiberg c5eed505fe board/common: Add convenience macros 'hd' and 'llping'
'hd':
    Hexdump, in canonical format

'llping':
    Ping any IPv6 neighbors using the link-local all-nodes group

    Usage: llping <IFACE>
2023-10-10 14:54:50 +02:00
Tobias WaldekranzandJoachim Wiberg cbaa599c68 aarch64: Use DTS overlay directory
Now that buildroot supports overlay directories for DT sources, use it
in the aarch64 build.
2023-10-10 14:54:50 +02:00
Tobias WaldekranzandJoachim Wiberg a485f15468 buildroot: DTS overlay directories 2023-10-10 14:54:50 +02:00
Tobias WaldekranzandJoachim Wiberg 558c2a40ee kernel: Bump to 6.5.6 + kkit-linux-6.5.y
In order get the ONIE EEPROM support and some mv88e6xxx related fixes,
move to 6.5.6, with the intention of upgrading again, to the next
longterm kernel, as soon as one becomes available.

Also, import patches from kkit-linux-6.5.y.
2023-10-10 14:54:50 +02:00
Joachim WibergandTobias Waldekranz db1d7f41e7 confd: rename Finit sysrepo.conf -> confd.conf
Everything else is named confd, even syslog messages are logged as
confd, and we've talked about not using sysrepo-plugind one day, so
let's prepare for a world where everthing is like that.

Also, and even more importantly, fix the sysrepo-plugind condition.
We cannot use <pid/syslogd>, because it can be restarted and thus
consequently Finit will stop sysrepo-plugind.  This first caused a
bit of head scratching because it cause a lot of very odd errors in
the execution of sysrepo-plugind, transactions being abruptly aborted
for instace.

Whatt we can do, however, is use a static condition, which Finit has
support for since a few releases now.  We want to guard the start of
our sysrepo-plugind service behind YANG /usr/libexec/confd/bootstrap.
So we can use <run/bootstrap/success>.  In case the bootstrap fails,
we catch that in the row before using if:<run/bootstrap/failure> to
trigger the /usr/libexec/confd/error script (described previously).

The other run/task/services can be guarded behind <pid/confd> and now
everything suddenly makes sense.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz 787955d877 confd: add error handling in case of failed bootstrap or load
- New script 'error' that can be overridden by a br2-external
 - Call 'error' if YANG model bootstap or factory-config.gen fails
 - Call 'error' if loading startup-config or failure-config fails

The 'error' script calls syslog¹ to log the error messge:

    The device has reached an unrecoverable error, please RMA.
____
¹ to get a timestamp log message, and send remote in case a
  br2-external has somehow hard-coded network for remote syslog

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz f357b1df3b confd: log [PID] to syslog
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz ca9daef15a confd: add support for generating /cfg/failure-config.cfg
This rather huge change is a refactor of the factory-config generataion to add
support for also generating a failure-config.

The confd bootstrap script has been given an rc file.  This both eases manual
testing, when modifying the script(s), and also makes it easier to override
from a br2-external.  Infix default is router/end-device, but a br2-external
may be a switch firmware and want to default to all ports in a bridge.

The generated failure-config creates a fail-safe "do no harm" config to boot
with in case startup-config for some reason is broken or cannot be applied,
e.g., bug in confd.  Meaning, for both the router and switch use-cases the
device will start up with all interfaces isolated¹, with an IPv6 SLAAC (EUI64)
address per interface.

Services enabled in this fail-safe mode are: LLDP, mDNS/SD, SSH, and NETCONF.
All to facilitate diagnostics, troubleshooting and device recovery.

Other noteworthy changes include:

 - rename factory/failure directories again -> factory.d/failure.d.  Use
   same naming as we do on target for directories holding generated files
 - The bootstrap script no longer regenerates /cfg/factory.d on each boot
 - The bootstrap script copies all static templates to /cfg/factory.d in
   case a newer image changes the contents of them.  For troubleshooting
 - Support for overriding the 20-interfaces.json generation by br2-external
 - Support for additional 30-config.json (ovrride/extend) by br2-external
 - Expand gen-interfaces to support bridge use-case.
_____
¹ For a switch this means "no switchport", i.e., no switching between ports
  otherwise connected to a switchcore (or bridge) in startup-config.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz 3e48af6c36 confd: relocate auto-factory templates and prepare fail secure mode
The template and scripts for generating per-device factory-config have
been spread out across the repo.  This is an attempt to gather all the
pieces to a single location for better overview.

Parts of factory-config will be reused for the new fail secure mode, in
the file failure-config.  The beginnings of which are in this commit.

Other changes:
 - cfg-bootstrap and confd-bootstrap have been collapsed into one
 - let gen-hostname + gen-interfaces save to /cfg instead of /etc,
   we've moved the /etc directory to read-only storage in /usr/share
 - delay start of bootstrap and sysrepo-plugind after syslogd barrier
 - set 'norestart' when loading startup-confg and failure-config,
   no point in retrying if that fails, just go to error immediately

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz b7c4c251ca board/common: Finit dbus.conf override behind <pid/syslogd>
This ensures dbus is not started before any udevadm call has completed.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz 5bad7f472f Guard system critical bootstrap services behind <pid/syslogd>
This ensures they do not start earlier than the system log daemon.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz fd366e78f6 package/skeleton-init-finit: rename condition set by sysklogd -> syslogd
The sysklogd and BusyBox syslogd can not run at the same time.  Since they
provide the same service we standardize on them providing <pid/syslogd>.

Also, ensure syslogd does not start until the fifth udevadm has completed.
This creates a barrier preventing other run/task/services from starting
too early.  Thus guaranteeing a proper boot order.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz 0103b1a491 Ensure /bin/sh is a plain POSIX shell (BusyBox /bin/ash)
This commit fixes a regression introduced in 15572e9e where /bin/bash
was unintentionally set as the defalt /bin/sh in the system. This cause
several warnings and errors when a Bash-based /bin/sh tries to sources
/etc/profile because $SHELL identifies it as /bin/bash.

The ietf-system.yang model, with the infix-system.yang extensions,
declare a per-user SHELL that allow /bin/clish, /bin/bash, /bin/sh
and /bin/false.  There should be a clear distinction between them.

This change also helps us keep bashisms away.  If a script needs
Bash features, declare: #!/usr/bin/env bash

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz 11c157116b sec: drop sulogin and disable rescue mode in Finit (NETCONF)
This commit drops sulogin from BusyBox, as well as the Finit replacement,
in the NETCONF builds.  The classic builds retain the Finit sulogin.

Furthermore, the Finit rescue mode is disabled (which uses sulogin), so
in case of trouble at boot, e.g. missing fstab or failure to fsck, the
system will no longer go to sulogin but instead log error to console and
reboot.

  NOTE: the bootloader still needs to be locked down, otherwise a user
        could just as easily change kernel cmdline to 'shell=/bin/sh'

Misc. reshuffle and defaults updated are due to make foo-update-defconfig.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz 3686401a7b configs: drop finit modprobe plugin, handled by udevd now
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz 17665dc962 package/finit: bump to v4.5-rc5
- with conditional execution support
 - fixes to udevd and udevadm calls in renamed 10-hotplug.conf
 - support for overriding internal services, e.g. dbus, keventd

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz acd33d4fa5 board/common: drop duplicate sshd.config and ssh-hostkeys
Instead, use the version from package/skeleton-init-finit, including the
ssh-hostkeys (previously ssh-genhostkeys) from the same package, because
it include extensive error handling and logging on failure.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz e85bc8223b confd: load startup-config with a new wrapper to detect errors
The new confd-load.sh script handles bootstrapping Infix using startup-config
or a failure-config (see later commits) on error.

When used with the -b (bootstrap) option, and failure to load the give file,
the script sets a Finit condition and goes to runlevel 9.  The condition can
be used to trigger loading of a failure-config to go to a Fail Secure mode.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz 8152df445b confd: save boot time by not loading startup-config twice
Only create a default startup-config from factory-config if one is missing.
Do not load an existing startup-config, that is handled by a later step in
the boot process, which needs to be monitored (and displayed) separately to
fail over to a Fail Secure mode on error.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz 17e748a129 confd: log to syslog when user is created/deleted/modifed or error
Changes to the system concerning access rights, like users, should always
be logged, in particular when creating new users or failure to create or
modify their properties.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz b46849520e libsrx: add NOTE() log macro for default log level, LOG_NOTICE
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim WibergandTobias Waldekranz d4820b598b Fix SSH hostkey generation and verification
This change addresses a problem accessing Infix over SSH.  The root cause
turned out to be the hostkeys, which live in /var/lib/ssh and not in /etc
on Infix, were corrupt.

The corruption was interesting in that they all existed, but had size 0.
This state was not caught by our ssh-genhostkeys script and that is what
this change attempts to fix.

As before this change, the script starts by calling `sshd -t` to verify
they hostkeys.  Unlike before we now check for 'invalid format' in the
output of that command.  If any file with invalid format is found, we
remove them and regenerate the hostkeys.

In this investigation it was found that the 'ssh-keygen -A' command that
generates hostkeys does not use the directories specified for the given
files in sshd_config, instead it always saves the files to /etc/ssh.

Also, since there is no panic in getting the hostkeys generated we can
allow the script to wait for syslogd to start before we run, even though
it all happens in runlevel S.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-09 10:41:46 +02:00
Joachim Wiberg 6583b1e451 .github: simplify Bob's workflow and don't move latest tag [skip ci]
We only want Bob to run when PR's have been merged to main, this means
when something is pushed to main.  (Took a while to figure this one out
actually.)  See the following community discussion for details:

https://github.com/orgs/community/discussions/26724#discussioncomment-3253102

Also, we've seen that moving the 'latest' tag messes up any push/pull/sync
operation between clones and forks, so let's skip it and see how that works.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-03 13:39:56 +02:00
Richard AlpeandRichard Alpe e11c46dc94 statd: handle IP origin for IPv6 RA
Handle IPv6 Router Advertisement (RA) based addresses.

If the last 64 bits of a link-local address is generated using the
local MAC address of the interface, i.e. a EUI-64 based address. Then
the origin is set to "link-layer".

If the addrgenmode is set to "random" instead of "eui64", then the
device will generate the interface identifier portion of the address
(the last 64 bits) randomly rather than deriving it from the MAC
address using the EUI-64 process. This will result in a "random"
origin.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-10-03 11:13:21 +02:00
Joachim Wiberg d8494e30d2 Add support for setting and fetching IPv4/IPv6 interface MTU
Setting the link MTU in Linux changes the sysctl IPV6 MTU, so we have to
set the IPv6 MTU on each run in case the IPv4 MTU changes.  Hence, this
also means the IPv6 MTU must be set *after* the IPv4 (link) MTU.

statd has been updated to read the sysctl setting for IPv6 MTU.

Notice how the loopback interface is unsupported for config + status.

Fixes issue #151

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-03 10:46:17 +02:00
Joachim Wiberg 1b58114891 configs: update minimal defconfig, add pwgen + python
We should really drop minimal defconfig entirely, see issue #127.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-03 10:46:17 +02:00
Richard AlpeandJoachim Wiberg 7ee49e60a5 .github: use gh result file in separate run cmd
Use the new fancy result-gh.md file which as github emojis. Also,
split result publishing to its own run command to simplify the YAML
file.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-10-02 11:22:47 +02:00
Richard AlpeandJoachim Wiberg ac0ef1d179 Bump 9pm submodule
> 9pm: add new result file with github emojis
> 9pm.py: expose ROOT_PATH to tests via env
> lib_tcl: improve handling of extra ssh args from test
> 9pm: fix evaluation of <base> option in nested suite
> .github: publish test result md in github
> 9pm: resolve <scratch> in suite option

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-10-02 11:22:47 +02:00
Joachim Wiberg a91f8d0e3f Update ChangeLog for v23.09 development release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-10-02 10:35:34 +02:00
Jon-Olov VatnandJoachim Wiberg 5976ecd163 Add deviations for MTU configuration (IPv4/IPv6) in ietf-ip.yang
MTU configuration/status not yet implemented in Infix, thus
deviations added.
2023-10-02 09:40:56 +02:00
Joachim Wiberg 784c175ba3 .github: disable force push in sync
Branch protection rules on forks may cause this action to fail. [skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-26 06:51:10 +02:00
Joachim Wiberg f58a726604 test: Bump docker container 0.6 -> 0.7, now with socat
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-25 19:16:33 +02:00
Joachim Wiberg 400788252f test: bump PyYAML 5.4.1 -> 6.0.1 to fix buid error
Collecting pyyaml==5.4.1 (from -r /root/pip-requirements.txt (line 6))
  Downloading PyYAML-5.4.1.tar.gz (175 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 175.1/175.1 kB 16.2 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [68 lines of output]
      /tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
      !!

              ********************************************************************************
              The license_file parameter is deprecated, use license_files instead.

              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

      !!
        parsed = self.parsers.get(option_name, lambda x: x)(value)
      running egg_info
      writing lib3/PyYAML.egg-info/PKG-INFO
      writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
      writing top-level names to lib3/PyYAML.egg-info/top_level.txt
      Traceback (most recent call last):
        File "/root/.infix-test-venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/root/.infix-test-venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/root/.infix-test-venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 271, in <module>
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 318, in run
          self.find_sources()
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 326, in find_sources
          mm.run()
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 548, in run
          self.add_defaults()
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 586, in add_defaults
          sdist.add_defaults(self)
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/command/sdist.py", line 113, in add_defaults
          super().add_defaults()
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
          self.filelist.extend(build_ext.get_source_files())
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<string>", line 201, in get_source_files
        File "/tmp/pip-build-env-smwadpdr/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
          raise AttributeError(attr)
      AttributeError: cython_sources
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
The command '/bin/sh -c ~/init-venv.sh ~/pip-requirements.txt' returned a non-zero code: 1

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-25 19:16:33 +02:00
Joachim Wiberg 5b5ca862dd test: update Dockerfile to install socat and ssdp[cli]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-25 19:16:29 +02:00
Joachim Wiberg d0f1885ac5 cli: do password encrypt, change default hash, md5 -> sha512
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-25 18:57:10 +02:00
Joachim Wiberg 0d311cc94f test: set 9pm LOG_PATH to create GitHub action summary from last log
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-25 17:58:09 +02:00
Richard AlpeandRichard Alpe c3c1ccc837 statd: split code into multiple files (cosmetic)
Mainly in preparation for upcoming patches for ethtool.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-25 15:27:37 +02:00
Joachim Wiberg 0506b0f364 .github: attempt to fix sync job [skip ci]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-25 14:57:28 +02:00
Joachim Wiberg 590066f454 doc/cli: add missing command [skip ci]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-25 13:53:59 +02:00
Richard AlpeandJoachim Wiberg 484b12611b cli: use infix interfaces types in cli-pretty
Don't use iana-if-type, use infix-if-type.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-25 12:38:33 +02:00
Joachim Wiberg 6bba38bb1c statd: add support for ietf-interfaces/interface/admin-status
Xlate IFF_UP flag to admin-status: up/down.  We do not support any
'testing' mode (yet) in Infix.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-25 10:49:57 +02:00
Jon-Olov VatnandJoachim Wiberg 4cb9f66e0f Doc: Updating IP address assignment examples
Improved "show interfaces" information is now
reflected in IP address examples
- source info added
- IPv6 addresses shown

Also added an example with IPv6 privacy for stateless autoconfig
2023-09-25 08:31:26 +02:00
Joachim Wiberg 2431089e50 Merge branch 'jovatn-jonva/user-guide'
Manually merge PR #137, with minor updates to the YANG deviations, and
complete relocation of the new user-guide.  The idea is to keep all the
documentation generic and use the docgen package later to include all
relevant parts into a PDF user guide.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-22 07:19:12 +02:00
Joachim Wiberg febf6c632d confd: simplify not-supported
- drop origin since targeted at v23.09
 - drop ipv6 temporary address deviations, fixed in #139

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-22 07:18:48 +02:00
Joachim Wiberg 999d83ba8b confd: /if:interfaces-state is deprecated in IETF
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-22 07:18:48 +02:00
Joachim Wiberg 5d664fa055 doc: relocate images to img/
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-22 07:18:48 +02:00
Joachim Wiberg d014bc4b91 doc: expand on data plane setup
- expand on data plane setup
 - adjust headings
 - replace infix-00-00-00 with exmaple

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-22 07:18:48 +02:00
Joachim Wiberg 76341750c0 doc: relocate user-guide/* to .
Like the Developer's Guide the User's Guide should be a single file on
top-level (at least for now), where it references certain sections in
other files.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-22 07:18:48 +02:00
Jon-Olov VatnandJoachim Wiberg 7c69926211 Adding draft doc on IP address configuration (user guide)
Adding it in a dedicted directory for the user guide.
Can be changed, of course.
2023-09-22 07:18:48 +02:00
Jon-Olov VatnandJoachim Wiberg 1bf1f06a21 Updating infix-ip to clarify non-support deviations of ietf-ip
Setting deviations of non-supported parts of ietf-ip

Idea is that "pyang -f tree ietf-ip.yang infix-ip.yang" should
show what we really support (and should make tests for).
2023-09-22 07:18:48 +02:00
Joachim Wiberg 525716e88e Revert ".github: fix sync action pat naming"
This reverts commit ce95488420.
2023-09-21 19:47:56 +02:00
Joachim Wiberg 1b272e994b doc: relocate .svg to doc/img/ and mention loopback in overview
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:53:35 +02:00
Joachim Wiberg 933330cd87 doc: update svg
[skip actions]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:53:35 +02:00
Joachim Wiberg 1197b9de5c doc: proposal for how to document netoworking use-cases/capabilities
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:53:35 +02:00
Joachim Wiberg b0d36ca51d confd: recreate interfaces which do not have permaddr
Only physical interfaces have a permanent link address.  So in order to
restore the default MAC generated by the kernel for interfaces such as
bridges, veth pairs, VLAN interfaces, and link aggregates, we recreate
them.

This patch adds support for checking if the phys-address attribute has
been deleted from bridge, vlan, and veth interfaces.

The netdag_must_del() function has been refactorored slightly so each
interface type is responsible for returning true if its condiitions are
satisfied.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:34:48 +02:00
Joachim Wiberg 9a8251ec66 confd: use 'ip link' instead of ethtool to query permaddr
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:34:48 +02:00
Joachim Wiberg 2f045c73de confd: only warn missing outer-tag if missing from cif
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:34:48 +02:00
Joachim Wiberg 34a89c4909 confd: drop developer debug messages
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:34:48 +02:00
Joachim Wiberg f7e877ebcc test/case: add new test to suite
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:34:48 +02:00
Joachim Wiberg e528fe0e34 test/case: new test, verify custom mac address
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:34:48 +02:00
Joachim Wiberg d3ac2942bb test/infamy: refactor and add iface.get_phys_address()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:34:48 +02:00
Joachim Wiberg 826ea9d2a9 test/infamy: add missing <get-data> RPC to netconf-client
The netconf-client Python lib currently does not support the <get-data>
RPC.  This commit adds a local extension to the Device class which can
be upstreamed at a later time.

Also some added comments and disabling of pylint warnings.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:34:48 +02:00
Joachim Wiberg 15bc21c56b test/infamy: minor refactor and whitespace
- prefix local members with _
 - pylint whitespace
 - pylint unnecessary parens

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:34:48 +02:00
Joachim Wiberg d0bb51e433 confd: add support for setting phy-address on interfaces
- Override read-only flag in YANG model
 - Add support for setting custom MAC
 - Add support for restoring permanent/original MAC

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 16:34:48 +02:00
Joachim WibergandTobias Waldekranz d5f9f1a73e confd: fix IPv6 autoconf support
- Enable privacy feature, allows true random address instead of EUI64
 - Allow global addresses to use router prefix

Fixes #136

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-21 09:05:49 +02:00
Richard AlpeandJoachim Wiberg f2267b98b9 avahi: set proto random for ipv4 Link-Local address
Set the IP origin "random" for avahi IPv4LL addresses. The reason we
use random and not link-layer for link-local IPv4 addresses is the
fact that they are not based on link-layer info, such as IPv6 eui64
generated LL addresses.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-20 11:33:35 +02:00
Richard AlpeandJoachim Wiberg 32511c2b2b avahi: add pristine copy of avahi-autoipd.action
Add a pristine copy of the current version of avahi-autoipd.action.
This script will be modified by us in later commits.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-20 11:33:35 +02:00
Richard AlpeandJoachim Wiberg d00c062c0e cli: print ip origin in detailed interfaces view
Include ip origin when doing "show interfaces name NAME". Both IPv4
and IPv6.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-20 11:33:35 +02:00
Richard AlpeandJoachim Wiberg 411fa38c50 cli: pretty print ipv6 addresses in show interfaces
Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-20 11:33:35 +02:00
Richard AlpeandJoachim Wiberg 4cfe0fa945 test: add ipv6 to bloated.json for cli-pretty
Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-20 11:33:35 +02:00
Richard AlpeandJoachim Wiberg cf0c99bd78 statd: add ipv6 data to operational datastore
Modify existing IPv4 code to also add IPv6 address data to the
operational datastore. Also add support for handling link-layer IPv6
address.

IPv6 LL addresses generated with eui64 has "link-layer" origin
and random/secure generated LL addresses has "random" origin.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-20 11:33:35 +02:00
Richard AlpeandJoachim Wiberg b05d220fa4 statd: break out existing ipv4 code (cosmetic)
A preparation patch for ipv6 support. There's no functional change.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-20 11:33:35 +02:00
Richard AlpeandJoachim Wiberg f69b08ea59 test: add top level unit test suite
This currently includes cli-pretty tests. It could be executed
separately to clarify test results in github actions. This commit
includes it in the main test execution. The most important thing is
that it's executed.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:57:08 +02:00
Richard AlpeandJoachim Wiberg ebdbc1e7ad test: use sh shell in cli pretty test runner (POSIX)
Bash is apparently missing in the Alpine Docker.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:57:08 +02:00
Richard AlpeandJoachim Wiberg 2830080c0f .github: checkout submodules in regression.yml
It doesn't look like the regression suites updates the 9pm submodule,
in this commit we attempt to fix this.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:57:08 +02:00
Richard AlpeandJoachim Wiberg ed2060c2a2 Bump 9pm submodule
> 9pm: print git sha sum in banner
> 9pm: add graceful check for missing suites and tests
> ssh: Spell out the full name of node properties
> ssh: Remove username from debug messages
> Merge pull request #48 from neg/execute-cleanup

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:57:08 +02:00
Richard AlpeandJoachim Wiberg 12d4760156 test: add ip addr origin to bloated.json unit test
Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:56:14 +02:00
Richard AlpeandJoachim Wiberg b4ad2fb3c4 confd: add ip proto when setting static ip
There might be more places in confd where this is needed. This works
for the most basic use case.

The proto set here is picked up by statd and converted into a YANG
origin, which is exposed to the user.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:56:14 +02:00
Richard AlpeandJoachim Wiberg 59c02bd7f3 udhcpc: flush dhcp addresses in default.script
Flush addresses during shutdown and renewal with new address.
This is kind of a hack and needs further testing.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:56:14 +02:00
Richard AlpeandJoachim Wiberg f75053c931 udhcpc: convert default.script to use ip not ifconfig
This fixes one bug in Infix, namely that dhcp removes all other
statically configured addresses. However it introduces a new one
where dhcp renewals with new ip addresses are added as "duplicates",
we fix this in a later commit in this patchset.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:56:14 +02:00
Richard AlpeandJoachim Wiberg 7f89abe1af udhcpc: add pristine copy of default.script
Add a pristine version of default.script to our local board override.
The reason for this commit is to track changes we do to it.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:56:14 +02:00
Richard AlpeandJoachim Wiberg e3a2895531 cli-pretty: print ip address origin (ip route proto)
Print the origin which is based on info from ip route proto.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:56:14 +02:00
Richard AlpeandJoachim Wiberg 6e9ba0fce5 cli-pretty: use self variables for ipv4 address
Cosmetic code cleanup.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:56:14 +02:00
Richard AlpeandJoachim Wiberg 669379818e statd: add operational ip addr origin (proto) data
Add protocol from ip route (kernel) as origin in YANG model.

Note, we control the names static and dhcp in the file rt_addrprotos.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:56:14 +02:00
Richard AlpeandJoachim Wiberg 478a15bc90 statd: break out ipv4 address creation (cosmetic)
This commit is purely cosmetic.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:56:14 +02:00
Richard AlpeandJoachim Wiberg 2c25a1f343 iproute2: add rt_addrprotos file
This file is read by iproute2 and creates valid names for ip proto.

Such as "static" in:
ip addr add dev e0 192.168.1.1/24 proto static

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-19 11:56:14 +02:00
Richard AlpeandJoachim Wiberg d61762dc7a iproute2: add upstream patch for ip protocol
Add a pristine upstream patch which includes protocol info in ip the
ip command.

More info:
https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=bdb8d85
2023-09-19 11:56:14 +02:00
Richard AlpeandJoachim Wiberg 8fc709676f Bump 9pm submodule
> 9pm: add new result markdown file
> Use unique log dir for each 9pm execution
> 9pm: parse 9pm.rc file in harness
> Add new 9pm.py harness examples
> 9pm: add space between timestamp and output
> Move tcl library code to lib_tcl subdirectory
> 9pm: fix TAP skip result when not last in test
> unit_test: allow tap.yaml to be executed from cmdline
> Merge pull request #49 from kernelkit/master

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-12 11:07:01 +02:00
Richard AlpeandJoachim Wiberg ea4a187a1a cli: don't set empty to none in show iface pretty
This allows us to show empty values easier, while not affecting the
if statements.

This allows for a greater flexibility in which values are shown and
not. For example, we want to show empty columns for data that the
user adds/removes, such as IP addresses.

...
ipv4 addresses      :
...

However, we don't want to show empty columns for information that
should never exist for a particular interface type.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-12 08:33:14 +02:00
Richard AlpeandJoachim Wiberg 3000597fbc cli: add statistics to detailed show interface view
Print in and out octets for each interface that has the information
in the operational data store.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-12 08:33:14 +02:00
Richard AlpeandJoachim Wiberg 7b1974c85f cli: print ipv4-address key even if no ip is set
Should make reading easer and make it more obvious if an interface
doesn't have an IP set.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-12 08:33:14 +02:00
Joachim Wiberg c421e14e6c doc: replace 'exec' with '/', CLI fixed as of v23.08
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-10 11:01:23 +02:00
Joachim Wiberg 9f573f6c6f Add CLI example fold-out
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-09 17:59:20 +02:00
Joachim Wiberg c9e84bffd8 Minor spellcheck and update of footnote
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-09 17:53:33 +02:00
Richard AlpeandJoachim Wiberg 3c2b901439 aarch64: add python3 on target (defconfig)
Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-06 16:11:59 +02:00
Richard AlpeandJoachim Wiberg 9e48fb09f6 cli: rewrite interface pretty printer in phyton3
The old version (bash) where slow and cluttered. This version is much
faster and easier to read / maintain.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-06 16:11:59 +02:00
Richard AlpeandJoachim Wiberg 1ea658ad1d test: add new cli-pretty unit test
This test is a "unit" test, which implies that it can be executed
locally without access to a Infix target environment.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-06 16:11:59 +02:00
Richard AlpeandJoachim Wiberg 7b0bd77d16 x86_64: add python3 on target (defconfig)
Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-06 16:11:59 +02:00
Richard AlpeandJoachim Wiberg 5ac24eb29e statd: add parent-interface to operational data
Add ietf-if-extensions:parent-interface which is synonymous with link
in ip-route.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-06 16:11:59 +02:00
Richard AlpeandJoachim Wiberg 48120c9144 statd: add interface bridge to operational datastore
Add bridge master into "infix-interfaces:bridge-port" -> "bridge".

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-09-06 16:11:59 +02:00
Joachim Wiberg ce95488420 .github: fix sync action pat naming
GITHUB_ prefix is reserved.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-05 07:40:17 +02:00
Joachim Wiberg 2bcf0d1f57 doc: add Development section and expand on initial requirements
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-01 16:13:47 +02:00
Joachim Wiberg 2d608f44b1 doc: fix markdown link to Buildroot manual
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-01 16:13:27 +02:00
Joachim Wiberg 94d93260a8 doc: add symlink for default README -> variant.md
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-31 18:02:20 +02:00
Joachim Wiberg c592818587 .github: fix missing release notes from release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-31 17:57:00 +02:00
Joachim Wiberg 8b4f10c21d doc: update ChangeLog for v23.08 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-31 13:23:15 +02:00
Joachim Wiberg 76fe75469d libsrx: fix include, core.h replaced by common.h outside confd
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-31 10:47:08 +02:00
Tobias WaldekranzandJoachim Wiberg a88391afa2 common: nameif: Drop the assumption that any eN interface is a port
The port marker is intended to be used as a hint to the
auto-factory-config generator, so that it can create a bridge for all
switch ports by default. Therefore, revert to only include ports that
devlink reports as "flavour physical".

If we want to test this functionality in QEMU, we can use Rocker, the
virtual switch, instead.
2023-08-30 12:45:51 +02:00
Tobias WaldekranzandJoachim Wiberg 93118b02fe confd: Make physical port detection compatible with Linux 6.1
The old assumption was that only virtual links would have specific
"linkinfo" data. However, somewhere between 5.19 and 6.1, DSA ports
gained the ability to report its "conduit" interface via the
"linkinfo" attribute. That's great, but unfortunately it broke our
heuristic assumptions.

The new assumption is that only physical ports will report a
"parentbus" attribute. Let's see how long that will last :)
2023-08-30 12:45:51 +02:00
Tobias WaldekranzandJoachim Wiberg 4a4733354b kernel: Use Buildroot's default kernel (6.1.y)
Our custom version has gone from being newer than Buildroot's default
to being older, so there is no reason for us override it anymore.

The kernel has become a bit more picky and will give nasty error
messages if a link's PHY connection is not explicitly defined, but
instead relies on implicit defaults. This was missing from the CPU
port of the CRB, so we supply a small patch to fix that.
2023-08-30 12:45:51 +02:00
Joachim WibergandTobias Waldekranz 04e8a87287 package: set foo_REDISTRIBUTE = NO for local packages
When running `make legal-info` Buildroot will collect source and
licenses for all packages, which generates a few warnings for our
local packages.  Local packages are skipped.

> The source code for packages that set <PKG>_REDISTRIBUTE = NO will not
> be saved.  Patches that were applied are also saved, along with a file
> named series that lists the patches in the order they were applied.

Hence, setting 'foo_REDISTRIBUTE = NO' disables the warning, which seems
like a good idea to reduce the number of unnecessary questions we might
otherwise get.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 12:44:57 +02:00
Joachim WibergandTobias Waldekranz ab88c97d45 package/statd: properly declare license and group decls.
Correct license for package is the same as confd and libsrx.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 12:44:57 +02:00
Joachim WibergandTobias Waldekranz 1baeaeddf5 src/statd: licensed under the same license as confd & libsrx
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 12:44:57 +02:00
Joachim WibergandTobias Waldekranz b6baf452bd package/confd: properly declare license and group decls.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 12:44:57 +02:00
Joachim WibergandTobias Waldekranz e3d9236927 test: disable flaky services_basic test
See issue #126 for details.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 8ce3785d26 test/case: increase test time slightly to catch per-20 sec LLDP
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz c07d3e7ec9 Relocate confd-bootstrap.sh to /usr/libexec
Bootstrap and daemon-specific helper scripts, sometimes known as foot
guns, should not be in $PATH.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 31abe00514 test/case: add LLDP to same test
This unfortunately required some restructuring, and as well as extending
the run time since we have no way of sending Ethernet frames currently
in the test framework (socat would be nice).

 - Put enable/disable of services before tcpdump start, LLDP lingers ...
 - Extend run time: 3 -> 20 sec to catch periodic LLDP messages

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 943603b636 test/case: check for both SSDP and mDNS in same test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 3dd5810b59 test/case: new test, verify SSDP can be disabled/enabled
This test use NETCONF to enable/disable SSDP, it then verifies that the
DUT responds to, or does not respond to, SSDP discover messages.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 9075e93524 test: add SsdpClient helper class to probe for end devices
This first version reliles on netcat (nc), mostly because that's what I
could figure out how to run in a netns.  A better way would be to have a
full SsdpClient that can collect query responses properly and log all
devices found.

This, however, will do fine for verifying SSDP on/off functionality.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 9a5c619571 test: add Sniffer helper class, wrapping tcpdump
Monday fixup, audit with @wkz

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 1ff744fd04 test: minor, syntax pep-8
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 27387e5e27 package/skeleton-init-finit: rename SSDP service .conf
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz b31e2e9a74 package/skeleton-init-finit: let SSDP advertise every 30 sec, like LLDP
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz efccd7fbda Enable LLDP agent in factory-config
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 50a550b83f confd: add support for enabling LLDP agent using ieee802-dot1ab-lldp
This patch adds support for enabling LLDP using the std IEEE 802.1ab
LLDP yang model.  An infix-lldp model is as well to reduce the set of
available parameters to a bare minimum (enabled), for now.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz f6cfdfd467 cli: add "end" alias to "up", leave this node/subsection
I'm sorry, I'm just so used to this modus from the previous company.
The difference to 'exit', which is available on Cisco IOS, is that it
on the top-level config context does not exit/abort to admin-exec but
instead stops.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 44987d7045 Fix 120: rename sysrepo-bootstrap -> confd-bootstrap
The script resides with confd and sets up our system for confd, this
should make it easier to rememeber where it's located.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 757428364b patches/tcpdump: add missing drop-verbose-default-output patch
Lost in the big summer merge of 2023

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 445cf92009 patches/netcalc: add missing pipe colorization patch
Lost in the big summer merge of 2023

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz bbf9560d73 Ignore /.backup and /x-* directories
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 9e1e90e87b Enable mDNS/SD and SSDP discovery services in factory-config
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz dba737b975 confd: add support for enabling mDNS/SD and SSDP discovery services
Also, for usability, add `name:<SVC>` to each service declaration so they
can be located more easily and/or enabled/disabled using the service they
provide.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 295cc11a8d confd: flatten hierarchy now that statd has moved out
Fix #115

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz ac011e459b src: minor, add missing dist_doc_DATA incl. LICENSE file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz a38e5582ac Refactor, break out a libsrx from confd, shared with statd
Everything (!) potentially shared with other sysrepo plugins/daemons and
helper functions (not yet in libite) that can be used by other daemons
have been relocated to libsrx.

Fix #116

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Joachim WibergandTobias Waldekranz 72c8aaef0c package/skeleton-init-finit: enable fewer services by default
This patch drops auto-enable of services we want to be able to control
via NETCONF/YANG.  SSDP and mDNS/SD enable/disable configure support,
using native models, will be included in the same PR and LLDP+SNMP may
come later, using std. IEEE/IETF models, they are not critical atm.

Fix #118

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-30 10:37:43 +02:00
Tobias WaldekranzandJoachim Wiberg 2d6c872937 netconf: Ignore internal ifaces (e.g. DSA ports) in factory-config
On some system, certain interfaces are not usable by an end-user. The
canonical example of this is the ethernet MAC connected to a switch,
i.e. the DSA port.

Avoid having these be picked up in the generated factory-config, which
would be confusing to a user, by classifying them as "internal" ports
to be ignored by confd and friends.
2023-08-25 10:51:45 +02:00
Tobias WaldekranzandJoachim Wiberg 319a1bb46b cn9130-crb: Add a workaround for the MMC timeout issue in U-Boot
For some reason, the controller disables the bus power sometime after
it was enabled by the driver. The reference manual says, in Table 645,
about the SD_BUS_POWER bit:

> ... It will be cleared if one of the following occurs: the
> sd_bus_vlt and the voltage support in the Capabilities Register 1 do
> not match or if a card removal state was detected.

Further investigation will be needed to find the (electrical?)
root-cause of this issue.
2023-08-25 10:51:45 +02:00
Tobias WaldekranzandJoachim Wiberg 02ac90b35f cn9130-crb: Upgrade U-Boot to 2023.07.02 2023-08-25 10:51:45 +02:00
Tobias WaldekranzandJoachim Wiberg 06ea1dd80b uboot: Fix inconsistency in naming of the netboot mode
This is referred to "net" in all places except for this script.
2023-08-25 10:51:45 +02:00
Tobias WaldekranzandJoachim Wiberg 246b06b8d5 uboot: When booting from a block device, wait for it to show up
The kernel's mounting of the rootfs may race against the underlying
device being probed - especially for media like MMC cards and USB
sticks.

Therefore, tell the kernel to wait for the root device to show up.
2023-08-25 10:51:45 +02:00
Tobias WaldekranzandJoachim Wiberg 73f991081c post-image: Allow disk images to be built from downloaded release
This is useful when we're only building a bootloader, but we still
want to create a full disk image on the format expected by Infix.
2023-08-25 10:51:45 +02:00
Tobias WaldekranzandJoachim Wiberg c08fe9f522 post-image: Defer RAUC status file generation to disk image creation
In the future we want to build disk images from builds where we
haven't locally built Infix, we've just downloaded an existing
release. In those cases we also have to create rauc.status, even
though we're not creating a bundle.
2023-08-25 10:51:45 +02:00
Tobias WaldekranzandJoachim Wiberg cf05d46548 aarch64: Keep dtb directory structure from kernel tree in /boot
This is the layout expected by the "distro boot" effort in U-Boot.

As far as I understand, the contract is:

- U-Boot built for `fooboard` by `vendor`, will set the `fdtfile`
  variable to `vendor/fooboard.dtb` - or more precisely: matching
  whatever path the dtb is built at in the kernel tree.

- A distro (e.g. Infix) then just needs to specify the `fdtdir` in its
  syslinux config (/boot in our case), and U-Boot will be able to find
  the correct dtb.
2023-08-25 10:51:45 +02:00
Tobias WaldekranzandJoachim Wiberg 308a620b69 common: Improve "traditional FIT" image generation
Make the traditional FITs smaller by:

- Filtering out the kernel image from the rootfs, since the FIT way is
  to ship it separately.

- Gzipping the kernel in the FIT, since aarch64 uses the uncompressed
  "Image" format, and squashfs won't take care of it for us.
2023-08-25 10:51:45 +02:00
Richard AlpeandTobias Waldekranz c6513a37bb cli: add source to show interface (ietf type)
Add source, such as "ethernet" to the show ietf interfaces command.
This is translated from the somewhat obscure ietf type, such as
iana-if-type:ethernetCsmacd => ethernet

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-08-23 14:45:38 +02:00
Richard AlpeandTobias Waldekranz 1112203eb3 cli: merge ipv4 and mac in show interface output
Print both ip and mac in the PROTOCOL/ADDRESS column.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-08-23 14:45:38 +02:00
Richard AlpeandTobias Waldekranz fdf027d282 cli: change header design in show interfaces
Signed-off-by: Richard Alpe <richard@bit42.se>
2023-08-23 14:45:38 +02:00
Richard AlpeandTobias Waldekranz 035397e87f cli: add color to state in show interfaces
Signed-off-by: Richard Alpe <richard@bit42.se>
2023-08-23 14:45:38 +02:00
Richard AlpeandTobias Waldekranz 03f99d7252 cli: autocomplete interface names in show interfaces
And quote the "$name" variable.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-08-23 14:45:38 +02:00
Richard AlpeandTobias Waldekranz 62f0958b65 cli: replace show interfaces with new pretty printer
Replace the old "ip" output with data from the sysrepo operational
datastore. This data is piped through the new json-cfg-pretty script,
which formats the data in a nice human readable way.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-08-23 14:45:38 +02:00
Richard AlpeandTobias Waldekranz 2656f17f58 statd: add operational ipv4 address data
Add IPv4 address info from "ip addr" json to sysrepo operational
datastore.

This patch adds: MTU and ip with prefix-length.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-08-23 14:45:38 +02:00
Jon-Olov VatnandJoachim Wiberg d34908a0e5 Fixing broken urls in document docs 2023-08-22 13:41:09 +02:00
Joachim WibergandTobias Waldekranz 3f3de71a38 Fix #107: auto-sync forks every day 2:42 UTC or on dispatch
Highly experimental.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 13:33:19 +02:00
Joachim WibergandTobias Waldekranz fcb629f08f test: update cases to use new infix-if-types
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 13:32:47 +02:00
Joachim WibergandTobias Waldekranz 3a56cbe1d4 confd: minor janitoring, yang linting
The commit adds a missing description and reorders some yang statements
to meet canonical ordering according to RFC7950, section 14.

It also relocates the /interfaces/interfaces/infix-if:port augment to
its own base model that the bridge (and later lag) models reference.
Solving the bisarre ordering issues we've seen previously.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 13:32:47 +02:00
Joachim WibergandTobias Waldekranz 34fd50d1b8 confd: add deviation for if:type limiting it to supported types
This patch adds a new infix-interface-type, derived from the IANA base
type, allowing us to limit the list of supported native interface types.

Basing on IANA interface type ensure compatibility with other models,
e.g., standard/ieee/published/802.3/ieee802-ethernet-interface.yang,
which attaches itself to all interfaces of type ianaift:ethernetCsmacd.

Tested with yanglint and in Infix using ieee802-ethernet-interface.yang,
the 'ethernet' container was properly attached to interfaces of type
infixift:ethernet.

Tab completion in the CLI now lists only the supported types.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 13:32:47 +02:00
Joachim WibergandTobias Waldekranz 43dd052707 confd: in case of error from aug_save(), log error strings
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 13:32:47 +02:00
Joachim WibergandTobias Waldekranz 782d63e910 board/netconf: fix regex that adds /bin/clish to /etc/shells
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 13:32:47 +02:00
Joachim WibergandTobias Waldekranz 96a2418d19 confd: set fallback shell to /bin/false
This further locks down confd to fall back to /bin/false as login shell
in case of internal errors.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 13:32:47 +02:00
Joachim WibergandTobias Waldekranz 1e74f17a66 Fix #95: lock down and restrict /system/authentication/user/shell
This patch restricts the possible user shells to a subset of the list in
/etc/shells, which is generated by Buildroot.  The default is 'false' to
prevent accidental shell access for non-admin role users.

The default shell for the admin user is now /bin/clish, which can be
further locked down before Infix v24.02 LTS.

In case of internal error the default fallback shell is now set to the
customizable LOGIN_SHELL, which currently is /bin/bash.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 13:32:47 +02:00
Joachim WibergandTobias Waldekranz 7307439bf6 confd: drop old versions of internal yang models
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 13:32:47 +02:00
Joachim WibergandTobias Waldekranz 2d614d4fe1 confd: merge internal yang revisions when inside release cycle
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 13:32:47 +02:00
Joachim WibergandTobias Waldekranz 5f63a4d671 confd: fix lost deviations and timezone enumerations lost in merge
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 13:32:47 +02:00
Joachim WibergandTobias Waldekranz bc048f6313 Drop Hybrid Mode from default builds, update documentation
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-22 10:38:02 +02:00
Ahmed KaricandJoachim Wiberg 2c4b67cbbc test/case: add basic routing test 2023-08-18 14:26:58 +02:00
Joachim WibergandTobias Waldekranz 920a4481b1 .github: simplify contribution guidelines slightly
Also, the file MAINTAINERS has been removed previously.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-17 08:28:33 +02:00
Joachim WibergandTobias Waldekranz 64a6df7b71 .github: add support resource/contact for when reporting issues
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-17 08:28:33 +02:00
Joachim WibergandTobias Waldekranz cad6530949 Drop unused script, PROFINET moved to separate repo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-17 08:28:33 +02:00
Joachim WibergandTobias Waldekranz b1720f7f77 Relocate from top level
No need to clutter up the root directory of the project.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-17 08:28:33 +02:00
Joachim WibergandTobias Waldekranz 58525325b9 Slight redisposition of content
The following changes have been made to condense and simplify the
leading text in the README.  Tested with Grip to verify that the first
paragraph flows nicely to the left to the fine new logo.  This allows
us to use the space more efficiently and the reader does not have to
scroll so long before reaching relevant content.

 - Right-align logo, and shrink it a bit, to fit text to the left
 - Move topic links to a foldout at the top
 - Move boring licensing stuff to separate docment

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-17 08:28:33 +02:00
Tobias Waldekranz 8b8090bd31 doc: Add new Logo (again)
Go for something simple - Tux trapped in an RJ45 jack.

Also, remove the old versions that we don't use any more. They're in
the log if we ever need them.
2023-08-16 13:52:04 +02:00
Joachim WibergandTobias Waldekranz 1dc1a02f0c doc: add syntax highlighting for dot segments
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-16 13:52:04 +02:00
Joachim WibergandTobias Waldekranz 361ba05d8e doc: drop unused documents
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-16 13:52:04 +02:00
Joachim WibergandTobias Waldekranz b480cd76f1 Fix #64: initial Developer's Guide
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-16 13:52:04 +02:00
Joachim WibergandTobias Waldekranz 93db790de6 Untabify
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-16 13:52:04 +02:00
Joachim WibergandTobias Waldekranz d2ccb32871 New logo and split of README in multiple pages
This is a cleanup and reorganization of the Infix documentation.
Starting with a simplification of the top-level README, splitting
it up into several pages.

Also, fixes #100 by updating the documentation on Qemu.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-16 13:52:04 +02:00
Ahmed KaricandTobias Waldekranz 7432ff10aa test/case: add bridge forwarding tests (single-DUT, dual-DUT, VLAN separation) 2023-08-16 13:51:00 +02:00
Ahmed KaricandTobias Waldekranz fc7d212696 test/infamy: add edge type to logical topology (mgmt port selection) 2023-08-16 13:51:00 +02:00
Richard AlpeandJoachim Wiberg 769338515a klish-plugin-infix: fix indentation in infix.xml
Prior to this patch the indentation was a mix of tabs and spaces.
Now use 2 spaces as indentation.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-08-14 16:49:30 +02:00
Joachim WibergandTobias Waldekranz c94733f6bd package/klish: add missing faux dependency
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-14 13:00:09 +02:00
Joachim WibergandTobias Waldekranz 83e5af33ff Fix #86: rename klinfix -> klish-plugin-infix
Also renames all klix_SYM@klinfix to SYM@infix, this is fine since we're
always calling these symbols with @infix.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-14 13:00:09 +02:00
Tobias WaldekranzandJoachim Wiberg f660f6e9c7 qemu: Homogenize network setup
- Always respect the requested model to emulate. Before this change, a
  device configured to run in TAP mode would ignore a user's requested
  model and always emulate a e1000.

  This worked on x86_64 where that driver is part of the kernel, but
  that is not true for aarch64.

- Always supply a mactab. It was very confusing that the interface
  names would change, in Infix, depending on the selected networking
  mode.

- Remove old decoy variables that were assigned but never used
  anywhere.

- Separately setup the host and target side of a nic (i.e. use a
  -netdev/-device pair instead of the -nic shortcut). This lets us
  share the host side setup across all modes.
2023-08-09 19:45:32 +02:00
Tobias WaldekranzandJoachim Wiberg 9e5904936a statd: Add missing dependencies to Config.in 2023-08-09 19:45:32 +02:00
Joachim WibergandTobias Waldekranz 15795c4b41 confd: skip lldpd and avahi hostname reload during bootstrap
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 17ff8677ee board/common: replace default editor, nano -> mg
This reverts an earlier change where nano was made the default editor in
a misguided attemt by yours truly to accomodate beginner users.

With the recent improvements of the CLI and the fact that the NETCONF
support has matured greatly, the need for a user-friendly editor have
diminished drastically.  Editing system files is now limited to devs
and the core team prefers Mg over nano and vi.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 9766bbbed5 doc/cli: update all the topics to match the refreshed CLI functions
Also, add a new `quick.md` that pops up when the user types `help`.
Very quick intro to get started.  Useful when we add a factory-default
motd: "Welcome to the CLI, type 'help' for a quick overview."

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz bfce877525 confd: ensure change_hostname() returns a sysrepo error code
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz d5298d10e8 klinfix: misc. fixes
- Sync sysrepo conf settings, lots of new settings added, one removed
 - Check if help topic exists
 - password encrypt arguments should be optional, add SWITCH
 - show datetime argument should also be optional, add SWITCH
 - Trial, output factory- and startup-config colorized
 - Switch to srp_prompt v2 for configure context

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 0c6d82cf2f package/klish-plugin-sysrepo: bump to latest + new kkit srp_prompt
The upstream help system has improved greatly.  We can now rely more on
it for generating the man-page like help texts for leaf nodes.  There
is also a new srp_prompt symbol that overrides the default klish one,
srp_prompt adds a '%x' format specifier for an inline path instead of
the default [edit foo bar] JunOS style two-liner.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 8d79235436 package/klish: bump to kkit-next, based on latest upstream
Lots of changes upstream for parsing help texts, running as different
user, etc.  Was getting too difficult to backport to tags/3.0.0, so this
resets the clock on top of (almost) the latest.  Experienced issues with
the admin user in configure mode on the latest commits (e4f65d5).

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz fdb2a5a6dc package/faux: bump to latest upstream git hash
This is needed for the bleeding edge klish + klish-plugin-sysrepo, which
the next couple of commits will add.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz e57616fe3a confd: improve DHCPv4 YANG model descriptions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 987ec779d3 klinfix: add new commands uptime, version, and netcalc
Preparing for a "show system-information" as well, which still needs to
be discussed to determine contents.  Some data also still missing, e.g.,
article/serial/product number db.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 883d59709e klinfix: add new commands ping and tcpdump, w/ interface completion
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 10684d200f board/common: use tempfile for sysctl manip and remove when done
Mainly just cleaning up /tmp from stale files.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 032881fbf8 board/netconf: chmod 444 (read-only) generated factory-config
Prevent tampering and unintentional overwrite by users.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz b95a82207d package/klish: switch to kkit branch @kernelkit, new features
This commit switches the klish package to use the kkit branch instead of
keeping a lot of patches from the v3.0.0 release.

Most of the changes made are for dragging tinyrl into the 21st century.
It now supports most of the basic features one have come to expect from
a readline replacement: line navigation, deleting words, erasing entire
line, kill and yank of lines/words and last argument on previous line.

The history has also gotten a bit of a stern talking to.  It no longer
deletes lines matching existing old ones from the history, instead it
just checks if the previous command is repeated.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 07b057c455 board/common: import bash completion for initctl
From upstream Finit@b682a5e

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 1a2d799f82 board: drop disabling of built-in help for bash on NETCONF builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz d4b23eac75 klish: klish-plugin-sysrepo: klinfix: bump for new srp_prompt@sysrepo
This commit changes the JunOS look of the CLI to something more akin to
a standard shell.  To achieve this a %w format specifier to display the
path components is added to both klish and klish-plugin-sysrepo.

Before:
	admin@infix-12-34-56:exec> configure
	[edit]
	admin@infix-12-34-56:configure> ediit interfaces interface eth0
	[edit interfaces interface eth0]
	admin@infix-12-34-56:configure> leave
	admin@infix-12-34-56:exec>

After:
	admin@infix-12-34-56:/> configure
	admin@infix-12-34-56:/config/> edit interfaces interface eth0
	admin@infix-12-34-56:/config/interfaces/interface/eth0/> leave
	admin@infix-12-34-56:/> leave

However, due to unforseen problems with the naming of VIEWs in klish,
the admin-exec level "path" is hard-coded to "/" for now.

Future imporovement: fold in calling prompt@klish from srp_prompt, and
figure out why the "main" VIEW cannot be changed to "exec" without klish
just bailing out starting up.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 63779cfe37 configs: change default TERM from linux to xterm
Turns out one of the reasons some keys did not work as they should in
certain commnands, most notably the Home/End in 'less', was due to the
default TERM variable being set to 'linux'.  Changing to 'xterm' fixes
this issue, works with both console and ssh login, and from testing do
not seem to have any adverse effects on existing functionality.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 63aa130e9c klinfix: restore Ctrl-C to abort current line, use Ctrl-D instead
While spending the past couple of weeks actually trying to use the CLI,
I realized that it was very confusing to have a different behavior for
Ctrl-C than I was used to from regular shells (including the old clish
from $OLDJOB).

This change drops the Ctrl-C binding, restoring break/abort behavior,
and lets Ctrl-D be abort/exit.  Pressing Ctrl-D in a sub-context in
configure calls exit, when in the top-most configure context we now
do an abort and return to admin-exec.

To apply the changes the user still has to type 'commit' or 'leave',
or tap Ctrl-Z as in the Cisco CLI.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz d913ce00e6 doc/cli: relocate and extend CLI docs with intro and keybindings
This is not just for online viewing, these markdown documents are also
made available in the CLI itself from admin-exec as:

    help [introduction | keybindings | tutorial]

With this commit we also add lowdown and the real less application to
be the Infix help system.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 52301db8bd package/lowdown: new package, markdown pretty-printer for terminals
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Tobias Waldekranz 0aae72745f package/klish-plugin-sysrepo: bump and switch to KernelKit mirror
This adds support for the srp_help_text() symbol.  It allows us to
display the full description for a leaf in a YANG model.  This has
been added to the 'help [foo]' configure context command.

A separate admin-exec level 'help' command will be added in a later
commit.  It will only be an intro to the CLI, keybindings, etc.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 3a4097c741 package: switch faux and klish to KernelKit mirrors on GitHub
No need to go fishing every time we build when we have everything we
need in the pond next door.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 142f33e89e patches/klish: restore some common keybindings for line manipulation
This restores some of the original keybindings for line manipulation
that was part of the original CLISH.  They had been disabled upstream
during the UTF8 conversion and never got reimplemented.

From branch kkit on https://github.com/kernelkit/klish, the kkit branch
is based off of the 3.0.0 release.  The same patches are also available
on kkit-next, which is based on the latest upstream master.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 30a28fe874 klinfix: modify show datetime, add optional [iso] flag
By default, output human-friendly RFC2822 format rather than NETCONF:ish
ISO-8601 format.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 697a907350 klinfix: new commands show log [FILE] and follow [FILE]
With completion support.  The log command has an optional last arg,
after FILE, tail NUM, which runs tail -n NUM FILE instead of cat.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 24d9a6dfc6 klinfix: add new commands password [generate | encrypt]
An excellent example of how to define commands with optional subcommands
and optional parameters:

  password encrypt [type <md5 | sha256 | sha512>] [salt STRING] [PASSWORD]

The tricks here are two:

  1. mode="switch" in the top-level password command
  2. min="0" in the encrypt subcommands

The first turns the COMMAND element into a SWITCH element (with command
matching), and the second makes a COMMAND optional.  If an optional
command is input by the user, then the enclosed PARAM is mandatory.

Please note, due to limitations in the mkpasswd¹ utility, spaces are not
supported in PASSWORD, i.e., when read from CLI prompt.  However, spaces
are allowed when using the interactive prompt, i.e., when omitting the
PASSWORD from the CLI prompt.

¹) mkpasswd does not look for any leading ' or " in the password arg.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz a5ad52e5eb package/klish: install default type definitions for klish plugin
The documentation for klish mentions the file ptypes.xml, which defines
the ptype /STRING.  So let's use that instead of defining our own types.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz 682384875c klinfix: add new commands show bridge [fdb | mdb | vlans]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz cd0d12c8c0 klinfix: add new commands show [ip | interfaces] [brief | detailed]
Helper commands for quickly diagnosnig the networking subsystem after
making config changes.  Should over time be replaced with operational
status from sysrepo.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Joachim WibergandTobias Waldekranz de9c255b27 klinfix: add support for libyang
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 16:35:18 +02:00
Richard AlpeandTobias Waldekranz 7e1027488f statd: add interface type to operational data
An iana or infix interface type is derived from "ip link" data.
Such as loopback -> iana-if-type:softwareLoopback.

This patch adds support for the following types:
loopback, ethernetCsmacd, veth, l2vlan and bridge.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-08-08 14:39:50 +02:00
Joachim WibergandTobias Waldekranz 2a37d903b9 board/common: enable CONFIG_FEATURE_CHECK_NAMES for usernames
This commit enables a basic sanity check of usernames in BusyBox that by
default is disabled (!).  The rules enabled by this are:

 - the user or group name should consist only of letters, digits,
   underscores, periods, and dashes¹, and not start with a dash (as
   defined by IEEE Std 1003.1-2001), or periods²

 - for compatibility with Samba machine accounts, $ is supported at the
   end of names

 - max length of user or group name is 256 chars

Changes in this commit also includes a sync with latest BusyBox 1.36,
which adds: tree, tsort, SHA hw acceleration, and a separate script
for udhcpc6.

_____
¹) The documentation actually mentions "and at-signs" as well, but that
   has been explicitly removed from the source code.
²) The documentation does not mention that leading periods are not
   allowed, though this is also explicitly mentioned in the source code.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz fe23781827 package/confd: follow-up to 259239c, drop clean-etc script
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz c100a75abe confd: refactor, reduce code duplication
Factor out a new helper function, change_get_user(), to do the bulk of
the work for the change callbacks.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz e078465d19 confd: add support for specifying login shell for ietf-system users
- Add /bin/clish (symlink) to /etc/shells, as well as the traditional
   /bin/{true,false} for completeness
 - Validate shell string, with fallback to /bin/bash and /bin/sh
 - Step infix-system revision, keeping old model in tree

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz 0585499202 confd: give local callbacks access to the current sysrepo session
Needed when searching for unchanged data, e.g., default values when
creating new users.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz 69fa434b44 confd: call lldpcl and avahi-set-host-name after system bootstrap
Services have not even started up yet, so system() calls will only
unnecessarily delay the boot.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz 4d76da309d confd: minor refactor, dry
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz 3893538e46 cli: add support for editing NACM rules
This patch bumps klish-plugin-sysrepo to get EnableNACM support.  For
this to work as expected for the admin user we also need to change the
permission for the model in sysrepo.

Note: the srp_rollback() symbol has been renamed to srp_reset() upstram.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz 11ba06fddf confd: minor cleanup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz 528ea61302 confd: set up compat authorized_keys symlink for netopeer2-server
Apparently netopeer2-server expects public keys for users to be in the
canonical place (~/.ssh/authorized_keys).  Infix use a custom location
in /var/run, maintained by the ietf-system plugin, which OpenSSH knows
but netopeer2-server doesn't.

It seems to be possible to add some sort of "pattern" to netopeer2 to
indicate where to look for public keys.  This is added when building it
but Buildroot does not expose this as a setting.  So for now, this seem
to be the least intrusive way of handling it.  The owner is root, so a
malicious user cannot change the link or contents without some other
form of privilege escalation first.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz 94908ed33c confd: remove home directory when removing users
No point in leaving unused home directories lingering on the system,
also a potential security problem.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz 5f27f043d1 confd: create users not locked but with password login disabled
Employ the new 'adduser -d' feature where users can be created with
password login disbled instead of creating them locked by default.

This allows us to create remote users that can only access the device
using public key SSH login, which until this point was not possible.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz 7cb68b3a51 patches/busybox: add support for shadow passwords to login applet
The login applet did not know about shadow passwords, and could thus not
determine if a user accont was locked or passwordless.  This caused it
to return 'login: bad salt' instead of "Login incorrect", which is the
more secure path for handling brute force attempts.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Joachim WibergandTobias Waldekranz 7bc14cf07b patches/busybox: add support for adduser -d
The existing 'adduser -D' command adds a locked user account, similar to
the Debian adduser --disabled-login'.  This patch adds support for the
'adduser -d' command, similar to Debian 'adduser --disabled-password',
meaning login is possible but using methods other than password, e.g.,
SSH keys.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-08 14:36:35 +02:00
Richard AlpeandJoachim Wiberg f727653834 statd: add tx/rx counters to iface operational data
Add tx and rx bytes as YANG out-octets and in-octets.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-08-08 06:30:25 +02:00
Tobias WaldekranzandJoachim Wiberg 5236d81819 confd: infix-system-software: Add descriptions 2023-08-07 16:29:59 +02:00
Tobias WaldekranzandJoachim Wiberg c14d506ab1 confd: infix-system-software: Remove unsupported notification node
This would be nice to have, but it is not prioritized at the moment.

Fixes: 4fb0926 ("confd: Add a sysrepo interface to install RAUC bundles")
2023-08-07 16:29:59 +02:00
Tobias WaldekranzandJoachim Wiberg 5978edce94 confd: Explicitly set operstate to up when bringing interfaces up
This ensures that the operstate is defined for all interface
types. Without supplying this, virtual interfaces (e.g. loopback,
dummies, tunnels) will report an "UNKNOWN" operstate. For ports backed
by physical (or virtualized) hardware, this option has no effect.
2023-08-07 15:50:52 +02:00
Joachim WibergandTobias Waldekranz 1afc2adcfc confd,statd: add support for enabling DEBUG log messages at runtime
- add debug flag to trigger DEBUG() statements
 - DEBUG() macro needs 'path' argument

For statd we can add support for an optional '-d' command line option to
trigger, and SIGUSR1 to toggle, debug mode.  TBD for confd which still
remains to be refactored into the same standalone daemon as statd.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-07 00:28:04 +02:00
Joachim WibergandTobias Waldekranz f40e747fbd statd: drop extra \n, not needed
The idea is to 1) map debug/error macros to syslog(), which does not
need \n, and 2) when stdout logging is used, let the macro add a \n.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-07 00:28:04 +02:00
Joachim WibergandTobias Waldekranz db813bd623 klinfix: add CLI support for set datetime 2023-07-03T16:06:34+02:00
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-06 23:58:59 +02:00
Joachim WibergandTobias Waldekranz 6dafda072a klinfix: add klix_rpc() for poweroff and reboot CLI commands
This change allows us to verify common RPC commands from within the
CLI, starting with the poweroff and reboot commands.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-08-06 23:58:59 +02:00
Richard AlpeandJoachim Wiberg a9317901c3 statd: add support for additional operstates
Add support for yang link state "lower-layer-down" and "not-present".

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-08-02 11:11:19 +02:00
Ahmed KaricandJoachim Wiberg 2ff57f865a test/case: upgrade deprecated hash method 2023-07-13 15:41:38 +02:00
Joachim Wiberg 84fda1dd56 test/docker: update instructions on test and upload of new container
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-13 15:13:27 +02:00
Ahmed KaricandJoachim Wiberg b44932c614 "test/docker: add passlib to docker image" 2023-07-13 14:15:41 +02:00
Jon-Olov VatnandJoachim Wiberg 76c09ba3bd Timezone names as enumerated strings defined by IANA
Use timezone names defined in iana-timezones.yang, replacing
the type 'string' in standard ietf-system.yang

This enables CLI (tab complete) and NETCONF clients (dropdown)
to view available timezone strings, and the yang engine to
validate the input.
2023-07-12 08:51:27 +02:00
Jon-Olov VatnandJoachim Wiberg a43bdd94ab Limit username length and pattern in system yang model
Deviation in ietf-system.yang
'replace' username type from general string to a string
with length and pattern restrictions inline with the
BusyBox 'adduser' tool.

Note, chk_sr_user_update is more restrictive, which should
be handled.
2023-07-12 08:51:27 +02:00
Jon-Olov VatnandJoachim Wiberg 5c4982e388 Specify deviations for optional features (ietf-systems.yang)
Declaring deviations for optional features for clarity regaring
extent of support.

New revision and file of infix-systems created, as earlier version
was included in infix-2023.06 release.
Please see infix-systems@2023-04-11 for history.

Support and deviations has not been checked for the included
'sub-yang-module' infix-systems-software, thus there may be
more updates to come.
2023-07-12 08:51:27 +02:00
Ahmed KaricandJoachim Wiberg b0d3976ae0 test/case: Add interface status tests 2023-07-11 18:05:58 +02:00
Jon-Olov VatnandJoachim Wiberg a1a4491d37 Doc: Fixing hybrid-mode FRR example
two fixes
- first a typo (probably copy/paste issue)
- the sleep and 'vtysh -b' was added to make
  vtysh read the /etc/frr/frr.conf file upon start(*)
  sleep needed to make this happen after initctl reload

(*) See https://docs.frrouting.org/en/latest/vtysh.html#integrated-configuration-mode
But there ought to be a better way.
2023-07-06 16:54:22 +02:00
Ahmed KaricandJoachim Wiberg 7b99cdbd16 test/case: Add authentication/user test 2023-07-04 23:08:21 +02:00
Richard AlpeandJoachim Wiberg b3213c6228 statd: break out operational status into new daemon
This patch does two main things:
1) Breaks "statd" free from "confd".
2) Introduces netlink monitoring of interfaces for sysrepo data.

Prior to this patch, sysrepo operation status was handled by code
named "statd" inside "confd". (Where confd is a sysrepo-plugin and
not a real daemon, which its name implies)

In this patch, we break out the interface part of the operational
sysrepo status, previously "statd", into a new daemon, also called
"statd".

The main reason for doing this is to avoid sysrepo threading, which
allows the new "statd" to have control over sysrepo events in the
same event pool as netlink events from the kernel. This in turn allows
statd to subscribe and unsubscribe dynamically to interfaces that
comes and goes during runtime (such as vlans).

It also makes sense that "statd" is in fact a finit daemon.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-07-04 17:43:16 +02:00
Richard AlpeandJoachim Wiberg e26d4663d0 Increase rmem_max size
This allows an application to set a larger socket receive buffer size.
The default size is left unchanged (212992). 1MB is arbitrary chosen.

The main reason for this is to allow netlink kernel sockets to
hold more interface data while user-space is processing it. Typically
useful during main configuration changes where lots of kernel side
changes occur in short period of time, such as VLAN creation.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-07-04 17:43:16 +02:00
Joachim WibergandRichard Alpe 6befbf6a20 package: add missing LICENSE and LICENSE_FILES to packages
For some reason, the `make license-info` target complained klinfix
needed a hash file, but not the other local repos.  Issue #67 tracks
adding license-info to releases, which will need some looking into,
for now this fixes the most glaring packaging oversights.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-04 09:35:47 +02:00
Joachim WibergandRichard Alpe d2f83ef1b3 package: fix LICENSE_FILESS for klish family of packages
The packages have a misspelled license file. Sneaky

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-04 09:35:47 +02:00
Joachim WibergandRichard Alpe ff8cd981e1 .github: simplify expression guards
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-04 09:35:47 +02:00
Joachim WibergandRichard Alpe 259239ce5b package/confd: drop clean-etc script, fix #74
This script has some seriously sharp edges.  Today two devs cut their
fingers on it trying to get new functionality in place.  One when, in a
attempt at, adding an innocent status daemon, and another setting up a
client repository with a custom, enabled-by-default, daemon.  In both
instances this script happily cleaned out the deamons from enabled/.

A better alternative, as described in issue #74, is to be stricter on
what is enabled by default, and for things we feel provide value in the
Classic build, maintain a separate list of symlinks in its meta board
definitiion instead.

Also, clean out previous attempt at factory-config.  Now that we have
the auto-factory support in place we don't need this.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-04 09:35:47 +02:00
Joachim WibergandRichard Alpe 72e388458d board/common: drop sshd.conf symlink, enabled by skeleton-init-finit
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-04 09:35:47 +02:00
Joachim WibergandRichard Alpe 8ab2bdc625 package/querierd: don't enable service by default
In normal use-cases querierd needs a bridge with multicast-snooping
enabled to run.  No point in attempting to start querierd by default.

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

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-04 09:35:47 +02:00
Joachim WibergandRichard Alpe f8666ddeb2 .github: possible fix of Bob's upload
Use same if: syntax for release/upload job as for build job.  Only thing
the upload job needs to ensure is that it does not try to upload built
artifacts from forks or from non-main builds.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-03 13:51:30 +02:00
Joachim WibergandRichard Alpe c8c0350859 .github: fix markdown link to doc/MAINTAINERS
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-03 13:51:30 +02:00
Joachim WibergandRichard Alpe d5c28bc454 package: replace TARGET_FINALIZE_HOOKS with POST_INSTALL
When calling `make foo-rebuild` one expects all the registered hooks in
the foo package to have been called by Buildroot.  The Buildroot manual
has this to say about the target-finalize hook:

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

The correct hook to use for target packages is POST_INSTALL_TARGET_HOOK.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-03 13:51:30 +02:00
Joachim WibergandRichard Alpe de24d0389a package: relocate PROFINET packages to customer repo.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-03 13:51:30 +02:00
Joachim WibergandRichard Alpe 93fe939f91 Fix #72: import up-to-date Debian /etc/services (OSPF, mDNS, etc.)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-03 13:51:30 +02:00
Joachim WibergandTobias Waldekranz 77ef063185 klish: backport hotkey fixes, now Ctrl-D and Ctrl-Z work properly
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-01 14:39:42 +02:00
emihasandJoachim Wiberg 443b9cdf9f test/case: Add ietf_interfaces/ipv4_address.py
Verify that IPv4 addresses can be added and removed.
2023-06-30 18:38:59 +02:00
Tobias WaldekranzandJoachim Wiberg 7cf65f4c56 test/infamy: Support submitting edits containing deletions 2023-06-30 18:38:59 +02:00
Tobias WaldekranzandJoachim Wiberg 5be61a7013 test/case: Add ietf_system/upgrade
Verifies that RAUC bundles can be installed using NETCONF.

We choose to not add this to the "all" suite for now, as the qeneth
topologies do not run with full disk emulation.

To test locally, configure your "make run" instance to use the UEFI
loader, launch `make run`, and then run:

    make INFIX_TESTS=test/case/ietf_system/upgrade.py test-run
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg 4fb09267cf confd: Add a sysrepo interface to install RAUC bundles 2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg 6ca6a4e2f8 confd: Restructure list of source files
We were now at the point where it was completely impossible to see
which files are actually built.

Bring back some order, making future diffs easier to understand.
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg c4a1b2558d rauc: Increase maximum download size to 1 GiB
Default is 8 MiB which is, you know, not alot. Choose a very high
value and let the OS notify RAUC when the disk is full.
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg c4b7b2aa65 rauc: Enable service
The RAUC service exports a D-Bus API that fits well with NETCONF's
notion of RPCs and notifications.
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg f056e20558 rauc: Bundle RAUC status file in disk image
This let's us report the installed software versions, before any
updates have been made. Since the info should _not_ be erased in a
factory reset (since the installed software versions will not change),
move the status file to aux, which is the proper place for this class
of information.
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg 1b85d0c4e0 qemu: Restore 9p host mount support
This broke in the qemu-in-images-dir refactor when the config prefix
changed.
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg 193acaac6b qemu: Declare some missing dependencies in the configuration
- Only U-Boot can deal with the MMC disks at the moment
- Initrd's only make sense when starting QEMU with `-kernel`
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg f572f173da qemu: Refine serial setup
- When running with full disk emulation (via GRUB on x86, or U-Boot on
  aarch64), there's no way for us to influence the commandline passed
  to the kernel, so the console is fixed to ttyS0/AMA0. Therefore,
  reintroduce an option to choose the console.

- Use a fixed `nr`s for virtconsoles, so that the gdbserver always
  listens on `hvc1`. Ideally, we should use udevs `/dev/virtio-ports/*`
  symlinks, but for some reason these point to `/dev/vportXpY` and not
  to `/dev/hvcY`. TODO: Figure out what the difference is.

- While we're here, remove the duplicated RTC setup which was
  introduced with the virtio-console work a while back.
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg b02bba991d netboot: Consistently use /dev/ram0 as the root when ramloading
/dev/ram is accepted by the kernel during boot, but there's no actual
file with this name in /dev, so RAUC will get confused about which
slot is actually one we booted from.
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg 1202edc990 test: Ensure that the local pip environment is setup for test-run* 2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg be7b57412e test/case: Add meta/play
Launches an interactive ipython environment, attached to Infix nodes.
This can be used as a playground for developing tests, testing out
NETCONF operations, etc.
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg 6d6acda35d test/infamy: Patch netconf_client's logging to support IPv6
As an example, when running meta/play, a call to a device's `_debug()`
method will enable logging of all transmitted and received NETCONF
messages, which is very useful during debugging.
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg fd939f65ce test/infamy: Add helpers to access operational state 2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg 6fc131dace test/infamy: Add helpers to call actions and regular RPCs
As with config, the call can be described with a regular python
dictionary. As an example, to reboot the device:

    target.call_dict("ietf-system", { "system-restart": {} })
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg 60beca8820 test/infamy: Ensure that environment always has an ltop attribute
This fixes an issue where attaching to a device in an environment
without a logical topology would trigger an exception.
2023-06-30 15:33:10 +02:00
Tobias WaldekranzandJoachim Wiberg 31760e1c96 sysrepo-plugind: Require all plugins to load without error
If confd or statd fails to initialize, we want Finit to know about it.
2023-06-30 15:33:10 +02:00
Joachim WibergandTobias Waldekranz 772dbe9d64 test: add checklist for howto update the docker iamge
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim WibergandTobias Waldekranz fcf3605e12 test/case: new regression test for IPv4 autoconf
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim WibergandTobias Waldekranz ecdf2a1012 test: add fakeroot to the docker image
We need fakeroot for running tcpdump inside the container.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim WibergandTobias Waldekranz b88348145c confd: fix regression in enabling ipv4 zeroconf address
To reproduce regression, before fix, in CLI from factory-default:

  > configure
  > set interfaces interface e0 ipv4 autoconf enable true
  > leave
  > shell
  $ ps; ip -br a

Turns out, for some reason I cannot figure out, that we cannot use the
same pattern as for ipv6 with lydx_get_descendant().  Manually fetching
the node works though.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim WibergandTobias Waldekranz d6eca354b3 klish: add reboot and poweroff commands, for usability
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim WibergandTobias Waldekranz ecc24d13cb confd: call avahi-set-host-name on hostname changes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim WibergandTobias Waldekranz e4a1261ad8 Fix #57: unneccesary lldpd restarts on configuration change
Instead of restarting lldpd we can call lldpcli to inform lldpd of the change.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim WibergandTobias Waldekranz 6410a96d6d Fix #58: trim interface factory-defaults
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim WibergandTobias Waldekranz c93edfb6a2 board: relocate NETCONF factory-default scripts
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim WibergandTobias Waldekranz 4925636b2a Fix #56: relocate board/common auto-factory.d to board/netconf
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim WibergandTobias Waldekranz 32e8e95088 Fix #60: add replace BusyBox ping with iputils-ping
Among other things, it supports -L when detecting IPv6 neighbors:

    ping -6 -L ff02::1%eth0

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 14:13:09 +02:00
Joachim WibergandTobias Waldekranz b2c77a2457 test/infamy: use factory-default rpc between tests
Instead of relying on startup-config == factory-config we can now set
running-config to factory-config using the factory-default rpc when
we prepare for a new test.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 13:37:12 +02:00
Joachim WibergandTobias Waldekranz 123317ce35 confd: add support for factory-default rpc
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 13:37:12 +02:00
Joachim WibergandTobias Waldekranz 8302ad9735 confd: fix missing RPC OK from system-restart et al
Use new APIs runbg() and run_status() to call 'reboot' or 'poweroff' in
the background.  This allows sysrepo + netopeer to reply to remote RPCs
before networking goes down.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 13:37:12 +02:00
Joachim WibergandTobias Waldekranz 2d453d0025 Fix #46: 'make run-menuconfig' needs buildroot-config/mconf
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 13:37:12 +02:00
Joachim WibergandTobias Waldekranz 0a40014d1b package/finit: backport fix to indefinite stall at reboot/shutdown
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-30 13:35:36 +02:00
Richard AlpeandJoachim Wiberg 9d63aeed61 confd: fix memory leak in lydx_new_path()
Prior to this patch, every new call to lydx_new_path() where "first"
was set to 1 resulted in a memory leak of 72 bytes. Typically at least
once for each sysrepo query.

The memory was allocated deep down in the lyd library, but as the
parent node wasn't set (NULL) it wasn't found by sysrepo when
cleaning up.

In this patch we mitigate this by simply removing the "first" concept,
as it doesn't appear to be needed.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-29 14:47:36 +02:00
Joachim Wiberg 6d536e1b3f Further clarify how to use containers in Infix
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-28 08:57:42 +02:00
Joachim Wiberg 15843f4325 doc/container.md: add Real Example and update Hybrid Mode
Add a real example where we create a writable layer for container based
on a simple image.

To be able to properly start/stop and monitor containers using Finit, we
need to add the options `--systemd=false` and `--conmon-pidfile=...`.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-27 11:55:40 +02:00
Joachim Wiberg a8f14b949c doc/container.md: use correct interface in cni host interface
We usually put the vethNb interfaces in the bridge and the vethNa end in
the appliance/container.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-25 22:47:06 +02:00
Joachim Wiberg 44983a4bd5 doc/cli.md: add diff to veth and bridge sections
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-25 15:27:48 +02:00
Joachim Wiberg cfa220a043 package/podman: log any console output from podman to syslog
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-25 13:11:46 +02:00
Joachim Wiberg 01455a08f8 doc/container.md: use unused host port 222 for container port 22
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-25 13:05:54 +02:00
Joachim Wiberg cc1845d62b doc/container.md: add section on debugging
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-25 12:53:37 +02:00
Joachim Wiberg 43c68de6f1 doc/container.md: update Multiple Networks and Hybrid Mode example
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-25 12:06:45 +02:00
Joachim Wiberg d99445c489 Fix Frr Hybrid Mode example and link to doc/container.md
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-25 12:06:17 +02:00
Joachim Wiberg eed5c2f206 doc/cli.md: update with a toc and help on veth pairs and bridging
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-25 11:56:42 +02:00
Joachim Wiberg 593a0626d1 doc: always lead with an example, put caveats last
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-24 18:42:42 +02:00
Joachim Wiberg 81f2e78984 Minor, spellcheck Buildroot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-24 18:42:24 +02:00
Joachim Wiberg 2057f3dae5 Update ChangeLog for v23.06.0 release
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-23 14:22:13 +02:00
Joachim Wiberg a8271d878d .github: Introducing the Infix Release General
Similar to the standard build workflow, with the following exceptions:

 - Sets internal variable 'ver' to ${GITHUB_REF#refs/tags/v}, for filenames
   and directories, ensuring the leading 'v' in the tag is dropped
 - Sets INFIX_RELEASE variable, for post-image.sh, to '$ver' so it creates
   the .img files with the same name as the tarball and directory. (RELEASE
   clashes with OpenSSL's release handling, breaking builds completely.)
 - Sets release directory + tarball to infix-$variant-$ver, where variant
   is one of "classic" or "" (for NETCONF).
 - *Skips the tests*, for now.  We release from main, which should already
   be tested.  Future releases may run a release test suite here
 - Each build step (matrix) uploads its artifacts, when all build steps
   have completed we start the release job (depends on build), which then
   downloads all the various artifacts before creating the GitHub release
 - The release notes are derived from the file ChangeLog.md.  Please note,
   extraction of the first release notes will fail since there is no prior
   release marker in the file

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 23:16:33 +02:00
Joachim Wiberg 89ea840e74 board/common: append $INFIX_RELEASE to artifact names
This patch affects the various artiact file names in release tarballs.
The files /etc/os-release and /etc/version in the image use the actual
GIT commit (git describe), as per post-build.sh

Guiding principle: artifacts without release suffix are development or
"nightly" builds.  Artifacts *with* release suffix are released ones.

This drops the $GITVER from .img files for consistency with the other
artifacts, e.g. .gns3a and .pkg.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 23:12:10 +02:00
Joachim WibergandTobias Waldekranz f48fdcd211 buildroot: bump to 2023.02.1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 19:16:41 +02:00
Joachim WibergandTobias Waldekranz aea74842e0 test/case: new test, basic bridge vlan filtering
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 13:55:16 +02:00
Joachim WibergandTobias Waldekranz a295086a35 confd: add support for bridge VLAN proto and pvid
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 13:55:16 +02:00
Joachim WibergandTobias Waldekranz c8a3e94501 confd: initial support for bridge native vlan filtering
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 13:55:16 +02:00
Tobias Waldekranz 3784d769ca netopeer: Increase timeout to 60s
Empirical data shows response times of over 10s for even simple config
changes on heavily loaded systems (non-accelerated VMs with lots of
stress on the host). So we choose a really large number, hoping that
we won't be back here for a while.
2023-06-22 00:12:43 +02:00
Joachim WibergandTobias Waldekranz da1bc57b92 confd: prevent sprious errors of symlinks already existing
When/If dagger generations are abandoned we should not bail out if a
recovery generation finds an existing 'order' in the previous gen.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 00:12:43 +02:00
Joachim WibergandTobias Waldekranz 76b7dce7fc confd: ignore other end of veth pairs also when deleting interfaces
Same as with creating veth pairs, we must not try to delete both ends
since the kernel does that for us.  Ensure we check skip in the current
generation and not in the next.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 00:12:43 +02:00
Joachim WibergandTobias Waldekranz 5e5cc8070f confd: skip shebang in dagger action if action already exists
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 00:12:43 +02:00
Joachim WibergandTobias Waldekranz 9ca26a6ef7 confd: clean up error messages and drop developer debug messages
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 00:12:43 +02:00
Joachim WibergandTobias Waldekranz 2994b68e89 confd: follow-up to bridge support, support removing bridge ports
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 00:12:43 +02:00
Joachim WibergandTobias Waldekranz 791a153ebf confd: minor refactor
Relocate and reorder code a bit, preparing for VLAN support.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 00:12:43 +02:00
Joachim WibergandTobias Waldekranz 1c6b06d3ac test/case: minor, fix copy-paste in step description
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 00:12:43 +02:00
Joachim WibergandTobias Waldekranz 2014c470cd test/infamy: reset between test cases using 'copy startup running'
This should copy factory running, instead of using the factory-reset RPC
but for now we use startup since 'factory' is not yet supported as a
copy-from target.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 00:12:43 +02:00
Joachim WibergandTobias Waldekranz 52c2fe1e68 test/infamy: spellcheck
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-22 00:12:43 +02:00
Joachim WibergandTobias Waldekranz 35b4e3296b test/infamy: fix runtime exception handling
File "/home/runner/work/infix/infix/test/infamy/netconf.py", line 116, in put_config
    except self.ncc.RpcError:
           ^^^^^^^^^^^^^^^^^
AttributeError: 'Manager' object has no attribute 'RpcError'

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz d4014816d9 test: fix copy-paste from other test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz e8c3eff52b confd: add support for setting bridge group_fwd_mask
This one was a little bit tricky with the special yang union.  To figure
out the integer value of enums one has to check the schema and deref the
correct subvalue within.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 587f92cbaa test/infamy: attempt to handle RpcError "processing timed out"
While running tests in GitHub action, the following[1] often happens.
From the timestamp it seems unlikely to be casused by timeout, which
from what I can tell is 120 sec in the library and 30 sec on our socket.
This never happens when running locally, so I've added a simple
try-catch to retry the operation, because some[2] jobs actually pass.

2023-06-18 09:18:17 # Traceback (most recent call last):
2023-06-18 09:18:17 #   File "/home/runner/work/infix/infix/test/case/infix_interfaces/dual_bridge.py", line 18, in <module>
2023-06-18 09:18:17 #     target.put_config_dict("ietf-interfaces", {
2023-06-18 09:18:17 #   File "/home/runner/work/infix/infix/test/infamy/netconf.py", line 117, in put_config_dict
2023-06-18 09:18:17 #     return self.put_config(lyd.print_mem("xml", with_siblings=True, pretty=False))
2023-06-18 09:18:17 #            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-06-18 09:18:17 #   File "/home/runner/work/infix/infix/test/infamy/netconf.py", line 112, in put_config
2023-06-18 09:18:17 #     self.ncc.edit_config(xml, default_operation='merge')
2023-06-18 09:18:17 #   File "/root/.infix-test-venv/lib/python3.11/site-packages/netconf_client/ncclient.py", line 277, in edit_config
2023-06-18 09:18:17 #     self._send_rpc(rpc_xml)
2023-06-18 09:18:17 #   File "/root/.infix-test-venv/lib/python3.11/site-packages/netconf_client/ncclient.py", line 223, in _send_rpc
2023-06-18 09:18:17 #     r = f.result(timeout=timeout)
2023-06-18 09:18:17 #         ^^^^^^^^^^^^^^^^^^^^^^^^^
2023-06-18 09:18:17 #   File "/usr/lib/python3.11/concurrent/futures/_base.py", line 456, in result
2023-06-18 09:18:17 #     return self.__get_result()
2023-06-18 09:18:17 #            ^^^^^^^^^^^^^^^^^^^
2023-06-18 09:18:17 #   File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
2023-06-18 09:18:17 #     raise self._exception
2023-06-18 09:18:17 # netconf_client.error.RpcError: EV ORIGIN: "rpc" ID 5 processing timed out.
2023-06-18 09:18:17 #

[1]: https://github.com/kernelkit/infix/actions/runs/5302735753/jobs/9597878647
[2]. https://github.com/kernelkit/infix/actions/runs/5302735946/jobs/9597878838

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz c832a906fd test/case: split bridge-basic test in three
A basic test should be just that, very basic test of a feature.  So we
split out the more advanced ones, building up to the dual-bridge.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 16be0e9db5 test/infamy: use merge operation with edit-config
Unsure if this is right, but existing nework test does not send loopback
or other interfaces in the networking configuration, so maybe merge?

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 4d122eb49b .github: prevent multiple reggies from running from the same branch
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 09055f64ea .github: start bob on push to main
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz c4f16e788d .github: upload resulting Infix image(s) even if tests fail
Add support for uploading resulting image(s) from a job even though the
tests may have failed.   This way we can inspect the image and see what
went wrong, or if it was a glitch in the matrix^W^Wazure.

Retain a symlink to images/ for test step.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 1d3b9e9e0f patches/sysrepo: add support for sysrepoctl -Cfactory -d running
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 812ee32029 test: add basic pc --> bridge-veth-bridge test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 7555e18996 confd: allow wheel group (admin) to access datastore locally
The admin account is the superuser in Infix.  The root account will soon
only be for running system daemons.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz c00ff6daf5 confd: bootstrap sysrepo+netopeer yang models with factory defaults
To set up proper factory defaults in Infix we need to drop the default
/etc/sysrepo datastores, initialized at compile-time by Buildroot when
installing netopeer2.  The pre-initialized datastores cannot be set up
with new {factory} data in any other way.

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

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

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

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

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

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

Some sanity checks and debug possibilities:

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

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz f19939e405 buildroot: backport sysrepo factory-default init support
Backport upstream sysrepo support for initializing internal modules,
like ietf-netconf-acm, with factory-default data.

A local KernelKit patch on top is required for run-time loading from
/etc/sysrepo/factory-default.json instead of the upsream compile-time
support.

Renamed existing patches to maintain the proper patch order.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 003eedeab8 confd: IP addresses must not be set, or be deleted, when not enabled
The ietf-ip yang model has a global IPv4 and IPv6 'enabled' setting that
must be honored.  E.g., when setting eth0 as a bridge port and disabling
IPv4 address on eth0, we must flush all addresses, including autoconf.
When detaching interface from the bridge and toggling the 'enabled' node
back on, we only get a "replaced" flag for that node, so we must restore
all addresses from the configure data.  The same goes for 'autoconf'.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz d71a3b3db6 confd: add support for "replace" operation
When toggling settings like 'interfaces/interface/ipv6/enabled', which
guards both link-local and all static addresses, the operation is not
"create" or "delete", but "replace".  Callback must take any "replace"
on an 'enabled' node into account since none of the other nodes will
be available in the diff.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 5be4a629f3 confd: add errno codes for out-of-range prio and missing current gen
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 352a1f1f64 confd: refactor, make lydx_is_enabled() available to all modules
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 86304e2656 confd: rudimentary support for Linux bridges
Very limited, only TPMR-style bridge, no VLAN filtering support yet.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 1b7d72a07c confd: add support for veth pairs, incl. new native YANG models
This change adds support for Linux veth pairs and is also a bit of a
cleanup of our native yang models, more on that below.  The interesting
things are the use of submodule(s) for veth, and the addition of the
deviation for the deprecated /if:interfaces-state.

Unfortunately the `fprintf(ip, "link add dev %s down", ifname);` had to
be delagated from netdag_gen_afspec_add() because of this change.  This
because we only know very late that the peer-end of the pair should be
skipped.  Having a lingering `ip link add dev foo down` causes iproute2
to fail hard.

A note about Yang models.  According to RFC they must follow the naming
standard; 'org-name' and use prefixes 'org-shortname'.  So we've decided
to standardize on 'infix-modulename' and 'infix-mn', where 'modulename'
is the standard model we extend, and 'mn' is the prefix used by that
standard model.  For example

 - infix-interfaces extend ietf-interfaces and use infix-if
 - infix-if-veth is a submodule extending infix with veth pairs

Upcoming bridge and lag models follow the same pattern.  The use of
submodules require a patch to sysrepo, included earlier, and allows
us to have the same 'infix-if:', or 'infix-interfaecs:' prefix to
all ietf-interfaces extensions.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 7c17793e5a confd: add support for bookkeeping "skip" interfaces
When setting up veth pairs we only need to set up one end of the pair,
so the confd callback code need a way to remember to skip setting up
the peer interface.

The code added here is generic enough to handle other such transactions.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 491239f99c confd: backport fexistf() from latest libite master
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 50a02e1690 confd: add support for changes in more deeply nested nodes
With the coming support for veth pairs, bridge, and link aggregates, we
need to infer peer interfaces (veth), and similar more deeply nested
data nodes to aid the user.  Thereforce we can no longer rely on the
xpath in the callbacks to always be "interfaces/interface[name='ifnm']".

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz f6e64a52ac confd: minor fixes
- initialize stack variables to prevent undefined behavior
 - memory leak

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 28d07c6255 confd: new function, srx_set_str(), complements srx_set_item()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 6f27e51700 confd: refactor srx_require_module(), patched upstream now works
This changeset includes a patch to the upstream sysrepo that is a slight
refactor of the internal function sr_install_modules_prepare_mod() that
is used by sr_install_module2().  Meaning, the srx_require_module() can
now be simplified greatly and we now also support the include statement
with submodules in yang models.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Joachim WibergandTobias Waldekranz 8462fe4ab6 confd: refactor ietf-system augments and deviations
Initial yang model cleanup:

 - Use infix-foo@rev.yang for augments and deviations of each std-foo model
 - Drop kernelkit-infix-deviations, moved to infix-system model

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-20 11:11:52 +02:00
Jon-Olov VatnandJoachim Wiberg aa372c247e Fixing typos is Infix discovery doc.
Ready for review.

Note for future: Add picture on Infix as Network Infrastructure
equipment in Windows Explorer (SSDP section)
2023-06-16 16:21:14 +02:00
Jon-Olov VatnandJoachim Wiberg ede1f59479 Minor changes to Infix discovery doc 2023-06-16 16:21:14 +02:00
Jon-Olov VatnandJoachim Wiberg 14712fdc91 Add info on Infix discovery services and possibilities 2023-06-16 16:21:14 +02:00
Tobias WaldekranzandJoachim Wiberg 77f9ca8e2a doc/testing: Add an overview of the test system 2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg 4e69f800de test/case: Add meta/wait to wait for nodes to boot up
When running in the cloud, without KVM emulation, together with many
other tenants, it can take a very long time to boot the instances.

Therefore, add a meta test that will wait for all devices in the
physical topology to come up before exiting. This means that the
actual test cases that follow can assume that devices will answer
NETCONF requests.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg aa8e11a58b test/infamy: Create an infamy specific topology object
Create topology objects that are tailored to represent topologies on
the expected format. This let's us make convenient accessors for
things like the controller node, infix devices, getting the ports used
to reach a certain device from another one, etc.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg 175f7e1c58 x86_64: Make the test environment more customizable
- Collect all test related targets under the test- prefix.

- Add target to run test suite against a `make run` instance. The
  intended use-case is that you are testing out a new build with `make
  run`, and then realize that you want to run some tests.  With this
  change, it is now possible to run `make infix-run-check` from a
  separate terminal - which attaches to the running instance and runs
  the tests.

- Provide -sh targets to spawn interactive environments, which is
  useful during debugging.

- Allow the user to supply a custom suite or list of tests to be run
  by 9PM.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg d75ecf3a1e test/env: Improve usage message 2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg c35553b20a test/env: Allow KVM to be explicitly disabled in the container
This let's us check for timing issues in tests that arise when falling
back to TCG acceleration in QEMU.

While we're here, add a proper option to see the usage message.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg d5b5cffa3b test/env: Provide a wrapper for qeneth to the running topology
With this change, when running an interactive test session, a plain
`qeneth status` will show the status for the network started by
test/env.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg bc3933ad92 test/env: Accept an explicit topology in place of a qeneth network
For now, this is only expected to be used with `-C`, i.e. not in a
containerized environment.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg c76233f5ba test/docker: Add debug tools to container
busybox-extras contains an implementation of telnet, which is needed
for `qeneth console` to work. While we're updating, add tcpdump since
we'll need it sooner or later.
2023-06-14 17:40:16 +02:00
Tobias WaldekranzandJoachim Wiberg 7eb2269972 test/infamy: Fix incorrect call when bailing out of MACVLAN creation
We're calling the bound instance of __exit__, so `self` is
superfluous.
2023-06-14 17:40:16 +02:00
Richard AlpeandJoachim Wiberg 723c325b0d statd: add limited operational data for all ifaces
Add oper-status and if-index data to sysrepo for every existing
interface. The origin of the data is the "standard" ip tool with
JSON output.

Current implementation is limited to interfaces existing at startup.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-13 16:39:53 +02:00
Richard AlpeandJoachim Wiberg 75155b72b3 confd: move helper.c to lib
Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-13 16:39:53 +02:00
Joachim Wiberg 9e5cf13522 test: debug gh action
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg 6c9735a783 .github: shorten job title
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg 3afd84fb1a board: minimal builds provide qeneth compatible .img
Minimal builds should probably trigger use of another template in
Infamy, but for now we use this.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg 0da9606644 test: infamy: raise exception if dut mgmt ip cannot be found
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg 4582b3446c .github: drop this job from regular branches and run after merge
We want Reggie to take most of the hits, then we sail in and build after
the PR has been merged so we can upload new "Nightly" images.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg 72c5e18f5c .github: add dedicated regression job for all actions and branches
- Keep build times low, use minimal defconfig and a single arch
 - Focus on the regression testing
 - Allow running on all branches for all users

Goal: when tests pass, reviews can start, if review is good, then merge

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg a4c3d7367b configs: add x86_64_minimal_defconfig
The idea for this is to maintain a smallest-possible type build that can
be used to run regression tests in GitHub Actions.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Joachim Wiberg c34981cc9f board/common: allow image signing to be optional
Primarily intended for minimal/testing images, but likely also useful
for other use-cases as well.

Defaults remain to sign all images.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-09 11:54:23 +02:00
Tobias WaldekranzandJoachim Wiberg d28b17bdef .github: Run the test suite as part of the CI on x86_64-netconf 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 225395f749 x86_64: Add convenience target to run the test suite
Once infix has been built, the test suite can now be run by issuing:

    make infix-check
2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg f26bd54336 test: Add a 9PM compatible test suite to run all tests 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 0f76b07625 test: Introduce a standardized test environment 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg d81ca8fcd1 test: Add qeneth topology for running tests in VMs 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 3c0afcdc08 test: Add ietf_interfaces/vlan_ping
Verify that we can communicate with an infix device over a stacked
VLAN interface.
2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg d82da157b6 test: Add ietf_system/hostname 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 0fc720d48a test/infamy: Initial add of python based test library 2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 9bead2fca4 qemu: Generate graphviz description of instance
This will be used to run tests against a `make run` instance.
2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg b3e6325c76 9pm: Generic test anything protocol (TAP) runner and expect wizard
The plan is to leverage this for Infix's internal test suite.
2023-06-08 11:10:31 +02:00
Tobias WaldekranzandJoachim Wiberg 60d2b1f105 test: Remove 9pm console lab
Hopefully we won't have to go down the dark path of console parsing,
but if we do, it's good to have this example in the log.
2023-06-08 11:10:31 +02:00
Richard AlpeandJoachim Wiberg 382f428edf confd: add new statd skeleton for operational status
Add a new "statd" module to sysrepo. This module is intended to handle
operational status, i.e. R/O attributes.

In this state, the statd module only retrieves and answers to the
"oper-state" of "eth0". This will be replaced by proper interface
handling and json data processing in upcoming patches. The indent here
is to get the base logistics in place as soon as possible to make life
easier for developers.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-07 13:24:23 +02:00
Richard AlpeandJoachim Wiberg 26391d5381 confd: move srx_module to src/lib
Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-07 13:24:23 +02:00
Richard AlpeandJoachim Wiberg 84822390ff confd: move lyx source to new src lib directory
Preparation for statd.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-07 13:24:23 +02:00
Tobias Waldekranz f6a7fe5353 qemu: Allow qemu.sh to be run from any directory
Since qemu.sh is now tied to the directory it's ran from, it makes
sense to change into that directory before starting to resolve any
file paths. This let's us start the script from any directory without
the need for any (cd && qemu) subshell.
2023-06-05 14:07:02 +02:00
Joachim WibergandTobias Waldekranz fd9d3a2723 board: minor shellsheck fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-05 14:07:02 +02:00
Joachim WibergandTobias Waldekranz f8d5c3a9b8 Drop Infix Qemu support from "make menuconfig"
This change drops Qemu menuconfig from the regular 'make menuconfig' in
favor of full release tarball support.  Meaning "make update-defconfig"
will not longer cause unwanted diffs for Qemu defaults checked in when
the defconfigs are updated.

Details:

 - For "make run, run-menuconfig" and bootstrapping qemu.cfg we want to
   use the Buildroot menuconfig system. However, we must set the proper
   environment variables for it to not overwrite our product's .config,
   so the calls to conf and mconf are not pretty.

 - The qemu.sh script can probably be cleaned up further, I've just set
   a CONFIG_ prefix to all variables and dropped any images/ prefix vs.
   the original.  The CONFIG_ prefix is to make the qemu.cfg compatible
   with kconfig-mconf from the kconfig-frontends package.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-05 14:07:02 +02:00
Joachim WibergandTobias Waldekranz 816cf5c370 qemu: add stand-alone menuconfig support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-05 14:07:02 +02:00
Joachim WibergandTobias Waldekranz 93701ae2ef qemu: export Qemu start script in release tarball
First basic step, we also want a menuconfig-like way of changing the
settings, e.g., networking options.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-05 14:07:02 +02:00
Richard AlpeandTobias Waldekranz 4fa89651a7 confd: move src into confd subdirectory
This patch is a preparation for the upcoming "statd" addition.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-06-05 13:21:01 +02:00
Joachim WibergandTobias Waldekranz 19df588fe4 package/querierd: bump to version 0.10
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-02 18:19:50 +02:00
Joachim Wiberg 646364a6e0 doc: update README and add doc/cli.md
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-02 15:38:40 +02:00
Joachim Wiberg e6ef11a023 configs: fix string syntax, i.e., s/""/"/g
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-02 14:32:49 +02:00
Joachim WibergandTobias Waldekranz c81bc445ca confd: simplify, yang model ensures iftype (+ ifname) is always set
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-01 15:16:39 +02:00
Tobias Waldekranz d82e586687 confd: Infer VLAN parameters for the common <BASE>.<VID> pattern
When adding a new interface to the candidate, if the name matches
<BASE>.<VID>, infer that:

- The parent-interface is <BASE>
- The tag-type is c-vlan
- The vlan-id is <VID>

With this in place, from klish, the following sequence:

configure
set interfaces interface e0.10
leave

Will create a stacked VLAN interface, using VID 10, on top of e0.
2023-06-01 15:16:39 +02:00
Tobias Waldekranz a09a1b922f confd: Generalize VLAN support to arbitrary virtual interfaces
- Make sure that when we need to delete an interface, this is done in
  the exit phase of the generation we're exiting, i.e. it is treated
  as a regular delete.

- When we need to delete and rebuild an interface, make sure that all
  settings and addresses are applied again.  This is done by swapping
  out the diff for the configured data, which we just annotate with
  enough metadata to make it look like a diff.

- Create a dagger dependency from the VLAN to it's parent interface.
  This ensures that the parent interface is properly configured before
  the VLAN is created, which is important when virtual interfaces are
  stacked on top of each other. E.g. a VLAN on top of another VLAN.

- Recreate the VLAN when the parent is changed.

- Fix VLAN tag-type parsing
2023-06-01 15:16:39 +02:00
Tobias Waldekranz 361c0d7827 confd: Move interface deletion logic to its own function
Let's try to keep netdag_gen_iface from becoming do_everything().
2023-06-01 15:16:39 +02:00
Tobias Waldekranz 82aa842cd2 confd: srx: Add helper to query the number of items matching a path
This is useful in candidate inference scenarios where you only want
to infer settings that don't have explicit values set.
2023-06-01 15:16:39 +02:00
Tobias Waldekranz 258ba272c7 confd: lyx: Allow diffs of NULL nodes
This makes the pattern

    if (lydx_get_diff(lydx_get_child(diffnode, "attribute"), &nd)) {
        /* Handle changes to "attribute" */
    }

safe to use in the common case where "attribute" has not been
modified, and is therefore not present in `diffnode`.
2023-06-01 15:16:39 +02:00
Tobias Waldekranz 092db20a80 confd: Avoid duplicate nodes in fetched config data
It is not clear why, but the former XPATH will return a tree with many
duplicate nodes in it, while the latter will not.
2023-06-01 15:16:39 +02:00
Tobias Waldekranz a9c5fccd47 dagger: Keep abandoned generations around for debugging
When evolving to a new generation fails, users will typically abandon
it (so that a new attempt can be made).  However, the generated
scripts and the logged output is very valuable from a debugging
perspective.

Therefore, keep the data around by just renaming the generation
directory.

Later, we can include these directories in the garbage collecting
process, if we want to.
2023-06-01 15:16:39 +02:00
Tobias Waldekranz af298a0a05 qemu: Create a gdbserver to UNIX socket bridge
Infix ships with a gdbserver configuration that listens on
/dev/hvc1. Connect this to gdbserver.sock on the host, so that we can
attach to or run Infix processes using GDB.
2023-06-01 15:16:39 +02:00
Joachim WibergandTobias Waldekranz ba382e1af5 src/confd: fix copy-paste check of alloca() return value
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-01 15:16:39 +02:00
Joachim WibergandTobias Waldekranz 37397543fa src/confd: drop developer debug messages
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-01 15:16:39 +02:00
Joachim WibergandTobias Waldekranz ee73ed3410 src/confd: add support for VLAN sub-interfaces
This adds support for VLAN sub-interfaces on physical interfaces, e.g.,
eth0.10 on eth0.  There are no restrictions or sanity checks other than
what is defined in the YANG models.

Neither the ietf-if-extensions or the ietf-if-vlan-encapsulation model
have been ratified as standards and are thus experimental.  As such, the
ietf-if-vlan-encapsulation model originally references a non-existing
revision of ieee802-dot1q-types, which has been modified to use the
latest release from IEEE.

How to set up, notice we do not use the l2vlan type:

  interface eth0.10 {
    type ethSubInterface;
    encapsulation {
      dot1q-vlan {
        outer-tag {
          tag-type s-vlan;
          vlan-id 10;
        }
      }
    }
    parent-interface eth0;
    ipv6 {
      autoconf {
        create-global-addresses true;
      }
    }
  }

Unfortunately, we have to create the VLAN interface on a separate line
since adding VLAN interfaces does not allow setting addrgenmode at the
same time, hence the introduction of the new line `link set %s down`.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-01 15:16:39 +02:00
Joachim WibergandTobias Waldekranz c2fc658734 board/common: relocate and drop unused files from NETCONF build
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-01 08:23:36 +02:00
Joachim WibergandTobias Waldekranz d449279661 configs: trim default build, drop unused packages
These packages are not (yet) used in the NETCONF build, only make sense
in the Classic Infix builds.  SMCRoute will be needed later on, but not
right now, so also remove.

The dhcpcd package is only used by ifupdown-ng in Classic, in NETCONF we
use avahi-autoipd and udhcpc.

iproute2 is selected by the net tool, so collapsed by menuconfig.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-06-01 08:23:36 +02:00
Joachim WibergandGitHub 4ad676bb4e .github: also run when PR is merged
https://stackoverflow.com/a/61565445/1708249
2023-05-30 09:00:59 +02:00
Joachim WibergandTobias Waldekranz 8ffe839a99 src/confd: add support for ietf-system user authorized-key(s)
- Keys stored in system specific directory /var/run/sshd/$USER.keys
 - Keys are regenerated on each corresponding reconfiguration event
 - Deletion of key(s) or user remove all keys

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-28 23:31:18 +02:00
Joachim WibergandTobias Waldekranz e7bc7d76e8 src/confd: always run initctl in batch mode
Also, quiet output from cond get.  We're only using the exit code.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-28 23:31:18 +02:00
Joachim WibergandTobias Waldekranz 838a83e5b3 src/confd: fix review issue 'cannot disable dhcp client'
- Flip 'enabled' logic, if attribute is missing => 'enabled: false'
 - Release lease on udhcpc exit
 - Call initctl with -f (force) when deleting dhcp-$iface.conf otherwise
   in interactive mode, waiting for (y/N)? question
 - Also, always use -batch and -quiet modes with initctl

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-26 15:10:26 +02:00
Joachim WibergandTobias Waldekranz 6c8d5472d5 src/confd: finalize initial DHCPv4 with optional client-id support
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-26 15:10:26 +02:00
Joachim WibergandTobias Waldekranz f2cb63df72 src/confd: initial support for DHCPv4 yang model
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-26 15:10:26 +02:00
Joachim WibergandTobias Waldekranz 0e48a847b9 buildroot: bump libyang, sysrepo, and netopeer2 to latest versions
Changes to netopeer2-server required refactoring our foreground patch.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-26 15:10:26 +02:00
Joachim WibergandTobias Waldekranz b319a2df9d src/confd: refactor commit done hook into a pre and post hook
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-26 15:10:26 +02:00
Joachim WibergandTobias Waldekranz ebc87eb0a0 src/confd: refactor handling of callbacks for SR_DS_CANDIDATE
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-26 15:10:26 +02:00
Tobias WaldekranzandJoachim Wiberg 3424985b2b netconf: Allow IPv6 connections by default in factory-config
By default, netopeer2 will accept connections from
INADDR_ANY (0.0.0.0), which limits it to IPv4. Open it up to include
IPv6 as well.
2023-05-25 16:34:50 +02:00
Tobias WaldekranzandJoachim Wiberg cd52a42388 netconf: Inject NACM config for admin user in factory-config
On May 10, 2023, @troglobit wrote:
> Initial proposal for factory-config, based on example from RFC8341.

This gives the admin user the ability to configure the device over
NETCONF.
2023-05-25 16:34:50 +02:00
Tobias Waldekranz 3dbc59120f confd: srx: Duplicate entire tree in srx_get_diff
Use the _siblings variant to ensure that the full diff tree is
duplicated. Otherwise, the caller would only see the first branch of
changes.
2023-05-25 11:45:10 +02:00
Richard AlpeandJoachim Wiberg 6adb508f37 confd: add new factory user admin:admin
This patch adds a new user "admin" with the password "admin". The
password is hashed with sha512 ($6) as a hint to new users attempting
to change the password (avoid the weakest algorithms).

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-05-25 08:24:31 +02:00
Richard AlpeandJoachim Wiberg f56ca0d0ca confd: fix json merging when generating factory config
jq -s 'add' didn't merge data, i.e.:

hostname.json:
"ietf-system:system": {
  "hostname": { }
}

auth.json:
"ietf-system:system": {
  "authentication": { }
}

Didn't become:
"ietf-system:system": {
  "authentication": { }
  "hostname": { }
}

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-05-25 08:24:31 +02:00
Joachim Wiberg d4333e1a8d src/confd: fix ietf-interfaces copy-paste bug in netdat_init()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-23 11:20:09 +02:00
Joachim WibergandTobias Waldekranz 96fb836635 Add disclaimer about Frr and podman in Hybrid Mode section
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-23 08:52:16 +02:00
Joachim WibergandTobias Waldekranz 4c15897c6a Fix #29: drop FRR from default builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-23 08:52:16 +02:00
Joachim WibergandTobias Waldekranz 9844f0e148 configs: enable CA certificates package for all defconfigs
Provided a little time, all an embedded system really needs is trust.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-23 08:52:16 +02:00
Joachim WibergandTobias Waldekranz 0a99f1a5f6 board/common: drop factory/reset user
Initial analysis of system default users gives that there is no real
need for a default 'factory' user to trigger a factory reset.  On an
actual physical device we will have a reset button or a menu option in
the bootloader to trigger factory reset, and in both physical and
virtual (GNS3) devices a logged in admin user can call the factory
command.

A virtual device that cannot be logged in to will have to be removed and
have its persistent backing store deleted, but that is the only real
downside to removing this user.  The idea is to set a kernel command
line flag from the bootloader, and that could also be done from, e.g.,
GNS3.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-23 08:51:37 +02:00
Joachim WibergandTobias Waldekranz 08ad4e9bc6 Fix #24: disable bridge firewalling by default in Infix
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-23 08:48:47 +02:00
Joachim WibergandTobias Waldekranz d8b24e16de doc: new document, Containers in Infix (with podman & CNI)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Joachim WibergandTobias Waldekranz 8addf469bf package/podman: add tool to create CNI profiles
Currently only supports creating host-device profiles, e.g. from veth
pairs or physical interfaces.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Joachim WibergandTobias Waldekranz 679d64d496 Update Hybrid Mode with podman example to start Docker containers
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Joachim WibergandTobias Waldekranz 56677fb1d6 package/podman: helper script to create supervised Finit service
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Joachim WibergandTobias Waldekranz b3761d84dc board: update kernel defconfigs for running containers (podman)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Joachim WibergandTobias Waldekranz 852f1ed4c4 board/common: bind mount /var and /var/lib
The /var, and particularly /var/lib, directories are used for persistent
storage for various system daemons.  While adding support for containers
it became clear we had to change how we make these directories writable.
Both LXC and Podman use OverlayFS for the writable layer, and you cannot
set up an overlay on top of another overlay.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Joachim WibergandTobias Waldekranz bd696cba9a qemu: add support for optional /var disk (256M)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Joachim WibergandTobias Waldekranz 468b49e916 buildroot: bump to v2023.02.1 w/ kkit patches
- package/libyang: Bump version to 2.1.55
 - package/netopeer2: Bump version to 2.1.59
 - package/sysrepo: Bump version to 2.2.60
 - package/cni-plugins: partial backport to enable missing plugins

The libite v2.5.3 backport has been dropped from the kkit patches
since it's been merged in upstream Buildroot LTS branch.

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

Based on work by Christian Stewart and Nathaniel Husted.

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

Based on work by Christian Stewart and Nathaniel Husted.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-21 20:39:12 +02:00
Richard AlpeandJoachim Wiberg 08a3f51e8f test: add functional example of how to test CLI auth
This test is based on the 9pm framework, which supports execution
of test-cases written in any language. This test is written in
tcl/expect with help from the 9pm expect library. It's what I used to
test during development of the Infix basic authentication support.

The aim of this patch is to serve as an example of how the
interactiveness of the 9pm-expect library can be used.

9pm framework code is here:
https://github.com/rical/9pm

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-05-16 13:34:28 +02:00
Joachim Wiberg 8aed30552f package/finit: bump for Finit v4.4 (GA)
Full release notes: https://github.com/troglobit/finit/releases/tag/4.4

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

Follow-up to f5866ee

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-15 18:45:37 +02:00
Joachim Wiberg 50963a7883 src/confd: fix regression in ietf-system:motd and ietf-system:clock
The writesf() API was hard coded to always open files in "r+" mode,
which fails if the file doesn't exist.

Add a mode option to writesf() and writedf().

Also, drop the default motd, we don't have one in NETCONF mode.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-15 16:05:08 +02:00
Joachim Wiberg 23dc3fcb4f qemu: change console to hvc0, ensure TTY is saved and restored
This change drops -nographic in favor of the more flexible virtconsole,
fixing the problem with loss of terminal history and reset.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-15 16:05:08 +02:00
Joachim Wiberg 480d870587 src/confd: harmonize ietf-system, rename infix-system.yang augment
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-15 16:05:08 +02:00
Joachim Wiberg f5866ee3d4 Add support for admin/admin to manage Infix as group 'wheel'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-15 12:53:32 +02:00
Tobias WaldekranzandJoachim Wiberg 304e65e298 confd: ietf-interfaces: Handle attribute deletions properly
When deleting a value, the old value is in nd.val, so use the absence
of a new value to catch deletions.
2023-05-15 12:17:10 +02:00
Tobias WaldekranzandJoachim Wiberg 9d5a1d893c confd: lyx: Return the modified-from-default value from the diff
I.e. return the answer to the question "has this attributes changed
from the last config generation?" Which is always what we want to know
anyway.
2023-05-15 12:17:10 +02:00
Tobias WaldekranzandJoachim Wiberg 7491c280ac confd: Reload finit after the exit phase, if services are disabled
Bringing down the current generation is a step of its own, so it makes
sense to let finit clear out all old services before setting up the
new ones.

For example, with avahi-autoipd, without this step, we would run the
following sequence when disabling it on an interface:

initctl disable zeroconf@iface
ip link set dev iface down
ip link set dev iface up
initctl reload

But we really want to stop the zeroconf service before the down/up
cycle on the interface, since that is likely to disrupt the
daemon. With this additional step, the sequence becomes:

initctl disable zeroconf@iface
initctl reload
ip link set dev iface down
ip link set dev iface up
initctl reload

Which means that finit won't try to restart zeroconf if it dies during
the down/up cycle, since the service is already gone at that point.
2023-05-15 12:17:10 +02:00
Tobias WaldekranzandJoachim Wiberg 5b261cff2d dagger: Add pre and post hooks for actions
The special directories @pre and @post will always have their scripts
ran before and after, respectively, the rest of the DAG.
2023-05-15 12:17:10 +02:00
Joachim Wiberg b2191d0c20 package/finit: bump for 4.4-rc2 + kill process group fix
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-14 09:37:49 +02:00
Joachim WibergandTobias Waldekranz 3b3cadd72d src/confd: simplify after review comments from wkz
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-12 15:58:20 +02:00
Joachim WibergandTobias Waldekranz c98a99df58 src/confd: use global hook also for core_startup_save()
Saving running to startup follows the same pattern as config update of
candidate to running, so we must employ the same hook mechanism here.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-12 15:58:20 +02:00
Joachim WibergandTobias Waldekranz 688e196347 src/confd: consistent whitespace
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-12 15:58:20 +02:00
Joachim WibergandTobias Waldekranz 36f38d6198 src/confd: global event hook support
Refactor register_change() wrapper, for sr_module_change_subscribe(),
with an additional twist of setting up a commit DONE event catcher.

This creates a global event hook that ensures we call 'initctl reload'
after all module callbacks have completed, regardless of the xpath and
without having to have "shadow" subscriptions to all new modules being
added to confd.

Based on on ideas from https://github.com/sysrepo/sysrepo/issues/2188

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-12 15:58:20 +02:00
Tobias WaldekranzandJoachim Wiberg 580bcf5115 confd: Support controlling IP forwarding on interfaces 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg a1183780d1 sysctl: Disable forwarding by default on netconf builds
This matches the defaults in ietf-ip.
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 0d09c4e16a confd: Use regular errnos internally when generation iface config
This:
1. Makes the code more familiar and easy to read
2. Let's us output more precise error messages
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg a07910f51f confd: Simplify code with the lyx diff helpers 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg fa311c699b sysctl: Keep static IPv6 addresses on downed interfaces 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 32f6f22b47 common: Use IPv4/6 default configuration on all interfaces
The comment in the script has the story.
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg c2042bb036 confd: ietf-interfaces: Add IPv4/6 autoconf support 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 82d11112a6 avahi-autoipd: Default to always assigning a LL address
Without --force-bind, the address is removed if another routable
address is added to the interface.

While this is likely something that should be configurable in the
future, we choose this mode as the default so that IPs used for
NETCONF connections are not dropped because other addresses are added.
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 5e23b2ac79 confd: dagger: Explicitly choose order for init/exit actions
Dagger's builtin fallback to bottom-up works for init, but exit should
run top-down.
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 580c5b06b9 confd: lyx: Add helpers to classify the modification of a node 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg cc15adb774 confd: Move from net-do to dagger for managing config generations 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 3342270e18 dagger: Directed Acyclic Graph Generational Execution Runner
A generic replacement for src/net with some advantages:

- Shell script is well-suited to these kinds of tasks, making this
  implementation much simpler.

- Allow arbitrary number of actions (not just init/exit), this can be
  used to implement things like `dagger exec up/down`.

- Allow arbitrary number of scripts for each action/node tuple. This
  will let us handle more complex scenarios in confd without having to
  fiddle about with src/net.
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 8df758dac0 confd: Add support for static IPv4/6 address configuration 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 88c845bc16 confd: Disable support for non-contiguous netmasks
Not something we need, and keeping it disabled has some nice symmetry
effects on the handling of ipv4/6 addresses.
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 3192a69970 confd: ietf-interfaces: Initial work on net-do implementation 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg a5b4c04d08 confd: Add helper to get the diff being applied as a libyang tree 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 6e39b3dbf6 confd: Add helpers to find attributes belonging to a lyd_node
This avoids awkward XPath lookups when the structure of the lyd is
known.
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 35ec76b0ef confd: Add helpers to read files containing a single number 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 751b22f4db confd: Avoid futile attempts to reload finit's config during boot
finit is not ready to accept the messages anyway, so we end up waiting
for the 2s timeout (2 times). Since finit won't setup a utmp entry
until it leaves runlevel S, we use that as the sync point for when
finit is ready to receive reloads.
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 3ae4e1d9ca confd: Use printf attribute on relevant helpers
This let's the compiler catch format-specifier-to-argument mismatches.
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 31d5dbda8c confd: Split out libyang extensions to separate file 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg a79c6ec06c confd: Remove temporary interface configuration
This will be replaced by the "net do" implementation
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 03e44dd5b1 confd: Dynamically generate factory-config
This allows you to define a single "logical" config that can be
tailored to the specific system based on the available interfaces,
base MAC address etc.
2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg 80d9312e36 confd: Infer type when configuring physical interfaces 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg ed41b621d9 confd: Fix -Wformat-security warning 2023-05-12 14:24:41 +02:00
Tobias WaldekranzandJoachim Wiberg f40841e5e7 confd: Consistently use srx_require_modules
This allows confd to start without errors when modules are already
loaded.
2023-05-12 14:24:41 +02:00
Richard AlpeandJoachim Wiberg def761b067 src/confd: add basic user authentication support
This patch introduces basic user authentication support via sysrepo.

Namely it adds:
* The ability to create or delete a UNIX user.
* The ability to set or delete a UNIX user password.

The password needs to be hashed and in a UNIX shadow format, such as
"$ALG$SALT$HASH". We want to avoid the handling of clear text
passwords as much as possible. In the meanwhile, passwords
can be generated in the infix shell using mkpasswd.

CLI Examples:

Add a user:
configure> set system authentication user foo

Delete a user:
configure> delete system authentication user foo

Set a user password:
configure> set system authentication user foo password ...

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-05-10 09:50:53 +02:00
Richard AlpeandJoachim Wiberg 53ad138854 sys/confd: expose systemv functions in new header
Expose systemv() and systemv_silent() to confd code that includes
core.h or systemv.h explicitly.

Signed-off-by: Richard Alpe <richard@bit42.se>
2023-05-10 09:50:53 +02:00
Joachim Wiberg e7e22c4a13 package/finit: bump for fixes to 'initctl enable' regression
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-05 06:04:45 +02:00
Joachim Wiberg 28f8f36cca Enable runparts support at bootstrap for hybrid systems
This commit enables support for running custom startup scripts at boot,
allowing a mix of a NETCONF-based system and Classic /etc.  For example,
use NETCONF to set up network interfaces, users, etc. and runparts for
enabling and configuring the device as an OSPF router.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-05 06:04:45 +02:00
Henrik NordstromandJoachim Wiberg 7db1581b21 linux aarch64: Enable CPU_THERMAL 2023-05-02 10:52:43 +02:00
Joachim Wiberg f19d1fc06f package/skeleton-init-finit: take "new" runlevel 0 into account
Some critical services must never be stopped, and with the unfortunate
separation of runlevel S and 0 in Finit recently, all affected service
definitions must be updated.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-05-02 00:00:04 +02:00
Joachim Wiberg 941a2d85aa src/confd: system() replacement without /bin/sh intermediary
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-30 19:49:27 +02:00
Joachim Wiberg 60fa170bee board/common: for consistency, preserve x86_64 even in filenames
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-29 12:47:30 +02:00
Joachim Wiberg d69109305c .github: store symlinks as files
For each build there is an infix-$ARCH-$VARIANT.img -> rootfs.squash
that we want to be a real file when extracting it.  This to ease the
integration with testing frameworks like Qeneth.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-29 12:18:38 +02:00
Joachim Wiberg da014804a6 patches/lldpd: allow group wheel to use lldpctl
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-28 20:40:20 +02:00
Joachim Wiberg 6d96b218ca board/classic: generate interfaces.d, set hostname from qemu_fw_cfg
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-28 19:43:06 +02:00
Joachim Wiberg 806a0293a5 board/common: allow /bin/bash as login shell (BusyBox symlink)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-28 19:00:51 +02:00
Joachim Wiberg 5e15d85ff9 board/common: artifact naming overhaul
With the introduction of the -classic defconfigs we need to also make
sure to name the resulting artifacts accordingly:

 - infix-$ARCH.{gns3a,img,pkg}
 - infix-$ARCH-classic.{gns3a,img,pkg}

For release builds the version (-23.02-$REV) will be appended before
the file suffix, e.g., infix-x86-64-classic-23.02-3.img

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-28 18:18:16 +02:00
Joachim Wiberg 42dbc1feee configs: follow-up to 5d7e6bd, path to grub-embed.cfg has changed
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-28 11:47:56 +02:00
Joachim WibergandTobias Waldekranz daa67f94c1 board/netconf: add missing (empty) rootfs overlay
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz ff7faada00 .github: fix .ccache caching
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz f515d8e737 .github: update to bild all platform::variant defconfigs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 5b02ab80e9 configs: add aarch64_classic_defconfig, same as x86_64_classic
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 2272b56618 board/common: let Bash update its PS1 hostname for each new line
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 05d49f6cfc src/confd: set NETCONF specific motd as default
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 8158d3bffb Simplify and refine NETCONF and Classic build variants
- board/common: drop everything not needed by NETCONF mode
 - board/classic: most board/common helpers relocated here
 - Simplify Finit scripts for critical services
 - Source variant from /etc/os-release to select ramdisk /etc

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 5d7e6bd693 Rename amd64 -> x86_64 and native -> classic
A long standing internal debate comes to its logical conclusion.  Arch
naming should follow GCC.  The "native /etc" has also found a better
name: classic!

README and GitHub action has been updated accordingly.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz de85e4e4e0 configs: netconf build requires 512 MiB RAM and we want 10 ifaces
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 3caaada051 board/common: add menuconfig support for GNS3 RAM and num. of ifaces
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz ce10e4b734 board/common: add missing $DISK_IMAGE_SIZE to mkdisk.sh
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 291bfaeff0 board/common: fix system timezone in "show system-information" command
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 9462499d51 configs: split defconfigs in default (NETCONF) and simplificed (native)
- Drop unused packages in NETCONF (default) mode
   In the default build we will use the net tool instead of iupdown-ng,
   p-net & Profeth will move to customer-specifc builds with another
   licensing model.
 - Split out NETCONF specific parts from board/common to board/netconf

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 3cea71a11f configs/amd64_minimal_defconfig: simplified basic Linux build
This build is intended as a base reference and for use as a very simple
end device.  The default starts DHCP and IPv4LL (ZeroConf) on eth0, but
can be configured by editing /etc/network/interfaces.d/*

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

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

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

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 461599e502 src/confd: hackish w/a to get 'initctl reload' for ietf-interfaces
This is very ugly, what we really want is that the commit_done_hook()
runs when *all* DONE events have been processed in all models.  The
side-effect of this hack is that the callback is run twice, both for
ietf-systm and ietf-interfaces if both are modified.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 8b9504ffa5 src/confd: augment ietf-ip with an 'autoconf' setting also for IPv4
This patch adds a first Infix model to augment ietf-ip with a node,
similar to the IPv6 'autoconf' node, also for IPv4.  For IPv6 the
autoconf feature comes built-in, for IPv4 it is defined in RFC3927.

The setting behaves the same as for IPv6, but in the case of IPv4 we
enable avahi-autoipd per interface to acquire the 169.254/16 address.

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

    $ initctl enable zeroconf@eth0

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 78c12d66fe patches/klish: allow all users of group 'wheel' to connect to klishd
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Joachim WibergandTobias Waldekranz 33d1b9cfc5 board/common: drop clicon + www-data users, add default admin user
The root user is by default not allowed to log in over SSH, so we add an
admin user with limited root privileges for this purpose.

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

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-27 09:59:35 +02:00
Tobias WaldekranzandJoachim Wiberg dcf3c5fe97 confd: Infer the interface type for common patterns
When a new interface is create, but the type is not specified, try to
infer the type from the interface name.
2023-04-21 19:03:15 +02:00
Tobias WaldekranzandJoachim Wiberg 54200eaba9 confd: Add wrapper for sr_set_item
This allows the xpath to be built using format string.
2023-04-21 19:03:15 +02:00
Tobias WaldekranzandJoachim Wiberg 2259e108e4 confd: Rename srx_set_item -> lydx_new_path
Since this function wraps lyd_new_path.

This allows us to write a wrapper for sr_set_item, using the expected
name.
2023-04-21 19:03:15 +02:00
Tobias WaldekranzandJoachim Wiberg 69d6bc6942 confd: Fix some build warnings 2023-04-21 19:03:15 +02:00
Tobias WaldekranzandJoachim Wiberg 62e4a733d0 confd: Honor CFLAGS coming in from configure
This makes it easy to create unoptimized debug builds, for example.
2023-04-21 19:03:15 +02:00
Tobias WaldekranzandJoachim Wiberg 7afc650bcf confd: Fix use of uninitialized value 2023-04-21 19:03:15 +02:00
Tobias WaldekranzandJoachim Wiberg 9969987347 confd: Skip extraneous calls to sr_unsubscribe
core.c will always take care of this if any initialization fails.
2023-04-21 19:03:15 +02:00
Joachim WibergandTobias Waldekranz 81c7939a0d src/net: update docs with new admin-state control file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz dd96583ce2 package/net: depends also on iproute2
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz cd00a3d2be package/net: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 8a73c31f91 package/confd: update package dependencies
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 64804bee5d src/net: add missing deps when moving between generations
The init_next_gen() function moves us to the next generation, as well as
intialize all data files for expected interfaces in that generation.

However, bridge and lag interfaces have dependendcies that need to be
moved as well.  It is only the test author that knows the expected new
state, so this function only sets up the desired state, without ever
looking at what any previous generation looked like.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 1c99e92312 src/net: finalize bridge-lag.sh test, add step remove; vlan1 and br0
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 3edd4c7dff src/net: let init_next_gen init new generation with ifaces
The (optional) interface list represent the expected state in the new
generation.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz c99b5c659a src/net: add test to verify moving port from lag to bridge
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 61c5724da7 src/net: update basic bridge test with new create_bridge() API
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz afb82a52e4 src/net: test; factor out state file creation from create_iface()
With more advanced interface types we cannot use create_iface() to set
up the file structure in new generations.  This commit adds a _data()
function that should be used instead.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 19ed88ac9e src/net: silence noisy "skipping" debug logs for missing scripts
Not really needed unless you're doing changes to the net tool itself.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 9aeb35c73b src/net: rename helper fn create_ng -> init_next_gen
This function is responsible for initializing the necessary files for
the next net generation.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 4c7813f996 src/net: new test, advanced bridge with lag and a top VLAN interface
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 7945207989 src/net: fix interface creation/attach order in generation generator
The net tool traverses the graph and executes the scripts et al in
postorder, i.e., all leaves are evaluated first before the parent's
script is run.  Hence, attaching ports to a bridge or link aggregate
is the responsibility of the parent, not the leaves.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 45c6b704f9 src/net: must close each pipe before exectuing the next pipe action
For instance, when adding ip command to the ip pipe we need the kernel
to execute those commands before the bridge command pipe is executed.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 2de8ff052d src/net: factor out pipe identification and debug each piped command
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz e6834c5db6 src/net: new test, basic bridge
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz a26dd9c19f src/net: install tests to target /usr/share/net
Host tools and target are often out of sync, sometimes because we need
to run a newer version of iproute2 with more features.  By installing
tests to target we can still verify basic functionality, provided the
tests verify their dependencies and exit 77 (SKIP).

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz f84b4803d9 src/net: fix bugs in 'net up|down' uncovered by first test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 48fba80baf src/net: finalize first test, three indep ifaces in two generations
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 6b3eaa05e5 src/net: refactor test into lib.sh and <test>.sh
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz f180bcae24 src/net: convert to GNU Configure & Build system
- Simplify build process, including cross compilation
 - Add basic test framework, available as `make check`

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz da56f8d653 src/net: first automated test case, run with unshare
Run with unshare, as so:

    make clean; make; cd test/
    unshare -mrun ./three-independent.sh

This sets up a test directory in /tmp/net, creates three independtent
interface configs for dummy interfaces.  Activates the config with a
call to `net -vd apply`, and then verifies the result using a mix of
ip link/addr and jq magic.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 0f337a4b13 src/net: increased debugging of basics
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz ad1c3fb777 src/net: 'do' is a reserved keyword in shell scripts add 'apply' too
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 0ec3448858 src/net: refactor, reuse existing linked list also for 'do' command
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 997e536081 src/net: add support for acting as a multicall binary (ifup/ifdown)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 75a1b231da src/net: add commands; do, up/down with optional ifname(s)
Calling net prevsiouly meant `net do`, the new separation is to be able
to add `net up` and `net down` commands, with optional interface args.

The idea is to support the same semantics as `ifup -a` of `ifup foo`.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 32db1fe3d0 src/net: refactor filtering of forbidden names
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz f2472d6474 src/net: minor cleanup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz a80a8eeee5 src/net: fix bug in savedep(), trashed interface path argument
This caused the critical run() function to run action scripts properly.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 9a895dcd47 src/net: fix bug in test, lag0 remains a dep for br0 even in gen 1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 6eb6324477 src/net: rename action scripts as per review
Naming the actions after their executing entity, e.g., foo.sh when it is
executed by /bin/sh, is a tried and true paradigm.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 47c3448774 src/net: calculate and run teardown in reverse dependency order
When taking down a network setup, it needs to be deconstructed using the
foo.exit rules of the previous generation, and in reverse dependency
order.

This patch adds support for generating the deps when bringing up the
network setup, and saving an rdeps file in that generation, which can
be used later when moving leafs between nodes.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz 0f7d931541 src/net: new test, also drop lo and use same interfaces as in figure
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Joachim WibergandTobias Waldekranz a2fbc9e2f8 src/net: ovarhaul script naming ip-link.up/ip-addr.up -> ip.init etc
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-20 21:14:54 +02:00
Tobias WaldekranzandJoachim Wiberg 09751fdd96 x86_64: Harmonize GRUB's behavior with that of U-Boot
This means that:

- The full boot order is now respected, using the magic "fallback"
  varible in GRUB. This means that if an entry fails to load, we move
  on to the next one in the defined order.

- Netbooting is supported. In this mode, GRUB will acquire an IP
  address using DHCP, after which it downloads an image using TFTP.

- If we run out of valid entries, we always make sure to reboot. This
  ensures that, e.g., a temporary TFTP server outage does not cause an
  Infix device to get stuck in GRUB.

At the moment, the image handling is excruciatingly inefficient when
netbooting, as the image is downloaded multiple times behind the
scenes. Ideally, downloads would be cached, but a quick investigation
indicates that an implementation of this would take more time than we
can spare at the moment. Therefore, we settle for the working, though
wasteful, implementation.
2023-04-19 10:47:54 +02:00
Joachim Wiberg b7058b2d6c board/common: enable ipv4 and ipv6 global forwarding flag by default
The per-interface and per-af setting in the ietf-ip yang module allow
the user to enable a more granular forwarding between interfaces, which
is disabled by default.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 23cf9df856 Follow-up to 7e089ee: convert to kernel modules, use /etc/modprobe.d
Instead of having to rely on the kernel command line, we convert all the
kernel functionality in question into modules and rely on the auto-load
feature in the kernel and modprobe to add options at load time.

The fb_tunnels setting is a net core setting, for that we use sysctl.

This commit also syncs the kernel config between our two main archs,
disabling DRM and SOUND for the Amd64 build as a spin-off.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg dfda11f9ce Follow-up to 025a877, import new iana-if-type version
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 15010acc3a src/confd: set default loopback addresses
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 4f09f2b51e src/confd: refactor, simplify ietf-system:system-state
We now have our own srx_set_item() that hides a lot of the complexity.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 5bc7dd443f qemu: disable bond0, dummy0, sit0, erspan0, etc. fallback interfaces
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg a8227a3ab9 src/confd: standardize on 'fail:' as cleanup label on failure
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 4fe6a2aba7 src/confd: initial operational data support for ietf-interfaces
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 5fe77fdbee src/confd: add missing free() of data from lyd_print_mem()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 34d8cf2fdb src/confd: add missing calls to release context in ieft-system
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg a061242119 src/confd: minor refactor, add convenience macro REGISTER_OPER()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg f080ebd341 src/confd: add support for ipv6 in ietf-interfaces
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 36d4e1b92b src/confd: refactor srx_val.c to use sr_get_items() to silence log
Calling sr_get_time() for an xpath that has no data causes sysrepo to
always log the access as an error.  With sr_get_items() it is left to
the callee to determine if the missing data should cause an error.

This patch is a refactor that silences the syslog message and also
fixes one or tow memory leaks.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg fdb8e56461 src/confd: fix invalid xpath, 'enabled' not available per address
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg abe8ecb3d3 src/confd: fix invalid use of fopenf() in write*f() wrappers
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg dabfe7bc20 src/confd: drop developer debug messages
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 2e73d643ed src/confd: add support for ietf-ip:ipv4/forwarding
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg a7306d0c06 src/confd: refactor, add first file function helper: writesf()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 8296f75893 src/confd: optionally use netmask instead of prefix-length
Some users still prefer the old netmask style to set up an interface.
This patch enables the corresponding model feature and checks for a
netmask only if prefix-length is unset.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg ac0b0d520f src/confd: refactor srx_get_bool() to create srx_enabled()
All value functions, except the new srx_enabled(), now return clear
error indication, with the value as a separate argument.

The srx_enabled() predicate function is for cases where the default
value is disabled and code checks enable a subsystem or flag.  I.e.,
when an error can safely be returned as 'false'.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 63bc767593 src/confd: refactor sr_get_int() into a generic srx_get_int()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 9882309adf src/confd: rename sr_ext.[ch] -> srx_module.[ch]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg eaedae4ccb src/confd: draft ietf-interfaces prototype to set static IP address
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg ce5ff75c9c src/confd: refactor sr_get_bool() into srx_get_bool()
Note: new API, srx_get_bool() returns -1 on error, leaving 0 and 1 as
false and true, respectively.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 4654e169a5 src/confd: replace local run() function with systemf() from libite
It started its life as a copy of systemf() anyway, time to clean up.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg c838977f91 src/confd: unlock -lite API, e.g. fopenf(), systemf(), etc.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg f28a19c9ea src/confd: minor, rename local var for consistency
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 12f72c5e5f src/confd: refactor helper fns to new namespace
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg ede544257f src/confd: add missing header
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg cfba783f1c src/confd: minor, drop trailing / from YANG_PATH_
Prevent // in new srx_require_module() when composing module PATH.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 6ff3d15b0b src/confd: add SPDX license identifier to new files
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg c74f76cdee src/confd: minor, use more common fmt rather than frmt
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Joachim Wiberg 6a73a3fcc2 src/confd: minor, fix iana-if-type revision
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-17 14:09:24 +02:00
Tobias WaldekranzandJoachim Wiberg 1bd66003ae confd: if: Ensure that the required modules are loaded 2023-04-17 14:09:24 +02:00
Tobias WaldekranzandJoachim Wiberg a7fcdc8f4a confd: Add helper to ensure that required modules are loaded
Unfortunately, sysrepo considers it an error to load a module that is
already loaded, ruling out using `sr_install_modules`.

Therefore, provide `require_modules` instead, which ensures that a
given set of modules are loaded, or loads them otherwise.
2023-04-17 14:09:24 +02:00
Tobias WaldekranzandJoachim Wiberg db804eb9d0 confd: Allow usage of asprintf 2023-04-17 14:09:24 +02:00
Joachim WibergandTobias Waldekranz 95a4b43091 configs: drop currently unused packages to save build time + size
Things we really want later, but don't use right now:

 - MRP
 - MSTP

Neat to have in a networking product, but not used at all by us atm:

 - ttyd
 - tmux

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 12:22:29 +02:00
Joachim WibergandTobias Waldekranz 3217722c36 Update, Clixon has been replaced by sysrepo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 12:22:29 +02:00
Joachim WibergandTobias Waldekranz 4e4b6f2a7b package/{ifupdown2,python-templating}: drop unused packages, replaced by ifupdown-ng
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 12:22:29 +02:00
Joachim WibergandTobias Waldekranz 4d835ff808 package/{sysrepo*,umgmt}: drop unused packages, replaced by confd
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 12:22:29 +02:00
Joachim WibergandTobias Waldekranz 73892ea6f0 package/cli*: drop cligen and clixon after migration to sysrepo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 12:22:29 +02:00
Joachim WibergandTobias Waldekranz 41b17fc64d package/mech: drop, unused after migration to sysrepo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 12:22:29 +02:00
Joachim WibergandTobias Waldekranz e9757ac3ef .github: run action on approved PR or if started manually
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 11:12:09 +02:00
Joachim WibergandTobias Waldekranz 1ebdf05371 .github: only allow upload of latest build from main repo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-13 11:12:09 +02:00
Tobias Waldekranz f2aaf4a558 Merge branch 'sysrepo' 2023-04-13 10:21:23 +02:00
Tobias Waldekranz e9c4bafb4c confd: Treat all build warnings as errors
We exclude unused parameters, since many callbacks have parameters
that we're not interested in.
2023-04-13 09:30:43 +02:00
Tobias Waldekranz f5259b32d8 confd: Kill all -Wall -Wextra warnings 2023-04-13 09:30:43 +02:00
Tobias Waldekranz 3320175abd confd: Fix symbol redefinition error 2023-04-13 09:27:36 +02:00
Richard AlpeandJoachim Wiberg 02ac6a7ea7 src/confd: add the ability to change MotD in cli
Add the ability to set and delete system MotD (Message Of The Day)
using the cli.

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

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

Introduces:
exec> configure> set system motd STRING
exec> configure> delete system motd
2023-04-12 16:51:08 +02:00
Joachim Wiberg 22a18f3e61 src/confd: skeleton for ietf-interfaces
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-12 09:22:50 +02:00
Joachim Wiberg 015f1b7a87 package/finit: add support for setting RTC plugin fallback datetime
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-10 16:36:32 +02:00
Joachim Wiberg 82c8423cea src/net: fixes after spec. audit by wkz
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-08 10:53:44 +02:00
Joachim Wiberg caa07e8b20 Drop local libite patches in favor of libite v2.5.3
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-08 07:18:46 +02:00
Joachim WibergandGitHub e9a49ac546 Merge pull request #6 from hno-addiva/fix/crb_defconfig
cn9130_crb_boot: Add required host tools for build

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-06 15:45:28 +02:00
Joachim WibergandGitHub 530adeaf53 Merge pull request #5 from hno-addiva/fix/binutils-2.9
Patch for building ARM TF-A with binutils-2.39+

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-06 15:44:46 +02:00
Henrik Nordstrom dc8f1c344e cn9130_crb_boot: Add required host tools for build 2023-04-06 15:44:17 +02:00
Henrik Nordstrom a410c38c0f Patch for ARM TF-A with binutils-2.39+
Adopted from https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/19401/4/Makefile
2023-04-06 15:35:50 +02:00
Joachim WibergandGitHub 2bdb910db8 Merge pull request #3 from hno-addiva/main
Set buildroot branch name

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-06 14:53:46 +02:00
Henrik Nordstrom 64c3fdc5b1 Set buildroot branch name
allows "submodule update --remote" to refresh to current version
2023-04-06 14:31:04 +02:00
Joachim Wiberg 8f1f74263d src/net: first prototype
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-05 16:08:07 +02:00
Joachim Wiberg 2943922b4c configs: add dosfstools and mtools for disk image generation + gns3
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-04 15:11:55 +02:00
Joachim Wiberg 2ba8612f7f src/confd: add commit_done_hook() to call initctl reload
This is needed to confirm the new system configuration generation and
reload all affected services.  E.g., when configuring an NTP server
and committing the candidate to running, the ietf-system plugin has
only enabled the service, as a last step we need to tell Finit to
actually start it.

This hook needs to run last since the enabled service(s) may depend on
other service(s), or networking, to be enabled in the proper order.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-03 20:35:55 +02:00
Joachim Wiberg 59d5340eae src/confd: mark missing yang support with XXX
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-03 19:33:37 +02:00
Joachim Wiberg 69920cb230 src/confd: add support for /ietf-system:system/dns-resolver
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-03 19:31:34 +02:00
Joachim Wiberg 42281378f8 src/confd: new function, sr_get_int()
Really ugly handling here, needs to be reworked into sr_uint8() etc.,
adding as-is for big upcoming demo.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-03 19:29:55 +02:00
Joachim Wiberg 443cb2ddf1 src/confd: add support for /ietf-system:system/clock, with deviation
Declare deviation for /ietf-system:system/clock/timezone-utc-offset,
which we currently do not support.

Please note, when setting out to add support for timezone-utc-offset,
you need to ensure the user does not input both, that should be a
validation error.  It's an either-or thing.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-03 18:17:59 +02:00
Joachim Wiberg 68a5a50040 src/confd: add timezone support to set-current-datetime rpc
How to verify, use the following command and paste the XML below:

    $ sysrepocfg -R
    <sys:set-current-datetime xmlns:sys="urn:ietf:params:xml:ns:yang:ietf-system">
        <sys:current-datetime>2022-01-12T14:29:00-02:00</sys:current-datetime>
    </sys:set-current-datetime>

Reuse code from mech, verified and working.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-03 16:37:23 +02:00
Joachim Wiberg 4e0d7ad494 src/confd: use /etc/os-release for platform operational data
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-03 14:14:05 +02:00
Joachim Wiberg a2d2d0948f src/confd: minor refactor
Reuse code from mech, verified and working.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-03 14:08:30 +02:00
Joachim Wiberg 32e55d3562 configs: update defconfigs post e729c82
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-03 06:32:17 +02:00
Joachim Wiberg 4e3f3a01b3 board/common: change cli alias to start klish
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-03 06:31:47 +02:00
Joachim Wiberg 36ff60f99c package/confd: support for customer factory startup-config.cfg
When researching the systemd tmpfiles.d implementation I discovered the
effort to standarize on /usr/share/factory as a generic factory defaults
for Linux systems.  This patch adds a small example factory.cfg file
that is installed as /usr/share/factory/cfg/startup-config.cfg.  The
tmpfiles.d backend will then install it as /cfg/startup-config.cfg if
that file is missing at boot.  Confd does the rest to bootstrap our
(by default) empty sysrepo db with this startup-config.

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

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-02 16:24:08 +02:00
Joachim Wiberg d8eb88e6da src/confd: improve error handling in ietf-system
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-02 16:24:08 +02:00
Joachim Wiberg af5c5bc3d2 src/confd: refactor, expose flags arg to change subscrie
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-02 16:24:08 +02:00
Joachim Wiberg 405e1f1b70 src/confd: minor refactor, split in multiple files
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-02 16:24:08 +02:00
Joachim Wiberg b3b25ed4d6 src/confd: improved coverage of ietf-system
- Call external programs safely with run()
 - Use augeas to update /etc/hostname and /etc/hosts
 - Add support for generating /etc/chrony.conf
 - Update license copyright due to significant contrib.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-02 16:24:08 +02:00
Joachim Wiberg 7079a35088 configs: disable nginx temporarily while evaluating sysrepo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-02 16:24:08 +02:00
Joachim Wiberg 3bef1eec16 Disable rauc streaming and kernel nbd, not used atm.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-02 16:24:08 +02:00
Joachim Wiberg b639812ba4 patches/netopeer2: add support for running in foreground with syslog
The default is to use -d (debug), which changes logging to stdout, which
we do not want with Finit.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-02 16:24:08 +02:00
533 changed files with 39122 additions and 17692 deletions
+7 -9
View File
@@ -2,16 +2,15 @@ Contributing to Infix
=====================
We welcome any and all help in the form of bug reports, fixes, patches
to add new features -- *preferably as GitHub pull requests*. Other
methods are of course also possible: emailing the [maintainers][] a
patch or even a raw file, a feature request or an alert of a problem.
to add new features -- *preferably as GitHub pull requests*.
If you are unsure of what to do, or how to implement an idea or bugfix,
open an issue with `"[RFC: Unsure if this is a bug ... ?"`, or use the
GitHub discussions forum, so we can discuss it. Talking about the code
first is the best way to get started before submitting a pull request.
If you are unsure of what to do, or how to implement an idea or bug fix,
open an issue with `"[RFC]: Unsure if this is a bug ... ?"`, or use the
[GitHub discussions forum](https://github.com/orgs/kernelkit/discussions).
Talking about code and problems first is often the best way to get started
before submitting a pull request.
Either way, when sending an email, patch, or pull request, start by
When submitting a bug report, patch, or pull request, please start by
stating the version the change is made against, what it does, and why.
Please take care to ensure you follow the project coding style and the
@@ -72,7 +71,6 @@ The *"maintainers have the right and responsibility to remove, edit,
or reject comments, commits, code, wiki edits, issues, and other
contributions that are not aligned to this Code of Conduct."*
[1]: ../doc/MAINTAINERS
[KNF]: https://en.wikipedia.org/wiki/Kernel_Normal_Form
[gitbook]: https://git-scm.com/book/ch5-2.html
[conduct]: CODE-OF-CONDUCT.md
+1
View File
@@ -0,0 +1 @@
Paid support and development provided by Addiva Elektronik <https://addiva.se>
+42 -23
View File
@@ -1,63 +1,82 @@
# To enable this workflow of your Infix fork, set the repoistory or
# organisation variable (not secret):
#
# LATEST_BUILD = true
#
# https://docs.github.com/en/actions/learn-github-actions/variables#creating-configuration-variables-for-a-repository
name: Bob the Builder
#on:
# push:
# branches:
# - '*'
# pull_request:
# branches:
# - '*'
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Build ${{ matrix.platform }}
if: ${{ vars.LATEST_BUILD == 'true' }}
name: Build ${{ matrix.platform }} ${{ matrix.variant }}
runs-on: ubuntu-latest
strategy:
matrix:
platform: [aarch64, amd64]
platform: [aarch64, x86_64]
variant: [netconf, classic]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set Build Variables
id: vars
run: |
echo "dir=infix-${{ matrix.platform }}" >> $GITHUB_OUTPUT
echo "tgz=infix-${{ matrix.platform }}.tar.gz" >> $GITHUB_OUTPUT
if [ "${{ matrix.variant }}" = "netconf" ]; then
target=${{ matrix.platform }}
else
target=${{ matrix.platform }}-${{ matrix.variant }}
fi
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
- name: Restore Cache of dl/
uses: actions/cache@v3
with:
path: dl/
key: dl-${{ matrix.platform }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
key: dl-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-${{ matrix.platform }}-${{ matrix.variant }}-
dl-${{ matrix.platform }}-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v3
with:
path: .buildroot-ccache/
key: ccache-${{ matrix.board }}-os-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
path: .ccache/
key: ccache-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.board }}-os-
ccache-${{ matrix.board }}-
ccache--os-
ccache-${{ matrix.platform }}-${{ matrix.variant }}-
ccache-${{ matrix.platform }}-
ccache-
- name: Configure & Build
run: |
make ${{ matrix.platform }}_defconfig
if [ "${{ matrix.variant }}" = "netconf" ]; then
target=${{ matrix.platform }}_defconfig
else
target=${{ matrix.platform }}_${{ matrix.variant }}_defconfig
fi
echo "Buildring $target ..."
make $target
make
- name: Prepare Artifact
run: |
cd output
mv images ${{ steps.vars.outputs.dir }}
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
ls -l
ls -l ${{ steps.vars.outputs.dir }}
ln -s ${{ steps.vars.outputs.dir }} images
tar chfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
- name: Test
if: matrix.platform == 'x86_64' && matrix.variant == 'netconf'
run: |
make test-qeneth
- uses: actions/upload-artifact@v3
with:
path: output/${{ steps.vars.outputs.tgz }}
release:
if: ${{github.repository_owner == 'kernelkit' && github.ref_name == 'main'}}
name: Upload Latest Build
needs: build
runs-on: ubuntu-latest
@@ -66,7 +85,7 @@ jobs:
- uses: pyTooling/Actions/releaser@main
with:
tag: latest
rm: true
rm: false
token: ${{ secrets.GITHUB_TOKEN }}
files: artifact/*
- name: Summary
+78
View File
@@ -0,0 +1,78 @@
# To enable this workflow of your Infix fork, set the repoistory or
# organisation variable (not secret):
#
# REGRESSION_TEST = true
#
# https://docs.github.com/en/actions/learn-github-actions/variables#creating-configuration-variables-for-a-repository
name: Reggie Regression
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
if: ${{ vars.REGRESSION_TEST == 'true' }}
name: Regression Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Set Build Variables
id: vars
run: |
target=x86_64-minimal
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
- name: Restore Cache of dl/
uses: actions/cache@v3
with:
path: dl/
key: dl-x86_64-netconf-${{ hashFiles('.git/modules/buildroot/refs/heads/master', 'package/*/*.hash') }}
restore-keys: |
dl-x86_64-netconf-
dl-x86_64-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v3
with:
path: .ccache/
key: ccache-x86_64-netconf-${{ hashFiles('.git/modules/buildroot/refs/head/master', 'package/*/*.hash') }}
restore-keys: |
ccache-x86_64-netconf-
ccache-x86_64-
ccache-
- name: Configure Minimal NETCONF
run: |
make x86_64_minimal_defconfig
- name: Build
run: |
make
- name: Prepare Artifact
run: |
cd output
mv images ${{ steps.vars.outputs.dir }}
ln -s ${{ steps.vars.outputs.dir }} images
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
path: output/${{ steps.vars.outputs.tgz }}
- name: Regression Test
run: make test-qeneth
- name: Publish Test Result
# Ensure this runs even if Regression Test fails
if: always()
run: cat test/.log/last/result-gh.md >> $GITHUB_STEP_SUMMARY
+101
View File
@@ -0,0 +1,101 @@
name: Release General
on:
push:
tags:
- 'v[0-9]*.*'
jobs:
build:
if: github.repository == 'kernelkit/infix' && startsWith(github.ref, 'refs/tags/')
name: Build Infix ${{ github.ref_name }} [${{ matrix.platform }}-${{ matrix.variant }}]
runs-on: ubuntu-latest
strategy:
matrix:
platform: [aarch64, x86_64]
variant: [netconf, classic]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set Release Variables
id: build
run: |
ver=${GITHUB_REF#refs/tags/v}
echo "ver=${ver}" >> $GITHUB_OUTPUT
if echo $ver | grep -qE '[0-9.]+(-alpha|-beta|-rc)[0-9]*'; then
echo "pre=true" >> $GITHUB_OUTPUT
else
echo "pre=false" >> $GITHUB_OUTPUT
fi
if [ "${{ matrix.variant }}" = "netconf" ]; then
target=${{ matrix.platform }}-${ver}
else
target=${{ matrix.platform }}-${{ matrix.variant }}-${ver}
fi
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
- name: Restore Cache of dl/
uses: actions/cache@v3
with:
path: dl/
key: dl-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-${{ matrix.platform }}-${{ matrix.variant }}-
dl-${{ matrix.platform }}-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v3
with:
path: .ccache/
key: ccache-${{ matrix.platform }}-${{ matrix.variant }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.platform }}-${{ matrix.variant }}-
ccache-${{ matrix.platform }}-
ccache-
- name: Configure & Build
env:
INFIX_RELEASE: ${{ steps.build.outputs.ver }}
run: |
if [ "${{ matrix.variant }}" = "netconf" ]; then
target=${{ matrix.platform }}_defconfig
else
target=${{ matrix.platform }}_${{ matrix.variant }}_defconfig
fi
echo "Buildring $target ..."
make $target
make
- name: Prepare Artifact
run: |
cd output
mv images ${{ steps.build.outputs.dir }}
ln -s ${{ steps.build.outputs.dir }} images
tar chfz ${{ steps.build.outputs.tgz }} ${{ steps.build.outputs.dir }}
- uses: actions/upload-artifact@v3
with:
path: output/${{ steps.build.outputs.tgz }}
release:
name: Release Infix ${{ github.ref_name }}
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Extract ChangeLog entry ...
run: |
awk '/-----*/{if (x == 1) exit; x=1;next}x' doc/ChangeLog.md \
|head -n -1 > release.md
cat release.md
- uses: ncipollo/release-action@v1
with:
name: Infix ${{ github.ref_name }}
prerelease: ${{ needs.build.outputs.pre }}
bodyFile: release.md
artifacts: artifact/*
- name: Summary
run: |
cat <<EOF >> $GITHUB_STEP_SUMMARY
# Infix ${{ github.ref_name }} Released! :rocket:
For the public download links of this release, please see:
<https://github.com/kernelkit/infix/releases/tag/${{ github.ref_name }}>
EOF
+28
View File
@@ -0,0 +1,28 @@
# To enable automatic sync of your Infix fork every day, or on dispatch,
# set the repoistory or organisation variable (not secret):
#
# SYNC_FORK = true
#
# You also need a GH_SYNC_REPO token allowed to update workflows. For
# more information on variables and secrets, see the GitHub docs.
# See https://docs.github.com/en/actions/learn-github-actions/variables
name: Synchronize your fork of Infix with upstream
on:
schedule:
- cron: 42 2 * * *
workflow_dispatch:
jobs:
sync_fork:
if: ${{github.repository_owner != 'kernelkit' && vars.SYNC_FORK == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: TobKed/github-forks-sync-action@master
with:
github_token: ${{ secrets.GH_SYNC_REPO }}
upstream_repository: KernelKit/infix
upstream_branch: main
target_branch: main
force: false
tags: true
+4
View File
@@ -1,6 +1,10 @@
*~
.gdb_history
/.backup
/.ccache
/dl
/output*
/x-*
/test/.venv
/test/.log
/local.mk
+6
View File
@@ -1,3 +1,9 @@
[submodule "buildroot"]
path = buildroot
url = ../buildroot.git
[submodule "9pm"]
path = 9pm
url = ../9pm
[submodule "qeneth"]
path = qeneth
url = ../qeneth.git
Submodule
+1
Submodule 9pm added at d80f8cfc7d
+133 -6
View File
@@ -1,13 +1,140 @@
menu "Branding"
config INFIX_VENDOR
string "Vendor name"
default "KernelKit"
help
The name of the operating system vendor. This is the name of the
organization or company which produces the OS.
This name is intended to be exposed in "About this system" UIs or
software update UIs when needed to distinguish the OS vendor from
the OS itself. It is intended to be human readable.
Used for VENDOR_NAME in /etc/os-release and GNS3 appliance files.
config INFIX_VENDOR_HOME
string "Vendor URL"
help
The homepage of the OS vendor. The value should be in RFC3986
format, and should be "http:" or "https:" URLs. Only one URL shall
be listed in the setting.
Optional, used for VENDOR_HOME in /etc/os-release
config INFIX_NAME
string "Operating system name"
default "Infix"
help
Mandatory. Used for identifying the OS as NAME in /etc/os-release
and product_name in GNS3 appliance files.
config INFIX_ID
string "Operating system identifier"
default "infix"
help
A lower-case string (no spaces or other characters outside of 09,
az, '.', '_' and '-') identifying the operating system, excluding
any version information and suitable for processing by scripts or
usage in generated filenames.
Mandatory. Used for identifying the OS as ID in /etc/os-release and
in the generated image name: ID-ARCH-VERSION.img
config INFIX_IMAGE_ID
string "Operating system image name"
default "${INFIX_ID}-${BR2_ARCH}"
help
A lower-case string (no spaces or other characters outside of 09,
az, ".", "_" and "-"), for naming critical image files, directories
and archives containting the operating system.
Mandatory. When INFIX_RELEASE is set, this string is appended to
the IMAGE_ID with a '-' separator.
config INFIX_TAGLINE
string "Operating system tagline"
default "Infix — a Network Operating System"
help
Mandatory. Used for identifying the OS, e.g. as PRETTY_NAME in
/etc/os-release and description in the GNS3 appliance.
This is also show at boot when the system init process starts.
config INFIX_DESC
string "Operating system description"
help
Optional. Used for long description texts about the OS. E.g.,
the GNS3 appliance file description field. Saved in the file
/etc/os-release as INFIX_DESC.
config INFIX_HOME
string "Operating system URL"
help
Used for identifying the OS, e.g. as HOME_URL in /etc/os-release
config INFIX_DOC
string "Operating system docs"
help
Optional. Main documentation URL, will be shown in /etc/os-release
as DOCUMENTATION_URL.
config INFIX_SUPPORT
string "Operating system support"
help
Main support page for the operating system, if there is any. This
is primarily intended for operating systems which vendors provide
support for. May be a http:, https:, or mailto: URI.
Optional. Shown, e.g., as SUPPORT_URL in /etc/os-release or
maintainer_email in .gns3a.
config INFIX_OEM_PATH
string "Path to OEM br2-external"
help
A br2-external using Infix will likely want to version the branded
OS using their own GIT tags. Set this variable to point to the base
directory (absolute path) and the Infix post-build.sh will call `git
describe -C $INFIX_OEM_PATH`.
Note: for release builds the global variable INFIX_RELEASE overrides
the version information derived from `git describe`. However, the
GIT version is always saved as the BUILD_ID in /etc/os-releases.
endmenu
# For /etc/os-release, uses CondtionArchitechture= from systemd.unit(5)
config INFIX_ARCH
string
default "arm" if BR2_arm
default "arm64" if BR2_aarch64
default "mips64" if BR2_mips64
default "riscv64" if BR2_riscv
default "x86_64" if BR2_x86_64
# For /etc/os-release, VARIANT & VARIANT_ID used, e.g., in mnt script
choice
prompt "Select variant/flavor"
default INFIX_VARIANT_NETCONF
config INFIX_VARIANT_NETCONF
bool "NETCONF"
help
Managed NETCONF mode, /etc is a ramdisk, all configuration is
generated by sysrepo plugins using NETCONF (xml) or RESTCONF.
config INFIX_VARIANT_CLASSIC
bool "Classic /etc mode"
help
User managed mode, read-write configuration files in /etc that
is saved across reboots.
endchoice
menu "Packages"
source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in"
endmenu
menu "QEMU Virtualization"
source "$BR2_EXTERNAL_INFIX_PATH/qemu/Config.in"
endmenu
source "$BR2_EXTERNAL_INFIX_PATH/board/common/Config.in"
+74 -115
View File
@@ -1,129 +1,88 @@
<img align="right" src="doc/text3134.png" alt="Infix Linux Networking Made Easy">
<img align="right" src="doc/logo.png" alt="Infix - Linux <3 NETCONF" width=480>
<details><summary><b>Documentation</b></summary>
* [Introduction](#introduction)
* [Hardware](#hardware)
* [Qemu](#qemu)
* [GNS3](#gns3)
* [Building](#building)
* [Origin & Licensing](origin--licensing)
- **Infix In-Depth**
- [Infix Variants](doc/variant.md)
- [Boot Procedure](doc/boot.md)
- [Containers in Infix](doc/container.md)
- [Developer's Guide](doc/developers-guide.md)
- [Discover Your Device](doc/discovery.md)
- [Virtual Environments](doc/virtual.md)
- [Origin & Licensing](doc/license.md)
- **CLI Topics**
- [Introduction to the CLI](doc/cli/introduction.md)
- [CLI User's Guide](doc/cli/tutorial.md)
- [Quick Overview](doc/cli/quick.md)
</details>
Introduction
------------
Infix is a Linux Network Operating System (NOS) based on [Buildroot][1],
and [sysrepo][2]. A powerful mix that ease porting to different
platforms, simplify long-term maintenance, and provide made-easy
management using NETCONF[^1] (remote) or the built-in [CLI][3].
Infix is an embedded Linux Network Operating System (NOS) based on
[Buildroot][1], [Finit][2], [ifupdown-ng][3], and [Clixon][6].
Providing an easy-to-maintain and easy-to-port Open Source base for
networked equipment.
<details><summary><b>Example CLI Session</b></summary>
See the [GitHub Releases](https://github.com/kernelkit/infix/releases)
page for out pre-built images. The *Latest Build* has the bleeding edge
images, if possible we recommend using a versioned release.
The CLI configure context is automatically generated from the loaded
YANG models and their corresponding [sysrepo][2] plugins. The following
is brief example of how to set the IP address of an interface:
> Login with user 'root', no password by default on plain builds. See
> the online `help` command for an introduction to the system.
```
admin@infix-12-34-56:/> configure
admin@infix-12-34-56:/config/> edit interfaces interface eth0
admin@infix-12-34-56:/config/interfaces/interface/eth0/> set ipv4 <TAB>
address autoconf bind-ni-name enabled
forwarding mtu neighbor
admin@infix-12-34-56:/config/interfaces/interface/eth0/> set ipv4 address 192.168.2.200 prefix-length 24
admin@infix-12-34-56:/config/interfaces/interface/eth0/> show
type ethernetCsmacd;
ipv4 address 192.168.2.200 prefix-length 24;
ipv6 enabled true;
admin@infix-12-34-56:/config/interfaces/interface/eth0/> diff
interfaces {
interface eth0 {
+ ipv4 {
+ address 192.168.2.200 {
+ prefix-length 24;
+ }
+ }
}
}
admin@infix-12-34-56:/config/interfaces/interface/eth0/> leave
admin@infix-12-34-56:/> show interfaces brief
lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
eth0 UP 52:54:00:12:34:56 <BROADCAST,MULTICAST,UP,LOWER_UP>
admin@infix-12-34-56:/> show ip brief
lo UNKNOWN 127.0.0.1/8 ::1/128
eth0 UP 192.168.2.200/24 fe80::5054:ff:fe12:3456/64
admin@infix-12-34-56:/> copy running-config startup-config
```
[Click here][3] for more details.
</details>
Hardware
--------
Infix can run on many different types of architectures and boards, much
thanks to Linux and Buildroot. Currently the focus is on 64-bit ARM
devices, optionally with switching fabric supported by Linux switchdev.
The [following boards](board/aarch64/README.md) are fully supported:
### aarch64
- Marvell CN9130 CRB
- Marvell EspressoBIN
- Microchip SparX-5i PCB135 (eMMC)
By default, Infix builds with support for the following boards (you
may enable additional boards in the config, of course):
An x86_64 build is also available, primarily intended for development
and testing, but can also be used for evaluation and demo purposes. For
more information, see: [Infix in Virtual Environments](doc/virtual.md).
- Marvell CN9130 CRB
- Marvell EspressoBIN
- Microchip SparX-5i PCB135 (eMMC)
> See the [GitHub Releases](https://github.com/kernelkit/infix/releases)
> page for our pre-built images. The *Latest Build* has the bleeding
> edge images, if possible we recommend using a versioned release.
>
> For *customer specific builds* of Infix, see your product repository.
See the aarch64 specific [documentation](board/aarch64/README.md) for more
information.
[^1]: NETCONF or RESTCONF, <https://datatracker.ietf.org/doc/html/rfc8040>,
for more information, see [Infix Variants](doc/variant.md).
### amd64
Primarily intended to be run under [QEMU][] for development & test as
well as evaluation, demo and [training][] purposes, e.g. using [GNS3][]
or [Qeneth][7].
QEMU
----
A virtualized instance can easily be launched from a Linux system, with
Qemu installed, by issuing `make run`.
Some settings, e.g. networking, can be configured via `make menuconfig`
under `External options -> QEMU virtualization`.
GNS3
----
Download the [latest build][0] of amd64, unpack in a dedicated directory
and use ["Import Appliance"][9] to install the `.gns3a` file into GNS3.
Infix will show up in the "Router" category, it has 10 interfaces
available by default for use as switch ports or routing.
Building
--------
Buildroot is almost stand-alone, but need a few locally installed tools
to bootstrap itself. For details, see the [excellent manual][manual].
Briefly, to build an Infix image; select the target and then make:
make amd64_defconfig
make
Online help is available:
make help
To see available defconfigs for supported targets, use:
make list-defconfigs
> **Note:** build dependencies (Debian/Ubuntu): <kbd>sudo apt install make libssl-dev</kbd>
Origin & Licensing
------------------
Infix is entirely built on Open Source components (packages). Most of
them, as well as the build system with its helper scripts and tools, is
from [Buiildroot][1], which is distributed under the terms of the GNU
General Public License (GPL). See the file COPYING for details.
Some files in Buildroot contain a different license statement. Those
files are licensed under the license contained in the file itself.
Buildroot and Infix also bundle patch files, which are applied to the
sources of the various packages. Those patches are not covered by the
license of Buildroot or Infix. Instead, they are covered by the license
of the software to which the patches are applied. When said software is
available under multiple licenses, the patches are only provided under
the publicly accessible licenses.
Infix releases include the license information covering all Open Source
packages. This is extracted automatically at build time using the tool
`make legal-info`. Any proprietary software built on top of Infix, or
Buildroot, would need separate auditing to ensure it does not link with
any GPL[^1] licensed library.
[^1]: Infix image builds use GNU libc (GLIBC) which is covered by the
[LGPL][4]. The LGPL *does allow* proprietary software, as long as
said software is linking dynamically, [not statically][5], to GLIBC.
[0]: https://github.com/kernelkit/infix/releases/tag/latest
[1]: https://buildroot.org/
[2]: https://github.com/troglobit/finit
[3]: https://github.com/ifupdown-ng/ifupdown-ng
[4]: https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License
[5]: https://lwn.net/Articles/117972/
[6]: https://github.com/clicon/clixon
[7]: https://github.com/wkz/qeneth
[9]: https://docs.gns3.com/docs/using-gns3/beginners/import-gns3-appliance/
[QEMU]: https://www.qemu.org/
[GNS3]: https://gns3.com/
[training]: https://addiva-elektronik.github.io/
[manual]: https://buildroot.org/downloads/manual/manual.html
[2]: https://www.sysrepo.org/
[3]: doc/cli/introduction.md
@@ -0,0 +1,51 @@
/ {
config {
environment {
/* After the MMC driver has enabled bus power,
* the controller seems to sometimes detect a
* card removal state , which causes it to
* disable power again. This hack re-enables the
* bus power in those cases.
*/
bootcmd = "
setexpr.b pwrctl *0xf2780029
setexpr pwrctl ${pwrctl} \"|\" 1
mw.b 0xf2780029 ${pwrctl}
run ixboot
";
boot_targets = "mmc1";
ethprime = "eth1";
/* Uncomment this if you're debugging U-Boot
*
* This will allow you to break out of the
* normal boot flow and into the interactive
* console.
*
* To upgrade U-Boot itself, simply set the
* `bootfile` variable to the path of
* `flash-image.bin` on your TFTP server, then
* issue `run ixupgradeboot`.
*/
/* bootdelay = "2"; */
/* ixupgradeboot = " */
/* dhcp */
/* setexpr fileblks ${filesize} + 0x1ff */
/* setexpr fileblks ${fileblks} / 0x200 */
/* mmc dev 1 */
/* part start mmc 1 boot bootstart */
/* part size mmc 1 boot bootsize */
/* mmc erase ${bootstart} ${bootsize} */
/* mmc write ${fileaddr} ${bootstart} ${fileblks} */
/* "; */
};
};
};
/* &cp0_eth0 { */
/* phy-mode = "10gbase-r"; */
/* }; */
@@ -0,0 +1,4 @@
CONFIG_DEVICE_TREE_INCLUDES="infix-env.dtsi infix-key.dtsi cn9130-crb-env.dtsi"
CONFIG_ENV_IS_NOWHERE=y
# CONFIG_ENV_IS_IN_MMC is not set
+76
View File
@@ -0,0 +1,76 @@
#ifndef _ALDER_MPP_H
#define _ALDER_MPP_H
#define CP_SMI_MDIO(X) X( "mpp0", none, 0, 0)
#define CP_SMI_MDC(X) X( "mpp1", none, 0, 0)
#define CP_XSMI_MDIO(X) X( "mpp2", none, 0, 0)
#define CP_XSMI_MDC(X) X( "mpp3", none, 0, 0)
/* mpp4: Unused */
/* mpp5: Unused */
/* mpp6: Unused */
#define SFP9_TX_FAULT(X) X( "mpp7", cp0_gpio1, 7, GPIO_ACTIVE_HIGH)
#define SFP9_TX_DISABLE(X) X( "mpp8", cp0_gpio1, 8, GPIO_ACTIVE_HIGH)
#define SFP9_MOD_ABS(X) X( "mpp9", cp0_gpio1, 9, GPIO_ACTIVE_LOW)
#define SW_RESETn(X) X("mpp10", cp0_gpio1, 10, GPIO_ACTIVE_LOW)
#define SFP9_RS0(X) X("mpp11", cp0_gpio1, 11, GPIO_ACTIVE_HIGH)
/* mpp12: Unused */
#define CP_SPI1_MISO(X) X("mpp13", none, 0, 0)
#define CP_SPI1_CS0(X) X("mpp14", none, 0, 0)
#define CP_SPI1_MOSI(X) X("mpp15", none, 0, 0)
#define CP_SPI1_SCK(X) X("mpp16", none, 0, 0)
#define WDT_TICKLE(X) X("mpp17", cp0_gpio1, 17, GPIO_ACTIVE_HIGH)
/* mpp18: Unused */
/* mpp19: Unused */
/* mpp20: Unused */
/* mpp21: Unused */
/* mpp22: Unused */
/* mpp23: Unused */
#define SFP9_RX_LOS(X) X("mpp24", cp0_gpio1, 24, GPIO_ACTIVE_HIGH)
#define ETH9_RESETn(X) X("mpp25", cp0_gpio1, 25, GPIO_ACTIVE_LOW)
#define SW_INTn(X) X("mpp26", cp0_gpio1, 26, IRQ_TYPE_LEVEL_LOW)
#define SFP9_RS1(X) X("mpp27", cp0_gpio1, 27, GPIO_ACTIVE_HIGH)
#define SFP10_TX_FAULT(X) X("mpp28", cp0_gpio1, 28, GPIO_ACTIVE_HIGH)
#define CP_UA0_RXD(X) X("mpp29", none, 0, 0)
#define CP_UA0_TXD(X) X("mpp30", none, 0, 0)
#define SFP10_TX_DISABLE(X) X("mpp31", cp0_gpio1, 31, GPIO_ACTIVE_HIGH)
#define SFP10_MOD_ABS(X) X("mpp32", cp0_gpio2, 0, GPIO_ACTIVE_LOW)
#define I2C_IRQ(X) X("mpp33", cp0_gpio2, 1, GPIO_ACTIVE_HIGH)
#define SFP10_RS0(X) X("mpp34", cp0_gpio2, 2, GPIO_ACTIVE_HIGH)
#define CP_I2C1_SDA(X) X("mpp35", none, 0, 0)
#define CP_I2C1_SCK(X) X("mpp36", none, 0, 0)
#define CP_I2C0_SCK(X) X("mpp37", none, 0, 0)
#define CP_I2C0_SDA(X) X("mpp38", none, 0, 0)
#define SFP10_RX_LOS(X) X("mpp39", cp0_gpio2, 7, GPIO_ACTIVE_HIGH)
#define SFP10_RS1(X) X("mpp40", cp0_gpio2, 8, GPIO_ACTIVE_HIGH)
#define CP_SD_CRD_PWR_OFF(X) X("mpp41", none, 0, 0)
#define CP_SD_HST_18_EN(X) X("mpp42", none, 0, 0)
#define CP_SD_CRD_DT(X) X("mpp43", none, 0, 0)
#define ETH9_INTn(X) X("mpp44", cp0_gpio2, 12, GPIO_ACTIVE_LOW)
/* mpp45: Unused */
#define ETH10_RESETn(X) X("mpp46", cp0_gpio2, 14, GPIO_ACTIVE_LOW)
#define I2C_RESETn(X) X("mpp47", cp0_gpio2, 15, GPIO_ACTIVE_LOW)
#define ETH10_INTn(X) X("mpp48", cp0_gpio2, 16, GPIO_ACTIVE_LOW)
#define DEV_MODEn(X) X("mpp49", cp0_gpio2, 17, GPIO_ACTIVE_LOW)
#define USB1_VBUS_ENABLE(X) X("mpp50", cp0_gpio2, 18, GPIO_ACTIVE_HIGH)
#define USB1_VBUS_ERROR_OC(X) X("mpp51", cp0_gpio2, 19, GPIO_ACTIVE_HIGH)
/* mpp52: Unused */
/* mpp53: Unused */
/* mpp54: Unused */
#define CP_SD_LED(X) X("mpp55", none, 0, 0)
#define CP_SD_CLK(X) X("mpp56", none, 0, 0)
#define CP_SD_CMD(X) X("mpp57", none, 0, 0)
#define CP_SD_D0(X) X("mpp58", none, 0, 0)
#define CP_SD_D1(X) X("mpp59", none, 0, 0)
#define CP_SD_D2(X) X("mpp60", none, 0, 0)
#define CP_SD_D3(X) X("mpp61", none, 0, 0)
#define DDR_TEN(X) X("mpp62", cp0_gpio2, 30 GPIO_ACTIVE_HIGH)
/* Macros to extract MPP info in different formats */
#define MPP_ID(_mpp, _chip, _no, _flags) _mpp
#define MPP_GPIO_CHIP(_mpp, _chip, _no, _flags) _chip
#define MPP_GPIO_REF(_mpp, _chip, _no, _flags) <&_chip _no _flags>
#define MPP_GPIO_REF_NO_CHIP(_mpp, _chip, _no, _flags) <_no _flags>
#define MPP_IRQ_REF(_mpp, _chip, _no, _flags) <&_chip _no _flags>
#endif /* _ALDER_MPP_H */
+9
View File
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (C) 2021 Marvell International Ltd.
* Copyright (C) 2023 Addiva Elektronik AB
*
* Device tree for Alder board
*/
#include "alder.dtsi"
+611
View File
@@ -0,0 +1,611 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (C) 2021 Marvell International Ltd.
* Copyright (C) 2023 Addiva Elektronik AB
*
* Device tree for Alder board
*/
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include "../marvell/cn9130-patched.dtsi"
#include "alder-mpp.h"
/ {
model = "Alder";
compatible = "alder,alder",
"marvell,armada-ap807-quad",
"marvell,armada-ap807";
chosen {
stdout-path = "serial0:115200n8";
};
memory@0 {
device_type = "memory";
reg = <0x0 0x0 0x0 0x80000000>;
};
};
/* UART0 (Console) */
&cp0_pinctrl {
cp0_uart0_pins: cp0-uart0-pins {
marvell,pins = CP_UA0_RXD(MPP_ID), CP_UA0_TXD(MPP_ID);
marvell,function = "uart0";
};
};
&uart0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_uart0_pins>;
};
/* GPIO */
&cp0_gpio1 {
status = "okay";
};
&cp0_gpio2 {
status = "okay";
};
/* I2C0 (EEPROM) */
&cp0_pinctrl {
cp0_i2c0_pins: cp0-i2c0-pins {
marvell,pins = CP_I2C0_SCK(MPP_ID), CP_I2C0_SDA(MPP_ID);
marvell,function = "i2c0";
};
};
&cp0_i2c0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_i2c0_pins>;
eeprom@50 {
// AT24C256C-MAHL-T
compatible = "atmel,24c256";
reg = <0x50>;
};
};
/* I2C1 (Mux) */
&cp0_pinctrl {
cp0_i2c1_pins: cp0-i2c1-pins {
marvell,pins = CP_I2C1_SCK(MPP_ID), CP_I2C1_SDA(MPP_ID);
marvell,function = "i2c1";
};
};
&cp0_i2c1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_i2c1_pins>;
i2cmux@70 {
compatible = "nxp,pca9548";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x70>;
reset-gpios = I2C_RESETn(MPP_GPIO_REF);
i2c_sysmgmt: i2c@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
};
i2c_pwr: i2c@1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
};
i2c_sw: i2c@2 {
#address-cells = <1>;
#size-cells = <0>;
reg = <2>;
};
i2c_sfp9: i2c@3 {
#address-cells = <1>;
#size-cells = <0>;
reg = <3>;
};
i2c_sfpa: i2c@4 {
#address-cells = <1>;
#size-cells = <0>;
reg = <4>;
};
i2c@5 {
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
reg = <5>;
};
i2c@6 {
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
reg = <6>;
};
i2c@7 {
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
reg = <7>;
};
};
};
/* System Management */
&i2c_sysmgmt {
eeprom@b {
label = "vpd";
reg = <0x0b>;
compatible = "atmel,24c02";
read-only;
nvmem-layout {
compatible = "onie,tlv-layout";
base_mac: mac-address {
#nvmem-cell-cells = <1>;
};
};
};
};
/* AP SDHCI (eMMC) */
&ap_sdhci0 {
status = "okay";
pinctrl-names = "default";
/* pinctrl-0 = <&ap_emmc_pins>; No pinctrl in Linux? */
bus-width = <8>;
mmc-ddr-1_8v;
mmc-hs400-1_8v;
};
/* CP SDHCI (Micro-SD) */
/ {
cp0_reg_sd_vccq: cp0_sd_vccq@0 {
compatible = "regulator-gpio";
regulator-name = "cp0_sd_vccq";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
/* gpios = <&CP_SD_HST_18_EN>; */
states = <1800000 0x1
3300000 0x0>;
};
cp0_reg_sd_vcc: cp0_sd_vcc@0 {
compatible = "regulator-fixed";
regulator-name = "cp0_sd_vcc";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
/* gpio = <&CP_SD_CRD_PWR_OFF>; */
enable-active-high;
regulator-always-on;
};
};
&cp0_pinctrl {
cp0_sdhci_pins: cp0-sdhi-pins-0 {
marvell,pins = \
CP_SD_CRD_PWR_OFF(MPP_ID), CP_SD_HST_18_EN(MPP_ID), \
CP_SD_CRD_DT(MPP_ID), CP_SD_LED(MPP_ID), \
CP_SD_CLK(MPP_ID), CP_SD_CMD(MPP_ID), \
CP_SD_D0(MPP_ID), CP_SD_D1(MPP_ID), \
CP_SD_D2(MPP_ID), CP_SD_D3(MPP_ID);
marvell,function = "sdio";
};
};
&cp0_sdhci0 {
status = "disabled";
pinctrl-names = "default";
pinctrl-0 = <&cp0_sdhci_pins>;
bus-width = <4>;
/* cd-gpios = <&CP_SD_CRD_DT>; */
vqmmc-supply = <&cp0_reg_sd_vccq>;
vmmc-supply = <&cp0_reg_sd_vcc>;
};
/* SPI1 (Boot FLASH) */
&cp0_pinctrl {
cp0_spi1_pins: cp0-spi-pins-0 {
marvell,pins = \
CP_SPI1_MISO(MPP_ID), CP_SPI1_CS0(MPP_ID), \
CP_SPI1_MOSI(MPP_ID), CP_SPI1_SCK(MPP_ID);
marvell,function = "spi1";
};
};
&cp0_spi1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_spi1_pins>;
/* Boot flash */
spi-flash@0 {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "jedec,spi-nor", "spi-flash";
reg = <0x0>;
/* On-board MUX does not allow higher frequencies */
spi-max-frequency = <40000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot0@0 {
label = "boot0";
reg = <0x0 0x200000>;
};
boot1@200000 {
label = "boot1";
reg = <0x200000 0x200000>;
};
};
};
};
/* USB1 */
/ {
cp0_usb3_0_phy1: cp0_usb3_phy {
compatible = "usb-nop-xceiv";
vcc-supply = <&reg_cp0_usb3_vbus1>;
};
reg_cp0_usb3_vbus1: reg_cp0_usb3_vbus1 {
compatible = "regulator-fixed";
regulator-name = "cp0-xhci1-vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
enable-active-high;
gpio = USB1_VBUS_ENABLE(MPP_GPIO_REF);
};
};
&cp0_utmi {
status = "okay";
};
&cp0_utmi1 {
status = "okay";
};
&cp0_usb3_1 {
status = "disabled";
usb-phy = <&cp0_usb3_0_phy1>;
phys = <&cp0_utmi1>, <&cp0_comphy3 1>;
phy-names = "usb", "usb3";
dr_mode = "host";
};
/* ETH0 (DSA connection to switch) */
&cp0_crypto {
status = "okay";
};
&cp0_ethernet {
status = "okay";
};
&cp0_eth0 {
status = "okay";
phy-mode = "10gbase-r";
phys = <&cp0_comphy4 0>;
managed = "in-band-status";
nvmem-cells = <&base_mac 0>;
nvmem-cell-names = "mac-address";
};
/* MDIO (Switch) */
&cp0_pinctrl {
cp0_mdio_pins: cp0-mdio-pins-0 {
marvell,pins = CP_SMI_MDIO(MPP_ID), CP_SMI_MDC(MPP_ID);
marvell,function = "ge";
};
};
&cp0_mdio {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_mdio_pins>;
sw: switch@0 {
compatible = "marvell,mv88e6190";
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
reset-gpios = SW_RESETn(MPP_GPIO_REF);
interrupts-extended = SW_INTn(MPP_IRQ_REF);
interrupt-controller;
dsa,member = <0 0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0x0>;
label = "cpu";
ethernet = <&cp0_eth0>;
phy-mode = "10gbase-r";
fixed-link {
speed = <10000>;
full-duplex;
};
};
#define SWP(_n, _label, _mac_offs, _phymode, _phy) \
port@_n { \
reg = <0x ## _n>; \
label = _label; \
phy-mode = _phymode; \
phy-handle = <&_phy>; \
\
nvmem-cells = <&base_mac _mac_offs>; \
nvmem-cell-names = "mac-address"; \
}
SWP(9, "x1", 1, "usxgmii", xphy9);
SWP(a, "x2", 2, "usxgmii", xphya);
SWP(8, "x3", 3, "gmii", swphy8);
SWP(7, "x4", 4, "gmii", swphy7);
SWP(6, "x5", 5, "gmii", swphy6);
SWP(5, "x6", 6, "gmii", swphy5);
SWP(4, "x7", 7, "gmii", swphy4);
SWP(3, "x8", 8, "gmii", swphy3);
SWP(2, "x9", 9, "gmii", swphy2);
SWP(1, "x10", 10, "gmii", swphy1);
#undef SWP
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
swphy1: ethernet-phy@1 { reg = <0x1>; };
swphy2: ethernet-phy@2 { reg = <0x2>; };
swphy3: ethernet-phy@3 { reg = <0x3>; };
swphy4: ethernet-phy@4 { reg = <0x4>; };
swphy5: ethernet-phy@5 { reg = <0x5>; };
swphy6: ethernet-phy@6 { reg = <0x6>; };
swphy7: ethernet-phy@7 { reg = <0x7>; };
swphy8: ethernet-phy@8 { reg = <0x8>; };
};
};
};
/* XMDIO (88X3310P 10G PHYs) */
&cp0_pinctrl {
cp0_xmdio_pins: cp0-xmdio-pins-0 {
marvell,pins = CP_XSMI_MDIO(MPP_ID), CP_XSMI_MDC(MPP_ID);
marvell,function = "xg";
};
};
&ETH9_RESETn(MPP_GPIO_CHIP) {
xphy9-reset-hog {
gpio-hog;
gpios = ETH9_RESETn(MPP_GPIO_REF_NO_CHIP);
output-low;
line-name = "x1-phy-reset";
};
};
&ETH10_RESETn(MPP_GPIO_CHIP) {
xphya-reset-hog {
gpio-hog;
gpios = ETH10_RESETn(MPP_GPIO_REF_NO_CHIP);
output-low;
line-name = "x2-phy-reset";
};
};
&cp0_xmdio {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&cp0_xmdio_pins>;
/* 88X3310 specifices 35ns minimum MDC period (28.57 MHz). */
clock-frequency = <28571428>;
xphy9: ethernet-phy@4 {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <4>;
sfp = <&sfp9>;
};
xphya: ethernet-phy@5 {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <5>;
sfp = <&sfpa>;
};
};
/ {
sfp9: sfp@9 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp9>;
mod-def0-gpios = SFP9_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP9_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP9_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP9_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP9_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP9_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
sfpa: sfp@a {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfpa>;
mod-def0-gpios = SFP10_MOD_ABS(MPP_GPIO_REF);
los-gpios = SFP10_RX_LOS(MPP_GPIO_REF);
tx-disable-gpios = SFP10_TX_DISABLE(MPP_GPIO_REF);
tx-fault-gpios = SFP10_TX_FAULT(MPP_GPIO_REF);
rate-select0-gpios = SFP10_RS0(MPP_GPIO_REF);
rate-select1-gpios = SFP10_RS1(MPP_GPIO_REF);
maximum-power-milliwatt = <3000>;
};
};
/* Power Board */
&i2c_pwr {
// Shared IRQ on I2C_IRQ
// 0x26 U13 PCF8574 GPIO I/O
gpio_pwr1: gpio@26 {
compatible = "nxp,pcf8574a";
#gpio-cells = <2>;
gpio-controller;
reg = <0x26>;
#define GPIO_PWR1_UNUSED0 gpio_pwr1 0 GPIO_ACTIVE_HIGH
#define GPIO_PWR1_UNUSED1 gpio_pwr1 1 GPIO_ACTIVE_HIGH
#define GPIO_POE_PGOOD gpio_pwr1 2 GPIO_ACTIVE_HIGH
#define GPIO_RESET_BUTTON gpio_pwr1 3 GPIO_ACTIVE_LOW
#define GPIO_VIN1_PGOOD gpio_pwr1 4 GPIO_ACTIVE_LOW
#define GPIO_LED_VIN1_ALERT gpio_pwr1 5 GPIO_ACTIVE_LOW
#define GPIO_VIN2_PGOOD gpio_pwr1 6 GPIO_ACTIVE_LOW
#define GPIO_LED_VIN2_ALERT gpio_pwr1 7 GPIO_ACTIVE_LOW
};
//0x27 U3 PCF8574 GPIO LED
gpio_pwr2: gpio@27 {
compatible = "nxp,pcf8574a";
#gpio-cells = <2>;
gpio-controller;
reg = <0x27>;
#define GPIO_LED2G gpio_pwr2 0 GPIO_ACTIVE_LOW
#define GPIO_LED2R gpio_pwr2 1 GPIO_ACTIVE_LOW
#define GPIO_LED1G gpio_pwr2 2 GPIO_ACTIVE_LOW
#define GPIO_LED1R gpio_pwr2 3 GPIO_ACTIVE_LOW
#define GPIO_LED4G gpio_pwr2 4 GPIO_ACTIVE_LOW
#define GPIO_LED4R gpio_pwr2 5 GPIO_ACTIVE_LOW
#define GPIO_LED3G gpio_pwr2 6 GPIO_ACTIVE_LOW
#define GPIO_LED3R gpio_pwr2 7 GPIO_ACTIVE_LOW
};
//0x28* U5 TPS23861PWR PoE Controller
//0x30 U5 TPS23861PWR PoE Controller broadcast
//0x50 U15 AT24C256C EEPROM
eeprom@50 {
// AT24C256C-MAHL-T
compatible = "atmel,24c256";
reg = <0x50>;
};
};
/* System LEDs */
/ {
leds: leds {
compatible = "gpio-leds";
led-statg {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_GREEN>;
gpios = <&GPIO_LED1G>;
};
led-statr {
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED1R>;
};
led-faultg {
function = LED_FUNCTION_FAULT;
color = <LED_COLOR_ID_GREEN>;
gpios = <&GPIO_LED2G>;
};
led-faultr {
function = LED_FUNCTION_FAULT;
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED2R>;
};
led-lang {
function = LED_FUNCTION_LAN;
color = <LED_COLOR_ID_GREEN>;
gpios = <&GPIO_LED3G>;
};
led-lanr {
function = LED_FUNCTION_LAN;
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED3R>;
};
led-dbgg {
function = LED_FUNCTION_DEBUG;
color = <LED_COLOR_ID_GREEN>;
gpios = <&GPIO_LED4G>;
};
led-dbgr {
function = LED_FUNCTION_DEBUG;
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED4R>;
};
led-vin1_alert {
function = "power-1";
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED_VIN1_ALERT>;
};
led-vin2_alert {
function = "power-2";
color = <LED_COLOR_ID_RED>;
gpios = <&GPIO_LED_VIN2_ALERT>;
};
};
};
@@ -0,0 +1,8 @@
#include "cn9130.dtsi"
&cp0_syscon0 {
cp0_pinctrl: pinctrl {
/* For some reason, this is missing from cn9130.dtsi */
compatible = "marvell,cp115-standalone-pinctrl";
};
};
@@ -5,7 +5,7 @@
*/
/dts-v1/;
#include "microchip/sparx5_pcb135_emmc.dts"
#include "sparx5_pcb135_emmc.dts"
&cpu0 {
enable-method = "spin-table";
+120 -30
View File
@@ -26,6 +26,7 @@ CONFIG_CPUSETS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
CONFIG_USER_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_BLK_DEV_INITRD=y
@@ -67,28 +68,32 @@ CONFIG_CMA=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_XDP_SOCKETS=y
CONFIG_XDP_SOCKETS_DIAG=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_NET_IPIP=y
CONFIG_NET_IPGRE_DEMUX=y
CONFIG_NET_IPGRE=y
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE_DEMUX=m
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE=y
CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_NET_IPVTI=y
CONFIG_SYN_COOKIES=y
CONFIG_NET_IPVTI=m
CONFIG_NET_FOU_IP_TUNNELS=y
CONFIG_IPV6_SIT=m
CONFIG_IPV6_GRE=m
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
CONFIG_NETFILTER=y
CONFIG_BRIDGE_NETFILTER=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
@@ -98,17 +103,80 @@ CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_TABLES=y
CONFIG_NF_TABLES_INET=y
CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_CT=m
CONFIG_NFT_CONNLIMIT=m
CONFIG_NFT_LOG=m
CONFIG_NFT_LIMIT=m
CONFIG_NFT_MASQ=m
CONFIG_NFT_REDIR=m
CONFIG_NFT_NAT=m
CONFIG_NFT_TUNNEL=m
CONFIG_NFT_OBJREF=m
CONFIG_NFT_QUEUE=m
CONFIG_NFT_REJECT=m
CONFIG_NFT_COMPAT=m
CONFIG_NFT_HASH=m
CONFIG_NFT_XFRM=m
CONFIG_NFT_SOCKET=m
CONFIG_NFT_OSF=m
CONFIG_NFT_DUP_NETDEV=m
CONFIG_NFT_FWD_NETDEV=m
CONFIG_NFT_REJECT_NETDEV=m
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
CONFIG_NETFILTER_XT_TARGET_LOG=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
CONFIG_NETFILTER_XT_MATCH_BPF=m
CONFIG_NETFILTER_XT_MATCH_CGROUP=m
CONFIG_NETFILTER_XT_MATCH_COMMENT=m
CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_NETFILTER_XT_MATCH_DSCP=m
CONFIG_NETFILTER_XT_MATCH_HELPER=m
CONFIG_NETFILTER_XT_MATCH_LIMIT=m
CONFIG_NETFILTER_XT_MATCH_MAC=m
CONFIG_NETFILTER_XT_MATCH_MARK=m
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_MANGLE=m
CONFIG_NF_LOG_IPV6=m
CONFIG_IP6_NF_IPTABLES=m
CONFIG_IP6_NF_MATCH_AH=m
CONFIG_IP6_NF_MATCH_EUI64=m
CONFIG_IP6_NF_MATCH_IPV6HEADER=m
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_TARGET_REJECT=m
CONFIG_IP6_NF_RAW=m
CONFIG_IP6_NF_NAT=m
CONFIG_IP6_NF_TARGET_MASQUERADE=m
CONFIG_IP6_NF_TARGET_NPT=m
CONFIG_NF_TABLES_BRIDGE=m
CONFIG_NFT_BRIDGE_META=m
CONFIG_NF_CONNTRACK_BRIDGE=m
CONFIG_BRIDGE_NF_EBTABLES=m
CONFIG_BRIDGE_EBT_BROUTE=m
CONFIG_BRIDGE_EBT_T_FILTER=m
CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_802_3=m
CONFIG_BRIDGE_EBT_ARP=m
CONFIG_BRIDGE_EBT_IP=m
CONFIG_BRIDGE_EBT_IP6=m
CONFIG_BRIDGE_EBT_LIMIT=m
CONFIG_BRIDGE_EBT_PKTTYPE=m
CONFIG_BRIDGE_EBT_STP=m
CONFIG_BRIDGE_EBT_VLAN=m
CONFIG_BRIDGE_EBT_ARPREPLY=m
CONFIG_BRIDGE_EBT_DNAT=m
CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
CONFIG_BPFILTER=y
CONFIG_BRIDGE=y
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE_MRP=y
@@ -117,9 +185,22 @@ CONFIG_NET_DSA=y
CONFIG_VLAN_8021Q=y
CONFIG_VLAN_8021Q_GVRP=y
CONFIG_VLAN_8021Q_MVRP=y
CONFIG_NET_L3_MASTER_DEV=y
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBQ=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_TCINDEX=y
CONFIG_NET_CLS_BPF=y
CONFIG_NET_CLS_FLOWER=y
CONFIG_NETLINK_DIAG=y
CONFIG_MPLS=y
CONFIG_NET_MPLS_GSO=y
CONFIG_MPLS_ROUTING=m
CONFIG_MPLS_IPTUNNEL=m
CONFIG_NET_PKTGEN=y
# CONFIG_WIRELESS is not set
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_LWTUNNEL=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCI_IOV=y
@@ -141,7 +222,6 @@ CONFIG_MTD_SPI_NOR=y
CONFIG_OF_OVERLAY=y
CONFIG_BLK_DEV_NULL_BLK=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_NBD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_NVME=y
@@ -164,25 +244,25 @@ CONFIG_DM_INIT=y
CONFIG_DM_VERITY=y
CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y
CONFIG_NETDEVICES=y
CONFIG_BONDING=y
CONFIG_DUMMY=y
CONFIG_NET_TEAM=y
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=y
CONFIG_NET_TEAM_MODE_LOADBALANCE=y
CONFIG_MACVLAN=y
CONFIG_MACVTAP=y
CONFIG_IPVLAN=y
CONFIG_IPVTAP=y
CONFIG_VXLAN=y
CONFIG_GENEVE=y
CONFIG_BAREUDP=y
CONFIG_MACSEC=y
CONFIG_TUN=y
CONFIG_VETH=y
CONFIG_BONDING=m
CONFIG_DUMMY=m
CONFIG_NET_TEAM=m
CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m
CONFIG_NET_TEAM_MODE_LOADBALANCE=m
CONFIG_MACVLAN=m
CONFIG_MACVTAP=m
CONFIG_IPVLAN=m
CONFIG_IPVTAP=m
CONFIG_VXLAN=m
CONFIG_GENEVE=m
CONFIG_BAREUDP=m
CONFIG_MACSEC=m
CONFIG_TUN=m
CONFIG_VETH=m
CONFIG_VIRTIO_NET=y
CONFIG_NLMON=y
CONFIG_NET_VRF=y
CONFIG_NET_DSA_MV88E6XXX=y
CONFIG_NET_DSA_MV88E6XXX=m
CONFIG_NET_DSA_MV88E6XXX_PTP=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_VENDOR_ADAPTEC is not set
@@ -207,8 +287,8 @@ CONFIG_NET_DSA_MV88E6XXX_PTP=y
# CONFIG_NET_VENDOR_GOOGLE is not set
# CONFIG_NET_VENDOR_HISILICON is not set
# CONFIG_NET_VENDOR_HUAWEI is not set
CONFIG_MVNETA=y
CONFIG_MVPP2=y
CONFIG_MVNETA=m
CONFIG_MVPP2=m
# CONFIG_NET_VENDOR_MELLANOX is not set
# CONFIG_NET_VENDOR_MICREL is not set
CONFIG_SPARX5_SWITCH=y
@@ -246,15 +326,16 @@ CONFIG_8139CP=y
# CONFIG_NET_VENDOR_XILINX is not set
CONFIG_SFP=y
CONFIG_MARVELL_PHY=y
CONFIG_MARVELL_10G_PHY=y
CONFIG_MARVELL_10G_PHY=m
CONFIG_MICREL_PHY=y
CONFIG_MICROCHIP_PHY=y
CONFIG_MICROCHIP_T1_PHY=y
CONFIG_MICROSEMI_PHY=y
CONFIG_MICROSEMI_PHY=m
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_MVUSB=y
CONFIG_MDIO_MSCC_MIIM=y
CONFIG_MDIO_BUS_MUX_MMIOREG=y
CONFIG_USB_RTL8152=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_CDC_EEM=y
# CONFIG_USB_NET_CDC_NCM is not set
@@ -291,6 +372,7 @@ CONFIG_I2C_SLAVE=y
CONFIG_SPI=y
CONFIG_SPI_ARMADA_3700=y
CONFIG_SPI_NXP_FLEXSPI=y
CONFIG_SPI_ORION=y
CONFIG_SPI_PL022=y
CONFIG_SPI_MUX=y
CONFIG_SPI_SPIDEV=m
@@ -312,6 +394,7 @@ CONFIG_SENSORS_SPARX5=y
CONFIG_SENSORS_JC42=y
CONFIG_SENSORS_LM90=m
CONFIG_SENSORS_INA2XX=m
CONFIG_CPU_THERMAL=y
CONFIG_THERMAL_EMULATION=y
CONFIG_ARMADA_THERMAL=y
CONFIG_WATCHDOG=y
@@ -377,6 +460,7 @@ CONFIG_MMC_SPI=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_EXYNOS=y
CONFIG_MMC_DW_K3=y
CONFIG_MMC_CQHCI=y
CONFIG_MMC_SDHCI_XENON=y
CONFIG_SCSI_UFSHCD=y
CONFIG_SCSI_UFSHCD_PLATFORM=y
@@ -417,11 +501,16 @@ CONFIG_TI_ADC081C=y
CONFIG_PWM=y
CONFIG_PHY_XGENE=y
CONFIG_PHY_MVEBU_CP110_COMPHY=y
CONFIG_PHY_MVEBU_CP110_UTMI=y
CONFIG_PHY_SAMSUNG_USB2=y
CONFIG_NVMEM_LAYOUT_ONIE_TLV=y
CONFIG_MUX_MMIO=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
@@ -449,6 +538,7 @@ CONFIG_IRQ_POLL=y
CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
CONFIG_DEBUG_FS=y
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_SCHED_DEBUG is not set
@@ -1,3 +1,4 @@
label Infix (aarch64)
kernel /boot/Image
fdtdir /boot
append ${bootargs_root} ${bootargs_rauc} ${bootargs_log}
+3 -2
View File
@@ -1,9 +1,10 @@
[system]
compatible=infix-aarch64
bootloader=uboot
statusfile=/var/lib/rauc/status
statusfile=/mnt/aux/rauc.status
mountprefix=/var/lib/rauc/mnt
bundle-formats=-plain
max-bundle-download-size=1073741824
[keyring]
directory=/etc/rauc/keys
@@ -17,5 +18,5 @@ device=/dev/disk/by-partlabel/secondary
bootname=secondary
[slot.net.0]
device=/dev/ram
device=/dev/ram0
bootname=net
+1
View File
@@ -0,0 +1 @@
x33x0fw_0_3_11_0_11832.hdr
-29
View File
@@ -1,29 +0,0 @@
set timeout="1"
set default="primary"
set log="loglevel=4"
load_env ORDER DEBUG
for slot in $ORDER; do
set default="$slot"
break
done
if [ "$DEBUG" ]; then
set log="debug"
fi
submenu "primary" "$log" {
set slot="$1"
set append="$2"
set root=(hd0,gpt3)
source /boot/grub/grub.cfg
}
submenu "secondary" "$log" {
set slot="$1"
set append="$2"
set root=(hd0,gpt4)
source /boot/grub/grub.cfg
}
-3
View File
@@ -1,3 +0,0 @@
menuentry "Infix" --id infix {
linux /boot/bzImage root=PARTLABEL=$slot rauc.slot=$slot console=ttyS0 $append nokaslr
}
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
. "$BR2_CONFIG"
# Prevent regen of host key at every boot, /etc is saved across reboots
if [ -L "$TARGET_DIR/etc/dropbear" ]; then
rm "$TARGET_DIR/etc/dropbear"
mkdir "$TARGET_DIR/etc/dropbear"
fi
@@ -415,17 +415,11 @@ a printer can publish IPP records with meta data on the printer type and model
or donwload URL for drivers. Switches and routers usually publish how they
can be reached: HTTP/HTTPS and SSH.
Note: there are other mechanisms for device discovery. Microsoft have been
slow to adopt mDNS, having relied on their own SSDP protocol. For the
full experince Apple's "Bonjour" can be installed in Windows.
mDNS is supported in this product and should be enabled by default. To
verify it works, open the Windows File Explorer (Win+E) and scroll to
Network in the left-hand menu. An icon with a matching hostname can be
found there which, when clicked, opens up the device's Web Interface.
macOS users have mDNS fully integrated by default. Linux users can use
'mdns-scan' or Avahi, as shown above. The latter two can also just set
their web browsers to https://hostname-01-02-03.local
mDNS is supported in this product and should be enabled by default. To
verify that it works, in Windows, macOS, or Linux, open your web browser
and point it to <https://hostname-01-02-03.local>. This is the hostname
and three last octets of the device's base MAC address. You can also use
mDNS browsers or command line tools like mdns-scan
$(h2 "VLAN Interfaces")
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
pdmenu
clear
@@ -215,10 +215,10 @@ system()
{
h1 "SYSTEM INFORMATION"
echo "System Name : $(uname -n)"
echo "System Boot Mode : $(cat /tmp/.boot_mode)"
echo "System Variant : $VARIANT"
echo "System Description : $PRETTY_NAME"
echo "System Contact : $HOME_URL"
echo "System Timezone : $TZ"
echo "System Timezone : $(cat /etc/timezone)"
echo "System Type : $NAME"
echo "System Version : $(cat /etc/version)"
echo "System Arch : $(uname -m)"
+18
View File
@@ -0,0 +1,18 @@
# System-wide .bashrc file for interactive bash(1) shells.
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# Reevaluate for each line, in case hostname changes
function prompt_command
{
PS1="\u@$(hostname):\w\$ "
}
export PROMPT_COMMAND=prompt_command
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# Disble built-ins
enable -n help
@@ -0,0 +1 @@
run [S] /lib/infix/swup --
@@ -60,8 +60,7 @@ menu:system:System:System Settings
exec:_Enable service:edit:initctl enable ~Enter name of service (filename) to enable:~
exec:_Disable service:edit:initctl disable ~Enter name of service (filename) to disable:~
nop
exec:_Change Operating Mode::chom
exec:_Factory Reset::yorn "Reboot and factory reset device, are you sure?" factory -y
exec:_Factory Reset::yorn "Factory reset device (reboots), are you sure?" factory -y
nop
exit:_Main menu..
+62
View File
@@ -0,0 +1,62 @@
#!/bin/sh
# Factory default:
# 1) all switch ports in VLAN 1 of br0
# 2) no switch ports => DHCP on eth0
# 3) no eth0
create_bridge()
{
nm=$1
shift
ports=$@
touch "/etc/network/interfaces.d/$nm"
for port in $ports; do
cat <<-EOF >>"/etc/network/interfaces.d/$nm"
iface $port
bridge-access 1
post-up ip link set $port group port
EOF
done
cat <<-EOF >> "/etc/network/interfaces.d/$nm"
auto $nm
iface $nm
bridge-ports $ports
bridge-vlan-aware yes
bridge-stp on
bridge-vids 1
auto vlan1
iface vlan1 inet dhcp
vlan-id 1
vlan-raw-device $nm
post-up ip link set vlan1 group iface
EOF
ip link set vlan1 group iface
}
# Check if already set up
[ -z "$(ls -A /etc/network/interfaces.d/)" ] || exit 0
# Check for custom hostname from Qemu/Qeneth
nm=$(cat /sys/firmware/qemu_fw_cfg/by_name/opt/hostname/raw)
if [ -n "$nm" ]; then
hostnm "$nm"
fi
# need to check for 'length > 0' because ip command
# outputs empty json objects for non-port group ifs
ports=$(ip -json link show group port | jq -r '.[].ifname | select(length > 0)' | tr "\n" " ")
if [ -n "$ports" ]; then
create_bridge br0 $ports
else
ifaces=$(ip -json addr show |jq -r '.[] | select(.link_type=="ether").ifname')
for iface in $ifaces; do
cat <<-EOF > "/etc/network/interfaces.d/$iface"
auto $iface
iface $iface inet dhcp
pre-up ip link set $iface group iface
EOF
done
fi
+82 -18
View File
@@ -1,7 +1,10 @@
comment "Image Signing"
menuconfig SIGN_ENABLED
bool "Image Signing"
default y
choice
prompt "Signing key source"
depends on SIGN_ENABLED
default SIGN_SRC_DIR
config SIGN_SRC_DIR
@@ -14,19 +17,9 @@ endchoice
config SIGN_KEY
string "Signing key"
depends on SIGN_ENABLED
default "${BR2_EXTERNAL_INFIX_PATH}/board/common/dev-key" if SIGN_SRC_DIR
comment "Additional Artifacts"
# For /etc/os-release, uses CondtionArchitechture= from systemd.unit(5)
config INFIX_ARCH
string
default "arm" if BR2_arm
default "arm64" if BR2_aarch64
default "mips64" if BR2_mips64
default "riscv64" if BR2_riscv
default "x86_64" if BR2_x86_64
menuconfig DISK_IMAGE
bool "Disk image"
help
@@ -38,25 +31,96 @@ menuconfig DISK_IMAGE
- Creating a GNS3 appliance
- Developing/debugging issues in the boot process in QEMU
config DISK_IMAGE_SIZE
menuconfig DISK_IMAGE_SIZE
string "Image size"
depends on DISK_IMAGE
default "512M"
help
Create a disk image of this size. Suffixes like K/M/G may be
used to multiply by powers of 1024. Suffixes like KB/MB/GB may
be used to multiply by powers of 1000.
Create a disk image of this size. A K/M/G suffix may be used
to multiply by powers of 1024. Suffixes like KB/MB/GB may be
used to multiply by powers of 1000. The image will be split
proportionally to fit the two rootfs, a kernel, a writable
/cfg and /var partiotions.
Minimum supported size is 512M.
config GNS3_APPLIANCE
choice
prompt "Bootloader"
depends on DISK_IMAGE
default DISK_IMAGE_BOOT_EFI if BR2_x86_64
default DISK_IMAGE_BOOT_NONE
config DISK_IMAGE_BOOT_NONE
bool "None"
help
Do not create any bootloader partition in the disk image.
config DISK_IMAGE_BOOT_EFI
bool "EFI"
help
Create a boot partition from a directory containing an EFI
boot application, e.g. GRUB.
config DISK_IMAGE_BOOT_BIN
bool "Binary"
help
Create a boot partition from a raw image containing the boot
application, e.g. U-Boot.
endchoice
config DISK_IMAGE_BOOT_DATA
string "Bootloader data"
depends on DISK_IMAGE
depends on DISK_IMAGE_BOOT_EFI || DISK_IMAGE_BOOT_BIN
default "${BINARIES_DIR}/efi-part/EFI" if BR2_x86_64
help
Path to the directory or file holding the bootloader data.
config DISK_IMAGE_BOOT_OFFSET
hex "Bootloader offset"
depends on DISK_IMAGE
depends on DISK_IMAGE_BOOT_EFI || DISK_IMAGE_BOOT_BIN
default 0x8000
help
Offset at which the bootloader partition is placed. Remember
to make sure that the GPT still fits at the start of the
image.
config DISK_IMAGE_RELEASE_URL
string "Infix URL"
depends on DISK_IMAGE
depends on !BR2_TARGET_ROOTFS_SQUASHFS
default "https://github.com/kernelkit/infix/releases/download/latest/infix-${BR2_ARCH}.tar.gz"
help
In situations where Infix itself is not being built, but a
disk image is, i.e. when building a bootloader: place this
Infix release in the primary and secondary partitions.
menuconfig GNS3_APPLIANCE
bool "GNS3 Appliance"
select DISK_IMAGE
default y if BR2_x86_64
default y
help
Create a GNS3 appliance description that, together with the
disk image, can be imported into GNS3.
config GNS3_APPLIANCE_RAM
int "Reserved RAM (MiB)"
depends on GNS3_APPLIANCE
default "192"
help
Amount of host RAM reserved for an appliance instance.
Minimum supported size is 192M.
config GNS3_APPLIANCE_IFNUM
int "Number of interfaces"
depends on GNS3_APPLIANCE
default "1"
help
Number of Ethernet interfaces to create for an appliance instance.
menuconfig FIT_IMAGE
bool "Traditional FIT image"
help
+17 -6
View File
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.35.0
# Mon Dec 12 13:47:01 2022
# Busybox version: 1.36.0
# Tue Oct 3 18:00:40 2023
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -93,6 +93,9 @@ CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
CONFIG_PASSWORD_MINLEN=6
CONFIG_MD5_SMALL=1
CONFIG_SHA1_SMALL=3
CONFIG_SHA1_HWACCEL=y
CONFIG_SHA256_HWACCEL=y
CONFIG_SHA3_SMALL=1
CONFIG_FEATURE_NON_POSIX_CP=y
# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
@@ -123,6 +126,9 @@ CONFIG_LAST_SUPPORTED_WCHAR=0
# CONFIG_UNICODE_BIDI_SUPPORT is not set
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
# CONFIG_UNICODE_PRESERVE_BROKEN is not set
# CONFIG_LOOP_CONFIGURE is not set
# CONFIG_NO_LOOP_CONFIGURE is not set
CONFIG_TRY_LOOP_CONFIGURE=y
#
# Applets
@@ -338,6 +344,7 @@ CONFIG_FEATURE_TR_CLASSES=y
CONFIG_FEATURE_TR_EQUIV=y
CONFIG_TRUE=y
CONFIG_TRUNCATE=y
CONFIG_TSORT=y
CONFIG_TTY=y
CONFIG_UNAME=y
CONFIG_UNAME_OSNAME="GNU/Linux"
@@ -526,13 +533,13 @@ CONFIG_USE_BB_CRYPT_SHA=y
CONFIG_ADDGROUP=y
CONFIG_FEATURE_ADDUSER_TO_GROUP=y
CONFIG_ADDUSER=y
# CONFIG_FEATURE_CHECK_NAMES is not set
CONFIG_FEATURE_CHECK_NAMES=y
CONFIG_LAST_ID=60000
CONFIG_FIRST_SYSTEM_ID=100
CONFIG_LAST_SYSTEM_ID=999
# CONFIG_CHPASSWD is not set
CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="md5"
# CONFIG_CRYPTPW is not set
CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="sha512"
CONFIG_CRYPTPW=y
CONFIG_MKPASSWD=y
CONFIG_DELUSER=y
CONFIG_DELGROUP=y
@@ -549,7 +556,7 @@ CONFIG_SU=y
CONFIG_FEATURE_SU_SYSLOG=y
CONFIG_FEATURE_SU_CHECKS_SHELLS=y
# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set
CONFIG_SULOGIN=y
# CONFIG_SULOGIN is not set
CONFIG_VLOCK=y
#
@@ -831,10 +838,12 @@ CONFIG_READAHEAD=y
CONFIG_RFKILL=y
CONFIG_RUNLEVEL=y
CONFIG_RX=y
CONFIG_SEEDRNG=y
CONFIG_SETFATTR=y
CONFIG_SETSERIAL=y
CONFIG_STRINGS=y
CONFIG_TIME=y
CONFIG_TREE=y
CONFIG_TS=y
CONFIG_TTYSIZE=y
CONFIG_UBIATTACH=y
@@ -1007,6 +1016,7 @@ CONFIG_UDHCPC=y
CONFIG_FEATURE_UDHCPC_ARPING=y
CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y
CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
CONFIG_UDHCPC6_DEFAULT_SCRIPT="/usr/share/udhcpc/default6.script"
CONFIG_UDHCPC6=y
CONFIG_FEATURE_UDHCPC6_RFC3646=y
CONFIG_FEATURE_UDHCPC6_RFC4704=y
@@ -1141,6 +1151,7 @@ CONFIG_ASH_IDLE_TIMEOUT=y
CONFIG_ASH_ECHO=y
CONFIG_ASH_PRINTF=y
CONFIG_ASH_TEST=y
CONFIG_ASH_SLEEP=y
CONFIG_ASH_HELP=y
CONFIG_ASH_GETOPTS=y
CONFIG_ASH_CMDCMD=y
+1 -1
View File
@@ -30,7 +30,7 @@ image var.ext4 {
}
}
image disk.img {
image @DISKIMG@ {
size = @TOTALSIZE@
hdimage {
partition-table-type = "gpt"
+13 -4
View File
@@ -9,11 +9,20 @@ die()
exit 1
}
# Find all matching key=value assignments in output/.config
# E.g., load_cfg DISK_IMAGE sets the following variables:
#
# DISK_IMAGE=y
# DISK_IMAGE_SIZE="512"
# etc.
#
# shellcheck disable=SC1090
load_cfg()
{
local tmp=$(mktemp -p /tmp)
tmp=$(mktemp -p /tmp)
grep "$1" $BR2_CONFIG >$tmp
. $tmp
rm $tmp
grep -E "${1}.*=" "$BR2_CONFIG" >"$tmp"
. "$tmp"
rm "$tmp"
}
+44 -21
View File
@@ -17,7 +17,6 @@ size2int()
dimension()
{
if [ $total -ge $((4 << G)) ]; then
bootsize=$(( 8 << M))
auxsize=$(( 8 << M))
@@ -31,14 +30,14 @@ dimension()
cfgsize=$((256 << M))
# var is at least ~1.75G
elif [ $total -ge $((1 << G)) ]; then
bootsize=$(( 4 << M))
auxsize=$(( 4 << M))
bootsize=$(( 8 << M))
auxsize=$(( 8 << M))
imgsize=$((256 << M))
cfgsize=$(( 64 << M))
# var is at least ~0.5G
elif [ $total -ge $((512 << M)) ]; then
bootsize=$(( 4 << M))
auxsize=$(( 4 << M))
bootsize=$(( 8 << M))
auxsize=$(( 8 << M))
imgsize=$((192 << M))
cfgsize=$(( 16 << M))
# var is at least ~100M
@@ -81,7 +80,7 @@ probeboot()
genboot()
{
if [ -d $BINARIES_DIR/efi-part/EFI ]; then
if [ -d "$bootdata" ]; then
bootimg=$(cat <<EOF
image efi-part.vfat {
size = $bootsize
@@ -103,6 +102,17 @@ EOF
EOF
)
elif [ -f "$bootdata" ]; then
bootpart=$(cat <<EOF
partition boot {
offset = $bootoffs
partition-type-uuid = U
bootable = true
image = $bootdata
size = $bootsize
}
EOF
)
fi
}
@@ -111,15 +121,26 @@ root=$BUILD_DIR/genimage.root
tmp=$BUILD_DIR/genimage.tmp
total=$((512 << M))
bootoffs=
bootoffs=$((32 << K))
bootdata=
diskimg=disk.img
bootimg=
bootpart=
while getopts "a:s:" opt; do
while getopts "a:b:B:n:s:" opt; do
case ${opt} in
a)
arch=$OPTARG
;;
b)
bootdata=$OPTARG
;;
B)
bootoffs=$(($OPTARG))
;;
n)
diskimg=${OPTARG}
;;
s)
total=$(size2int $OPTARG)
;;
@@ -141,6 +162,7 @@ awk \
-vimgsize=$imgsize \
-vcfgsize=$cfgsize \
-vvarsize=$varsize \
-vdiskimg=$diskimg \
-vbootimg="$bootimg" -vbootpart="$bootpart" \
'{
sub(/@TOTALSIZE@/, total);
@@ -149,7 +171,7 @@ awk \
sub(/@IMGSIZE@/, imgsize);
sub(/@CFGSIZE@/, cfgsize);
sub(/@VARSIZE@/, varsize);
sub(/@DISKIMG@/, diskimg);
sub(/@BOOTIMG@/, bootimg);
sub(/@BOOTPART@/, bootpart);
}1' \
@@ -158,27 +180,28 @@ awk \
mkdir -p $root/aux
cp -f $BINARIES_DIR/rootfs.itbh $root/aux/primary.itbh
cp -f $BINARIES_DIR/rootfs.itbh $root/aux/secondary.itbh
cp -f $BINARIES_DIR/rauc.status $root/aux/rauc.status
case "$arch" in
aarch64)
mkenvimage -s 0x4000 -o $root/aux/uboot.env \
$BR2_EXTERNAL_INFIX_PATH/board/common/uboot/aux-env.txt
mkenvimage -s 0x4000 -o "$root/aux/uboot.env" \
"$BR2_EXTERNAL_INFIX_PATH/board/common/uboot/aux-env.txt"
;;
x86_64)
mkdir -p $root/aux/grub
cp -f $BR2_EXTERNAL_INFIX_PATH/board/amd64/grub.cfg \
$BR2_EXTERNAL_INFIX_PATH/board/amd64/grubenv \
$root/aux/grub/
mkdir -p "$root/aux/grub"
cp -f "$BR2_EXTERNAL_INFIX_PATH/board/$arch/grub.cfg" \
"$BR2_EXTERNAL_INFIX_PATH/board/$arch/grubenv" \
"$root/aux/grub/"
;;
*)
;;
esac
rm -rf $tmp
rm -rf "$tmp"
genimage \
--rootpath $root \
--tmppath $tmp \
--inputpath $BINARIES_DIR \
--outputpath $BINARIES_DIR \
--config $root/genimage.cfg
--rootpath "$root" \
--tmppath "$tmp" \
--inputpath "$BINARIES_DIR" \
--outputpath "$BINARIES_DIR" \
--config "$root/genimage.cfg"
+12 -2
View File
@@ -18,12 +18,22 @@ load_cfg()
load_cfg
[ "$FIT_IMAGE" = "y" ] || exit 0
work=$(pwd)/build/fit-image-local
work=$BUILD_DIR/fit-image-local
dtbs=$(find $BINARIES_DIR -name '*.dtb')
kernel=$(find $BINARIES_DIR -name '*Image' | head -n1)
squash=$BINARIES_DIR/rootfs.squashfs
mkdir -p $work
gzip <$kernel >$work/Image.gz
kernel=$work/Image.gz
rm -rf $work/rootfs
unsquashfs -f -d $work/rootfs $squash
rm -f $work/rootfs/boot/*Image
squash=$work/rootfs-no-kernel.squashfs
rm -f $squash
mksquashfs $work/rootfs $squash
# mkimage will only align images to 4 bytes, but U-Boot will leave
# both DTB and ramdisk in place when starting the kernel. So we pad
@@ -79,7 +89,7 @@ cat <<EOF >$work/infix.its
arch = "$FIT_ARCH";
os = "linux";
$(cat $work/kernel-load.itsi)
compression = "none";
compression = "gzip";
data = /incbin/("$kernel");
};
+72 -21
View File
@@ -1,41 +1,92 @@
#!/bin/sh
# shellcheck disable=SC1091
. "$TARGET_DIR/etc/os-release"
cat <<EOF >"$BINARIES_DIR/infix.gns3a"
if [ -n "$INFIX_RELEASE" ]; then
rel="-${INFIX_RELEASE}"
fi
ARCH=$1
NM="${2:-custom}${rel}"
DISK=$3
RAM=${4:-512}
IFNUM=${5:-1}
# The aarch64 build currently has no "loader" but instead starts Linux
# directly, so we need to add a basic cmdline.
loader_args()
{
"name": "infix",
if [ "$ARCH" = "aarch64" ]; then
cat <<EOF
"kernel_command_line": "console=ttyAMA0 root=PARTLABEL=primary quiet",
EOF
fi
}
loader_img()
{
if [ "$ARCH" = "x86_64" ]; then
cat <<EOF
"bios_image": "$loader",
EOF
else
cat <<EOF
"kernel_image": "$loader",
EOF
fi
}
if [ "$ARCH" = "x86_64" ]; then
loader=OVMF.fd
accel=allow
opts=
else
loader=Image
accel=disable
opts="-M virt -cpu cortex-a72"
fi
echo ">> Disk image MD5: $(md5sum "$BINARIES_DIR/$DISK" | awk '{print $1}')"
cat <<EOF >"$BINARIES_DIR/${NM}.gns3a"
{
"name": "$NM",
"category": "router",
"description": "Infix is a Network Operating System based on Linux. It can be set up both as a switch, with offloading using switchdev, and a router with firewalling.",
"vendor_name": "KernelKit",
"vendor_url": "https://github.com/kernelkit/",
"product_name": "Infix",
"description": "$INFIX_DESC",
"vendor_name": "$VENDOR_NAME",
"vendor_url": "$VENDOR_HOME",
"product_name": "$NAME",
"registry_version": 6,
"status": "stable",
"maintainer": "KernelKit",
"maintainer_email": "kernelkit@googlegroups.com",
"usage": "Default login is 'root', no password.\n\nType 'help' for an overview of commands and relevant configuration files.\n\nThe /etc directory is writable, use the passwd tool after login as part of your set up.\nFor networking, classify interfaces as switchports with /etc/mactab, syntax: 'MAC-address eN', where N is the port number (1-MAX).\nTo set up bridging and management interfaces, use /etc/network/interfaces, and /etc/network/interfaces.d/",
"maintainer": "$VENDOR_NAME",
"maintainer_email": "${SUPPORT_URL#mailto:}",
"usage": "Default login, user/pass: admin/admin\n\nType 'help' for an overview of commands and relevant configuration files.\n\nFor Classic builds the following applies: the /etc directory is writable, use the passwd tool after login as part of your set up.\nFor networking, classify interfaces as switchports with /etc/mactab, syntax: 'MAC-address eN', where N is the port number (1-MAX).\nTo set up bridging and management interfaces, use /etc/network/interfaces, and /etc/network/interfaces.d/",
"port_name_format": "eth{0}",
"linked_clone": true,
"qemu": {
"adapter_type": "virtio-net-pci",
"adapters": 10,
"ram": 512,
"adapters": ${IFNUM},
"ram": ${RAM},
"cpus": 1,
"hda_disk_interface": "virtio",
"arch": "x86_64",
"arch": "$ARCH",
"console_type": "telnet",
"kvm": "allow"
$(loader_img)
$(loader_args)
"kvm": "$accel",
"options": "$opts"
},
"images": [
{
"filename": "OVMF.fd",
"filesize": $(stat --printf='%s' "$BINARIES_DIR/OVMF.fd"),
"md5sum": "$(md5sum "$BINARIES_DIR/OVMF.fd" | awk '{print $1}')",
"filename": "$loader",
"filesize": $(stat --printf='%s' "$BINARIES_DIR/$loader"),
"md5sum": "$(md5sum "$BINARIES_DIR/$loader" | awk '{print $1}')",
"version": "0.0"
},
{
"filename": "disk.img",
"filesize": $(stat --printf='%s' "$BINARIES_DIR/disk.img"),
"md5sum": "$(md5sum "$BINARIES_DIR/disk.img" | awk '{print $1}')",
"filename": "$DISK",
"filesize": $(stat --printf='%s' "$BINARIES_DIR/$DISK"),
"md5sum": "$(md5sum "$BINARIES_DIR/$DISK" | awk '{print $1}')",
"version": "0.0"
}
],
@@ -43,8 +94,8 @@ cat <<EOF >"$BINARIES_DIR/infix.gns3a"
{
"name": "0.0",
"images": {
"bios_image": "OVMF.fd",
"hda_disk_image": "disk.img"
$(loader_img)
"hda_disk_image": "$DISK"
}
}
]
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
set -e
# Bootstrap a RAUC status file showing the newly created image
# installed to both the primary and secondary slots. This then bundled
# in the aux partition in mkdisk.sh, so that RAUC (on the target) can
# always report the installed versions.
rauc info --no-verify --output-format=shell $1 >/tmp/rauc-$$.info
. /tmp/rauc-$$.info
rm /tmp/rauc-$$.info
tstamp=$(date -u +%FT%TZ)
cat <<EOF
[slot.rootfs.0]
bundle.compatible=$RAUC_MF_COMPATIBLE
bundle.version=$RAUC_MF_VERSION
status=ok
sha256=$RAUC_IMAGE_DIGEST_0
size=$RAUC_IMAGE_SIZE_0
installed.timestamp=$tstamp
installed.count=1
activated.timestamp=$tstamp
activated.count=1
[slot.rootfs.1]
bundle.compatible=$RAUC_MF_COMPATIBLE
bundle.version=$RAUC_MF_VERSION
status=ok
sha256=$RAUC_IMAGE_DIGEST_0
size=$RAUC_IMAGE_SIZE_0
installed.timestamp=$tstamp
installed.count=1
activated.timestamp=$tstamp
activated.count=1
EOF
+5 -4
View File
@@ -4,8 +4,9 @@ set -e
GIT_VERSION=$(git -C $BR2_EXTERNAL_INFIX_PATH describe --always --dirty --tags)
arch=$1
sign=$2
name=$1
arch=$2
sign=$3
crt=$(ls $sign/*.crt)
key=$(ls $sign/*.key)
@@ -38,7 +39,7 @@ filename=rootfs.img
hooks=post-install
EOF
rm -f $BINARIES_DIR/infix-$arch.pkg
rm -f $BINARIES_DIR/$name.pkg
rauc --cert=$crt --key=$key \
bundle $work $BINARIES_DIR/infix-$arch.pkg
bundle $work $BINARIES_DIR/$name.pkg
+67 -14
View File
@@ -1,29 +1,82 @@
#!/bin/sh
. "$BR2_CONFIG"
# shellcheck disable=SC1090,SC1091
. "$BR2_CONFIG" 2>/dev/null
. "$TARGET_DIR/usr/lib/os-release"
if [ -n "${ID_LIKE}" ]; then
ID="${ID} ${ID_LIKE}"
fi
GIT_VERSION=$(git -C $BR2_EXTERNAL_INFIX_PATH describe --always --dirty --tags)
if [ -z "$GIT_VERSION" ]; then
infix_path="$BR2_EXTERNAL_INFIX_PATH"
if [ -n "$INFIX_OEM_PATH" ]; then
# Use version from br2-external OEM:ing Infix
infix_path="$INFIX_OEM_PATH"
fi
GIT_VERSION=$(git -C "$infix_path" describe --always --dirty --tags)
fi
# Override VERSION in /etc/os-release and filenames for release builds
if [ -n "$INFIX_RELEASE" ]; then
VERSION="$INFIX_RELEASE"
else
VERSION=$GIT_VERSION
fi
# This is a symlink to /usr/lib/os-release, so we remove this to keep
# original Buildroot information.
rm "$TARGET_DIR/etc/os-release"
rm -f "$TARGET_DIR/etc/os-release"
{
echo "NAME=\"Infix\""
echo "VERSION=${GIT_VERSION}"
echo "ID=infix"
echo "ID_LIKE=\"${ID}\""
echo "VERSION_ID=${GIT_VERSION}"
echo "BUILD_ID=\"${NAME} ${VERSION}\""
echo "PRETTY_NAME=\"Infix by KernelKit\""
echo "ARCHITECTURE=\"${INFIX_ARCH}\""
echo "HOME_URL=https://github.com/KernelKit"
echo "NAME=\"$INFIX_NAME\""
echo "ID=$INFIX_ID"
echo "PRETTY_NAME=\"$INFIX_TAGLINE\""
echo "ID_LIKE=\"${ID}\""
echo "VERSION=\"${VERSION}\""
echo "VERSION_ID=${VERSION}"
echo "BUILD_ID=\"${GIT_VERSION}\""
if [ -n "$INFIX_IMAGE_ID" ]; then
echo "IMAGE_ID=\"$INFIX_IMAGE_ID\""
fi
if [ -n "$INFIX_RELEASE" ]; then
echo "IMAGE_VERSION=\"$INFIX_RELEASE\""
fi
if [ "$INFIX_VARIANT_NETCONF" = "y" ]; then
echo "VARIANT=\"Managed NETCONF\""
echo "VARIANT_ID=netconf"
else
echo "VARIANT=\"Classic, writable /etc\""
echo "VARIANT_ID=classic"
fi
echo "ARCHITECTURE=\"${INFIX_ARCH}\""
echo "HOME_URL=$INFIX_HOME"
if [ -n "$INFIX_VENDOR" ]; then
echo "VENDOR_NAME=\"$INFIX_VENDOR\""
fi
if [ -n "$INFIX_VENDOR_HOME" ]; then
echo "VENDOR_HOME=\"$INFIX_VENDOR_HOME\""
fi
if [ -n "$INFIX_DOC" ]; then
echo "DOCUMENTATION_URL=\"$INFIX_DOC\""
fi
if [ -n "$INFIX_SUPPORT" ]; then
echo "SUPPORT_URL=\"$INFIX_SUPPORT\""
fi
if [ -n "$INFIX_DESC" ]; then
echo "INFIX_DESC=\"$INFIX_DESC\""
fi
} > "$TARGET_DIR/etc/os-release"
echo "Infix by KernelKit $GIT_VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version"
echo "$INFIX_TAGLINE $VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version"
# Allow pdmenu (setup) to be a login shell
# Allow pdmenu (setup) and bash to be login shells, bash is added
# automatically when selected in menuyconfig, but not when BusyBox
# provides a symlink (for ash). The /bin/{true,false} are old UNIX
# beart means of disabling a user.
grep -qsE '^/usr/bin/pdmenu$$' "$TARGET_DIR/etc/shells" \
|| echo "/usr/bin/pdmenu" >> "$TARGET_DIR/etc/shells"
grep -qsE '^/bin/bash$$' "$TARGET_DIR/etc/shells" \
|| echo "/bin/bash" >> "$TARGET_DIR/etc/shells"
grep -qsE '^/bin/true$$' "$TARGET_DIR/etc/shells" \
|| echo "/bin/true" >> "$TARGET_DIR/etc/shells"
grep -qsE '^/bin/false$$' "$TARGET_DIR/etc/shells" \
|| echo "/bin/false" >> "$TARGET_DIR/etc/shells"
+73 -10
View File
@@ -1,29 +1,69 @@
#!/bin/sh
# shellcheck disable=SC2086
common=$(dirname "$(readlink -f "$0")")
. $common/lib.sh
. "$common/lib.sh"
load_cfg BR2_EXTERNAL_INFIX_PATH
# shellcheck disable=SC1091
. "$TARGET_DIR/etc/os-release"
load_cfg INFIX_ID
load_cfg BR2_ARCH
load_cfg SIGN_KEY
load_cfg BR2_DEFCONFIG
load_cfg BR2_EXTERNAL_INFIX_PATH
load_cfg BR2_TARGET_ROOTFS
if [ -n "$IMAGE_ID" ]; then
NAME="$IMAGE_ID"
else
NAME="$INFIX_ID"-$(echo "$BR2_ARCH" | tr _ - | sed 's/x86-64/x86_64/')
fi
diskimg=disk.img
ixmsg "Signing SquashFS Image"
$common/sign.sh $BR2_ARCH $SIGN_KEY
ver()
{
if [ -n "$INFIX_RELEASE" ]; then
printf -- "-%s" "$INFIX_RELEASE"
return
fi
}
ixmsg "Creating RAUC Update Bundle"
$common/mkrauc.sh $BR2_ARCH $SIGN_KEY
load_cfg SIGN_ENABLED
if [ "$SIGN_ENABLED" = "y" ]; then
load_cfg BR2_ARCH
load_cfg SIGN_KEY
ixmsg "Signing SquashFS Image"
$common/sign.sh $BR2_ARCH $SIGN_KEY
ixmsg "Creating RAUC Update Bundle"
$common/mkrauc.sh "$NAME$(ver)" $BR2_ARCH $SIGN_KEY
fi
load_cfg DISK_IMAGE
if [ "$DISK_IMAGE" = "y" ]; then
ixmsg "Creating Disk Image"
$common/mkdisk.sh -a $BR2_ARCH
diskimg="${NAME}-disk.img"
bootcfg=
if [ "$DISK_IMAGE_BOOT_DATA" ]; then
bootcfg="-b $DISK_IMAGE_BOOT_DATA -B $DISK_IMAGE_BOOT_OFFSET"
fi
if [ "$BR2_TARGET_ROOTFS_SQUASHFS" != "y" ] && \
[ ! -f "$BINARIES_DIR/rootfs.squashfs" ]; then
ixmsg " Injecting $DISK_IMAGE_RELEASE_URL"
archive="$BINARIES_DIR/$(basename $DISK_IMAGE_RELEASE_URL)"
[ -f "$archive" ] || wget -O"$archive" "$DISK_IMAGE_RELEASE_URL"
tar -xa --strip-components=1 -C "$BINARIES_DIR" -f "$archive"
fi
$common/mkrauc-status.sh "$BINARIES_DIR/${NAME}.pkg" >"$BINARIES_DIR/rauc.status"
$common/mkdisk.sh -a $BR2_ARCH -n $diskimg -s $DISK_IMAGE_SIZE $bootcfg
fi
load_cfg GNS3_APPLIANCE
if [ "$GNS3_APPLIANCE" = "y" ]; then
ixmsg "Creating GNS3 Appliance"
$common/mkgns3a.sh
ixmsg "Creating GNS3 Appliance, $GNS3_APPLIANCE_RAM MiB with $GNS3_APPLIANCE_IFNUM ports"
$common/mkgns3a.sh $BR2_ARCH $NAME $diskimg $GNS3_APPLIANCE_RAM $GNS3_APPLIANCE_IFNUM
fi
load_cfg FIT_IMAGE
@@ -31,3 +71,26 @@ if [ "$FIT_IMAGE" = "y" ]; then
ixmsg "Creating Traditional FIT Image"
$common/mkfit.sh
fi
if [ "$BR2_TARGET_ROOTFS_SQUASHFS" = "y" ]; then
if [ -z "${NAME##*minimal*}" ]; then
NAME=$(echo "$NAME" | sed 's/-minimal//')
fi
rel=$(ver)
ln -sf rootfs.squashfs "$BINARIES_DIR/${NAME}${rel}.img"
if [ -n "$rel" ]; then
ln -sf "$BINARIES_DIR/${NAME}${rel}.img" "$BINARIES_DIR/${NAME}.img"
fi
fi
# Menuconfig support for modifying Qemu args in release tarballs
cp "$BR2_EXTERNAL_INFIX_PATH/board/common/qemu/qemu.sh" "$BINARIES_DIR/"
sed -e "s/@ARCH@/QEMU_$BR2_ARCH/" \
-e "s/@DISK_IMG@/$diskimg/" \
< "$BR2_EXTERNAL_INFIX_PATH/board/common/qemu/Config.in.in" \
> "$BINARIES_DIR/Config.in"
rm -f "$BINARIES_DIR/qemu.cfg"
CONFIG_="CONFIG_" BR2_CONFIG="$BINARIES_DIR/qemu.cfg" \
"$O/build/buildroot-config/conf" --olddefconfig "$BINARIES_DIR/Config.in"
rm -f "$BINARIES_DIR/qemu.cfg.old" "$BINARIES_DIR/.config.old"
@@ -1,4 +1,18 @@
comment "System setup"
mainmenu "QEMU Virtualization"
choice
prompt "Target Architecture"
default @ARCH@
config QEMU_x86_64
bool "x86_64"
select QEMU_ARCH_IS_64
config QEMU_aarch64
bool "AArch64 (little endian)"
select QEMU_ARCH_IS_64
endchoice
choice
prompt "Loader"
@@ -9,11 +23,11 @@ config QEMU_LOADER_KERNEL
config QEMU_LOADER_UBOOT
bool "U-Boot"
depends on BR2_aarch64
depends on QEMU_aarch64
config QEMU_LOADER_OVMF
bool "OVMF (UEFI)"
depends on BR2_x86_64
depends on QEMU_x86_64
endchoice
@@ -23,56 +37,75 @@ choice
config QEMU_ROOTFS_MMC
bool "MMC"
depends on QEMU_aarch64
config QEMU_ROOTFS_INITRD
bool "Initrd"
depends on QEMU_LOADER_KERNEL
config QEMU_ROOTFS_VSCSI
bool "Virtio SCSI"
endchoice
choice
prompt "Console"
default QEMU_CONSOLE_VIRTIO
config QEMU_CONSOLE_VIRTIO
bool "Virtio (hvc0)"
depends on QEMU_LOADER_KERNEL
config QEMU_CONSOLE_SERIAL
bool "Serial (ttyS0/ttyAMA0)"
endchoice
config QEMU_MACHINE
string
default "qemu-system-aarch64 -M virt -cpu cortex-a72 -m 256M" if BR2_aarch64
default "qemu-system-x86_64 -M q35,accel=kvm -cpu host -m 512M" if BR2_x86_64
default "qemu-system-aarch64 -M virt -cpu cortex-a72 -m 256M" if QEMU_aarch64
default "qemu-system-x86_64 -M q35,accel=kvm -cpu host -m 256M" if QEMU_x86_64
config QEMU_KERNEL
string
depends on QEMU_LOADER_KERNEL
default "images/Image" if BR2_aarch64
default "images/bzImage" if BR2_x86_64
default "Image" if QEMU_aarch64
default "bzImage" if QEMU_x86_64
config QEMU_BIOS
string
depends on !QEMU_LOADER_KERNEL
default "images/u-boot.bin" if QEMU_LOADER_UBOOT
default "images/OVMF.fd" if QEMU_LOADER_OVMF
default "u-boot.bin" if QEMU_LOADER_UBOOT
default "OVMF.fd" if QEMU_LOADER_OVMF
config QEMU_ROOTFS
string
default "images/disk.img" if !QEMU_ROOTFS_INITRD
default "images/rootfs.squashfs" if QEMU_ROOTFS_INITRD
config QEMU_CONSOLE
string
depends on !QEMU_ROOTFS_MMC
default "ttyAMA0" if BR2_aarch64
default "ttyS0" if BR2_x86_64
default "@DISK_IMG@" if !QEMU_ROOTFS_INITRD
default "rootfs.squashfs" if QEMU_ROOTFS_INITRD
config QEMU_DTB_EXTEND
bool
depends on QEMU_LOADER_UBOOT
default y if BR2_aarch64
default y if QEMU_aarch64
config QEMU_RW
string "Writable layer"
string "Writable /cfg layer"
depends on QEMU_ROOTFS_INITRD
default "images/cfg.ext4"
default "cfg.ext4"
config QEMU_RW_VAR_OPT
bool "Separate writable /var (256MB)"
if QEMU_RW_VAR_OPT
config QEMU_RW_VAR
string "Writable /var layer"
default "var.ext4"
endif
config QEMU_HOST
string "Export host filesystem path"
default "images"
default "/tmp"
config QEMU_APPEND
string "Extra kernel options"
@@ -103,7 +136,7 @@ endchoice
config QEMU_NET_MODEL
string "Interface model"
default "virtio"
default "virtio-net-pci"
config QEMU_NET_BRIDGE_DEV
string "Bridge device"
@@ -120,5 +153,3 @@ config QEMU_NET_TAP_N
int "Number of TAPs"
depends on QEMU_NET_TAP
default 1
+326
View File
@@ -0,0 +1,326 @@
#!/bin/sh
# This script can be used to start an Infix OS image in Qemu. It reads
# either a .config, generated from Config.in, or qemu.cfg from a release
# tarball, for the required configuration data.
#
# Debian/Ubuntu users can change the configuration post-release, install
# the kconfig-frontends package:
#
# sudo apt install kconfig-frontends
#
# and then call this script with:
#
# ./qemu.sh -c
#
# To bring up a menuconfig dialog. Select `Exit` and save the changes.
# For more help, see:_
#
# ./qemu.sh -h
#
# Local variables
prognm=$(basename "$0")
usage()
{
echo "usage: $prognm [opts]"
echo
echo " -c Run menuconfig to change Qemu settings"
echo " -h This help text"
echo
echo "Note: 'kconfig-frontends' package (Debian/Ubuntu) must be installed"
echo " for -c to work: sudo apt install kconfig-frontents"
exit 1
}
die()
{
echo "$@" >&2
exit 1
}
load_qemucfg()
{
local tmp=$(mktemp -p /tmp)
grep ^CONFIG_QEMU_ $1 >$tmp
. $tmp
rm $tmp
[ "$CONFIG_QEMU_MACHINE" ] || die "Missing QEMU_MACHINE"
[ "$CONFIG_QEMU_ROOTFS" ] || die "Missing QEMU_ROOTFS"
[ "$CONFIG_QEMU_KERNEL" -a "$CONFIG_QEMU_BIOS" ] \
&& die "QEMU_KERNEL conflicts with QEMU_BIOS"
[ ! "$CONFIG_QEMU_KERNEL" -a ! "$CONFIG_QEMU_BIOS" ] \
&& die "QEMU_KERNEL or QEMU_BIOS must be set"
}
loader_args()
{
if [ "$CONFIG_QEMU_BIOS" ]; then
echo -n "-bios $CONFIG_QEMU_BIOS "
elif [ "$CONFIG_QEMU_KERNEL" ]; then
echo -n "-kernel $CONFIG_QEMU_KERNEL "
fi
}
append_args()
{
if [ "$CONFIG_QEMU_CONSOLE_VIRTIO" ]; then
echo -n "console=hvc0 "
elif [ "$CONFIG_QEMU_x86_64" ]; then
echo -n "console=ttyS0 "
elif [ "$CONFIG_QEMU_aarch64" ]; then
echo -n "console=ttyAMA0 "
else
die "Unknown console"
fi
if [ "$CONFIG_QEMU_ROOTFS_INITRD" = "y" ]; then
# Size of initrd, rounded up to nearest kb
local size=$((($(stat -c %s $CONFIG_QEMU_ROOTFS) + 1023) >> 10))
echo -n "root=/dev/ram0 ramdisk_size=${size} "
elif [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
echo -n "root=PARTLABEL=primary "
fi
if [ "$V" != "1" ]; then
echo -n "quiet "
else
echo -n "debug "
fi
echo -n "${QEMU_APPEND} ${QEMU_EXTRA_APPEND} "
}
rootfs_args()
{
if [ "$CONFIG_QEMU_ROOTFS_INITRD" = "y" ]; then
echo -n "-initrd $CONFIG_QEMU_ROOTFS "
elif [ "$CONFIG_QEMU_ROOTFS_MMC" = "y" ]; then
echo -n "-device sdhci-pci "
echo -n "-device sd-card,drive=mmc "
echo -n "-drive id=mmc,file=$CONFIG_QEMU_ROOTFS,if=none,format=raw "
elif [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
echo -n "-drive file=$CONFIG_QEMU_ROOTFS,if=virtio,format=raw,bus=0,unit=0 "
fi
}
serial_args()
{
echo -n "-display none "
echo -n "-device virtio-serial "
echo -n "-chardev stdio,id=console0,mux=on "
echo -n "-mon chardev=console0 "
if [ "$CONFIG_QEMU_CONSOLE_VIRTIO" ]; then
echo -n "-device virtconsole,nr=0,name=console,chardev=console0 "
elif [ "$CONFIG_QEMU_CONSOLE_SERIAL" ]; then
echo -n "-serial chardev:console0 "
else
die "Unknown console"
fi
echo -n "-chardev socket,id=gdbserver,path=gdbserver.sock,server=on,wait=off "
echo -n "-device virtconsole,nr=1,name=gdbserver,chardev=gdbserver "
}
rw_args()
{
[ "$CONFIG_QEMU_RW" ] || return
if ! [ -f "$CONFIG_QEMU_RW" ]; then
dd if=/dev/zero of="$CONFIG_QEMU_RW" bs=16M count=1 >/dev/null 2>&1
mkfs.ext4 -L cfg "$CONFIG_QEMU_RW" >/dev/null 2>&1
fi
echo -n "-drive file=$CONFIG_QEMU_RW,if=virtio,format=raw,bus=0,unit=1 "
if [ "$CONFIG_QEMU_RW_VAR_OPT" ]; then
if ! [ -f "$CONFIG_QEMU_RW_VAR" ]; then
dd if=/dev/zero of="$CONFIG_QEMU_RW_VAR" bs=256M count=1 >/dev/null 2>&1
mkfs.ext4 -L var "$CONFIG_QEMU_RW_VAR" >/dev/null 2>&1
fi
echo -n "-drive file=$CONFIG_QEMU_RW_VAR,if=virtio,format=raw,bus=0,unit=2 "
fi
}
host_args()
{
[ "$CONFIG_QEMU_HOST" ] || return
echo -n "-virtfs local,path=$CONFIG_QEMU_HOST,security_model=none,writeout=immediate,mount_tag=hostfs "
}
net_dev_args()
{
local name="e$1"
local mac=$(printf "02:00:00:00:00:%02x" $1)
echo -n "-device $CONFIG_QEMU_NET_MODEL,netdev=$name,mac=$mac "
echo "$name $mac" >>"$mactab"
}
net_args()
{
# Infix will pick up this file via fwcfg and install it to /etc
mactab=$(dirname "$CONFIG_QEMU_ROOTFS")/mactab
:> "$mactab"
echo -n "-fw_cfg name=opt/mactab,file=$mactab "
if [ "$CONFIG_QEMU_NET_BRIDGE" = "y" ]; then
echo -n "-netdev bridge,id=e0,br=$CONFIG_QEMU_NET_BRIDGE_DEV "
net_dev_args 0
elif [ "$CONFIG_QEMU_NET_TAP" = "y" ]; then
for i in $(seq 0 $(($CONFIG_QEMU_NET_TAP_N - 1))); do
echo -n "-netdev tap,id=e$i,ifname=qtap$i "
net_dev_args $i
done
elif [ "$CONFIG_QEMU_NET_USER" = "y" ]; then
local useropts=
[ "$CONFIG_QEMU_NET_USER_OPTS" ] && useropts=",$CONFIG_QEMU_NET_USER_OPTS"
echo -n "-netdev user,id=e0${useropts} "
net_dev_args 0
else
echo -n "-nic none"
fi
}
wdt_args()
{
echo -n "-device i6300esb -rtc clock=host"
}
run_qemu()
{
local qemu
read qemu <<EOF
$CONFIG_QEMU_MACHINE \
$(loader_args) \
$(rootfs_args) \
$(serial_args) \
$(rw_args) \
$(host_args) \
$(net_args) \
$(wdt_args) \
$CONFIG_QEMU_EXTRA
EOF
if [ "$CONFIG_QEMU_KERNEL" ]; then
$qemu -append "$(append_args)" "$@"
else
$qemu "$@"
fi
}
dtb_args()
{
[ "$CONFIG_QEMU_LOADER_UBOOT" ] || return
if [ "$CONFIG_QEMU_DTB_EXTEND" ]; then
# On the current architecture, QEMU will generate an internal
# DT based on the system configuration.
# So we extract a copy of that
run_qemu -M dumpdtb=qemu.dtb >/dev/null 2>&1
# Extend it with the environment and signing information in
# u-boot.dtb.
echo "qemu.dtb u-boot.dtb" | \
xargs -n 1 dtc -I dtb -O dts | \
{ echo "/dts-v1/;"; sed -e 's:/dts-v[0-9]\+/;::'; } | \
dtc >qemu-extended.dtb 2>/dev/null
# And use the combined result to start the instance
echo -n "-dtb qemu-extended.dtb "
else
# Otherwise we just use the unmodified one
echo -n "-dtb u-boot.dtb "
fi
}
generate_dot()
{
[ "$CONFIG_QEMU_NET_TAP" = "y" ] || return
hostports="<qtap0> qtap0"
targetports="<e0> e0"
edges="host:qtap0 -- target:e0 [kind=mgmt];"
for tap in $(seq 1 $(($CONFIG_QEMU_NET_TAP_N - 1))); do
hostports="$hostports | <qtap$tap> qtap$tap "
targetports="$targetports | <e$tap> e$tap "
edges="$edges host:qtap$tap -- target:e$tap;"
done
cat >qemu.dot <<EOF
graph "qemu" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { $hostports }"
pos="0,0!",
kind="controller",
];
target [
label="{ $targetports } | target",
pos="10,0!",
kind="infix",
];
$edges
}
EOF
}
menuconfig()
{
grep -q QEMU_MACHINE Config.in || die "$prognm: must be run from the output/images directory"
command -v kconfig-mconf >/dev/null || die "$prognm: cannot find kconfig-mconf for menuconfig"
exec kconfig-mconf Config.in
}
cd $(dirname $(readlink -f "$0"))
while [ "$1" != "" ]; do
case $1 in
-c)
menuconfig
;;
-h)
usage
;;
*)
break
esac
shift
done
if [ -f .config ]; then
# Customized settings from 'qemu.sh -c'
load_qemucfg .config
else
# Shipped defaults from release tarball
load_qemucfg qemu.cfg
fi
generate_dot
echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
line=$(stty -g)
stty raw
run_qemu $(dtb_args)
stty "$line"
-116
View File
@@ -1,116 +0,0 @@
#!/bin/sh
#set -x
mode=/mnt/cfg/infix/.use_etc
boot=/tmp/.boot_mode
if [ -f $boot ]; then
current=$(cat $boot)
else
current="unknown"
fi
m=on
n=off
p=off
select_mode()
{
if [ -f $mode ]; then
m=off
if grep -qi profinet $boot; then
n=off
p=on
else
n=on
p=off
fi
fi
exec 3>&1
selection=$(dialog --erase-on-exit --no-tags \
--hline "Arrow keys + space to select, enter to confirm" \
--backtitle "Select Operating Mode" \
--title "Select Operating Mode" \
--radiolist "System currently runs in: $current mode" 13 60 1 \
"1" "Managed NETCONF, XML datastore" "$m" \
"2" "Native Linux, /etc datastore" "$n" \
"3" "PROFINET, /etc variant" "$p" \
2>&1 1>&3)
exit_status=$?
exec 3>&-
case $exit_status in
1) # cancel
exit 0
;;
255) # escape
exit 1
;;
esac
}
usage()
{
cat <<EOF
usage:
chom [-h] [etc | netconf]
options:
-h Show this help text
arguments:
etc Change to Linux native mode, /etc
netconf Change to NETCONF mode, XML
profinet Change to PROFINET mode, /etc variant
EOF
}
case $1 in
-h)
usage
exit 0
;;
net* | xml)
selection=1
;;
nat* | etc*)
selection=2
;;
profinet)
selection=3
;;
*)
;;
esac
if [ -z "$selection" ]; then
use_dialog=1
select_mode
fi
case $selection in
1)
rm -f $mode 2>/dev/null
grep -qi netconf $boot 2>/dev/null && exit 0
result="Manageed NETCONF"
;;
2)
echo "native /etc" > $mode
grep -qi native $boot 2>/dev/null && exit 0
result="Native Linux, /etc"
;;
3)
echo "PROFINET" > $mode
grep -qi profinet $boot 2>/dev/null && exit 0
result="PROFINET"
;;
esac
if [ -n "$use_dialog" ]; then
dialog --erase-on-exit --cr-wrap --title "Activate Mode Change?" --yesno "\n Reboot to $result mode now?" 8 50
if [ $? -eq 0 ]; then
reboot
fi
fi
echo "Remember to reboot later to activate the change."
exit 0
+88
View File
@@ -0,0 +1,88 @@
#!/bin/sh
# This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with avahi; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
set -e
# Command line arguments:
# $1 event that happened:
# BIND: Successfully claimed address
# CONFLICT: An IP address conflict happened
# UNBIND: The IP address is no longer needed
# STOP: The daemon is terminating
# $2 interface name
# $3 IP adddress
PATH="$PATH:/usr/bin:/usr/sbin:/bin:/sbin"
# Use a different metric for each interface, so that we can set
# identical routes to multiple interfaces.
METRIC=$((1000 + `cat "/sys/class/net/$2/ifindex" 2>/dev/null || echo 0`))
if [ -x /bin/ip -o -x /sbin/ip ] ; then
# We have the Linux ip tool from the iproute package
case "$1" in
BIND)
ip addr flush dev "$2" label "$2:avahi"
ip addr add "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev "$2" proto 6
ip route add default dev "$2" metric "$METRIC" scope link ||:
;;
CONFLICT|UNBIND|STOP)
ip route del default dev "$2" metric "$METRIC" scope link ||:
ip addr del "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev "$2"
;;
*)
echo "Unknown event $1" >&2
exit 1
;;
esac
elif [ -x /bin/ifconfig -o -x /sbin/ifconfig ] ; then
# We have the old ifconfig tool
case "$1" in
BIND)
ifconfig "$2:avahi" inet "$3" netmask 255.255.0.0 broadcast 169.254.255.255 up
route add default dev "$2:avahi" metric "$METRIC" ||:
;;
CONFLICT|STOP|UNBIND)
route del default dev "$2:avahi" metric "$METRIC" ||:
ifconfig "$2:avahi" down
;;
*)
echo "Unknown event $1" >&2
exit 1
;;
esac
else
echo "No network configuration tool found." >&2
exit 1
fi
exit 0
+7 -3
View File
@@ -3,9 +3,13 @@
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# Reevaluate for each line, in case hostname changes
function prompt_command
{
PS1="\u@$(hostname):\w\$ "
}
export PROMPT_COMMAND=prompt_command
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# Disble built-ins
enable -n help
@@ -0,0 +1,141 @@
_cond()
{
initctl -pt cond dump | awk '{print $4}' | sed 's/<\(.*\)>/\1/'
}
_ident()
{
if [ -n "$1" ]; then
initctl ident | grep -q $1
else
initctl ident
fi
}
_svc()
{
initctl ls -pt | grep $1 | sed "s/.*\/\(.*\)/\1/g" | sort -u
}
_enabled()
{
echo "$(_svc enabled)"
}
_available()
{
all=$(mktemp)
ena=$(mktemp)
echo "$(_svc available)" >$all
echo "$(_svc enabled)" >$ena
grep -v -f $ena $all
rm $all $ena
}
# Determine first non-option word. Usually the command
_firstword() {
local firstword i
firstword=
for ((i = 1; i < ${#COMP_WORDS[@]}; ++i)); do
if [[ ${COMP_WORDS[i]} != -* ]]; then
firstword=${COMP_WORDS[i]}
break
fi
done
echo $firstword
}
# Determine last non-option word. Uusally a sub-command
_lastword() {
local lastword i
lastword=
for ((i = 1; i < ${#COMP_WORDS[@]}; ++i)); do
if [[ ${COMP_WORDS[i]} != -* ]] && [[ -n ${COMP_WORDS[i]} ]] && [[ ${COMP_WORDS[i]} != $cur ]]; then
lastword=${COMP_WORDS[i]}
fi
done
echo $lastword
}
_initctl()
{
local cur command
cur=${COMP_WORDS[COMP_CWORD]}
prev="${COMP_WORDS[COMP_CWORD-1]}"
firstword=$(_firstword)
lastword=$(_lastword)
commands="status cond debug help kill ls log version list enable \
disable touch show cat edit create delete reload start \
stop restart signal cgroup ps top plugins runlevel reboot \
halt poweroff suspend utmp"
cond_cmds="set get clear status dump"
cond_types="hook net pid service task usr"
signals="int term hup stop tstp cont usr1 usr2 pwr"
options="-b --batch \
-c --create \
-d --debug \
-f --force \
-h --help \
-j --json \
-n --noerr \
-1 --once \
-p --plain \
-q --quiet \
-t --no-heading \
-v --verbose \
-V --version"
case "${firstword}" in
enable)
COMPREPLY=($(compgen -W "$(_available)" -- $cur))
;;
disable|touch)
COMPREPLY=($(compgen -W "$(_enabled)" -- $cur))
;;
show|cat|edit|delete)
COMPREPLY=($(compgen -W "$(_svc .)" -- $cur))
;;
start|stop|restart|log|status)
COMPREPLY=($(compgen -W "$(_ident)" -- $cur))
;;
signal|kill)
if $(_ident "${prev}"); then
COMPREPLY=($(compgen -W "$signals" -- $cur))
else
COMPREPLY=($(compgen -W "$(_ident)" -- $cur))
fi
;;
cond)
case "${lastword}" in
set|clear)
compopt -o nospace
COMPREPLY=($(compgen -W "usr/" -- $cur))
;;
get)
COMPREPLY=($(compgen -W "$(_cond)" -- $cur))
;;
dump)
COMPREPLY=($(compgen -W "$cond_types" -- $cur))
;;
*)
COMPREPLY=($(compgen -W "$cond_cmds" -- $cur))
;;
esac
;;
*)
COMPREPLY=($(compgen -W "$commands" -- $cur))
;;
esac
if [[ $cur == -* ]]; then
COMPREPLY=($(compgen -W "$options" -- $cur))
fi
}
complete -F _initctl initctl
@@ -0,0 +1,77 @@
# For more information on this configuration file, see containers-registries.conf(5).
#
# NOTE: RISK OF USING UNQUALIFIED IMAGE NAMES
# We recommend always using fully qualified image names including the registry
# server (full dns name), namespace, image name, and tag
# (e.g., registry.redhat.io/ubi8/ubi:latest). Pulling by digest (i.e.,
# quay.io/repository/name@digest) further eliminates the ambiguity of tags.
# When using short names, there is always an inherent risk that the image being
# pulled could be spoofed. For example, a user wants to pull an image named
# `foobar` from a registry and expects it to come from myregistry.com. If
# myregistry.com is not first in the search list, an attacker could place a
# different `foobar` image at a registry earlier in the search list. The user
# would accidentally pull and run the attacker's image and code rather than the
# intended content. We recommend only adding registries which are completely
# trusted (i.e., registries which don't allow unknown or anonymous users to
# create accounts with arbitrary names). This will prevent an image from being
# spoofed, squatted or otherwise made insecure. If it is necessary to use one
# of these registries, it should be added at the end of the list.
#
# # An array of host[:port] registries to try when pulling an unqualified image, in order.
# unqualified-search-registries = ["example.com"]
#
# [[registry]]
# # The "prefix" field is used to choose the relevant [[registry]] TOML table;
# # (only) the TOML table with the longest match for the input image name
# # (taking into account namespace/repo/tag/digest separators) is used.
# #
# # The prefix can also be of the form: *.example.com for wildcard subdomain
# # matching.
# #
# # If the prefix field is missing, it defaults to be the same as the "location" field.
# prefix = "example.com/foo"
#
# # If true, unencrypted HTTP as well as TLS connections with untrusted
# # certificates are allowed.
# insecure = false
#
# # If true, pulling images with matching names is forbidden.
# blocked = false
#
# # The physical location of the "prefix"-rooted namespace.
# #
# # By default, this is equal to "prefix" (in which case "prefix" can be omitted
# # and the [[registry]] TOML table can only specify "location").
# #
# # Example: Given
# # prefix = "example.com/foo"
# # location = "internal-registry-for-example.net/bar"
# # requests for the image example.com/foo/myimage:latest will actually work with the
# # internal-registry-for-example.net/bar/myimage:latest image.
#
# # The location can be empty iff prefix is in a
# # wildcarded format: "*.example.com". In this case, the input reference will
# # be used as-is without any rewrite.
# location = internal-registry-for-example.com/bar"
#
# # (Possibly-partial) mirrors for the "prefix"-rooted namespace.
# #
# # The mirrors are attempted in the specified order; the first one that can be
# # contacted and contains the image will be used (and if none of the mirrors contains the image,
# # the primary location specified by the "registry.location" field, or using the unmodified
# # user-specified reference, is tried last).
# #
# # Each TOML table in the "mirror" array can contain the following fields, with the same semantics
# # as if specified in the [[registry]] TOML table directly:
# # - location
# # - insecure
# [[registry.mirror]]
# location = "example-mirror-0.local/mirror-for-foo"
# [[registry.mirror]]
# location = "example-mirror-1.local/mirrors/foo"
# insecure = true
# # Given the above, a pull of example.com/foo/image:latest will try:
# # 1. example-mirror-0.local/mirror-for-foo/image:latest
# # 2. example-mirror-1.local/mirrors/foo/image:latest
# # 3. internal-registry-for-example.net/bar/image:latest
# # in order, and use the first one that exists.
@@ -0,0 +1,78 @@
[aliases]
# almalinux
"almalinux" = "docker.io/library/almalinux"
"almalinux-minimal" = "docker.io/library/almalinux-minimal"
# centos
"centos" = "quay.io/centos/centos"
# containers
"skopeo" = "quay.io/skopeo/stable"
"buildah" = "quay.io/buildah/stable"
"podman" = "quay.io/podman/stable"
# docker
"alpine" = "docker.io/library/alpine"
"docker" = "docker.io/library/docker"
"registry" = "docker.io/library/registry"
"hello-world" = "docker.io/library/hello-world"
"swarm" = "docker.io/library/swarm"
# Fedora
"fedora-minimal" = "registry.fedoraproject.org/fedora-minimal"
"fedora" = "registry.fedoraproject.org/fedora"
# openSUSE
"opensuse/tumbleweed" = "registry.opensuse.org/opensuse/tumbleweed"
"opensuse/tumbleweed-dnf" = "registry.opensuse.org/opensuse/tumbleweed-dnf"
"opensuse/tumbleweed-microdnf" = "registry.opensuse.org/opensuse/tumbleweed-microdnf"
"opensuse/leap" = "registry.opensuse.org/opensuse/leap"
"opensuse/busybox" = "registry.opensuse.org/opensuse/busybox"
"tumbleweed" = "registry.opensuse.org/opensuse/tumbleweed"
"tumbleweed-dnf" = "registry.opensuse.org/opensuse/tumbleweed-dnf"
"tumbleweed-microdnf" = "registry.opensuse.org/opensuse/tumbleweed-microdnf"
"leap" = "registry.opensuse.org/opensuse/leap"
"leap-dnf" = "registry.opensuse.org/opensuse/leap-dnf"
"leap-microdnf" = "registry.opensuse.org/opensuse/leap-microdnf"
"tw-busybox" = "registry.opensuse.org/opensuse/busybox"
# SUSE
"suse/sle15" = "registry.suse.com/suse/sle15"
"suse/sles12sp5" = "registry.suse.com/suse/sles12sp5"
"suse/sles12sp4" = "registry.suse.com/suse/sles12sp4"
"suse/sles12sp3" = "registry.suse.com/suse/sles12sp3"
"sle15" = "registry.suse.com/suse/sle15"
"sles12sp5" = "registry.suse.com/suse/sles12sp5"
"sles12sp4" = "registry.suse.com/suse/sles12sp4"
"sles12sp3" = "registry.suse.com/suse/sles12sp3"
# Red Hat Enterprise Linux
"rhel" = "registry.access.redhat.com/rhel"
"rhel6" = "registry.access.redhat.com/rhel6"
"rhel7" = "registry.access.redhat.com/rhel7"
"ubi7" = "registry.access.redhat.com/ubi7"
"ubi7-init" = "registry.access.redhat.com/ubi7-init"
"ubi7-minimal" = "registry.access.redhat.com/ubi7-minimal"
"ubi8" = "registry.access.redhat.com/ubi8"
"ubi8-minimal" = "registry.access.redhat.com/ubi8-minimal"
"ubi8-init" = "registry.access.redhat.com/ubi8-init"
"ubi8-micro" = "registry.access.redhat.com/ubi8-micro"
"ubi8/ubi" = "registry.access.redhat.com/ubi8/ubi"
"ubi8/ubi-minimal" = "registry.access.redhat.com/ubi8-minimal"
"ubi8/ubi-init" = "registry.access.redhat.com/ubi8-init"
"ubi8/ubi-micro" = "registry.access.redhat.com/ubi8-micro"
# Rocky Linux
"rockylinux" = "docker.io/library/rockylinux"
# Debian
"debian" = "docker.io/library/debian"
# Kali Linux
"kali-bleeding-edge" = "docker.io/kalilinux/kali-bleeding-edge"
"kali-dev" = "docker.io/kalilinux/kali-dev"
"kali-experimental" = "docker.io/kalilinux/kali-experimental"
"kali-last-release" = "docker.io/kalilinux/kali-last-release"
"kali-rolling" = "docker.io/kalilinux/kali-rolling"
# Ubuntu
"ubuntu" = "docker.io/library/ubuntu"
# Oracle Linux
"oraclelinux" = "container-registry.oracle.com/os/oraclelinux"
# busybox
"busybox" = "docker.io/library/busybox"
# php
"php" = "docker.io/library/php"
# python
"python" = "docker.io/library/python"
# node
"node" = "docker.io/library/node"
@@ -1,2 +1,3 @@
run [S] /lib/infix/nameif -- Probing network interfaces
run if:<!boot/netconf> [S] /lib/infix/swup --
run [S] /lib/infix/probe -- Probing system information
run [S] <pid/syslogd> /lib/infix/sysctl-sync-ip-conf --
run [S] <pid/syslogd> /lib/infix/nameif -- Probing network interfaces
@@ -0,0 +1 @@
service [2345789] log:prio:user.notice rauc service -- Software update service
@@ -1,2 +0,0 @@
task [S] /lib/infix/ssh-hostkeys --
service [2345789] <usr/ssh-hostkeys> /usr/sbin/sshd -D -- OpenSSH daemon
@@ -0,0 +1,5 @@
# Override Finit plugin
service cgroup.system name:dbus pid:!/run/messagebus.pid <pid/syslogd> \
[S123456789] /usr/bin/dbus-daemon --nofork --system --syslog-only \
-- D-Bus message bus daemon
+1
View File
@@ -0,0 +1 @@
../available/rauc.conf
@@ -1 +0,0 @@
../available/sshd.conf
-3
View File
@@ -11,9 +11,6 @@ sysfs /sys sysfs defaults 0 0
debugfs /sys/kernel/debug debugfs nofail 0 0
cfgfs /config configfs nofail,noauto 0 0
# Optional host share when running in Qemu
hostfs /host 9p nofail,cache=none,msize=16384 0 0
# The chosen backing storage for the overlays placed on /cfg, /etc,
# /home, /root, and /var, are determined dynamically by /lib/infix/mnt
# depending on the available devices.
+1
View File
@@ -1,2 +1,3 @@
1 port
2 iface
3 internal
@@ -0,0 +1,3 @@
4 static
5 dhcp
6 random
@@ -0,0 +1,2 @@
options bonding max_bonds=0
@@ -0,0 +1,2 @@
options dummy numdummies=0
+1 -6
View File
@@ -45,13 +45,8 @@ http {
index index.html index.htm;
}
location /.well-known/host-meta {
fastcgi_pass unix:/run/sysrest.sock;
include fastcgi_params;
}
location /restconf/ {
fastcgi_pass unix:/run/sysrest.sock;
fastcgi_pass unix:/var/run/clixon/restconf.sock;
include fastcgi_params;
}
@@ -4,16 +4,21 @@ alias ll='ls -alF'
alias ls='ls --color=auto'
export EDITOR=/usr/bin/edit
export VISUAL=/usr/bin/edit
export LESS="-P %f (press h for help or q to quit)"
alias vim='vi'
alias view='vi -R'
alias emacs='mg'
alias sensible-editor=edit
alias sensible-pager=pager
alias hd="hexdump -C"
alias ip='ip --color=auto'
alias ipb='ip -br'
alias ipaddr='ip addr'
alias iplink='ip link'
alias bridge='bridge --color=auto'
alias setup='pdmenu; clear'
alias cli='clixon_cli'
alias llping='ping -L ff02::1 -I'
alias docker=podman
+361
View File
@@ -0,0 +1,361 @@
# Network services, Internet style
#
# Updated from https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml .
#
# New ports will be added on request if they have been officially assigned
# by IANA and used in the real-world or are needed by a debian package.
# If you need a huge list of used numbers please install the nmap package.
tcpmux 1/tcp # TCP port service multiplexer
echo 7/tcp
echo 7/udp
discard 9/tcp sink null
discard 9/udp sink null
systat 11/tcp users
daytime 13/tcp
daytime 13/udp
netstat 15/tcp
qotd 17/tcp quote
chargen 19/tcp ttytst source
chargen 19/udp ttytst source
ftp-data 20/tcp
ftp 21/tcp
fsp 21/udp fspd
ssh 22/tcp # SSH Remote Login Protocol
telnet 23/tcp
smtp 25/tcp mail
time 37/tcp timserver
time 37/udp timserver
whois 43/tcp nicname
tacacs 49/tcp # Login Host Protocol (TACACS)
tacacs 49/udp
domain 53/tcp # Domain Name Server
domain 53/udp
bootps 67/udp
bootpc 68/udp
tftp 69/udp
gopher 70/tcp # Internet Gopher
finger 79/tcp
http 80/tcp www # WorldWideWeb HTTP
kerberos 88/tcp kerberos5 krb5 kerberos-sec # Kerberos v5
kerberos 88/udp kerberos5 krb5 kerberos-sec # Kerberos v5
iso-tsap 102/tcp tsap # part of ISODE
acr-nema 104/tcp dicom # Digital Imag. & Comm. 300
pop3 110/tcp pop-3 # POP version 3
sunrpc 111/tcp portmapper # RPC 4.0 portmapper
sunrpc 111/udp portmapper
auth 113/tcp authentication tap ident
nntp 119/tcp readnews untp # USENET News Transfer Protocol
ntp 123/udp # Network Time Protocol
epmap 135/tcp loc-srv # DCE endpoint resolution
netbios-ns 137/udp # NETBIOS Name Service
netbios-dgm 138/udp # NETBIOS Datagram Service
netbios-ssn 139/tcp # NETBIOS session service
imap2 143/tcp imap # Interim Mail Access P 2 and 4
snmp 161/tcp # Simple Net Mgmt Protocol
snmp 161/udp
snmp-trap 162/tcp snmptrap # Traps for SNMP
snmp-trap 162/udp snmptrap
cmip-man 163/tcp # ISO mgmt over IP (CMOT)
cmip-man 163/udp
cmip-agent 164/tcp
cmip-agent 164/udp
mailq 174/tcp # Mailer transport queue for Zmailer
xdmcp 177/udp # X Display Manager Control Protocol
bgp 179/tcp # Border Gateway Protocol
smux 199/tcp # SNMP Unix Multiplexer
qmtp 209/tcp # Quick Mail Transfer Protocol
z3950 210/tcp wais # NISO Z39.50 database
ipx 213/udp # IPX [RFC1234]
ptp-event 319/udp
ptp-general 320/udp
pawserv 345/tcp # Perf Analysis Workbench
zserv 346/tcp # Zebra server
rpc2portmap 369/tcp
rpc2portmap 369/udp # Coda portmapper
codaauth2 370/tcp
codaauth2 370/udp # Coda authentication server
clearcase 371/udp Clearcase
ldap 389/tcp # Lightweight Directory Access Protocol
ldap 389/udp
svrloc 427/tcp # Server Location
svrloc 427/udp
https 443/tcp # http protocol over TLS/SSL
https 443/udp # HTTP/3
snpp 444/tcp # Simple Network Paging Protocol
microsoft-ds 445/tcp # Microsoft Naked CIFS
kpasswd 464/tcp
kpasswd 464/udp
submissions 465/tcp ssmtp smtps urd # Submission over TLS [RFC8314]
saft 487/tcp # Simple Asynchronous File Transfer
isakmp 500/udp # IPSEC key management
rtsp 554/tcp # Real Time Stream Control Protocol
rtsp 554/udp
nqs 607/tcp # Network Queuing system
asf-rmcp 623/udp # ASF Remote Management and Control Protocol
qmqp 628/tcp
ipp 631/tcp # Internet Printing Protocol
ldp 646/tcp # Label Distribution Protocol
ldp 646/udp
#
# UNIX specific services
#
exec 512/tcp
biff 512/udp comsat
login 513/tcp
who 513/udp whod
shell 514/tcp cmd syslog # no passwords used
syslog 514/udp
printer 515/tcp spooler # line printer spooler
talk 517/udp
ntalk 518/udp
route 520/udp router routed # RIP
gdomap 538/tcp # GNUstep distributed objects
gdomap 538/udp
uucp 540/tcp uucpd # uucp daemon
klogin 543/tcp # Kerberized `rlogin' (v5)
kshell 544/tcp krcmd # Kerberized `rsh' (v5)
dhcpv6-client 546/udp
dhcpv6-server 547/udp
afpovertcp 548/tcp # AFP over TCP
nntps 563/tcp snntp # NNTP over SSL
submission 587/tcp # Submission [RFC4409]
ldaps 636/tcp # LDAP over SSL
ldaps 636/udp
tinc 655/tcp # tinc control port
tinc 655/udp
silc 706/tcp
kerberos-adm 749/tcp # Kerberos `kadmin' (v5)
#
domain-s 853/tcp # DNS over TLS [RFC7858]
domain-s 853/udp # DNS over DTLS [RFC8094]
rsync 873/tcp
ftps-data 989/tcp # FTP over SSL (data)
ftps 990/tcp
telnets 992/tcp # Telnet over SSL
imaps 993/tcp # IMAP over SSL
pop3s 995/tcp # POP-3 over SSL
#
# From ``Assigned Numbers'':
#
#> The Registered Ports are not controlled by the IANA and on most systems
#> can be used by ordinary user processes or programs executed by ordinary
#> users.
#
#> Ports are used in the TCP [45,106] to name the ends of logical
#> connections which carry long term conversations. For the purpose of
#> providing services to unknown callers, a service contact port is
#> defined. This list specifies the port used by the server process as its
#> contact port. While the IANA can not control uses of these ports it
#> does register or list uses of these ports as a convienence to the
#> community.
#
socks 1080/tcp # socks proxy server
proofd 1093/tcp
rootd 1094/tcp
openvpn 1194/tcp
openvpn 1194/udp
rmiregistry 1099/tcp # Java RMI Registry
lotusnote 1352/tcp lotusnotes # Lotus Note
ms-sql-s 1433/tcp # Microsoft SQL Server
ms-sql-m 1434/udp # Microsoft SQL Monitor
ingreslock 1524/tcp
datametrics 1645/tcp old-radius
datametrics 1645/udp old-radius
sa-msg-port 1646/tcp old-radacct
sa-msg-port 1646/udp old-radacct
kermit 1649/tcp
groupwise 1677/tcp
l2f 1701/udp l2tp
radius 1812/tcp
radius 1812/udp
radius-acct 1813/tcp radacct # Radius Accounting
radius-acct 1813/udp radacct
cisco-sccp 2000/tcp # Cisco SCCP
nfs 2049/tcp # Network File System
nfs 2049/udp # Network File System
gnunet 2086/tcp
gnunet 2086/udp
rtcm-sc104 2101/tcp # RTCM SC-104 IANA 1/29/99
rtcm-sc104 2101/udp
gsigatekeeper 2119/tcp
gris 2135/tcp # Grid Resource Information Server
cvspserver 2401/tcp # CVS client/server operations
venus 2430/tcp # codacon port
venus 2430/udp # Venus callback/wbc interface
venus-se 2431/tcp # tcp side effects
venus-se 2431/udp # udp sftp side effect
codasrv 2432/tcp # not used
codasrv 2432/udp # server port
codasrv-se 2433/tcp # tcp side effects
codasrv-se 2433/udp # udp sftp side effect
mon 2583/tcp # MON traps
mon 2583/udp
dict 2628/tcp # Dictionary server
f5-globalsite 2792/tcp
gsiftp 2811/tcp
gpsd 2947/tcp
gds-db 3050/tcp gds_db # InterBase server
icpv2 3130/udp icp # Internet Cache Protocol
isns 3205/tcp # iSNS Server Port
isns 3205/udp # iSNS Server Port
iscsi-target 3260/tcp
mysql 3306/tcp
ms-wbt-server 3389/tcp
nut 3493/tcp # Network UPS Tools
nut 3493/udp
distcc 3632/tcp # distributed compiler
daap 3689/tcp # Digital Audio Access Protocol
svn 3690/tcp subversion # Subversion protocol
suucp 4031/tcp # UUCP over SSL
sysrqd 4094/tcp # sysrq daemon
sieve 4190/tcp # ManageSieve Protocol
epmd 4369/tcp # Erlang Port Mapper Daemon
remctl 4373/tcp # Remote Authenticated Command Service
f5-iquery 4353/tcp # F5 iQuery
ntske 4460/tcp # Network Time Security Key Establishment
ipsec-nat-t 4500/udp # IPsec NAT-Traversal [RFC3947]
iax 4569/udp # Inter-Asterisk eXchange
mtn 4691/tcp # monotone Netsync Protocol
radmin-port 4899/tcp # RAdmin Port
sip 5060/tcp # Session Initiation Protocol
sip 5060/udp
sip-tls 5061/tcp
sip-tls 5061/udp
xmpp-client 5222/tcp jabber-client # Jabber Client Connection
xmpp-server 5269/tcp jabber-server # Jabber Server Connection
cfengine 5308/tcp
mdns 5353/udp # Multicast DNS
postgresql 5432/tcp postgres # PostgreSQL Database
freeciv 5556/tcp rptp # Freeciv gameplay
amqps 5671/tcp # AMQP protocol over TLS/SSL
amqp 5672/tcp
amqp 5672/sctp
x11 6000/tcp x11-0 # X Window System
x11-1 6001/tcp
x11-2 6002/tcp
x11-3 6003/tcp
x11-4 6004/tcp
x11-5 6005/tcp
x11-6 6006/tcp
x11-7 6007/tcp
gnutella-svc 6346/tcp # gnutella
gnutella-svc 6346/udp
gnutella-rtr 6347/tcp # gnutella
gnutella-rtr 6347/udp
redis 6379/tcp
sge-qmaster 6444/tcp sge_qmaster # Grid Engine Qmaster Service
sge-execd 6445/tcp sge_execd # Grid Engine Execution Service
mysql-proxy 6446/tcp # MySQL Proxy
babel 6696/udp # Babel Routing Protocol
ircs-u 6697/tcp # Internet Relay Chat via TLS/SSL
bbs 7000/tcp
afs3-fileserver 7000/udp
afs3-callback 7001/udp # callbacks to cache managers
afs3-prserver 7002/udp # users & groups database
afs3-vlserver 7003/udp # volume location database
afs3-kaserver 7004/udp # AFS/Kerberos authentication
afs3-volser 7005/udp # volume managment server
afs3-bos 7007/udp # basic overseer process
afs3-update 7008/udp # server-to-server updater
afs3-rmtsys 7009/udp # remote cache manager service
font-service 7100/tcp xfs # X Font Service
http-alt 8080/tcp webcache # WWW caching service
puppet 8140/tcp # The Puppet master service
bacula-dir 9101/tcp # Bacula Director
bacula-fd 9102/tcp # Bacula File Daemon
bacula-sd 9103/tcp # Bacula Storage Daemon
xmms2 9667/tcp # Cross-platform Music Multiplexing System
nbd 10809/tcp # Linux Network Block Device
zabbix-agent 10050/tcp # Zabbix Agent
zabbix-trapper 10051/tcp # Zabbix Trapper
amanda 10080/tcp # amanda backup services
dicom 11112/tcp
hkp 11371/tcp # OpenPGP HTTP Keyserver
db-lsp 17500/tcp # Dropbox LanSync Protocol
dcap 22125/tcp # dCache Access Protocol
gsidcap 22128/tcp # GSI dCache Access Protocol
wnn6 22273/tcp # wnn6
#
# Datagram Delivery Protocol services
#
rtmp 1/ddp # Routing Table Maintenance Protocol
nbp 2/ddp # Name Binding Protocol
echo 4/ddp # AppleTalk Echo Protocol
zip 6/ddp # Zone Information Protocol
#=========================================================================
# The remaining port numbers are not as allocated by IANA.
#=========================================================================
# Kerberos (Project Athena/MIT) services
kerberos4 750/udp kerberos-iv kdc # Kerberos (server)
kerberos4 750/tcp kerberos-iv kdc
kerberos-master 751/udp kerberos_master # Kerberos authentication
kerberos-master 751/tcp
passwd-server 752/udp passwd_server # Kerberos passwd server
krb-prop 754/tcp krb_prop krb5_prop hprop # Kerberos slave propagation
zephyr-srv 2102/udp # Zephyr server
zephyr-clt 2103/udp # Zephyr serv-hm connection
zephyr-hm 2104/udp # Zephyr hostmanager
iprop 2121/tcp # incremental propagation
supfilesrv 871/tcp # Software Upgrade Protocol server
supfiledbg 1127/tcp # Software Upgrade Protocol debugging
#
# Services added for the Debian GNU/Linux distribution
#
poppassd 106/tcp # Eudora
moira-db 775/tcp moira_db # Moira database
moira-update 777/tcp moira_update # Moira update protocol
moira-ureg 779/udp moira_ureg # Moira user registration
spamd 783/tcp # spamassassin daemon
skkserv 1178/tcp # skk jisho server port
predict 1210/udp # predict -- satellite tracking
rmtcfg 1236/tcp # Gracilis Packeten remote config server
xtel 1313/tcp # french minitel
xtelw 1314/tcp # french minitel
zebrasrv 2600/tcp # zebra service
zebra 2601/tcp # zebra vty
ripd 2602/tcp # ripd vty (zebra)
ripngd 2603/tcp # ripngd vty (zebra)
ospfd 2604/tcp # ospfd vty (zebra)
bgpd 2605/tcp # bgpd vty (zebra)
ospf6d 2606/tcp # ospf6d vty (zebra)
ospfapi 2607/tcp # OSPF-API
isisd 2608/tcp # ISISd vty (zebra)
fax 4557/tcp # FAX transmission service (old)
hylafax 4559/tcp # HylaFAX client-server protocol (new)
munin 4949/tcp lrrd # Munin
rplay 5555/udp # RPlay audio service
nrpe 5666/tcp # Nagios Remote Plugin Executor
nsca 5667/tcp # Nagios Agent - NSCA
canna 5680/tcp # cannaserver
syslog-tls 6514/tcp # Syslog over TLS [RFC5425]
sane-port 6566/tcp sane saned # SANE network scanner daemon
ircd 6667/tcp # Internet Relay Chat
zope-ftp 8021/tcp # zope management by ftp
tproxy 8081/tcp # Transparent Proxy
omniorb 8088/tcp # OmniORB
clc-build-daemon 8990/tcp # Common lisp build daemon
xinetd 9098/tcp
git 9418/tcp # Git Version Control System
zope 9673/tcp # zope server
webmin 10000/tcp
kamanda 10081/tcp # amanda backup services (Kerberos)
amandaidx 10082/tcp # amanda backup services
amidxtape 10083/tcp # amanda backup services
sgi-cmsd 17001/udp # Cluster membership services daemon
sgi-crsd 17002/udp
sgi-gcd 17003/udp # SGI Group membership daemon
sgi-cad 17004/tcp # Cluster Admin daemon
binkp 24554/tcp # binkp fidonet protocol
asp 27374/tcp # Address Search Protocol
asp 27374/udp
csync2 30865/tcp # cluster synchronization tool
dircproxy 57000/tcp # Detachable IRC Proxy
tfido 60177/tcp # fidonet EMSI over telnet
fido 60179/tcp # fidonet EMSI over TCP
# Local services
@@ -1 +1 @@
Subsystem cli /usr/bin/clixon_cli
Subsystem cli /usr/bin/klish
@@ -0,0 +1,4 @@
# https://addiva-elektronik.github.io/2023/03/29/bridge-firewalling/
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
@@ -0,0 +1,2 @@
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
@@ -0,0 +1,2 @@
net.core.fb_tunnels_only_for_init_net=2
net.core.rmem_max=1000000
@@ -1 +0,0 @@
local7.* -/var/log/profinet.log
+26 -6
View File
@@ -1,12 +1,11 @@
#!/bin/sh
# Called from /etc/fstab to ensure we have something writable mounted
# at /cfg, /etc, /home, /root, and /var.
#
# /mnt/cfg is used to store device modifications made to /etc, /home,
# /root.
#
# /mnt/var is used as the backins store for /var. If /mnt/var is not
# /mnt/var is used as the backing store for /var. If /mnt/var isn't
# available, /mnt/cfg will still be be used to persist /var/lib.
#
# If a disk partiion with the corresponding label ("cfg"/"var") is
@@ -14,6 +13,7 @@
# directories. Otherwise fall back to a tmpfs based RAM disk. This
# effectively brings up the system with the default configuration, but
# obviously any subsequent configuration is ephemeral.
. /etc/os-release
set -e
@@ -32,6 +32,21 @@ mount_rw()
return 1
}
# Bind mount /var or /var/lib to ensure applications like podman can set
# up overlay mounts for containers. Overlays cannot sit on top of other
# overlays. We always copy the contents of /var or /var/lib from the
# rootfs to get updates, e.g., new packages added in an upgrade.
mount_bind()
{
src="$1"
dst="$2"
mkdir -p "$src"
cp -af "$dst/." "$src/" ||:
mount -o bind "$src" "$dst"
}
# mkdir -p -m 0755 only applies to the deepest directory
# shellcheck disable=SC2174
mount_overlay()
@@ -64,7 +79,11 @@ if ! mount_rw var >/dev/null 2>&1; then
logger $opt -p user.warn -t "$nm" \
"No persistent storage found for /var, only /var/lib is persisted."
varsrc=/mnt/tmp
vlibsrc=/mnt/cfg
vlibsrc=/mnt/cfg/vlib
else
mount_bind "$varsrc" /var
varsrc=
vlibsrc=
fi
cfgsrc=/mnt/cfg
@@ -88,7 +107,8 @@ else
sync
fi
if /lib/infix/use-etc; then
# Check build: NETCONF or Classic
if [ "$VARIANT_ID" != "netconf" ]; then
etcsrc=/mnt/cfg
fi
@@ -101,9 +121,9 @@ mount_overlay cfg $cfgsrc /cfg
mount_overlay etc $etcsrc /etc
mount_overlay home $cfgsrc /home
mount_overlay root $cfgsrc /root
mount_overlay var $varsrc /var
[ "$vlibsrc" ] && mount_overlay vlib "$vlibsrc" /var/lib
[ "$varsrc" ] && mount_overlay var "$varsrc" /var
[ "$vlibsrc" ] && mount_bind "$vlibsrc" /var/lib
# Keep transient configs in a ramdisk and symlink out to /cfg for
# startup.
+4 -9
View File
@@ -25,19 +25,14 @@ for netif in /sys/class/net/*; do
dsa="dsa$num"
logger -k -p user.notice -t "$ident" "Found DSA interface, renaming $iface -> $dsa"
ip link set dev "$iface" name $dsa
ip link set dev "$iface" name $dsa group internal
num=$((num + 1))
done
# Find and mark all switch ports
ports=$(devlink port 2>/dev/null | awk '/flavour physical/{print $5}')
for iface in $ports; do
ip link set "$iface" group port
done
# Testing, e.g., using /etc/mactab may use TAP devices to create
# emulated switch ports, make sure to mark them as well
ports=$(ip -json link | jq -r '.[].ifname | match("^e[[:digit:]]+").string')
ports=$(devlink -j port | jq -r '.port[]
| select(.flavour == "physical")
| .netdev')
for iface in $ports; do
ip link set "$iface" group port
done
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
# Probe for various types of harware features
if dmesg |grep -q QEMU || test -d /sys/module/qemu_fw_cfg; then
initctl cond set qemu
fi
@@ -1,9 +0,0 @@
#!/bin/sh
for type in ecdsa ed25519 rsa; do
[ -f /var/lib/ssh/ssh_host_${type}_key ] \
|| ssh-keygen -N "" -t $type -f /var/lib/ssh/ssh_host_${type}_key \
|| exit 1
done
initctl cond set ssh-hostkeys
-38
View File
@@ -1,38 +0,0 @@
#!/bin/sh
# Only runs in native /etc and PROFINET nodes.
if initctl cond get boot/profinet; then
initctl enable snmpd
initctl disable lldpd
fi
# Factory default: all switch ports in VLAN 1 of br0
# need to check for 'length > 0' because ip command
# outputs empty json objects for non-port group ifs
ports=$(ip -json link show group port | jq -r '.[].ifname | select(length > 0)' | tr "\n" " ")
[ -f /etc/network/interfaces.d/br0 ] || [ -z "$ports" ] && exit 0
touch /etc/network/interfaces.d/br0
for port in $ports; do
cat <<-EOF >>/etc/network/interfaces.d/br0
iface $port
bridge-access 1
post-up ip link set $port group port
EOF
done
cat <<-EOF >>/etc/network/interfaces.d/br0
auto br0
iface br0
bridge-ports $ports
bridge-vlan-aware yes
bridge-stp on
bridge-vids 1
auto vlan1
iface vlan1 inet dhcp
vlan-id 1
vlan-raw-device br0
post-up ip link set vlan1 group iface
EOF
ip link set vlan1 group iface
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
# When changing default IPv4/6 settings, this does not apply to
# existing interfaces. This syncs the default settings to all known
# interfaces at boot, such that physical interfaces will start from
# the same point as virtual ones.
tmp=$(mktemp)
sysctl net.ipv4.conf.default >$tmp
sysctl net.ipv6.conf.default >>$tmp
for iface in $(ip -j link show | jq -r .[].ifname); do
sed -e "s/.default./.${iface}./g" $tmp | sysctl -p -
done
rm $tmp
-21
View File
@@ -1,21 +0,0 @@
#!/bin/sh
if [ -f /mnt/cfg/infix/.use_etc ]; then
exit 0
fi
# Finit's condition system may not yet be bootstrapped when this script
# is called, e.g., when /etc/fstab is parsed, so we have to manually
# check for the boot/etc condition.
awk '
$0 == "finit.cond" {
cond=1;
next;
}
cond == 1 {
use_etc = index($0, "etc") != 0;
}
END {
exit(use_etc ? 0 : 1);
}
' /proc/1/cmdline
@@ -1,26 +0,0 @@
#!/bin/sh
# Override boot mode based on user input from setup tool
set_cond()
{
mkdir -p /run/finit/cond/boot
ln -s /run/finit/cond/reconf "/run/finit/cond/boot/$1"
}
# Report to the setup and show tools the current boot mode
if /lib/infix/use-etc; then
if [ -f /mnt/cfg/infix/.use_etc ]; then
cat /mnt/cfg/infix/.use_etc > /tmp/.boot_mode
if grep -qi profinet /mnt/cfg/infix/.use_etc; then
set_cond profinet
else
set_cond etc
fi
else
echo "native /etc" > /tmp/.boot_mode
set_cond etc
fi
else
echo "NETCONF" > /tmp/.boot_mode
set_cond netconf
fi
+181
View File
@@ -0,0 +1,181 @@
#!/bin/sh
set -e
inform()
{
local level="$1"
shift
logger -p "daemon.$level" -t dagger -c $LOGGER_STDOUT "$@"
}
abort()
{
inform err "Aborting: $*"
exit 1
}
generate_order()
{
[ -f "$1/bottom-up-order" ] && [ -f "$1/top-down-order" ] && return
# The bottom-up order corresponds to a DFS through the DAG, with
# duplicates removed
find -L "$1/dag" -depth -mindepth 1 -exec basename {} \; \
| awk '!seen[$0]++' \
>"$1/bottom-up-order"
# The reverse is a valid top-down order
sed '1!G;h;$!d' "$1/bottom-up-order" >"$1/top-down-order"
}
action_exec()
{
local actdir="$2/action/$1"
local orderfile="$actdir/order"
local code=0
generate_order "$2"
if [ ! -r "$orderfile" ]; then
orderfile="$2/bottom-up-order"
inform warn "No order defined for $actdir, falling back to bottom-up"
fi
local order=$(cat "$orderfile")
[ -d "$actdir/@pre" ] && order="@pre $order"
[ -d "$actdir/@post" ] && order="$order @post"
for node in $order; do
for work in $(find "$actdir/$node" -type f -executable 2>/dev/null | sort); do
$work >>"$work.log" 2>&1 || code=$?
echo "[exit:$code]" >>"$work.log"
[ $code -eq 0 ] || abort "$work failed with exitcode $code"
done
done
}
do_exec()
{
local action="$1"
local current=
current=$([ -f "$basedir/current" ] && cat "$basedir/current")
[ "$current" ] && [ -d "$basedir/$current" ] \
|| abort "Current generation does not exist"
action_exec "$1" "$basedir/$current"
}
do_abandon()
{
local next=
next=$([ -f "$basedir/next" ] && cat "$basedir/next" || true)
[ "$next" ] && [ -d "$basedir/$next" ] \
|| abort "Next generation does not exist"
mv "$basedir/$next" "$basedir/$next-ABANDONED-$(date +%F-%T)"
rm "$basedir/next"
inform info "Abandoned generation $next"
}
do_evolve()
{
local current=
local next=
current=$([ -f "$basedir/current" ] && cat "$basedir/current" || true)
[ ! "$current" ] || [ -d "$basedir/$current" ] \
|| abort "Current generation does not exist"
next=$([ -f "$basedir/next" ] && cat "$basedir/next" || true)
[ "$next" ] && [ -d "$basedir/$next" ] \
|| abort "Next generation does not exist"
[ "$current" ] && action_exec exit "$basedir/$current"
action_exec init "$basedir/$next"
mv "$basedir/next" "$basedir/current"
inform info "Evolved to generation $next"
}
usage()
{
cat <<EOF
usage: dagger [-d] [-C <root>] <command> [<args>]
Directed Acyclic Graph Generational Execution Runner
Global options:
-d
In addition to the system log, also log messages to stderr.
-C <root>
Instead of the current working directory, use <root> as the dagger
root directory.
Commands:
abandon
Abandon a prepared, but not yet applied, next generation.
evolve
Run the exit action of the current generation, followed by the
init action of the next generation.
exec <action>
Run the specified action of the current generation.
help
Show this message.
EOF
}
basedir=$(pwd)
# Global options
while getopts "dC:" opt; do
case $opt in
d)
LOGGER_STDOUT=-s
;;
C)
basedir=$OPTARG
;;
*)
usage && exit 1
esac
done
shift $((OPTIND - 1))
if [ $# -lt 1 ]; then
usage && exit 1
fi
cmd=$1
shift
case $cmd in
"help")
usage && exit 0
;;
"abandon")
do_abandon
;;
"evolve")
do_evolve
;;
"exec")
do_exec "$@"
;;
*)
usage && exit 1
esac
+1 -1
View File
@@ -1 +1 @@
nano
mg
+1 -1
View File
@@ -1 +1 @@
nano
mg
+134
View File
@@ -0,0 +1,134 @@
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
ACTION="$1"
RESOLV_CONF="/etc/resolv.conf"
[ -e $RESOLV_CONF ] || touch $RESOLV_CONF
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="$subnet"
# Handle stateful DHCPv6 like DHCPv4
[ -n "$ipv6" ] && ip="$ipv6/128"
if [ -z "${IF_WAIT_DELAY}" ]; then
IF_WAIT_DELAY=10
fi
wait_for_ipv6_default_route() {
printf "Waiting for IPv6 default route to appear"
while [ $IF_WAIT_DELAY -gt 0 ]; do
if ip -6 route list | grep -q default; then
printf "\n"
return
fi
sleep 1
printf "."
: $((IF_WAIT_DELAY -= 1))
done
printf " timeout!\n"
}
flush_dhcp_addresses() {
addrs=$(ip -j addr show dev $interface | jq -c \
'.[0].addr_info[] | select(.family == "inet") | select(.protocol == "dhcp")')
for addr in $addrs; do
ip="$(echo "$addr" | jq -r '."local"')"
prefix="$(echo "$addr" | jq -r '."prefixlen"')"
ip addr del "$ip/$prefix" dev "$interface"
done
}
case "$ACTION" in
deconfig)
flush_dhcp_addresses
/bin/ip link set dev $interface up
# drop info from this interface
# resolv.conf may be a symlink to /tmp/, so take care
TMPFILE=$(mktemp)
grep -vE "# $interface\$" $RESOLV_CONF > $TMPFILE
cat $TMPFILE > $RESOLV_CONF
rm -f $TMPFILE
if [ -x /usr/sbin/avahi-autoipd ]; then
/usr/sbin/avahi-autoipd -c $interface && /usr/sbin/avahi-autoipd -k $interface
fi
;;
leasefail|nak)
if [ -x /usr/sbin/avahi-autoipd ]; then
/usr/sbin/avahi-autoipd -c $interface || /usr/sbin/avahi-autoipd -wD $interface --no-chroot
fi
;;
renew|bound)
if [ -x /usr/sbin/avahi-autoipd ]; then
/usr/sbin/avahi-autoipd -c $interface && /usr/sbin/avahi-autoipd -k $interface
fi
/bin/ip addr add dev $interface $ip/$NETMASK $BROADCAST proto 5
if [ -n "$ipv6" ] ; then
wait_for_ipv6_default_route
fi
# RFC3442: If the DHCP server returns both a Classless
# Static Routes option and a Router option, the DHCP
# client MUST ignore the Router option.
if [ -n "$staticroutes" ]; then
echo "deleting routers"
route -n | while read dest gw mask flags metric ref use iface; do
[ "$iface" != "$interface" -o "$gw" = "0.0.0.0" ] || \
route del -net "$dest" netmask "$mask" gw "$gw" dev "$interface"
done
# format: dest1/mask gw1 ... destn/mask gwn
set -- $staticroutes
while [ -n "$1" -a -n "$2" ]; do
route add -net "$1" gw "$2" dev "$interface"
shift 2
done
elif [ -n "$router" ] ; then
echo "deleting routers"
while route del default gw 0.0.0.0 dev $interface 2> /dev/null; do
:
done
for i in $router ; do
route add default gw $i dev $interface
done
fi
# drop info from this interface
# resolv.conf may be a symlink to /tmp/, so take care
TMPFILE=$(mktemp)
grep -vE "# $interface\$" $RESOLV_CONF > $TMPFILE
cat $TMPFILE > $RESOLV_CONF
rm -f $TMPFILE
# prefer rfc3397 domain search list (option 119) if available
if [ -n "$search" ]; then
search_list=$search
elif [ -n "$domain" ]; then
search_list=$domain
fi
[ -n "$search_list" ] &&
echo "search $search_list # $interface" >> $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo "nameserver $i # $interface" >> $RESOLV_CONF
done
;;
esac
HOOK_DIR="$0.d"
for hook in "${HOOK_DIR}/"*; do
[ -f "${hook}" -a -x "${hook}" ] || continue
"${hook}" "$ACTION"
done
exit 0
+6
View File
@@ -3,11 +3,17 @@ CONFIG_DEVICE_TREE_INCLUDES="infix-env.dtsi infix-key.dtsi"
CONFIG_ENV_IMPORT_FDT=y
CONFIG_RSA=y
CONFIG_RSA_VERIFY=y
CONFIG_FIT=y
CONFIG_FIT_SIGNATURE=y
CONFIG_BLKMAP=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_DISTRO_DEFAULTS=y
CONFIG_CMD_SETEXPR=y
CONFIG_CMD_SETEXPR_FMT=y
CONFIG_MMC=y
+2
View File
@@ -2,9 +2,11 @@ for tgt in "${boot_targets}"; do
if test "${tgt}" = "mmc0"; then
setenv devtype "mmc"
setenv devnum 0
mmc dev 0
elif test "${tgt}" = "mmc1"; then
setenv devtype "mmc"
setenv devnum 1
mmc dev 1
else
setenv devtype "${tgt}"
setenv devnum 0
+1 -1
View File
@@ -5,7 +5,7 @@ if test "${slot}" = "primary"; then
run ixprepblk
elif test "${slot}" = "secondary"; then
run ixprepblk
elif test "${slot}" = "dhcp"; then
elif test "${slot}" = "net"; then
run ixprepdhcp
fi
+1 -1
View File
@@ -10,7 +10,7 @@ if load ${devtype} ${devnum}:${auxpart} ${ramdisk_addr_r} /${slot}.itbh; then
if part start ${devtype} ${devnum} ${slot} devoffs; then
if ${devtype} read ${sqaddr} ${devoffs} ${sqblkcnt}; then
setenv bootargs_root "root=PARTLABEL=${slot}"
setenv bootargs_root "root=PARTLABEL=${slot} rootwait"
setenv prepared ok
fi
fi
-3
View File
@@ -1,3 +0,0 @@
clicon -1 clicon -1 * - - wheel Clixon backend
factory -1 wheel -1 =reset - /sbin/factory - Reset to factory defaults
www-data -1 www-data -1 * - - clicon www-data
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
# shellcheck disable=SC1090
. "$BR2_CONFIG" 2>/dev/null
# Drop Buildroot default symlink to /tmp
if [ -L "$TARGET_DIR/var/lib/avahi-autoipd" ]; then
rm "$TARGET_DIR/var/lib/avahi-autoipd"
mkdir "$TARGET_DIR/var/lib/avahi-autoipd"
fi
# Allow clish (symlink to /usr/bin/klish) to be a login shell
grep -qsE '^/bin/clish$$' "$TARGET_DIR/etc/shells" \
|| echo "/bin/clish" >> "$TARGET_DIR/etc/shells"
+1
View File
@@ -0,0 +1 @@
../usr/bin/klish

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