Compare commits

...
219 Commits
Author SHA1 Message Date
Joachim Wiberg 6f210174c2 package/skeleton-init-finit: enable rngd by default
Platforms with /dev/hwrandom use that to see /dev/urandom.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-05 13:32:38 +01:00
Joachim WibergandGitHub c81b03e1ca Merge pull request #796 from kernelkit/rtc
Support for save/restore system clock from file
2024-11-05 13:05:59 +01:00
Joachim WibergandGitHub bca13137a3 Merge pull request #800 from kernelkit/jovatn-test-arch-doc-fix
Update test-arch.md
2024-11-04 14:25:48 +01:00
Jon-Olov VatnandGitHub 6ba13776df Update test-arch.md
Fixing typo

[skip ci]
2024-11-04 14:19:29 +01:00
Joachim Wiberg 1323d2f266 doc: update ChangeLog
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-04 11:33:51 +01:00
Joachim Wiberg 79d7e8bbab configs: allow aarch64 targets to save system clock to a file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-04 11:10:53 +01:00
Joachim Wiberg 5a38e8768b package/finit: backport upstream v4.9-pre patches
Backport support for saving and restoring system time from a file on
systems with broken RTC that reset to the future.

With this support a system can be sure time only ever moves forward.

Fix #794

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-04 11:10:53 +01:00
Joachim Wiberg c23b9c2dc4 package/finit: fix missing default hostname
The string variable handling in configuring Finit did not follow the
Buildroot best practises.  This patch adds stripping quotes from all
string variables before adding them as configure arguments.

This fixes issue with, e.g., this sneaky bastard:

    configure --with-rtc-date=""2024-10-12 12:34:56""

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg 5261e4f66f board/common: add support for tweaking RTC behavior
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg a6b7b3d2c0 board/common: fix issue with grub menu being misaligned
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg b4d6c787d5 board/common: allow more logging to stdout before starting qemu
Creating/Recreating the qcow2 image now logs to stdout, as does the check
using qemu-img, which looks funny in raw mode.  So let's delay the start
of raw mode until just before starting qemu.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg 58b2ade1e6 board/common: don't regenerate disk image when starting qemu
This fixes an annoying problem with `make run` when set to boot with a
qcow2 disk image.  By default the disk image was recreated every time
the qemu.sh script was called.

Also, add image check to enforce regen if broken.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg 228c93e430 board/common: hide /var option when booting disk image
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg 2938efc8a4 board/common: proper string check in /var/lib bind mount
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Joachim Wiberg ae82f7fdcf board/aarch64: disable rtc on styx, all revs
The RTC in the CN913x series does not have any "valid" bit, and this
board (all revs) does not have any backup power connected, so it will
return garbage values after every vold boot.

It was therefore decided to disable the RTC completely and set system
time manually, or using an NTP client.  This way any time skips would
only ever be forward, never backwards.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-11-03 22:14:00 +01:00
Jon-Olov VatnandGitHub fbddedb51b Merge pull request #792 from kernelkit/jovatn/doc-fixes
Minor doc fixes
2024-11-01 09:21:39 +01:00
Jon-Olov VatnandGitHub 43e2201dd1 Merge branch 'main' into jovatn/doc-fixes 2024-11-01 08:58:12 +01:00
Jon-Olov Vatn b8b0cd3377 Addressing feedback on doc fixes
[skip ci]
2024-11-01 08:54:47 +01:00
Jon-Olov Vatn 6b63b2f9b4 Minor doc fixes
[skip ci]
2024-11-01 08:27:13 +01:00
Joachim WibergandGitHub 142eda81d5 Merge pull request #783 from rical/cli-add-show-iface-cont-sup 2024-10-31 20:22:04 +01:00
Joachim WibergandGitHub fb3c026288 Merge pull request #791 from kernelkit/reboot-on-error 2024-10-31 20:21:33 +01:00
Mattias Walström b0f4192f24 kernel: Reboot device if kernel panics
The worst way of handling a kernel crash is to do nothing at all.
2024-10-31 15:55:47 +01:00
Richard Alpe b9492c7bee cli: add container support to show interfaces
Make show interfaces container aware. This is done by looking though
all podman containers for interfaces and looking up there info from
network namespaces on the main system / hypervisor.

Interfaces controlled by containers are clearly marked in the "show
interfaces" output, with a single gray row. Telling the user that they
belong to one or more named containers. The user can then run "show
interface name NAME" on interfaces owned by containers, which provided
some additional info, such as mac address and stat counters.

The patch also add support for printing veth peers which are owned by
containers.

Lastly, the patch also adds test cases for this functionality.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-29 17:23:30 +01:00
Richard Alpe 31061fcc10 yanger: simplify setting of admin-status
There should be no functional change.
2024-10-29 17:22:59 +01:00
Joachim WibergandGitHub 3e8ead6f92 Merge pull request #778 from kernelkit/r2s-libssh-openssl 2024-10-29 09:14:21 +01:00
Jon-Olov VatnandGitHub b00b6cd6ea Merge pull request #766 from kernelkit/update-bridging-doc
Update bridging doc
2024-10-29 08:33:03 +01:00
Joachim Wiberg ba60b8b494 configs: re-enable OpenSSL backend for libssh/libssh2 also on R2S
Fixes issue with netopeer2-server failing to load its host certificate.

Follow-up to 8b75022 for the NanoPi R2S.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-29 05:47:57 +01:00
Mattias WalströmandGitHub 1e5d4612c9 Merge pull request #767 from addiva-elektronik/update-make-test-spec
Minor Update in Generating Test Spec
2024-10-28 15:16:36 +01:00
Ahmed Karic b359ac794d test: update make-test-spec to escape '/'
It has been identified that the sed command fails to process INFIX_NAME
when it contains an unescaped '/' character.
2024-10-28 13:18:46 +01:00
Ahmed Karic 3b00a376b1 test: regenerate .svg for dhcp_basic test
In the recent work, the generation and commit of topology.svg for the
dhcp_basic test was unintentionally overlooked.
2024-10-28 13:18:21 +01:00
Joachim WibergandGitHub 00cdff1d2d Merge pull request #761 from kernelkit/misc-interface-dhcp
Misc interface dhcp

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 12:38:25 +01:00
Joachim Wiberg 3e5e89b328 package/finit: backport fix to clear background color from GRUB menu
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg 56d1964559 doc: sync dev-guide and contributing guidelines
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg 0112113028 doc: add description of description setting and update ChangeLog
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg 967bfc1e67 test: new test, verify ifAlias
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg 0284e2ca58 confd: allow interface description as ifAlias
This patch adds support for setting the free form description string as
the interface alias.  This can be read from /sys/class/net/*/ifalias, or
using the 'ip link show' command.  The ifalias is reported by SNMP and
LLDP by default, and now also in the operational datastore.

Linux supports 250 characters in ifalias, but the IF-MIB is restricted
to 64 characters, so we add a local deviation to limit the type.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg 710616f8c4 doc,test: clarify relationship between DHCP option 3 and 121
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Joachim Wiberg dbf0fd2514 board/common: fix rauc compatible regression
The new variable INFIX_COMPATIBLE, used for the RAUC compatible string,
is not properly evaluated on defconfigs where it is composed of another
variable, e.g.

    INFIX_COMPATIBLE="${INFIX_IMAGE_ID}"

Unfortunately, this is the default value for INFIX_COMPATIBLE, and so it
breaks all tier one defconfigs on the mainline branch since a1771ff.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-28 11:04:49 +01:00
Jon-Olov Vatn aefb90f8f3 Doc: Updating pictures in bridging examples
[skip ci]
2024-10-25 15:31:59 +02:00
Jon-Olov Vatn 49660b7771 Fixing #748 by updating doc on MAC bridging
- Introduce the term MAC bridge in the networking documentation
- List the limitation to one MAC bridge on Marvell Linkstree
- Adding lego pictures for the MAC bridge and VLAN bridge examples

[skip ci]
2024-10-25 15:21:00 +02:00
Ahmed KaricandGitHub 55a20bb4c7 Merge pull request #764 from addiva-elektronik/update-infix-test
Simplify Running Infix Tests from External Projects
2024-10-25 10:29:13 +02:00
Ahmed Karic 3b2bdbf93c test: simplify running infix tests from external
This will facilitate running infix tests from external projects:
  - eliminate the need for an external topology.dot.in file
  - eliminate the requirement to manually provide external image name

Fixes #763
2024-10-25 09:57:08 +02:00
Ahmed KaricandGitHub 04c843e095 Merge pull request #760 from kernelkit/update-dhcp-tests
test: update dhcp test topologies
2024-10-24 13:57:27 +02:00
Tobias WaldekranzandGitHub 1aa5169641 Merge pull request #757 from kernelkit/rauc-compatible2
Use INFIX_COMPATIBLE also for aux partition's rauc.status
2024-10-24 12:26:45 +02:00
Ahmed Karic 594d074f7a test: update dhcp test topologies
Fixes #746
2024-10-24 09:59:56 +02:00
jovatnandGitHub b81407e7d9 Merge pull request #759 from kernelkit/jovatn/doc-vlan-iface-qos
Update QoS documentation (VLAN interface ingress/egress priority)
2024-10-24 09:33:34 +02:00
Mattias WalströmandGitHub 8fc0ab9b2f Merge pull request #758 from kernelkit/update-test-spec
Update test spec
2024-10-23 14:50:47 +02:00
Mattias Walström 3b3656c8f5 test: spec: change image format from PNG to SVG
SVG is a plain text file, better to see why it changed
than binary PNG. Also fix #744 by adding infix/OEM hash
to test specification

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-10-23 14:21:26 +02:00
Jon-Olov Vatn 0eb1fe0ab0 Add QoS doc change to Changelog
[skip ci]
2024-10-23 13:55:28 +02:00
Jon-Olov Vatn 9be43ed0bb Updating colors in QoS complex example picture
[skip ci]
2024-10-23 13:47:30 +02:00
Jon-Olov Vatn 604f22e315 Updating QoS documentation
- More information on Software Forwarding, and its settings.
- Pictures added

[skip ci]
2024-10-23 13:47:30 +02:00
Mattias Walström 76f0c8e3e6 test:spec: Add version of Infix/OEM build
Show the version of the infix build, for traceability

This fix #744

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-10-23 13:45:30 +02:00
Joachim WibergandGitHub d36296da42 Merge pull request #754 from kernelkit/firewall-test
Container firewall test
2024-10-23 13:42:53 +02:00
Joachim WibergandGitHub 9f33658127 Merge pull request #756 from kernelkit/r2s-factory
Update r2s factory-config
2024-10-23 12:46:55 +02:00
Joachim WibergandGitHub 767a1f194b .github: create discussion for new releases
[skip ci]
2024-10-23 12:45:24 +02:00
Joachim Wiberg c7760a68cb test: update infix-containers group README
This is a proposal to how a test section/group overview could look.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 12:27:42 +02:00
Joachim Wiberg 933613e6a3 test: new basic firewall container test
Fix #598

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 12:27:42 +02:00
Joachim Wiberg 14fde1bf90 test: new util method to_binary()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 10:08:10 +02:00
Joachim Wiberg 64c20d96ad test: minor, cleanup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 10:08:10 +02:00
Joachim Wiberg a1771ff5c6 board/common: use INFIX_COMPATIBLE also in rauc.status
Follow-up to cedb654, issue #755.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 10:03:22 +02:00
Joachim Wiberg a7e7b75a97 board/aarch64: update r2s factory-config
- add default-deny-all rule from 2341e07
 - enable iburst for the ntp client (quicker initial sync)
 - bump meta version (to skip .cfg migration at boot)

Fix #750 [skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-23 08:04:31 +02:00
Joachim WibergandGitHub 822cb93265 Merge pull request #755 from kernelkit/rauc-compatible
Add support for overriding the compatible string

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-22 19:36:31 +02:00
Joachim Wiberg cedb654643 Add support for overriding the compatible string
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-22 18:32:55 +02:00
Ahmed KaricandGitHub 52eafa70a8 Merge pull request #749 from kernelkit/disable-ntpd
Disable BusyBox Related NTP Services
2024-10-22 17:03:47 +02:00
Ahmed Karic 6ba8e3bf55 busybox: disable ntpd from defconfig 2024-10-22 13:28:39 +02:00
Joachim WibergandGitHub f119138107 Update SUPPORT.md
[skip ci]
2024-10-22 12:08:43 +02:00
Ahmed KaricandGitHub 5c822efa6f Merge pull request #742 from kernelkit/add-docs-ntp
Update system.md by adding NTP details
2024-10-22 09:50:03 +02:00
Mattias WalströmandGitHub 19d5f1db1c Merge pull request #752 from kernelkit/dsa-interface
Make detection of DSA interface more robust
2024-10-22 09:37:37 +02:00
Ahmed Karic 438e39d2fe doc: update system.md with ntp information
Fixes #733
2024-10-22 08:58:19 +02:00
Mattias Walström 0ee973b2b2 Make detection of DSA interface more robust
Sometimes the interface creation are done, but
the sysfs is not, this gap we sometimes finds
in the nameif script. Wait out the sysfs creation
if running a DSA switch.

Fix #685

Signed-off-by: Mattias Walström <lazzer@gmail.com>
2024-10-22 08:50:54 +02:00
Joachim WibergandGitHub c0e68579c1 Merge pull request #737 from kernelkit/checklist
Checklist for code review and releases

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-21 10:10:25 +02:00
Joachim Wiberg 5b61ccd960 .github: update pull request template
For some documentation changes, e.g., the recent change in the QoS
documentation, see de76b97, it is highly relevant to also mention
this change in the release notes.

In fact, any change that would make it worthwhile for a user to
update their knowledge on a topic should probably be documented
in the release notes.

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-21 10:09:39 +02:00
Joachim Wiberg 1dd761560d .github: add checklist for pull requests and releases
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-21 10:07:15 +02:00
Joachim Wiberg 076d174579 Update ChangeLog for v24.10.1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 15:32:29 +02:00
Tobias WaldekranzandGitHub 1470c473f6 Merge pull request #736 from kernelkit/fix-missing-copy-command
Add missing copy and erase commands to CLI
2024-10-18 15:08:48 +02:00
Joachim Wiberg 9ae7115bbf doc: update ChangeLog for upcoming v24.10.1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 14:16:51 +02:00
Joachim Wiberg f9a0c71b1f package/klish: make sure to select bin tools (copy, erase)
Fix #735

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 14:13:45 +02:00
Joachim Wiberg aad5bcd4e6 doc: update ChangeLog for v24.10.0
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 12:43:14 +02:00
Ahmed KaricandGitHub e875239639 Merge pull request #732 from kernelkit/fix-admin-perm
Allow admin to run 'show ntp'
2024-10-18 10:45:12 +02:00
Joachim WibergandGitHub 3bcc058969 Merge pull request #717 from kernelkit/copy-timeout
Fix too small timeout for copy command

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 09:44:16 +02:00
Ahmed Karic 3fa820b41e klish-plugin-infix: allow admin to run 'show ntp'
Fixes #730
2024-10-18 09:35:43 +02:00
Mattias WalströmandGitHub baec6cb35f Merge pull request #731 from kernelkit/minor-cli-fixes
Minor CLI fixes
2024-10-18 09:33:30 +02:00
Joachim Wiberg 903960f6a0 package/klish-plugin-sysrepo: add units to help text, hide obsolete
Fixes the following CLI issues:

 - kernelkit/klish-plugin-sysrepo#5 : hide obsolete nodes, e.g., meta/version
 - kernelkit/klish-plugin-sysrepo#6 : add units to online help text

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 08:55:44 +02:00
Joachim Wiberg 44727b9a47 confd: mark entire meta container obsolete
Mark meta data as obsolete to hide from CLI and other frontends.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-18 08:52:58 +02:00
Tobias WaldekranzandGitHub eac60b1883 Merge pull request #729 from kernelkit/led-fixes
Disable software LED control of port LEDs
2024-10-18 08:37:26 +02:00
Joachim WibergandGitHub b5abadd52a Merge pull request #728 from kernelkit/uboot-http-netboot-fixes
U-Boot HTTP Netboot Fixes

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-17 16:31:24 +02:00
Joachim Wiberg 4603649145 doc: software led control disabled on styx
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-17 16:02:14 +02:00
jovatnandGitHub c1f552a8dc Merge pull request #726 from kernelkit/jovatn/test-cases-minor-updates
Formatting fixes for test specification and topologies
2024-10-17 15:52:14 +02:00
Tobias Waldekranz c1dfdd92b0 uboot: Fix repeated calls to boot_net in combination with HTTP
Previously, when the `proto://path` format of `bootfile` was used, the
transformed argument sent to either tftp or wget would also be stored
in `bootfile` overriding the original value set by the user.

If the first boot attempt failed for some reason, the protocol
information was stripped from `bootfile` and the second attempt would
then default to TFTP, even if the user had originally specified
`http://...`.

Therefore, store the transformed value in a separate variable.

For some reason, setexpr's parsing of regex escapes changes when this
mode is used, so we need double backslashes to fetch match groups
instead of 1. Yikes.

Fixes #724
2024-10-17 15:38:47 +02:00
Jon-Olov Vatn d3b28339c1 Updating test specs to have consistent formatting 2024-10-17 15:11:19 +02:00
Tobias Waldekranz 563b4a743b uboot: Settle for only ipaddr being set to skip DHCP
This puts the responsibility on the user to set the appropriate static
parameters. On the plus side, we avoid requiring redundant information
when the `proto://path` format is used in `bootfile`
2024-10-17 15:11:12 +02:00
Jon-Olov Vatn 272a7c1e69 Formatting fixes for test specification and topologies
Also including some existing test to test specification, from ietf_system
and ietf_interfaces directories.
2024-10-17 15:11:12 +02:00
Joachim Wiberg 01e91a2fce package/finit: backport upstream rdeps patch
This patch fixes a upstream issue troglobit/finit#415, greatly reducing
the amount of service restarts, needlessly affecting, e.g., iitod when
services like syslogd¹ is reloaded.

____
¹) Traditional UNIX services that properly support SIGHUP.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-17 14:37:02 +02:00
Joachim Wiberg d7abe46768 board/aarch64: disable port led control on styx, for now
For details, see discussion in #670

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-17 13:03:29 +02:00
Ahmed KaricandGitHub 484dc940dc Merge pull request #723 from kernelkit/verify-iface-status
Verify Interface Status
2024-10-17 10:27:10 +02:00
Ahmed Karic 420f6a0556 test: verify interface status (enable/disable)
Fixes #694
2024-10-17 09:50:01 +02:00
Ahmed Karic 4d4a4c68e7 test: refactor iface.py 2024-10-16 19:01:40 +02:00
Joachim WibergandGitHub eb79adce13 Merge pull request #722 from kernelkit/use-specific-secret-add-to-project 2024-10-16 17:24:43 +02:00
Mattias Walström 9fd92252ea CI: Use specific token when calling add to project
[skip ci]
2024-10-16 11:25:03 +02:00
Mattias WalströmandGitHub 90bda1b584 Merge pull request #710 from kernelkit/fix-test-texts
test: Update topologies and test texts
2024-10-16 11:24:44 +02:00
Ahmed KaricandGitHub 15830714f0 Merge pull request #721 from kernelkit/add-admin-status-to-yanger
Statd: Add 'admin-status' to Interface Operational Data
2024-10-16 11:02:36 +02:00
Mattias Walström 34cb229965 test: Update topologies and test texts
All mgmt links should be lightgrey, all mgmt ports should be named mgmt
links between duts should be named link.
2024-10-16 10:51:01 +02:00
Ahmed Karic 3f0b85aad9 statd: Add 'admin-status' to yanger
The interface operational data was missing the 'admin-status' parameter,
which indicates whether an interface is administratively enabled or
disabled. To resolve this, the 'admin-status' was added to the yanger

Fixes #700
2024-10-16 10:33:09 +02:00
Tobias WaldekranzandGitHub 7de94b996a Merge pull request #718 from kernelkit/container-fixups
Container fixups
2024-10-16 09:14:14 +02:00
Joachim WibergandGitHub 09c019b236 Merge pull request #720 from kernelkit/jovatn/changelog-fixes
Doc fixes in ChangeLog v24.10.0 related to OSPF
2024-10-16 08:47:22 +02:00
Joachim Wiberg 526d3356c7 board/common: add example to erase partition table
[skip ci]

Related to: #671

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 08:37:16 +02:00
jovatnandGitHub 358852aa4f Doc fixes in ChangeLog v24.10.0 related to OSPF
Updating existing formulations for changes and fixes for OSPF.

[skip ci]
2024-10-16 08:32:57 +02:00
jovatnandGitHub 18640a78d5 Merge pull request #719 from kernelkit/jovatn/qos-doc-fix
Doc fix on QoS. PCP takes priority over DSCP for tagged IP packets
2024-10-16 08:03:06 +02:00
Jon-Olov Vatn de76b97c94 Doc fix on QoS. PCP takes priority over DSCP for tagged IP packets
This is how it works and how we want it to be by default.
No code change, just doc change.

[skip ci]
2024-10-16 07:49:30 +02:00
Joachim Wiberg 99e0a2ee1c confd: refactor hostnamefmt()
This refactor, and massive code simplification, is a follow-up to the
double free discovery in 3b4d2b3.

Beacuse a hostname in Linux can never be more than 64 chars, we can
safely use a stack buffer instead of calloc(), reducing complexity
and simplifying the code further with the use of strlcat().

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 07:36:35 +02:00
Joachim Wiberg 0d0e2b168a doc: update container notes
- Expand on Docker Hello World
 - Add more pictures to help break up the content a bit

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 07:31:41 +02:00
Joachim WibergandGitHub 08348c43c2 Merge pull request #716 from rical/fix-confd-cont-double-free
confd: fix double free of container hostname
2024-10-16 06:43:29 +02:00
Joachim Wiberg 343b453c74 bin: use CONFD_TIMEOUT for all copy operations
Fixes #701

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 06:10:39 +02:00
Joachim Wiberg 464e0bcb92 bin: factor out copy, erase, and files from klish-plugin-infix
Relocate C code from klish-plugin-infix to stand-alone binaries we can
use also from Bash.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 06:10:39 +02:00
Joachim Wiberg 886d83933f keyack: minor, whitespace and constification
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 06:05:22 +02:00
Joachim Wiberg ef1b1b1d1a statd: add missing dependency
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-16 06:02:49 +02:00
Richard Alpe 3b4d2b38d7 confd: fix double free of container hostname
Fix a double free in the memory minefield surrounding container
hostname provisioning. The hostnamefmt() function already does free()
on success.

This caused all sorts of mayhem when working with multiple containers.
However it mainly manifested itself by some containers not starting
due to there activation script being polluted with gibberish
name data. Your symptom might be different..

Example of polluted activation script:
container --hostname foobar --net veth0k -r always \
  create ^S@`M-}^G docker://ghcr.io/kernelkit/curios:edge

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-15 20:06:45 +02:00
Mattias WalströmandGitHub 0e276a97b8 Merge pull request #711 from kernelkit/minor-test-formating
test: minor code formating
2024-10-15 11:26:54 +02:00
Joachim WibergandGitHub afc40ac2bd Merge pull request #715 from kernelkit/update-pull-request-template
Update pull request template
2024-10-15 11:24:45 +02:00
Mattias Walström 5ea65aea0d Update pull request template
Add information about test changes

Also remove "Other information" since I think that
should also go under Description and to lower the amount of
text in the template, to increase its use.

[skip ci]
2024-10-15 11:21:58 +02:00
Ahmed Karic 614b7efd42 test: update test cases (refactor)
- change topology colors
- add ascii charts
- apply new naming conventions (indexing)
2024-10-15 10:32:25 +02:00
Joachim WibergandGitHub 024acb184d Merge pull request #714 from kernelkit/jovatn/container-doc-fixes
Doc: minor fixes to container doc
2024-10-15 09:53:36 +02:00
Jon-Olov Vatn e11008c7d2 Doc: minor fixes to container doc
[skip ci]
2024-10-15 09:24:35 +02:00
Joachim WibergandGitHub e2e947629c Merge pull request #713 from kernelkit/deviate-link-up-down-trap-enable 2024-10-14 22:10:52 +02:00
Mattias Walström 754426f7ed confd: deviate link-up-down-trap-enable not-supported
This fix #709
2024-10-14 21:14:10 +02:00
Joachim WibergandGitHub 31552bfc48 Merge pull request #712 from kernelkit/container-ifname 2024-10-14 21:01:38 +02:00
Joachim Wiberg de27d1c7e6 doc: update changelog with latest fixes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-14 19:41:01 +02:00
Joachim Wiberg 24b93074c5 doc: update container documentation a bit, more images
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-14 19:18:34 +02:00
Joachim Wiberg a14fada0ee confd: add support for container hostname format specifiers
This patch makes it possible to use format specifiers to "uniqiefy" a
container's hostname in the same way as with ietf-system hostname.

The following specifiers are currently supported:

 - %h default hostname from /etc/os-release
 - %i value of ID from /etc/os-release
 - %m last three octets of base MAC, e.g., c0-ff-ee

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-14 18:00:00 +02:00
Joachim Wiberg 7346f122fd confd: allow all container networks to set interface name
Unlock setting a custom interface name inside the container.  This aids
se-cases where this is needed and provide a better user experience, for
example when upgrading containers.  Not having to reboot the host just
to activate an upgrated container.

Fixes #708

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-14 18:00:00 +02:00
jovatnandGitHub 227b3a92a0 Merge pull request #702 from kernelkit/jovatn/test-spec-minor-fixes
Jovatn/test spec minor fixes
2024-10-14 08:12:20 +02:00
Jon-Olov Vatn 6d1ac9aad2 Minior fixes to Test Specs
Updating after comments from Axkar (thx!)

[skip ci]
2024-10-14 08:07:36 +02:00
Mattias WalströmandGitHub 53d90ae45a Merge pull request #707 from kernelkit/misc
Bump Finit and add support for dummy interfaces
2024-10-14 05:56:04 +02:00
Joachim Wiberg 411626a8b7 package/finit: bump to v4.8
Full ChangeLog at <https://github.com/troglobit/finit/releases/tag/4.8>

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-13 20:01:10 +02:00
Joachim Wiberg a4e6e4422b confd: add support for dummy interfaces
Dummy interfaces are useful for configuring routes and testing network
services without having to allocate physical or virtual interfaces.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-13 18:08:20 +02:00
Joachim WibergandGitHub 3358687c39 Merge pull request #695 from kernelkit/custom-phys-address 2024-10-11 18:30:36 +02:00
Joachim Wiberg 26180859bb doc: update changelog
Add issue #680, and all others that's gone in during the last week.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg 025c3ab7f6 doc: new setting on general interface settings
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg 026236390b doc: add picture to show stacking direction
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg 284f79242a doc: add missing VLAN block to overview svg
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg f79ad4d2d8 confd: handle static factory-config syntax error
For products with a static factory-config, or customers generating with
an older syntax, attempt migration in case of bootstrap failure.

Refactor logging to drop '-s'.  This prevents duplicate log messages
since bootstrap always runs after syslogd has started and all stdout
is always logged.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg 1852d12e7f confd: refactor 30-cfg-migrate for stand-alone use
This patch relocates the 30-cfg-migrate init script to confd, where it
belongs, renaming it migrate and installing into /usr/sbin.

The script has been heavily modified to be more user friendly, as well
as useful for automated restore operations, to be able to refresh old
backups to modern .cfg file syntax.

Example (injected phys-address error):

    admin@example:~$ migrate -c /etc/factory-config.cfg
    /etc/factory-config.cfg: has syntax error, requires migrating.

Since backups are created with the old confd sytanx version in the name,
the backup functionality has been kept in the script.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg 98ff33113a confd: bump version for phys-address .cfg migration
See issue #680

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Joachim Wiberg cc165c5bb9 confd: replace phys-address deviation with new setting
This commit replaces the ietf-interfaces deviation for phys-address,
used to set custom MAC address on interfaces, with a more flexible
approach which can calculate the new MAC address based on the device's
chassi MAC, with or without an added offset.

The regression test has been updated to test all variants.

Resolves: #680

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 16:41:21 +02:00
Tobias WaldekranzandGitHub 6e8f91ef3c Merge pull request #704 from kernelkit/defconfig-regression-fixes
Defconfig regression fixes
2024-10-11 16:37:44 +02:00
Joachim Wiberg 60b8f97ad6 package/test-mode: rename to confd-test-mode
Declare that confd-test-mode depends on confd, otherwise with 'select',
a call to `make update-defconfig` will remove BR2_PACKAGE_CONFD=y, which
we feel is very confusing -- in particular when comparing any defconfig
that does not have test-mode package.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 15:02:49 +02:00
Joachim Wiberg 8b75022696 configs: re-enable OpenSSL backend for libssh/libssh2
NETOPEER2 requries the OpenSSL backend of libssh.  By default, except on
minimal builds, is to use GCrypt backend.  Gcrypt is selected because of
Podman, which is not in the minimal builds.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-11 14:23:34 +02:00
Jon-Olov Vatn d74e7f1458 Fixing typos and other minor issues on test spec
[skip ci]
2024-10-11 13:53:41 +02:00
Jon-Olov Vatn 9baa3ac674 Add missing Readme.adoc files in test specs 2024-10-11 13:28:45 +02:00
Tobias WaldekranzandGitHub e8035f42fa Merge pull request #699 from kernelkit/r2s-fixes
Minor fixes for the R2S and similar boards
2024-10-11 08:47:28 +02:00
Joachim Wiberg 9a3f7d44c4 statd: allow ethtool rmon counters readout to fail
In e373398 we restored statd suport for checking for faults in yanger at
runtime.  This in turn broke CLI "show interfaces" support on the little
NanoPi R2S because ethtool cannot read counters in JSON format on it.

This patch catches the subprocess exception, allowing this particular
call to ethtool to fail with empty result.  The only difference from
before e373398 is that run_json_cmd() will log an error that ethtool
failed, for every interface it is called on.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-10 23:55:13 +02:00
Joachim Wiberg 374d24a547 configs: update and add LIBMNL to x86_64 targets
- Sync (make update-defconfig)
   - test-mode selects confd
   - gencert seclets openssl which in turn selects LIBSSH*_OPENSSL
   - rest is relocaations according to Config.in
 - Add LIBMNL to x86_64 targets, otherwise iproute2 does not install devlink

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-10 23:55:13 +02:00
Mattias WalströmandGitHub dc0a68a9eb Merge pull request #692 from kernelkit/update-tests
Update some tests
2024-10-10 11:26:11 +02:00
Mattias Walström f1d730447d confd: ietf-system: Add missing endspent() when getting operational data
This fix #697
2024-10-10 10:56:47 +02:00
Mattias Walström c0d5bfa71d test: add_delete_user: Test yescrypt 2024-10-10 10:56:47 +02:00
Mattias Walström 02100ef1f8 test: ospf_multiarea: Test interface type point-to-point and router-id
Test point-to-point on /30-links, verify the interface type
set explicit-router-id and verify that it gets set and sent
over OSPF.
2024-10-10 10:56:47 +02:00
Mattias Walström 00b103d3d2 tests: Update some typos in test steps
Also add missing ipv4_autoconf test from specification
2024-10-10 10:56:47 +02:00
Ahmed KaricandGitHub c44621b8be Merge pull request #693 from kernelkit/verify-ssh-key
Verify fetching data using ssh public key
2024-10-10 10:04:15 +02:00
Ahmed Karic b1bc7b42b4 test: Verify fetching data using ssh public key
Add a test case to verify that a new (guest) user can retrieve data
(i.e. syslog data) using ssh public key

Fixes #304
2024-10-09 19:21:01 +02:00
Joachim WibergandGitHub 6a036ec671 Merge pull request #691 from rical/cli-fix-iface-tabcompl 2024-10-08 18:01:07 +02:00
Richard Alpe 49c47e4732 cli: hide internal interfaces in tabcomplete
Don't show "internal" interfaces in "show interface name"
tab completion.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-08 16:23:01 +02:00
Richard AlpeandGitHub 719fe709aa Merge pull request #690 from rical/fix-long-frr-uptime
yanger: handle all frr uptime formats
2024-10-08 13:43:45 +02:00
Richard Alpe 03245f3631 cli: print FRR uptime on same format as FRR
Use the same uptime representation as FRR does.

Example output:
DESTINATION            PREF NEXT-HOP   PROTO   UPTIME
>* 10.0.23.0/30        0/0 e6          direct  20:10:05
192.168.3.0/24         110/1 e2        ospfv2  5d13h05m
>* 192.168.3.0/24      0/0 e2          direct  01w1d13h

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-08 10:54:36 +02:00
Richard Alpe 950e868eb3 yanger: handle all frr uptime formats
FRR prints uptime different based on how long it is. Prior to this
commit yanger expected uptime to be on the format HH:MM:SS which it is
as long as it's shorter than a day. If it's longer the format changes,
this commit handles this.

The commit also adds unit test data triggering the different formats
(<day, <week, >week).

Side note:
cli-pretty could be made to represent the data on "FRR format" again,
which is perhaps more human friendly.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-08 10:06:32 +02:00
Joachim WibergandGitHub 3e8e8a2e99 Merge pull request #689 from kernelkit/container-nftables 2024-10-07 21:04:57 +02:00
Mattias WalströmandGitHub d8655ef70d Merge pull request #688 from kernelkit/vlan-move-ports
Do not delete VLAN when change a port from tagged to untagged
2024-10-07 17:16:15 +02:00
Joachim Wiberg 458c1f8795 configs: include nftables container image in default builds
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-07 17:09:30 +02:00
Joachim Wiberg 5cbe92f9ec package/curios-nftables: new package
Allow bundling dedicated nftables container in Infix images.  With this
container, the /etc/nftables.conf can be kept as part of the device's
startup-config (base-64 coded binary format).  Highly useful in advanced
setups, either with dedicated interfaces in the container, or when run
in host network mode.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-07 17:09:30 +02:00
Mattias Walström 2a5ed84898 Do not delete VLAN when change a port from tagged to untagged
Dagger did delete of the VLAN after it had configured it.
Resulting in that the new VLAN configuration was lost.

This will first delete all untagged/tagged ports that should be removed,
when they are removed, add the new or changed ports.
2024-10-07 16:19:38 +02:00
Joachim Wiberg 6743223b29 package/curios-httpd: install unmodified OCI tarball in image
Before:

    $ ls -lah output/target/lib/oci
    drwxr-xr-x  2 jacky users 4,0K Oct  7 12:26 .
    drwxr-xr-x 27 jacky users  20K Aug 29 06:45 ..
    -rw-r--r--  1 jacky users 1,8M Oct  7 12:19 curios-httpd-v24.05.0.tar.gz

After:

    $ ls -lah output/target/lib/oci
    drwxr-xr-x  2 jacky users 4,0K Oct  7 12:26 .
    drwxr-xr-x 27 jacky users  20K Aug 29 06:45 ..
    -rw-r--r--  1 jacky users 281K Oct  7 12:28 curios-httpd-v24.05.0.tar.gz

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-07 14:01:18 +02:00
Mattias WalströmandGitHub a66d1d3771 Merge pull request #684 from kernelkit/fix-test-texts
Update last tests for first version of test specification
2024-10-04 13:12:44 +02:00
Mattias Walström 65e5ab81f1 test: ietf-system: Update topology images 2024-10-04 11:22:58 +02:00
Mattias Walström 6cceecccda test: Update infix-dhcp for test specification 2024-10-04 11:22:58 +02:00
Mattias Walström a5e4e016e4 test: Update infix-services for test-specification 2024-10-04 11:22:58 +02:00
Mattias Walström 883123ecdd test: Update misc/operational_all for test specification 2024-10-04 11:22:58 +02:00
Mattias Walström 69ba9110fc test: Update infix-container for test specification 2024-10-04 11:22:58 +02:00
Mattias Walström 5a28a5611a test-specification: Make possible to add ASCII art
The ASCII art over the topology must be surrounded by .... and
is codeblock in ASCIIdoc. Since this is only used for ASCII arts
to help describe tests, border and background are white.
2024-10-04 11:22:58 +02:00
Ahmed KaricandGitHub 571f4a6b9c Merge pull request #683 from kernelkit/upgrade-netconf-client
Upgrade NETCONF Client from 2.2.0 to 3.1.1
2024-10-03 18:38:56 +02:00
Ahmed Karic 4bed63d310 test/infamy: update get_data
Refactor NETCONF functions (get_data) to accommodate the upgrade
in the netconf_client library within the Docker container image.

Fixes #390
2024-10-03 17:23:18 +02:00
Ahmed Karic 093a17234f test/docker: upgrade netconf-client in docker image 2024-10-03 17:23:18 +02:00
Joachim Wiberg a50edc7bcb .github: fix internal Markdown link
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 11:51:47 +02:00
Joachim WibergandGitHub b946ea937c Merge pull request #682 from kernelkit/drop-sync-job
Drop sync job in favor of local cronjob

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 10:51:20 +02:00
Joachim WibergandGitHub 515f1e60f9 Merge pull request #681 from kernelkit/contrib
Major update of CONTRIBUTING.md

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 10:30:50 +02:00
Joachim Wiberg 39da7f4509 .github: update support resources document
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 10:21:55 +02:00
Joachim Wiberg f2c60f2e16 .github: drop sync job in favor of local cronjob
[skip ci]

Resolves: #572

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 10:01:06 +02:00
Joachim WibergandTobias Waldekranz fb3bd858e1 .github: major overhaul of CONTRIBUTING.md
This major overhaul of the Contributing to Infix document is made both
for internal (scaling the core team) reasons and to make it easier for
external contributors to undertand what is expected:

 - For bug reporting
 - For feature requests
 - When submitting a patch
 - When adding a complete new subsystem
 - Etc.

Resolves: #672

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Co-authored-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 08:57:54 +02:00
Joachim Wiberg ba84c36878 doc: add separate png for Jack
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-03 08:40:11 +02:00
Mattias WalströmandGitHub 3b17dd013b Merge pull request #679 from kernelkit/fix-test-texts
Misc fixes
2024-10-03 08:10:27 +02:00
Mattias Walström 9fb2b57dd6 Add all issues to project Infix&co when new issue is opened 2024-10-03 07:28:33 +02:00
Mattias Walström 363516ce58 Update changelog for upcoming 2024.10.0 release 2024-10-03 07:28:33 +02:00
Mattias Walström 673ce2767f Do not allow to configure a loopback interface in multiple areas 2024-10-03 07:28:33 +02:00
Mattias Walström b88c3c3a0c ospf: Do not enable BFD on all interfaces when enable on one interface 2024-10-03 07:28:33 +02:00
Mattias Walström ff6c63a3bd test: ospf: Remove loopback from multiple areas
This is not allowed in FRR.

Fix #586
2024-10-03 07:28:33 +02:00
Mattias Walström 6c2e5542ca confd:yang: Refactor infix YANG file names and location
Instead of renaming the yang-file instead we keep the yang file
with the actual content linear, easier to review and easier to
follow changes. This only applies on all infix models,deviations
and auguments.

The actual infix-system@2038-01-19.yang is just a symlink to
ietf-system.yang which contains all the code.
2024-10-03 07:28:33 +02:00
Mattias Walström ca122ea093 test:case:usb: Update test documentation 2024-10-02 23:31:14 +02:00
Mattias Walström 2341e076a8 factory-config: Add default NACM deny rule for reading password hash
This fix #499
2024-10-02 23:31:14 +02:00
Mattias Walström 0d98ee5716 test-spec: Fail build on failed test specification build
This can fail on two ways:
* Generate topology files
  Unfortunatly the python-graphwiz has no way of detect faults
  it just show 'Warning' on stderr, catch it and if != empty, exit 1

* Generate pdf
  Here the default error level was FATAL, but for example a file
  that is included does not exist it just show an error on stdout.
  the error level is now INFO, it should always be silent.
2024-10-02 23:31:14 +02:00
Mattias Walström 7871bdb9f4 veth_delete: Update for test specification 2024-10-02 22:58:06 +02:00
Mattias Walström 64c51c7c94 test: verify_all_interface_types: Update to generate correct test specification 2024-10-02 22:58:06 +02:00
Mattias Walström 19d40af20a syslog: Update test texts for test specification 2024-10-02 22:58:06 +02:00
Tobias WaldekranzandGitHub b21945f38a Merge pull request #674 from rical/yanger-hide-internal-interfaces
yanger: hide internal interfaces
2024-10-01 22:20:31 +02:00
Tobias WaldekranzandGitHub 712780fd5a Merge pull request #675 from rical/fix-flaky-routing-test
test: use static time in ietf-routing unit tests
2024-10-01 21:57:21 +02:00
Mattias WalströmandGitHub 48722e551e Merge branch 'main' into fix-flaky-routing-test 2024-10-01 20:12:51 +02:00
Tobias WaldekranzandGitHub 14234a9a77 Merge pull request #677 from kernelkit/uboot-improvements
Uboot improvements
2024-10-01 16:42:55 +02:00
Richard Alpe f932f98ad2 test: use static time in ietf-routing unit tests
Fix flaky ietf-routing unit tests.

Prior to this patch, there was a unit-test race between Yanger
(sysrepo emulator) and cli-pretty, where the local system time could
change between crafting the data and printing it. This caused the CLI
output to change and the ietf-routing unit test to fail.

Fixes #668

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-01 16:34:58 +02:00
Tobias Waldekranz a127925d9e uboot: Add leading slash to path when using HTTP
RFC 7230, section 5.3.1 specifies that the path must start with a
slash.

...and nginx is not amused by its absence.
2024-10-01 16:00:38 +02:00
Joachim Wiberg 63c1f36005 doc: minor, fix syntax in example
[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-01 14:47:39 +02:00
Richard Alpe 707e7d1a29 yanger: skip internal interfaces
In "14128047e18d statd: remove nl code and improve speed" the handling
of all interfaces where moved from statd to Yanger. This means statd no
longer tracks interfaces using Netlink, but instead relies on Yanger
to recognise and list all interfaces in the system. In the midst of
this change the ignoring of "internal" interfaces where lost.

In this commit we reintroduce this logic in Yanger and add a test case
that ensures internal interfaces isn't listed.

Fixes: 14128047e1 statd: remove nl code and improve speed

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-01 14:28:31 +02:00
Richard Alpe 240a292725 test: remove explicit iface list from sysrepo emulator
Yanger now has the ability to loop all interfaces (based on ip link),
this means we can run once for all interfaces.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-01 14:28:30 +02:00
Richard Alpe e2fed7c9de yanger: redesign ip interface data collection
Run ip link and ip addr once and handle the interface selection in
Yanger. This should be faster on systems with many ports and it
simplifies the CLI test files.

Signed-off-by: Richard Alpe <richard@bit42.se>
2024-10-01 14:28:26 +02:00
Joachim WibergandGitHub 19563c00f4 Merge pull request #669 from kernelkit/doc-updates
doc: expand on static vs dynamic factory-config
2024-10-01 11:44:50 +02:00
Joachim Wiberg d37656e347 doc: expand on static vs dynamic factory-config
Infix now supports static /etc/factory-config.cfg from a rootfs overlay
or /usr/share/product/<VPD.PRODUCT>/etc/factory-config.cfg in addition
to the autogenerated /run/confd/*-config.gen files.

Update the Branding & Releases document with a bit more information on
this rather complex topic.

[skip ci]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-10-01 11:43:45 +02:00
Tobias Waldekranz 69b93507a9 uboot: Honor static network settings
If the user has manually configured all required network parameters,
honor that setup, by skipping DHCP, and directly fetch the image.
2024-10-01 09:53:37 +02:00
Tobias Waldekranz e3e6477d47 uboot: Skip bootmenu when in developer mode
When a device is in developer mode, drop the user directly into the
shell instead of having to go via the bootmenu, since this is usually
what you want in that case. Emit a note about how to access the menu,
for the rare cases when that is needed.
2024-10-01 09:53:37 +02:00
Joachim WibergandGitHub 808a04f125 Merge pull request #667 from kernelkit/gh-dl-artifact-fixes
Support downloading artifacts from release builds
2024-09-30 17:02:05 +02:00
Tobias Waldekranz fb8ac2aca1 utils/gh-dl-artifact.sh: Support extracting release tarballs
Release tarball names contain the version information. Make sure we
find these files when extracting them from the artifact ZIP.
2024-09-30 13:34:36 +02:00
Tobias Waldekranz 6dadbd9176 utils/gh-dl-artifact.sh: Look for artifacts in all runs
Previously, the assumption was that the artifact could be found in the
first run of "Bob the Builder". This does not hold in the case when:

1. An initial run is aborted, and is re-run at a later date
2. When a release is built (by "Release General")
2024-09-30 13:19:54 +02:00
Ahmed KaricandGitHub 3c1dc9be53 Merge pull request #666 from kernelkit/update-qeneth-submodule
test/qeneth: Update submodule
2024-09-30 13:12:24 +02:00
Ahmed KaricandAhmed Karic 1531688ac4 test/qeneth: Update submodule
Fixes #660
2024-09-30 13:11:59 +02:00
440 changed files with 12612 additions and 6200 deletions
+35
View File
@@ -0,0 +1,35 @@
Checklists for Pull Requests and Releases
=========================================
Maintainer checklists for reviewing pull requests and doing releases.
Pull Requests
-------------
- If applicable, is there a readable ChangeLog entry?
- If any LICENSE file has been updated, has the `.hash` file been updated?
- If any change to a Finit `.svc` file, does any run/task linger?
I.e., is there a runlevel and/or condition defined to prevent them
from running outside of their intended runlevel?
- If any change to grub or qemu/qeneth setup, has it been tested in GNS3?
- If any change to u-boot/buildroot, has it been tested with `<booloader>_defconfig`
- If any change to logging, have the resulting logs been audited?
- Check for duplicate entries, misspellings
- Check for sneaky severity changes, e.g., error vs note, error vs warning
- If new subsystem, or major changes to a subsystem, have the docs been updated?
- If change to mDNS, has it been tested with netbrowse?
- If change to `_defconfig`, verify `local.mk` and sync with other archs
- Test manually as well, e.g., CLI changes do not have ha regression tests
- Build from distclean, or use artifacts built by build servers, for manual tests
Releases
--------
- Make at least one -betaN release to verify the GitHub workflow well in time release day
- Stuff happens, remember kernelkit/infix#735
- Make at least one -rcN to flush out any issues in customer repos
- Easy to forget adaptations/hacks in customer repos -- may need Infix change/support
- Ensure the markdown link for the release diff is updated
- Ensure subrepos are tagged (can be automated, see kernelkit/infix#393)
+126 -29
View File
@@ -1,25 +1,49 @@
Contributing to Infix
=====================
Contributing Guidelines
=======================
We welcome any and all help in the form of bug reports, fixes, patches
to add new features -- *preferably as GitHub pull requests*.
Thank :heart: you for taking the time to read this!
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.
We welcome any help in the form of bug reports, fixes, or patches to add
new features. We *prefer* GitHub pull requests, but are open to other
forms of collaboration as well. [Let's talk!][support] :handshake:
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*.
If you are unsure how to start implementing an idea or fix:
- :bug: open an issue, there are human friendly templates for _bugs_
and _feature requests_ at <https://github.com/kernelkit/infix/issues>
- :speech_balloon: use the [Q&A Forum][discuss]
- :technologist: The [Developer's Guide][devguide] is also a useful start
> _Talking about code and problems first is often the best way to get
> started before submitting a pull request. We have found it always
> saves time, yours and ours._
:sparkles: General Guidelines
-----------------------------
When submitting bug reports or patches to bugs, please state which
version the change is made against, what it does, and, more importantly
*why* -- from your perspective, why is it a bug, why does the code need
changing in this way. Start with why.
- :bug: Bug reports need metadata like Infix version or commit hash
- :adhesive_bandage: Bug fixes also need version, and (preferably) a
corresponding issue number for the ChangeLog
- :new: New features, you need to get approval of the YANG model first!
:speech_balloon: Please use the [Forum][discuss], e.g., category:
*Ideas*, or open a :pray: feature request issue
- :white_check_mark: New features also need new regression tests, this
can be basic tests or more complex use-case tests comprising multiple
subsystems, see [Testing Changes](#test_tube-testing-changes), below
Please take care to ensure you follow the project coding style and the
commit message format. If you follow these recommendations you help
the maintainer(s) and make it easier for them to include your code.
the maintainers and make it easier for them to include your code.
Coding Style
------------
:woman_technologist: Coding Style
---------------------------------
Before jumping into code, remember to **document new features** and bug
fixes. Both the manual and ChangeLog are in the `doc/` sub-directory
@@ -40,23 +64,58 @@ We expect code contributions for:
> code! Legacy takes precedence, and remember, we read code a lot more
> than write it, so legibility is important.
As a final note, lines are allowed to be longer than 72 characters these
days. There is no enforced maximum, but the team usually keep it around
100 characters for both C and Python.
The ChangeLog deserves a separate mention:
- Releases are listed in reverse chronological order order, so the
latest/next release is at the beginning of the file
- Only *user-facing bugs and features* are detailed, so code refactor,
new tests, etc. are not listed.
- Add your changes/features to the Changes section
- Add your Fix line in the Fixes section, in numeric order
- Changes and fixes without an issue number are listed after all
numbered ones
- YANG model changes are documented in their respective model, for
standard models, e.g., for `ietf-interfaces.yang`, the corresponding
`infix-interfaces.yang` detail augments/deviations as revisions.
A final note, lines of code are allowed to be longer than 72 characters
these days, unless you live by PEP-8 (see above). There is no enforced
maximum, but the team usually keep it around 100 characters for both C
and Python.
Commit Messages
---------------
:test_tube: Testing Changes
---------------------------
Please test your changes, no matter how trivial or obviously correct
they may seem. Nobody is infallible, making mistakes is only human.
It is also the best insurance policy for your feature, it ensures your
use-case will remain functional as the source base evolves.
For new functionality we expect new regression tests to be added in
the same pull request.
For help getting started with testing, see the following resources:
- [Developer's Guide][devguide]
- [Regression Testing][testing]
:memo: Commit Messages
----------------------
Commit messages exist to track *why* a change was made. Try to be as
clear and concise as possible in your commit messages, and always, be
proud of your work and set up a proper GIT identity for your commits:
<img src="../doc/jack.png" width=70 align="right">
$ git config --global user.name "Jacky Linker"
$ git config --global user.email jacky.linker@example.com
Example commit message from the [Pro Git][gitbook] online book, notice
how `git commit -s` is used to automatically add a `Signed-off-by`:
Example commit message from one of many [online guides][cbeams]. Use
`git commit -s` to automatically add a `Signed-off-by` for proof of
origin, see [DCO][] for more info.
subsystem: brief, but clear and concise summary of changes
@@ -73,20 +132,58 @@ how `git commit -s` is used to automatically add a `Signed-off-by`:
- Typically a hyphen or asterisk is used for the bullet, preceded
by a single space, with blank lines in between, but conventions
vary here
If you use an issue tracker, put references to them at the bottom,
like this:
Resolves: #123
See also: #456, #789
Signed-off-by: Jacky Linker <jacky.linker@example.com>
This is an example of how to [automatically close][closing] an issue
when the commit is merged to mainline. Several keywords are available.
Code of Conduct
---------------
:twisted_rightwards_arrows: Pull Requests
-----------------------------------------
> _The git repository is the canonical location for information._
A pull request should preferably address a single issue or change. This
may of course include multiple related changes, but what is important to
remember is the bandwidth of the maintainers. A smaller well documented
PR is more likely to get attention quicker in some reviewer's busy day.
Well documented here means that each commit message stands on its own,
telling the complete story of the change. In fact each commit should,
as much as possible, be independent of other changes. This is very
important, not only when digging though logs to understand why a piece
of code exists, but also when bisecting a problem -- each single commit
should also compile and be possible to run.
If you've worked on projects that send patches, like the Linux kernel or
Buildroot, consider the pull request message body similar to the cover
letter for a series of patches -- it's a summary of changes, and it is
lost when the changes are merged to the mainline branch.
:balance_scale: Code of Conduct
-------------------------------
It is expected of everyone to respect the [Code of Conduct][conduct].
The *"maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, discussion forum threads, issues, and
other contributions that are not aligned to this Code of Conduct."*
[Linux]: https://www.kernel.org/doc/html/v6.9/process/coding-style.html
[PEP-8]: https://peps.python.org/pep-0008/
[RDD]: https://tom.preston-werner.com/2010/08/23/readme-driven-development
[gitbook]: https://git-scm.com/book/ch5-2.html
[conduct]: CODE-OF-CONDUCT.md
[support]: https://github.com/kernelkit/infix/blob/main/.github/SUPPORT.md
[discuss]: https://github.com/orgs/kernelkit/discussions
[testing]: https://github.com/kernelkit/infix/blob/main/doc/testing.md
[devguide]: https://github.com/kernelkit/infix/blob/main/doc/developers-guide.md
[Linux]: https://www.kernel.org/doc/html/v6.9/process/coding-style.html
[PEP-8]: https://peps.python.org/pep-0008/
[RDD]: https://tom.preston-werner.com/2010/08/23/readme-driven-development
[cbeams]: https://cbea.ms/git-commit/#seven-rules
[conduct]: CODE-OF-CONDUCT.md
[DCO]: https://developercertificate.org/
[closing]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests
+12 -1
View File
@@ -1 +1,12 @@
Paid support and development provided by Addiva Elektronik <https://addiva.se>
Limited free support is only available using the online resources of the
project on GitHub, and Discord, see <https://github.com/kernelkit>:
&nbsp;&nbsp; :speech_balloon: <https://github.com/orgs/kernelkit/discussions>
&nbsp;&nbsp; :bug: <https://github.com/kernelkit/infix/issues>
Support contracts, development of new features, fast-tracking of reviews
and contributions, customer branding of Infix, and even customer specific
features for dedicated products is provided by Addiva Elektronik.
&nbsp;&nbsp; :globe_with_meridians: <https://www.addiva.se/electronics/>
&nbsp;&nbsp; :e-mail: <mailto:ael@addiva.se>
+4 -7
View File
@@ -5,12 +5,6 @@
-- Remember: assign a reviewer, or use @mentions if org. member.
-->
## Other information
<!-- Other relevant info, e.g., before/after screenshots -->
## Checklist
Tick *relevant* boxes, this PR is-a or has-a:
@@ -23,9 +17,12 @@ Tick *relevant* boxes, this PR is-a or has-a:
- [ ] Regression tests added?
- [ ] ChangeLog updates (for next release)
- [ ] Documentation added?
- [ ] Test changes
- [ ] Checked in changed Readme.adoc (make test-spec)
- [ ] Added new test to group Readme.adoc and yaml file
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (please detail in commit messages)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] ChangeLog updated (for major changes)
- [ ] Other (please describe):
@@ -0,0 +1,16 @@
name: Adds all issues to project Infix & C:o
on:
issues:
types:
- opened
jobs:
add-to-project:
name: Add issue to project Infix&co
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/kernelkit/projects/3
github-token: ${{ secrets.ADD_TO_PROJECT }}
+1
View File
@@ -150,6 +150,7 @@ jobs:
name: Infix ${{ github.ref_name }}
prerelease: ${{ steps.rel.outputs.pre }}
makeLatest: ${{ steps.rel.outputs.latest }}
discussionCategory: Releases
bodyFile: release.md
artifacts: "*.tar.gz*"
-28
View File
@@ -1,28 +0,0 @@
# 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
+11
View File
@@ -52,6 +52,17 @@ config INFIX_IMAGE_ID
Mandatory. When INFIX_RELEASE is set, this string is appended to
the IMAGE_ID with a '-' separator.
config INFIX_COMPATIBLE
string "Operating system compatible string"
default "${INFIX_IMAGE_ID}"
help
A lower-case string (no spaces or other characters outside of 09,
az, ".", "_" and "-"), used for image identification at upgrade.
E.g., the RAUC [system] compatible string.
Mandatory. Defaults to $INFIX_IMAGE_ID, which in turn is composed
of $INFIX_ID-$BR2_ARCH.
config INFIX_TAGLINE
string "Operating system tagline"
default "Infix -- a Network Operating System"
+8
View File
@@ -33,6 +33,14 @@
};
};
/*
* RTC has no valid bit, and this board does not connect any
* backup power (e.g. supercap) to it, so it returns garbage
* after every cold reset.
*/
&cp0_rtc {
status = "disabled";
};
/* UART0 (Console) */
+2
View File
@@ -539,6 +539,8 @@ CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_TIMEOUT=20
CONFIG_DETECT_HUNG_TASK=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_RCU_TRACE is not set
+1 -1
View File
@@ -128,7 +128,7 @@ what provides a default, the same default MAC addresses to Linux:
This is important in case you want to run multiple R2S devices on the
same LAN. Meaning you either have to change the MAC address in the
U-Boot environment (below), or modify your `phys-address` setting in
U-Boot environment (below), or use the `custom-phys-address` setting in
Infix for the interface(s).
Break into U-Boot using Ctrl-C at power-on, preferably when the text
@@ -58,6 +58,7 @@
}
},
"ietf-netconf-acm:nacm": {
"enable-nacm": true,
"groups": {
"group": [
{
@@ -83,6 +84,21 @@
"comment": "Allow 'admin' group complete access to all operations and data."
}
]
},
{
"name": "default-deny-all",
"group": [
"*"
],
"rule": [
{
"name": "deny-password-read",
"module-name": "ietf-system",
"path": "/ietf-system:system/authentication/user/password",
"access-operations": "*",
"action": "deny"
}
]
}
]
},
@@ -123,7 +139,8 @@
"name": "ntp.org",
"udp": {
"address": "pool.ntp.org"
}
},
"iburst": true
}
]
},
@@ -169,7 +186,7 @@
]
},
"infix-meta:meta": {
"infix-meta:version": "1.0"
"infix-meta:version": "1.2"
},
"infix-services:mdns": {
"enabled": true
@@ -0,0 +1,2 @@
# empty to disable port LED control on Styx, for details, see issue
# https://github.com/kernelkit/infix/issues/670#issuecomment-2419025575
+6 -6
View File
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.36.0
# Thu Feb 8 08:22:32 2024
# Busybox version: 1.36.1
# Tue Oct 22 13:12:02 2024
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -957,10 +957,10 @@ CONFIG_FEATURE_NETSTAT_PRG=y
CONFIG_NSLOOKUP=y
CONFIG_FEATURE_NSLOOKUP_BIG=y
CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y
CONFIG_NTPD=y
CONFIG_FEATURE_NTPD_SERVER=y
CONFIG_FEATURE_NTPD_CONF=y
CONFIG_FEATURE_NTP_AUTH=y
# CONFIG_NTPD is not set
# CONFIG_FEATURE_NTPD_SERVER is not set
# CONFIG_FEATURE_NTPD_CONF is not set
# CONFIG_FEATURE_NTP_AUTH is not set
CONFIG_PING=y
CONFIG_PING6=y
CONFIG_FEATURE_FANCY_PING=y
+11 -2
View File
@@ -16,13 +16,22 @@ die()
# DISK_IMAGE_SIZE="512"
# etc.
#
# Nested variables, like INFIX_COMPATIBLE="${INFIX_IMAGE_ID}"
# are handled by sourcing the file in a subshell.
#
# shellcheck disable=SC1090
load_cfg()
{
tmp=$(mktemp -p /tmp)
(
. "$BR2_CONFIG" 2>/dev/null
# Set *all* matching variables
set | grep -E "^${1}[^=]*=" | while IFS= read -r line; do
echo "$line"
done
) > "$tmp"
grep -E "${1}.*=" "$BR2_CONFIG" >"$tmp"
. "$tmp"
rm "$tmp"
}
+1 -1
View File
@@ -62,7 +62,7 @@ else
fi
if [ -f "$TARGET_DIR/etc/rauc/system.conf" ]; then
sed -i "s/compatible=.*/compatible=$NAME/" "$TARGET_DIR/etc/rauc/system.conf"
sed -i "s/compatible=.*/compatible=$INFIX_COMPATIBLE/" "$TARGET_DIR/etc/rauc/system.conf"
fi
# This is a symlink to /usr/lib/os-release, so we remove this to keep
+5 -2
View File
@@ -7,11 +7,14 @@ common=$(dirname "$(readlink -f "$0")")
# shellcheck disable=SC1091
. "$TARGET_DIR/etc/os-release"
load_cfg INFIX_ID
# The INFIX_* variables may be composed from BR2_* variables,
# so we source them last.
load_cfg BR2_ARCH
load_cfg BR2_DEFCONFIG
load_cfg BR2_EXTERNAL_INFIX_PATH
load_cfg BR2_TARGET_ROOTFS
load_cfg INFIX_ID
load_cfg INFIX_COMPATIBLE
# The default IMAGE_ID is infix-$BR2_ARCH but can be overridden
# for imaage names, and compat strings, like infix-r2s
@@ -39,7 +42,7 @@ if [ "$SIGN_ENABLED" = "y" ]; then
$common/sign.sh $BR2_ARCH $SIGN_KEY
ixmsg "Creating RAUC Update Bundle"
$common/mkrauc.sh "$NAME$(ver)" $NAME $SIGN_KEY
$common/mkrauc.sh "$NAME$(ver)" $INFIX_COMPATIBLE $SIGN_KEY
fi
load_cfg DISK_IMAGE
+49
View File
@@ -106,6 +106,8 @@ config QEMU_DTB_EXTEND
depends on QEMU_LOADER_UBOOT
default y if QEMU_aarch64
if QEMU_ROOTFS_INITRD
config QEMU_RW
string "Writable /cfg layer"
depends on QEMU_ROOTFS_INITRD
@@ -123,6 +125,8 @@ config QEMU_RW_VAR
default "var.ext4"
endif
endif
config QEMU_VPD
bool "Emulate a Vital Product Data (VPD) Memory"
@@ -137,6 +141,51 @@ config QEMU_APPEND
config QEMU_EXTRA
string "Extra QEMU options"
comment "RTC"
choice
prompt "Mode"
default QEMU_RTC_UTC
config QEMU_RTC_UTC
bool "UTC"
config QEMU_RTC_LOCAL
bool "Local time"
config QEMU_RTC_RANDOM
bool "Random"
endchoice
choice
prompt "Clock"
default QEMU_CLOCK_HOST
config QEMU_CLOCK_HOST
bool "Host clock"
config QEMU_CLOCK_RT
bool "Independent (monotonic)"
config QEMU_CLOCK_VM
bool "Virtual"
endchoice
config QEMU_RTC
string
default "utc" if QEMU_RTC_UTC
default "localtime" if QEMU_RTC_LOCAL
default "random" if QEMU_RTC_RANDOM
config QEMU_CLOCK
string
default "host" if QEMU_CLOCK_HOST
default "rt" if QEMU_CLOCK_RT
default "vm" if QEMU_CLOCK_VM
comment "Networking"
choice
+36 -7
View File
@@ -261,7 +261,25 @@ EOF
wdt_args()
{
echo -n "-device i6300esb -rtc clock=host"
echo -n "-device i6300esb "
}
random_date()
{
rand=$(($(date +%_s) * $$ + $(date +%N | sed 's/^0*//')))
when=$((rand % 7258118400)) # 1970 - 2200
date -d "@$when" +"%Y-%m-%dT%H:%M:%S"
}
rtc_args()
{
rtc="${CONFIG_QEMU_RTC:-utc}"
clock="${CONFIG_QEMU_CLOCK:-host}"
if [ "$rtc" = "random" ]; then
rtc=$(random_date)
fi
echo -n "-rtc base=$rtc,clock=$clock"
}
gdb_args()
@@ -273,11 +291,19 @@ gdb_args()
run_qemu()
{
if [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then
qemu-img create -f qcow2 -o backing_file=$CONFIG_QEMU_ROOTFS -F raw $CONFIG_QEMU_ROOTFS.qcow2 > /dev/null
if ! qemu-img check "${CONFIG_QEMU_ROOTFS}.qcow2"; then
rm -f "${CONFIG_QEMU_ROOTFS}.qcow2"
fi
if [ ! -f "${CONFIG_QEMU_ROOTFS}.qcow2" ]; then
echo "Creating qcow2 disk image for Qemu ..."
qemu-img create -f qcow2 -o backing_file="$CONFIG_QEMU_ROOTFS" \
-F raw "${CONFIG_QEMU_ROOTFS}.qcow2" > /dev/null
fi
fi
local qemu
read qemu <<EOF
$CONFIG_QEMU_MACHINE -m $CONFIG_QEMU_MACHINE_RAM \
$CONFIG_QEMU_MACHINE -nodefaults -m $CONFIG_QEMU_MACHINE_RAM \
$(loader_args) \
$(rootfs_args) \
$(serial_args) \
@@ -286,16 +312,23 @@ run_qemu()
$(host_args) \
$(net_args) \
$(wdt_args) \
$(rtc_args) \
$(vpd_args) \
$(gdb_args) \
$CONFIG_QEMU_EXTRA
EOF
echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"
line=$(stty -g)
stty raw
if [ "$CONFIG_QEMU_KERNEL" ]; then
$qemu -append "$(append_args)" "$@"
else
$qemu "$@"
fi
stty "$line"
}
dtb_args()
@@ -401,8 +434,4 @@ 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"
@@ -14,6 +14,24 @@ for file in /sys/firmware/qemu_fw_cfg/by_name/opt/mactab/raw /etc/mactab; do
fi
done
# Sometimes the sysfs is not populated when the switch driver is loaded, with the result
# that the DSA interface was not found (no /dsa/tagging entry in sysfs. See issue #685.
#
# This mitigates that problem by waiting for sysfs to come up if a DSA switch is found
if [ -n "$(devlink -j dev info | jq -r '.info.[].driver' | grep -q mv88e6085)" ]; then
timeout=50
while [ -z "$(ls /sys/class/net/*/dsa/tagging)" ]; do
timeout=$((timeout-1))
if [ $timeout -eq 0 ]; then
logger -k -p user.emerg -t "$ident" "Failed to find DSA interface"
exit 1
fi
sleep 0.1
done
logger -k -p user.notice -t "$ident" "Found DSA interface in $timeout seconds"
fi
# Find CPU interfaces used for connecting to a switch managed by DSA
for netif in /sys/class/net/*; do
iface=$(basename "$netif")
@@ -1,102 +1,16 @@
#!/bin/sh
# Run .cfg migration jq scripts to backup and transform older .cfg files
ident=$(basename "$0")
MIGRATIONS_DIR="/usr/share/confd/migrate"
# Check if /cfg/startup-config.cfg needs to be migrated to new syntax.
# Backup of the original is created in /cfg/backup/ for old versions,
# the migrate tool inserts old version in name before .cfg extension.
CONFIG_FILE="/cfg/startup-config.cfg"
BACKUP_DIR="/cfg/backup"
note()
{
logger -I $$ -k -p user.notice -t "$ident" "$1"
}
err()
{
logger -I $$ -k -p user.err -t "$ident" "$1"
}
file_version()
{
jq -r '
if .["infix-meta:meta"] | has("version") then
.["infix-meta:meta"]["version"]
else
"0.0"
end
' "$1"
}
atoi()
{
echo "$1" | awk -F. '{print $1 * 1000 + $2}'
}
BACKUP_FILE="/cfg/backup/startup-config.cfg"
mkdir -p "$(dirname "$BACKUP_FILE")"
if [ ! -f "$CONFIG_FILE" ]; then
# Nothing to migrate
note "No $(basename "$CONFIG_FILE" .cfg) yet, likely factory reset."
exit 0
fi
cfg_version=$(file_version "$CONFIG_FILE")
current_version=$(atoi "$cfg_version")
# Find the latest version by examining the highest numbered directory
sys_version=$(find "$MIGRATIONS_DIR" -mindepth 1 -maxdepth 1 -type d | sort -V | tail -n1 | xargs -n1 basename)
latest_version=$(atoi "$sys_version")
# Check for downgrade
if [ "$current_version" -gt "$latest_version" ]; then
err "Configuration file $CONFIG_FILE version ($cfg_version) is newer than the latest supported version ($sys_version). Exiting."
exit 1
fi
# If the current version is already the latest, exit the script
if [ "$current_version" -eq "$latest_version" ]; then
note "Configuration is already at the latest version ($sys_version). No migration needed."
elif migrate -cq "$CONFIG_FILE"; then
exit 0
fi
note "Configuration file $CONFIG_FILE is of version $cfg_version, migrating ..."
# Create the backup directory if it doesn't exist
mkdir -p "$BACKUP_DIR"
# Create a backup of the current configuration file
nm=$(basename "$CONFIG_FILE" .cfg)
BACKUP_FILE="$BACKUP_DIR/${nm}-${cfg_version}.cfg"
if cp "$CONFIG_FILE" "$BACKUP_FILE"; then
note "Backup created: $BACKUP_FILE"
else
err "Failed creating backup: $BACKUP_FILE"
exit 1
fi
# Apply the scripts for each version directory in sequence
for version_dir in $(find "$MIGRATIONS_DIR" -mindepth 1 -maxdepth 1 -type d | sort -V); do
dir=$(basename "$version_dir")
version=$(atoi "$dir")
# Step by step upgrade file to latest version
if [ "$current_version" -lt "$version" ]; then
note "Applying migrations for version $dir ..."
# Apply all scripts in the version directory in order
for script in $(find "$version_dir" -type f -name '*.sh' | sort -V); do
note "Calling $script for $CONFIG_FILE ..."
sh "$script" "$CONFIG_FILE"
done
# File now at $version ...
current_version="$version"
fi
done
# Update the JSON file to the latest version
if jq --arg version "$sys_version" '.["infix-meta:meta"] = {"infix-meta:version": $version}' "$CONFIG_FILE" \
> "${CONFIG_FILE}.tmp" && mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"; then
note "Configuration updated to version $sys_version."
else
err "Failed updating configuration to version $sys_version!"
exit 1
fi
migrate -i -b "$BACKUP_FILE" "$CONFIG_FILE"
+1 -1
View File
@@ -146,7 +146,7 @@ mount_overlay home "$cfgsrc" /home
mount_overlay root "$cfgsrc" /root
mount_bind "$varsrc" /var
[ "$vlibsrc" ] && mount_bind "$vlibsrc" /var/lib
[ -n "$vlibsrc" ] && mount_bind "$vlibsrc" /var/lib
for tag in $(ls /sys/bus/virtio/devices/*/mount_tag 2>/dev/null); do
if [ "$(cat $tag | tr -d '\0')" = hostfs ]; then
@@ -17,6 +17,13 @@ device
- Initializes auxiliary and configuration filesystems and metadata
- Installs Infix to both primary and secondary partitions
To run this script again (on an already provisioned system), erase the
partition table, reboot and netboot Infix again.
Example:
sudo sgdisk --zap-all /dev/mmcblk0
EOF
}
+6 -2
View File
@@ -1,4 +1,4 @@
echo "Press Ctrl-C NOW to enter boot menu"
echo "Press Ctrl-C NOW to override the default boot sequence"
if sleep "${ixbootdelay}"; then
run ixbootorder
@@ -7,8 +7,12 @@ if sleep "${ixbootdelay}"; then
reset
fi
bootmenu
if test "${dev_mode}" != "yes"; then
bootmenu
pause "Console shell access PROHIBITED. Press any key to reset..."
reset
fi
echo
echo 'Run "bootmenu" to interactively select a boot device'
echo
+7 -3
View File
@@ -1,16 +1,20 @@
setenv autoload no
if dhcp; then
if test -n "${ipaddr}" || dhcp; then
setenv proto tftp
setenv dltool tftpboot
setenv dlfile "${bootfile}"
if setexpr proto sub "^(http|tftp)://.*" "\\1" "${bootfile}" && setexpr bootfile sub "^(http|tftp)://([^/]+?)/(.*)" "\2:\3"; then
if setexpr proto sub "^(http|tftp)://.*" "\\1" "${bootfile}"; then
if test "${proto}" = "http"; then
setenv dltool wget
setexpr dlfile sub "^http://([^/]+?)/(.*)" "\\1:/\\2" "${bootfile}"
else
setexpr dlfile sub "^tftp://([^/]+?)/(.*)" "\\1:\\2" "${bootfile}"
fi
fi
if ${dltool} ${ramdisk_addr_r} "${bootfile}"; then
if ${dltool} ${ramdisk_addr_r} "${dlfile}"; then
setenv old_fdt_addr ${fdt_addr}
if fdt addr ${ramdisk_addr_r}; then
fdt get value sqoffs /images/rootfs data-position
+2
View File
@@ -260,6 +260,8 @@ CONFIG_CRYPTO_GCM=y
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_PANIC_ON_OOPS=y
CONFIG_PANIC_TIMEOUT=20
CONFIG_DETECT_HUNG_TASK=y
CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
# CONFIG_FTRACE is not set
+5 -2
View File
@@ -14,6 +14,7 @@ BR2_INIT_FINIT=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_ROOTFS_MERGED_USR=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
@@ -24,7 +25,6 @@ BR2_TARGET_TZ_INFO=y
BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/rootfs"
BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
BR2_ROOTFS_MERGED_USR=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.52"
@@ -131,7 +131,9 @@ INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_CONFD_TEST_MODE=y
BR2_PACKAGE_CURIOS_HTTPD=y
BR2_PACKAGE_CURIOS_NFTABLES=y
BR2_PACKAGE_EXECD=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_STATD=y
@@ -140,6 +142,8 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
@@ -159,7 +163,6 @@ BR2_PACKAGE_TETRIS=y
BR2_PACKAGE_ROUSETTE=y
BR2_PACKAGE_LIBINPUT=y
BR2_PACKAGE_HOST_PYTHON_YANGDOC=y
BR2_PACKAGE_TEST_MODE=y
DISK_IMAGE_BOOT_BIN=y
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
+8 -6
View File
@@ -14,6 +14,7 @@ BR2_INIT_FINIT=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_ROOTFS_MERGED_USR=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
@@ -24,7 +25,6 @@ BR2_TARGET_TZ_INFO=y
BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/rootfs"
BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
BR2_ROOTFS_MERGED_USR=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.52"
@@ -76,6 +76,9 @@ BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPUTILS=y
BR2_PACKAGE_LLDPD=y
BR2_PACKAGE_NETCALC=y
BR2_PACKAGE_NGINX=y
BR2_PACKAGE_NGINX_HTTP_SSL_MODULE=y
BR2_PACKAGE_NGINX_HTTP_V2_MODULE=y
BR2_PACKAGE_OPENRESOLV=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_SOCAT=y
@@ -111,12 +114,16 @@ INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_CONFD_TEST_MODE=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_STATD=y
BR2_PACKAGE_FACTORY=y
BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
@@ -126,11 +133,6 @@ BR2_PACKAGE_LOWDOWN=y
BR2_PACKAGE_MCD=y
BR2_PACKAGE_MDNS_ALIAS=y
BR2_PACKAGE_LIBINPUT=y
BR2_PACKAGE_TEST_MODE=y
BR2_PACKAGE_NGINX=y
BR2_PACKAGE_NGINX_HTTP_SSL_MODULE=y
BR2_PACKAGE_NGINX_HTTP_V2_MODULE=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_ROUSETTE=y
DISK_IMAGE_BOOT_BIN=y
TRUSTED_KEYS=y
+2 -1
View File
@@ -183,6 +183,8 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
@@ -201,7 +203,6 @@ BR2_PACKAGE_PODMAN_DRIVER_VFS=y
BR2_PACKAGE_TETRIS=y
BR2_PACKAGE_ROUSETTE=y
BR2_PACKAGE_HOST_PYTHON_YANGDOC=y
# BR2_PACKAGE_TEST_MODE is not set
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
# GNS3_APPLIANCE is not set
+4 -4
View File
@@ -11,8 +11,8 @@ BR2_TARGET_GENERIC_ISSUE="Infix by KernelKit"
BR2_INIT_FINIT=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
BR2_ROOTFS_MERGED_USR=y
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_ROOTFS_MERGED_USR=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
@@ -65,9 +65,7 @@ BR2_PACKAGE_UBOOT_TOOLS_FIT_CHECK_SIGN=y
BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=y
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_GUNICORN=y
BR2_PACKAGE_LIBSSH_OPENSSL=y
BR2_PACKAGE_LIBSSH2=y
BR2_PACKAGE_LIBSSH2_OPENSSL=y
BR2_PACKAGE_LIBXCRYPT=y
BR2_PACKAGE_LIBOPENSSL_BIN=y
BR2_PACKAGE_LIBINPUT=y
@@ -166,6 +164,7 @@ INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_CONFD=y
# BR2_PACKAGE_CONFD_TEST_MODE is not set
BR2_PACKAGE_EXECD=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_STATD=y
@@ -174,6 +173,8 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
@@ -192,7 +193,6 @@ BR2_PACKAGE_PODMAN_DRIVER_VFS=y
BR2_PACKAGE_TETRIS=y
BR2_PACKAGE_ROUSETTE=y
BR2_PACKAGE_HOST_PYTHON_YANGDOC=y
# BR2_PACKAGE_TEST_MODE is not set
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
# GNS3_APPLIANCE is not set
+6 -2
View File
@@ -13,6 +13,7 @@ BR2_INIT_FINIT=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_ROOTFS_MERGED_USR=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
@@ -23,7 +24,6 @@ BR2_TARGET_TZ_INFO=y
BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/rootfs"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
BR2_ROOTFS_MERGED_USR=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.52"
@@ -57,6 +57,7 @@ BR2_PACKAGE_LIBSSH2_OPENSSL=y
BR2_PACKAGE_LIBXCRYPT=y
BR2_PACKAGE_LIBOPENSSL_BIN=y
BR2_PACKAGE_LIBCURL_CURL=y
BR2_PACKAGE_LIBMNL=y
BR2_PACKAGE_NETOPEER2_CLI=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_LINUX_PAM=y
@@ -134,7 +135,9 @@ INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_CONFD_TEST_MODE=y
BR2_PACKAGE_CURIOS_HTTPD=y
BR2_PACKAGE_CURIOS_NFTABLES=y
BR2_PACKAGE_EXECD=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_STATD=y
@@ -143,6 +146,8 @@ BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
@@ -161,7 +166,6 @@ BR2_PACKAGE_PODMAN_DRIVER_VFS=y
BR2_PACKAGE_TETRIS=y
BR2_PACKAGE_ROUSETTE=y
BR2_PACKAGE_HOST_PYTHON_YANGDOC=y
BR2_PACKAGE_TEST_MODE=y
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
GNS3_APPLIANCE_RAM=512
+9 -6
View File
@@ -13,6 +13,7 @@ BR2_INIT_FINIT=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs"
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_ROOTFS_MERGED_USR=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="@console"
BR2_TARGET_GENERIC_GETTY_TERM="xterm"
@@ -23,7 +24,6 @@ BR2_TARGET_TZ_INFO=y
BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/rootfs"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
BR2_ROOTFS_MERGED_USR=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.52"
@@ -56,6 +56,7 @@ BR2_PACKAGE_LIBSSH2_OPENSSL=y
BR2_PACKAGE_LIBXCRYPT=y
BR2_PACKAGE_LIBOPENSSL_BIN=y
BR2_PACKAGE_LIBCURL_CURL=y
BR2_PACKAGE_LIBMNL=y
BR2_PACKAGE_NETOPEER2_CLI=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_LINUX_PAM=y
@@ -71,6 +72,9 @@ BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_IPUTILS=y
BR2_PACKAGE_LLDPD=y
BR2_PACKAGE_NETCALC=y
BR2_PACKAGE_NGINX=y
BR2_PACKAGE_NGINX_HTTP_SSL_MODULE=y
BR2_PACKAGE_NGINX_HTTP_V2_MODULE=y
BR2_PACKAGE_OPENRESOLV=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_SOCAT=y
@@ -114,12 +118,16 @@ INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://github.com/kernelkit/infix/tree/main/doc"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_CONFD_TEST_MODE=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_STATD=y
BR2_PACKAGE_FACTORY=y
BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y
BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y
BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y
BR2_PACKAGE_FINIT_PLUGIN_RTC=y
BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00"
BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc"
BR2_PACKAGE_FINIT_PLUGIN_TTY=y
BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y
BR2_PACKAGE_IITO=y
@@ -128,11 +136,6 @@ BR2_PACKAGE_KLISH_PLUGIN_INFIX=y
BR2_PACKAGE_LOWDOWN=y
BR2_PACKAGE_MCD=y
BR2_PACKAGE_MDNS_ALIAS=y
BR2_PACKAGE_TEST_MODE=y
BR2_PACKAGE_NGINX=y
BR2_PACKAGE_NGINX_HTTP_SSL_MODULE=y
BR2_PACKAGE_NGINX_HTTP_V2_MODULE=y
BR2_PACKAGE_GENCERT=y
BR2_PACKAGE_ROUSETTE=y
TRUSTED_KEYS=y
TRUSTED_KEYS_DEVELOPMENT=y
+122 -1
View File
@@ -4,6 +4,125 @@ Change Log
All notable changes to the project are documented in this file.
[v24.10.2][UNRELEASED]
-------------------------
### Changes
- Support for showing interfaces owned by running containers in the CLI
command `show interfaces`. This also adds support for showing the
peer interface of VETH pairs. Issue #626
- Reboot system on kernel "oops", on "oops" the kernel now panics and
reboots after 20 seconds. Issue #740
- Update static factory-config for NanoPi R2S: enable NACM, securing all
passwords, and enabling `iburst` for the NTP client. Issue #750
- Updated QoS documentation with pictures and more information on VLAN
interface ingress/egress priority handling, issue #759
- Disable RTC device in Styx device tree, issue #794
- Support for saving and restoring system clock from a disk file. This
allows restoring the system clock to a sane date in case the RTC is
disabled or does not have a valid time, issue #794
### Fixes
- Fix #685: DSA conduit interface not always detected, randomly causing
major issues configuring systems with multiple switch cores
- Fix #778: reactivate OpenSSL backend for libssh/libssh2 for NanoPI R2S.
This fixes a regression in v24.10.0 causing loss of NETCONF supprt
[v24.10.1][] - 2024-10-18
-------------------------
### Changes
- Add support for interface description, sometimes referred to as
"ifAlias". Saved as an Linux interface alias (not `altname`), e.g.,
`/sys/class/interfaces/veth0a/ifalias`, includes operational support
### Fixes
- Fix #735: `copy` and `erase` commands missing from CLI, regression
in Infix v24.10.0 defconfigs, now added as dep. in klish package
[v24.10.0][] - 2024-10-18
-------------------------
**News:** this release contains *breaking YANG changes* in custom MAC
addresses for interfaces! For details, see below issue #680.
Also, heads-up to all downstream users of Infix. YANG models have been
renamed to ease maintenance, more info below.
### Changes
- Software control of port LEDs on the Styx platform has been disabled.
Default driver behavior, green link and green traffic blink, is kept
as-is, which should mitigate issues reported in #670
- Correcting documentation on QoS. For packets containing both a VLAN
tag and an IP header, PCP priority takes precedence over DSCP
priority (not vice versa).
- Update CONTRIBUTING.md for scaling core team and helping external
contributors understand the development process, issue #672
- Updated branding documentation with more information on how dynamic
and static factory-config work, including examples
- Updated container documentation, improved images, detail how to set
interface name inside the container, and some syntax fixes
- Updated networking documentation, new General settings section, and
more details added to initial section on network building blocks
- As of this release, all Infix YANG models have dropped the `@DATE`
suffix from the name, this type of versioning is not handled using
symlinks instead.
- Update Infix `provision` script, used to install Infix on eMMC, add
example of how to erase partition table to be able to re-run the
script on already provisioned devices, issue #671
- OSPF: Add limitation to allow an interface to be in one area only
- Add support for "dummy" interfaces, mostly useful for testing
- Add support for container hostname format specifiers, just like it
already works for the host's hostname setting
- Hide all `status obsolete` YANG nodes in CLI
- Add YANG `units`, if available, to CLI help text (default value)
- The CLI commands `copy` and `erase` are now available also from Bash
- Greatly reduced size of bundled curiOS httpd OCI container image,
reduced from 1.8 MiB to 281 KiB
- Add deviation to ietf-interfaces.yang, `link-up-down-trap-enable` is
not supported (yet) in Infix, issue #709
- The default builds now include the curiOS nftables container image,
which can be used for advanced firewall setups. For an introduction
see <https://kernelkit.org/posts/firewall-container/>
### Fixes
- Fix #499: add an NACM rule to factory-config, which by default deny
everyone to read user password hash(es)
- Fix #663: internal Ethernet interfaces shown in CLI tab completion
- Fix #674: CLI `show interfaces` display internal Ethernet interfaces,
regression introduced late in v24.09 release cycle
- Fix #676: port dropped from bridge when changing its VLAN membership
from tagged to untagged
- Fix #680: replace deviation for `phys-address` in ietf-interfaces.yang
with `custom-phys-address` to allow for constructing more free-form
MAC addresses based on the chassis MAC (a.k.a., base MAC) address.
For more information, see the YANG model, a few examples are listed in
the updated documentation.
The syntax will be automatically updated in the `startup-config` and
`factory-config` -- make sure to verify the changes and update any
static `factory-config` used for your products
- Fix #690: CLI `show ip route` command stops working after 24 hours,
this includes all operational data in ietf-routing:/routing/ribs.
- Fix #697: password is not always set for new users, bug introduced
in v24.06.0 when replacing Augeas with native user handling
- Fix #700: add missing `admin-status` to interface operational data
- Fix #701: make sure CLI (and Bash) `copy` command use same sysrepo
timeout as other operations that load sysrepo. Was 10 second timeout,
which caused some (really big) configurations not to apply from the
CLI, but worked at boot, for instance. New timeout is 60 seconds
- Fix #708: allow all container networks to set interface name inside
container, not just auto-generated veth-pair ends for `docker0` bridge
- Fix `show interfaces` on platforms like the NanoPi R2S, which does not
support reading RMON counters in JSON format using `ethtool`
- Fix #730: CLI command `show ntp [sources]` stopped working in v24.08.
Missing access rights after massive CLI lock-down
- Fix BFD in OSPF, previously you could not enable BFD on a single
interface without enabling it on all interfaces
[v24.09.0][] - 2024-09-30
-------------------------
@@ -1156,7 +1275,9 @@ Supported YANG models in addition to those used by sysrepo and netopeer:
- N/A
[buildroot]: https://buildroot.org/
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v24.08.0...HEAD
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v24.10.1...HEAD
[v24.10.1]: https://github.com/kernelkit/infix/compare/v24.10.0...v24.10.1
[v24.10.0]: https://github.com/kernelkit/infix/compare/v24.09.0...v24.10.0
[v24.09.0]: https://github.com/kernelkit/infix/compare/v24.08.0...v24.09.0
[v24.08.0]: https://github.com/kernelkit/infix/compare/v24.06.0...v24.08.0
[v24.06.0]: https://github.com/kernelkit/infix/compare/v24.04.0...v24.06.0
+3 -1
View File
@@ -143,7 +143,7 @@ which offers lots of benefits out-of-the-box:
media like USB sticks or SD-cards) and from remote servers using FTP
or HTTP(S).
To initiate a system upgrade, run:
To initiate a system upgrade from the shell[^1], run:
rauc install <file|url>
@@ -349,3 +349,5 @@ can funtion reasonably well without a persistent `/var`, loosing
If `var` is not available, Infix will still persist `/var/lib` using
`cfg` as the backing storage.
[^1]: See [CLI Upgrade](cli/upgrade.md) for information on upgrading
via CLI.
+192 -6
View File
@@ -41,13 +41,92 @@ Verify the result after a build by inspecting:
printed on a label on the device.
Factory Defaults
----------------
Factory & Failure Config
------------------------
The Infix default configuration, factory-config, is part static files
and part per-device generated files, e.g., SSH hostkey and hostname.
The latter is constructed from the file `/etc/hostname`, appended with
the last three octets of the system's base MAC address. To override the
To support booting the same image (CPU architecture) on multiple boards,
Infix by default generates the device's initial configuration every time
at boot. This also ensures the device can always be restored to a known
state after a factory reset, since the `factory-config` is guaranteed to
be compatible with the YANG models for the given software version. (For
more information on how the system boots, please see the section [Key
Concepts](introduction.md#key-concepts) in the Introduction document.)
However, for custom builds of Infix it is possible to override this with
a single static `/etc/factory-config.cfg` (and failure-config) in your
rootfs overlay -- with a [VPD](vpd.md) you can even support several!
### Variables & Format Specifiers
Parts of the configuration you likely always want to generated, like the
SSH hostkey used by NETCONF, a unique hostname, or the `admin` user's
unique (per-device with a VPD) password hash. This section lists the
available keywords, see the next section for examples of how to use
them:
- **Default password hash:** `$factory$` (from VPD, .dtb, or built-in)
XPath: `/ietf-system:system/authentication/user/password`
- **Default NETCONF hostkey:** `genkey` (regenerated at factory reset)
XPath: `/ietf-keystore:keystore/asymmetric-keys/asymmetric-key[name='genkey']`
- **Hostname format specifiers:**
XPath: `/ietf-system:system/hostname`
- `%i`: OS ID, from `/etc/os-release`, from Menuconfig branding
- `%h`: Default hostname, from `/etc/os-release`, from branding
- `%m`: NIC specific part of base MAC, e.g., to `c0-ff-ee`
- `%%`: Literal %
### Static Files
> **Caveat:** maintaining static a factory-config and failure-config may
> seem like an obvious choice, but as YANG models evolve (even the IETF
> models get upgraded), you may need to upgrade your static files.
First, for one-off builds (one image per product), the simplest way is
to override the location where the system looks for the files, `/etc`
already at build time. This can be done using a Buildroot rootfs
overlay providing, e.g., `/etc/factory-config.cfg`. Example: [NanoPi
R2S][] in `${INFIX}/board/aarch64/r2s/rootfs/etc/factory-config.cfg`.
Second, to support multiple products in a single image, we can employ
another method to install a `/etc/factory-config.cfg` override -- at
runtime. This relies on the very early system `probe` that detects the
specific product from VPD data.
The `probe` consists of several sequential steps that currently run from
`${INFIX}/board/common/rootfs/usr/libexec/infix/init.d/`. One of them
check if `/usr/share/product/<PRODUCT>` exists, and if so attempts to
copy the entire contents to `/`. Here, `<PRODUCT>` is determined from
the VPD, which is available in `/run/system.json` as `"product-name"`,
after `00-probe` has run. The lower case version of the string is used.
I.e., create a rootfs overlay that provides any combination of:
- `/usr/share/product/<PRODUCT>/etc/factory-config.cfg`
- `/usr/share/product/<PRODUCT>/etc/failure-config.cfg`
### Dynamically Generated
The generated `factory-config` and `failure-config` files consist of
both static JSON files and part generated files at runtime for each
device. The resulting files are written to the RAM disk in `/run`:
- `/run/confd/factory-config.gen`
- `/run/confd/failure-config.gen`
Provided no custom overrides (see above) have been installed already,
these files are then copied to:
- `/etc/factory-config.cfg`
- `/etc/failure-config.cfg`
... where the bootstrap process expects them to be in the next step.
Examples of generated contents are the SSH hostkey and hostname. The
latter is constructed from the file `/etc/hostname`, appended with the
last three octets of the system's base MAC address. To override the
base hostname, set `BR2_TARGET_GENERIC_HOSTNAME` in your defconfig.
The static files are installed by Infix `confd` in `/usr/share/confd/`
@@ -97,6 +176,112 @@ bootstrap script for more help, and up-to-date information.
> you may want to look into `GEN_IFACE_OPTS`.
### Example Snippets
**IETF System:**
```hsib
"ietf-system:system": {
"hostname": "example-%m",
"ntp": {
"enabled": true,
"server": [
{
"name": "ntp.org",
"udp": {
"address": "pool.ntp.org"
}
}
]
},
"authentication": {
"user": [
{
"name": "admin",
"password": "$factory$",
"infix-system:shell": "bash"
}
]
},
"infix-system:motd-banner": "Li0tLS0tLS0uCnwgIC4gLiAgfCBJbmZpeCAtLSBhIE5ldHdvcmsgT3BlcmF0aW5nIFN5c3RlbQp8LS4gdiAuLXwgaHR0cHM6Ly9rZXJuZWxraXQuZ2l0aHViLmlvCictJy0tLSctJwo="
}, # <---- REMEMBER COMMA SEPARATORS IN SNIPPETS!
# <---- ... and no comments.
```
The `motd-banner` is a binary type, which is basically a Base64 encoded
text file without line breaks (`-w0`):
```bash
$ echo "Li0tLS0tLS0uCnwgIC4gLiAgfCBJbmZpeCAtLSBhIE5ldHdvcmsgT3BlcmF0aW5nIFN5c3RlbQp8LS4gdiAuLXwgaHR0cHM6Ly9rZXJuZWxraXQuZ2l0aHViLmlvCictJy0tLSctJwo=" |base64 -d
.-------.
| . . | Infix -- a Network Operating System
|-. v .-| https://kernelkit.github.io
'-'---'-'
```
**IETF Keystore**
Notice how both the public and private keys are left empty here. The
`genkey` is always automatically regenerated after each factory reset.
Keeping the `factory-config` snippet like this means we can use the same
file on multiple devices, without risking them sharing the same host
keys. Sometimes you may want the same host keys, but that is the easy
use-case and not documented here.
```json
"ietf-keystore:keystore": {
"asymmetric-keys": {
"asymmetric-key": [
{
"name": "genkey",
"public-key-format": "ietf-crypto-types:ssh-public-key-format",
"public-key": "",
"private-key-format": "ietf-crypto-types:rsa-private-key-format",
"cleartext-private-key": "",
"certificates": {}
}
]
}
},
```
The `genkey` is currently only used by the NETCONF SSH backend.
**IETF NETCONF Server**
```json
"ietf-netconf-server:netconf-server": {
"listen": {
"endpoints": {
"endpoint": [
{
"name": "default-ssh",
"ssh": {
"tcp-server-parameters": {
"local-address": "::"
},
"ssh-server-parameters": {
"server-identity": {
"host-key": [
{
"name": "default-key",
"public-key": {
"central-keystore-reference": "genkey"
}
}
]
}
}
}
}
]
}
}
},
```
Integration
-----------
@@ -203,3 +388,4 @@ variable `INFIX_OEM_PATH` to that of the br2-external. It is also
possible to set the `GIT_VERSION` variable in your `post-build.sh`
script to change how the VCS version is extracted.
[NanoPi R2S]: https://github.com/kernelkit/infix/blob/main/board/aarch64/r2s/rootfs/etc/factory-config.cfg
+68 -34
View File
@@ -1,5 +1,6 @@
Containers in Infix
===================
<img align="right" src="img/docker.webp" alt="Docker whale" width=360>
* [Introduction](#introduction)
* [Caution](#caution)
@@ -75,19 +76,20 @@ Getting Started
In the CLI, containers can be run in one of two ways:
1. `container run IMAGE [COMMAND]`, and
1. `container run IMAGE [COMMAND]`, or
2. enter `configure` context, then `edit container NAME`
The first is useful mostly for testing, or running single commands in an
image. It is a wrapper for `podman run -it --rm ...`, while the latter
is a wrapper and adaptation of `podman create ...`.
The former is useful mostly for testing, or running single commands in
an image. It is a wrapper for `podman run -it --rm ...`, while the
latter is a wrapper and adaptation of `podman create ...`.
The second create a container with a semi-persistent writable layer that
survives container restarts and host system restarts. However, if you
change the container configuration or upgrade the image (see below), the
container will be recreated and the writable layer is lost. This is why
it is recommended to set up a named volume for directories, or use file
[Content Mounts][], in your container you want truly persistent content.
[Content Mounts](#content-mounts), in your container if you want truly
persistent content.
In fact, in many cases the best way is to create a `read-only` container
and use file mounts and volumes only for the critical parts. Podman
@@ -103,11 +105,23 @@ application to run.
> unlike virtualization, containers reuse the host's CPU and kernel.
<img align="right" src="img/docker-hello-world.svg" alt="Hello World" width=360>
### Examples
Classic Hello World:
admin@example:/> container run docker://hello-world
Starting docker://hello-world :: use Ctrl-p Ctrl-q to detach
Trying to pull docker.io/library/hello-world:latest...
Getting image source signatures
Copying blob c1ec31eb5944 done
Copying config d2c94e258d done
Writing manifest to image destination
Storing signatures
Hello from Docker!
This message shows that your installation appears to be working correctly.
Persistent web server using nginx, sharing the host's network:
@@ -132,7 +146,7 @@ container at runtime.
Container Images
----------------
The underlying `podman` project support importing and fetching images in
The underlying `podman` project supports importing and fetching images in
a variety of ways, the most common ones are also supported by Infix. In
this section we present how to use them and in the next section we show
how to upgrade to a newer base image.
@@ -209,7 +223,7 @@ admin-exec context ...
admin@example:/var/tmp$ cli
admin@example:/> container load /var/tmp/curios-oci-amd64.tar.gz name curios:edge
> By assigning The `name curios:edge` is the tag you give the imported
> The `name curios:edge` is the tag you give the imported
> (raw) archive which you can then reference in your container image
> configuration: `set image curios:edge`.
@@ -221,6 +235,10 @@ archive, which helps greatly with container upgrades (see below):
Upgrading a Container Image
---------------------------
<img align="right" src="img/shield-checkmark.svg" alt="Hello World" width=100>
The applications in your container are an active part of the system as a
whole, so make it a routine to keep your container images up-to-date!
> **Note:** the default writable layer is lost when upgrading the image.
> Use named volumes for content that you want to persist across upgrades.
@@ -299,14 +317,19 @@ Currently two types of of container networks are supported:
> For more information on VETH pairs, see the [Networking Guide][0].
### Container Bridge
A container bridge is what most container setups use and users want.
![IP Masquerading Container Bridge](img/cni-bridge-firewall.svg)
The difference from a regular bridge is that the container runtime fully
manages them -- connecting containers automatically with VETH pairs and
setting up firewall rules between the host and other containers, as well
as managing port forwarding. This transparent background management is
what makes container use seem to be so simple.
manages them -- connecting containers with automatically created VETH
pairs (look at the bridge port names) and setting up firewall rules
between the host and other containers, as well as managing port
forwarding. This transparent background management is what makes
container use seem to be so simple.
All interface configuration is done in configure context.
@@ -325,7 +348,7 @@ have to set manually:
admin@example:/config/interface/docker0/> set container-network type bridge
> **Note:** when doing the same operation over NETCONF there is no
> inference, so all the "magic" settings needs to be defined. This
> inference, so all the "magic" settings need to be defined. This
> makes the CLI very useful for first setup and then extracting the
> resulting XML from the shell using the `cfg -X` command.
@@ -394,20 +417,21 @@ namespace of a container[^3]. This of course works with plain Ethernet
interfaces as well, but here we will use one end of a VETH pair as an
example.
The network `option` setting is available also for this case, but only
the `interface_name=foo0` option works. Which is still very useful. To
change the MAC address, you need to use the `custom-phys-address` in the
general network settings.
[^3]: Something which the container bridge network type does behind the
scenes with one end of an automatically created VETH pair.
#### Routed Setup
In this routed setup we reserve 192.168.0.0/24 for the network between
the host and the `ntpd` container.
_____________
| |
veth0 .1 | .2 eth0 |
\ 192.168.0.0/24 | / |
'--------------------' [ntpd] |
|_____________|
![Basic VETH pair connecting ntpd container.](img/cni-ntpd-routed.svg)
Configuration is a straight-forward VETH pair setup where we name the
container-end of pair `ntpd`. This is just a convenience for us when
@@ -420,7 +444,7 @@ line where we declare the `ntpd` end as a container network interface:
admin@example:/config/interface/veth0/> end
admin@example:/config/> edit interface ntpd
admin@example:/config/interface/ntpd/> set ipv4 address 192.168.0.2 prefix-length 24
admin@example:/config/interface/ntpd/> set phys-address 00:c0:ff:ee:00:01
admin@example:/config/interface/ntpd/> set custom-phys-address static 00:c0:ff:ee:00:01
admin@example:/config/interface/ntpd/> set container-network
> Notice how you can also set a custom MAC address at the same time.
@@ -429,9 +453,12 @@ Adding the interface to the container is the same as before, but since
everything for host interfaces is set up in the interfaces context, we
can take a bit of a shortcut.
admin@example:/config/container/ntpd/> set network ntpd
admin@example:/config/container/ntpd/> set network interface ntpd
admin@example:/config/container/ntpd/> leave
> Use the `set network interface ntpd option interface_name=foo0` to set
> the name of the interface inside the container to `foo0`.
The point of the routed case is that port forwarding from the container
in this case is limited to a single interface, not *all interfaces* as
is the default in the masquerading container bridge setup.
@@ -443,21 +470,15 @@ A perhaps more common case is to bridge the other end of the VETH pair
with other physical ports. In this section we show how to add a new
pair to give our container two interfaces:
_______________
| | .1 br0
veth0 .1 | .2 eth0 | / \
\ 192.168.0.0/24 | / eth1 .2 | veth1b e1
'------------------' \ | 192.168.1.0/24 /
| [ntpd] '------------------'
|_______________|
![Bridged setup with ntpd container.](img/cni-ntpd-bridged.svg)
We start by adding the second VETH pair:
admin@example:/config/> edit interface veth1a
admin@example:/config/interface/veth1a/> set veth peer veth1b
admin@example:/config/interface/veth1a/> set veth peer veth1
admin@example:/config/interface/veth1a/> set ipv4 address 192.168.1.2 prefix-length 24
> The LAN bridge (br0) in this example has IP address 192.168.1.1.
> The LAN bridge (br1) in this example has IP address 192.168.1.1.
When a container has multiple host interfaces it can often be useful to
have a default route installed. This can be added from the host with a
@@ -473,15 +494,16 @@ have a default route installed. This can be added from the host with a
}
}
veth {
peer veth1b;
peer veth1;
}
admin@example:/config/interface/veth1a/> end
admin@example:/config/> set interface veth1b bridge-port bridge br0
admin@example:/config/> set interface veth1 bridge-port bridge br1
Please note, container network routes require the base interface also
have a static IP address set. Setting only the route, but no address,
means the route is skipped.
### Host Networking
The third use-case is host networking, this is where a container share
@@ -491,7 +513,7 @@ the host operating system.
The host networking setup cannot be combined with any other network.
For an example, see below.
For an example, [see below](#application-container-nftables).
Mounts and Volumes
@@ -599,6 +621,17 @@ container ID (hash) is used, but this can be easily changed:
admin@example:/> container shell system
root@sys101:/#
In fact, the container `hostname` setting supports the same format
specifiers as the host's `hostname` setting:
- `%i`: OS ID, from `/etc/os-release`, from Menuconfig branding
- `%h`: Default hostname, from `/etc/os-release`, from branding
- `%m`: NIC specific part of base MAC, e.g., to `c0-ff-ee`
- `%%`: Literal %
The most useful combination is probably `"container-name-%m"`, which in
this example give the container hostname `container-name-c0-ff-ee`.
[^1]: this does not apply to the admin-exec command `container run`.
This command is intended to be used for testing and evaluating
container images. Such containers are given a private network
@@ -626,6 +659,7 @@ Notice how we `set network host`, so the container can see and act on
all the host's interfaces, and that we also have to run the container
in *privileged* mode.
### Application Container: ntpd
The default NTP server/client in Infix is Chrony, a fully working and
@@ -706,7 +740,7 @@ and then asking what the hostname is on the host:
One use-case for this method is when extending Infix with a management
container that connects to other systems. For some tips on how to
control an Infix system this way, see [Scripting Infix](scriptiong.md).
control an Infix system this way, see [Scripting Infix](scripting.md).
[^2]: The `nsenter` program is available from either the util-linux
package in Debian/Ubuntu/Mint, or in BusyBox. Note, however,
@@ -714,7 +748,7 @@ control an Infix system this way, see [Scripting Infix](scriptiong.md).
[0]: networking.md
[1]: https://github.com/kernelkit/infix/blob/main/src/confd/yang/infix-containers%402023-12-14.yang
[1]: https://github.com/kernelkit/infix/blob/main/src/confd/yang/infix-containers.yang
[2]: https://github.com/troglobit/mg
[3]: https://github.com/opencontainers/image-spec/blob/main/image-layout.md
[4]: system.md#ssh-authorized-key
+15 -14
View File
@@ -206,20 +206,18 @@ corresponding image for execution with our normal tooling:
Contributing
------------
Infix is built from many parts, when contributing you need to set up
your own fork, create a local branch for your change, push to your fork,
and then use GitHub to create a *Pull Reqeuest*.
Infix is built from many components, when contributing you need to set
up your own fork, create a local branch for your change, push to your
fork, and then use GitHub to create a *Pull Reqeuest*.
For this to work as painlessly as possible:
For this to work as *painlessly as possible* for everyone involved:
1. Fork Infix to your own user or organization[^1]
2. Fork all the Infix submodules, e.g., `kernelkit/buildroot` to your
own user or organization as well
3. Clone your fork of Infix to your laptop/workstation
If you use a GitHub organization you get the added benefit of having
local peer reviews of changes before making a pull request to the
upstream Infix repository.
1. Fork Infix to your own user or organization[^1]
2. Fork all the Infix submodules, e.g., `kernelkit/buildroot` to your
own user or organization as well
3. Clone your fork of Infix to your laptop/workstation
4. [Deactivate the Actions][6] you don't want in your fork
5. Please read the [Contributing Guidelines][5] as well!
```bash
$ cd ~/Projects
@@ -227,10 +225,10 @@ $ git clone https://github.com/YOUR_USER_NAME/infix.git
$ cd infix/
$ git submodule update --init
```
> **Note:** when updating/synchronizing with upstream Infix changes you
> may have to synchronize your forks as well. GitHub have a `Sync fork`
> button in the GUI for your fork for this purpose.
> button in the GUI for your fork for this purpose. A cronjob on your
> server of choice can do this for you with the [GitHub CLI tool][7].
[^1]: Organizations should make sure to lock the `main` (or `master`)
branch of their clones to ensure members do not accidentally merge
@@ -243,3 +241,6 @@ $ git submodule update --init
[2]: https://github.com/wkz/qeneth
[3]: https://netopeer.liberouter.org/doc/sysrepo/master/html/dev_guide.html
[4]: https://buildroot.org/downloads/manual/manual.html#_developer_guide
[5]: https://github.com/kernelkit/infix/blob/main/.github/CONTRIBUTING.md
[6]: https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
[7]: https://cli.github.com/
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 317 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 340 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 269 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 339 KiB

+1 -1
View File
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 268 KiB

After

Width:  |  Height:  |  Size: 281 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 262 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 464 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 388 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 343 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 224 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 269 KiB

+19 -11
View File
@@ -15,7 +15,8 @@ managing entire fleets of installed equipment.
Nevertheless, when it comes to initial deployment and debugging, it
is very useful to know how to navigate and use the CLI.
> Proceed to the [CLI User Guide](cli/tutorial.md).
> Proceed to the [CLI Introduction](cli/introduction.md) or [CLI
> Configuration Tutorial](cli/configure.md).
## Key Concepts
@@ -62,9 +63,11 @@ The system has several datastores (or files):
configure context. Any changes made here can be discarded (`abort`,
`rollback`) or committed (`commit`, `leave`) to `running-config`.
> See the [Branding & Releases](branding.md) for information on how
> `factory-config` and `failure-config` can be adapted to different
> customer requirements.
> Please see the [Branding & Releases](branding.md) document for more
> in-depth information on how `factory-config` and `failure-config` can
> be adapted to different customer requirements. Including how you can
> override the generated versions of these files with plain per-product
> ones -- this may even protect against some of the failure modes below.
## System Boot
@@ -90,7 +93,8 @@ password in VPD, are detailed later in this section.
there is a working fail safe, or rather *fail secure*, mode
4. On first power-on, and after a factory reset, the system does not
have a `startup-config`, in which case `factory-config` is copied
to `startup-config`
to `startup-config` -- if a per-product specific version exists it
is preferred over the generated one
5. Provided the integrity of the `startup-config` is OK, a system
service loads and activates the configuration
@@ -123,13 +127,17 @@ syntax, failed validation against the system's YANG model, or a bug in
the system's `confd` service, the *Fail Secure Mode* is triggered and
`failure-config` is loaded (unless VPD Failure, see above).
> Again, please see the [Branding & Releases](branding.md) document for
> how to provide a per-product hard-coded `failure-config` to suit your
> products preferences.
*Fail Secure Mode* is a fail-safe mode provided for debugging the
system. The default[^3] is isolated interfaces with communication only to
the management CPU, SSH and console login using the device's factory
reset password, IP connectivity only using IPv6 link-local, and device
discovery protocols: LLDP, mDNS-SD. The login and shell prompt are set
to `failure-c0-ff-ee`, the last three octets of the device's base MAC
address.
system. The default[^3] creates a setup of isolated interfaces with
communication only to the management CPU, SSH and console login using
the device's factory reset password, IP connectivity only using IPv6
link-local, and device discovery protocols: LLDP, mDNS-SD. The login
and shell prompt are set to `failure-c0-ff-ee`, the last three octets of
the device's base MAC address.
[^1]: YANG is a modeling language from IETF, replacing that used for
SNMP (MIB), used to describe the subsystems and properties of
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+144 -17
View File
@@ -14,18 +14,47 @@ Infix to exploit the unique features not available in IEEE models.
## Interface LEGO®
The network building blocks available in Linux are akin to the popular
LEGO® bricks.
![Linux Networking Blocks](img/lego.svg)
There are two types of relationships that can link two blocks together:
1. **Lower-to-upper**: Visually represented by an extruding square
connected upwards to a square socket. An interface _can only have
a single_ lower-to-upper relationship, i.e., it can be attached to
a single upper interface like a bridge or a LAG. In `iproute2`
parlance, this corresponds to the interface's `master` setting
2. **Upper-to-lower**: Visually represented by an extruding semicircle
connected downwards to a semicircle socket. The lower interface in
these relationships _accepts multiple_ upper-to-lower relationships
from different upper blocks. E.g., multiple VLANs and IP address
blocks can be connected to the same lower interface
![Stacking order dependencies](img/lego-relations.svg)
An interface may simultaneously have a _lower-to-upper_ relation to some
other interface, and be the target of one or more _upper-to-lower_
relationships. It is valid, for example, for a physical port to be
attached to a bridge, but also have a VLAN interface stacked on top of
it. In this example, traffic assigned to the VLAN in question would be
diverted to the VLAN interface before entering the bridge, while all
other traffic would be bridged as usual.
| **Type** | **Yang Model** | **Description** |
| -------- | ----------------- | ------------------------------------------------------------- |
|----------|----------------------------|---------------------------------------------------------------|
| bridge | infix-if-bridge | SW implementation of an IEEE 802.1Q bridge |
| ip | ietf-ip, infix-ip | IP address to the subordinate interface |
| vlan | infix-if-vlan | Capture all traffic belonging to a specific 802.1Q VID |
| lag[^1] | infix-if-lag | Bonds multiple interfaces into one, creating a link aggregate |
| lo | ietf-interfaces | Software loopback interface |
| eth | ietf-interfaces, | Physical Ethernet device/port |
| | ieee802-ethernet-interface | |
| eth | ieee802-ethernet-interface | Physical Ethernet device/port. |
| | infix-ethernet-interface | |
| veth | infix-if-veth | Virtual Ethernet pair, typically one end is in a container |
| *common* | ietf-interfaces, | Properties common to all interface types |
| | infix-interfaces | |
## Data Plane
@@ -50,6 +79,69 @@ possible to share with a container. Meaning, all the building blocks
used on the left hand side can also be used freely on the right hand
side as well.
### General
General interface settings include `type`, `enable`, custom MAC address,
and text `description`. Other settings have their own sections, below.
The `type` is important to set when configuring devices remotely because
unlike the CLI, a NETCONF or RESTCONF session cannot guess the interface
type for you. The operating system provides an override of the
available interface types.
An `enabled` interface can be inspected using the operational datastore,
nodes `admin-state` and `oper-state` show the status, . Possible values
are listed in the YANG model.
The `custom-phys-address` can be used to set an interface's MAC address.
This is an extension to the ietf-interfaces YANG model, which defines
`phys-address` as read-only[^4]. The following shows the different
configuration options.
The `description` is saved as Linux `ifalias` on an interface. It is a
free-form string, useful for describing purpose or just adding comments
for remote debugging, e.g., using the operational datastore.
> **Note:** there is no validation or safety checks performed by the
> system when using `custom-phys-address`. In particular the `offset`
> variant can be dangerous to use -- pay attention to the meaning of
> bits in the upper-most octet: local bit, multicast/group, etc.
#### Fixed custom MAC
```
admin@example:/config/> edit interface veth0a
admin@example:/config/interface/veth0a/> set custom-phys-address static 00:ab:00:11:22:33
=> 00:ab:00:11:22:33
```
#### Chassis MAC
Chassis MAC, sometimes also referred to as base MAC. In these two
examples it is `00:53:00:c0:ff:ee`.
```
admin@example:/config/> edit interface veth0a
admin@example:/config/interface/veth0a/> set custom-phys-address chassis
=> 00:53:00:c0:ff:ee
```
#### Chassis MAC, with offset
When constructing a derived address it is recommended to set the locally
administered bit. Same chassis MAC as before.
```
admin@example:/config/> edit interface veth0a
admin@example:/config/interface/veth0a/> set custom-phys-address chassis offset 02:00:00:00:00:02
=> 02:53:00:c0:ff:f0
```
### Bridging
This is the most central part of the system. A bridge is a switch, and
@@ -57,6 +149,8 @@ a switch is a bridge. In Linux, setting up a bridge with ports
connected to physical switch fabric, means you manage the actual switch
fabric!
#### MAC Bridge
In Infix ports are by default not switch ports, unless the customer
specific factory config sets it up this way. To enable switching
between ports you create a bridge and then add ports to that
@@ -79,6 +173,13 @@ Here we add two ports to bridge `br0`: `eth0` and `eth1`.
> Other "magic" names are `ethN.M` for VLAN M on top of `ethN`, or
> `dockerN` to create an IP masquerading container bridge.
![A MAC bridge with two ports](img/mac-bridge.svg)
It is possible to create multiple MAC bridges, however, it is
currently[^5] _not recommended_ to use more than one MAC bridge on
products with Marvell LinkStreet switching ASICs. A VLAN filtering
bridge should be used instead.
#### VLAN Filtering Bridge
By default bridges in Linux do not filter based on VLAN tags. It can be
@@ -92,7 +193,7 @@ admin@example:/config/> edit interface br0
admin@example:/config/interface/br0/> up
admin@example:/config/> set interface eth0 bridge-port bridge br0
admin@example:/config/> set interface eth0 bridge-port pvid 10
admin@example:/config interface eth1 bridge-port bridge br0
admin@example:/config/> set interface eth1 bridge-port bridge br0
admin@example:/config/> set interface eth1 bridge-port pvid 20
admin@example:/config/> edit interface br0
admin@example:/config/interface/br0/> set bridge vlans vlan 10 untagged eth0
@@ -103,6 +204,8 @@ This sets `eth0` as an untagged member of VLAN 10 and `eth1` as an
untagged member of VLAN 20. Switching between these ports is thus
prohibited.
![A VLAN bridge with two VLANs](img/vlan-bridge.svg)
To terminate a VLAN in the switch itself, either for switch management
or for routing, the bridge must become a (tagged) member of the VLAN.
@@ -115,6 +218,7 @@ admin@example:/config/interface/br0/> set bridge vlans vlan 20 tagged br0
> on top of the bridge, see section [VLAN Interfaces](#vlan-interfaces)
> below for more on this topic.
#### Multicast Filtering and Snooping
Multicast filtering in the bridge is handled by the bridge itself. It
@@ -329,7 +433,7 @@ top of a bridge interface *br0* is named *vlan10*.
#### Ethernet Settings and Status
Physical Ethernet interfaces provide low-level settings for speed/duplex as
well as packet status and statistics (*ieee802-ethernet-interface.yang*).
well as packet status and [statistics](#ethernet-statistics).
By default, Ethernet interfaces defaults to auto-negotiating
speed/duplex modes, advertising all speed and duplex modes available.
@@ -411,7 +515,7 @@ require auto-negotiation to be enabled.
#### Ethernet statistics
Ethernet packet statistics can be listed as shown below.
Ethernet packet statistics[^6] can be listed as shown below.
```
admin@example:/> show interfaces name eth1
@@ -499,6 +603,9 @@ Multiple address assignment methods are available:
| link-local | infix-ip | Auto-assignment of IPv4 address in 169.254.x.x/16 range |
| dhcp | infix-dhcp-client | Assignment of IPv4 address by DHCP server, e.g., *10.0.1.1/24* |
> **Note:** DHCP address method is only available for *LAN* interfaces
> (Ethernet, virtual Ethernet (veth), bridge, link aggregates, etc.)
Supported DHCP (request) options, configurability (Cfg) and defaults,
are listed below. Configurable options can be disabled on a per client
interface basis, some options, like `clientid` and option 81, are
@@ -524,8 +631,16 @@ possible to set the value of as well.
**Default:** `router`, `dns`, `domain`, `broadcast`, `ntpsrv`, `search`,
`address`, `staticroutes`, `msstaticroutes`
> **Note:** DHCP address method is only available for *LAN* interfaces
> (Ethernet, virtual Ethernet (veth), bridge, link aggregates, etc.)
When configuring a DHCP client, ensure that the NTP client is enabled
for the `ntpsrv` DHCP option to be processed correctly. If the NTP
client is not enabled, any NTP servers provided by the DHCP server will
be ignored. For details on how to enable the NTP client, see the
[NTP Client Configuration](system.md#ntp-client-configuration) section.
> **Note:** as per [RFC3442][4], if the DHCP server returns both a
> Classless Static Routes option (121) and Router option (3), the
> DHCP client *must* ignore the latter.
### IPv6 Address Assignment
@@ -744,7 +859,7 @@ have changed type to *random*.
### IPv4 forwarding
To be able to route (static or dynamic) on the interface it is
required to enable forwarding. This setting controlls if packets
required to enable forwarding. This setting controls if packets
received on this interface can be forwarded.
```
admin@example:/config/> edit interface eth0
@@ -760,12 +875,12 @@ This flag behaves totally different than for IPv4. For IPv6 the
ability to route between interfaces is always enabled, instead this
flag controls if the interface will be in host/router mode.
| **Feature** | **Forward enabled** | **Forward disabled** |
|:------------------------------------------|:--------------------|:---------------------|
| IsRouter set in Neighbour Advertisements. | Yes | No |
| Transmit Router Solicitations. | No | Yes |
| Router Advertisements are ignored | No | Yes |
| Accept Redirects | No | Yes |
| **Feature** | **Forward enabled** | **Forward disabled** |
|:-----------------------------------------|:--------------------|:---------------------|
| IsRouter set in Neighbour Advertisements | Yes | No |
| Transmit Router Solicitations | No | Yes |
| Router Advertisements are ignored | No | Yes |
| Accept Redirects | No | Yes |
```
admin@example:/config/> edit interface eth0
@@ -967,7 +1082,7 @@ This CLI example show the IPv6 routing table.
#### Route Preference
The operating system leverages FRRouting ([Frr][4]) as routing engine
The operating system leverages FRRouting ([Frr][0]) as routing engine
for both static and dynamic routing. Even routes injected from a DHCP
client, and IPv4 link-local (IPv4) routes, are injected into Frr to let
it weigh all routes before installing them into the kernel routing table
@@ -1021,7 +1136,8 @@ currently supported, namely `ipv4` and `ipv6`.
[1]: https://www.rfc-editor.org/rfc/rfc8343
[2]: https://www.rfc-editor.org/rfc/rfc8344
[3]: https://www.rfc-editor.org/rfc/rfc8981
[4]: https://frrouting.org/
[4]: https://www.rfc-editor.org/rfc/rfc3442
[0]: https://frrouting.org/
[^1]: Please note, link aggregates are not yet supported in Infix.
[^2]: Link-local IPv6 addresses are implicitly enabled when enabling
@@ -1031,3 +1147,14 @@ currently supported, namely `ipv4` and `ipv6`.
mapping the low-order 23-bits of the IP address in the low-order 23
bits of the Ethernet address 01:00:5E:00:00:00. Meaning, more than
one IP multicast group maps to the same MAC multicast group.
[^4]: A YANG deviation was previously used to make it possible to set
`phys-address`, but this has been replaced with the more flexible
`custom-phys-address`.
[^5]: Infix MAC bridges on Marvell Linkstreet devices are currently
limited to use a single MAC database, causing issues if the same
MAC address appears on different MAC bridges.
[^6]: Ethernet counters are described in
*ieee802-ethernet-interface.yang* and
*infix-ethernet-interface.yang*. [Ethernet
Counters](eth-counters.md) page provides additional details on
statistics support.
+45 -10
View File
@@ -12,14 +12,6 @@ packets to drop and which ones to prioritize, such that critical
services remain operational.
## Software Forwarded Traffic
For packets which are processed by a CPU, i.e. typically routed
traffic, and bridged traffic between interfaces that do not belong to
the same hardware switching domain, an [nftables container][1] can be
used to define a QoS policy.
## Hardware Forwarded Traffic
The default QoS policy for flows which are offloaded to a switching
@@ -34,6 +26,14 @@ chips in this family where limited to 4 output queues per port, this
documentation is _only_ valid for newer generations with 8 output
queues per port.
![Hardware offloading for Marvell Link Street](img/qos-hw-mvls.svg)
The picture illustrates packets having their priority determined at
ingress, here interface _e1_ and _e3_. In this example, both packets
are forwarded to the same outgoing interface (_e2_), subject to output
queueing. The sections below provides more information on these
topics.
#### Default Policy
##### Queueing
@@ -54,8 +54,8 @@ significant bits of the DSCP is used to select the queue:
| 6 | 48-55 | ⇒ | 6 | 25 |
| 7 | 56-63 | ⇒ | 7 | 33 |
For packets containing both a VLAN tag and an IP header, DSCP priority
takes precedence over PCP priority. In cases where neither are
For packets containing both a VLAN tag and an IP header, PCP priority
takes precedence over DSCP priority. In cases where neither are
available, packets are always assigned to queue 0.
Each port's set of 8 egress queues operate on a Weighted Round Robin
@@ -73,6 +73,41 @@ set to the 3 most significant bits of it. If no priority information
is available in the frame on ingress (i.e. untagged non-IP), then
packets will egress out of tagged ports with PCP set to 0.
## Software Forwarded Traffic
For packets which are processed by a CPU, i.e. typically routed
traffic, and bridged traffic between interfaces that do not belong to
the same hardware switching domain, an [nftables container][1] can be
used to define a QoS policy.
For VLAN interfaces, Infix provides support for mapping the Priority
Code Point (PCP) to internal priority on ingress, and the reverse on
egress.
![Ingress and Egress Priority mapping for VLAN interfaces](img/qos-vlan-iface.svg)
These `ingress-qos` and `egress-qos` settings are done per VLAN, both
defaulting to '0'. The example below shows how to keep the PCP priority
for packets being routed between two VLAN interfaces.
```
admin@example:/config/> edit interface e1.10
admin@example:/config/interface/e1.10/> set vlan ingress-qos priority from-pcp
admin@example:/config/interface/e1.10/> up
admin@example:/config/> edit interface e1.20
admin@example:/config/interface/e1.20/> set vlan egress-qos pcp from-priority
admin@example:/config/interface/e1.20/> leave
admin@example:/>
```
## A complex example
The picture below shows a packet flow being subject both to software
forwarding and hardware offloading.
![Hardware and Software QoS Handling](img/qos-complex.svg)
[1]: container.md#application-container-nftables
[2]: https://en.wikipedia.org/wiki/IEEE_802.1Q
+77 -1
View File
@@ -145,7 +145,7 @@ is committed by issuing the `leave` command.
admin@host:/config/> edit system
admin@host:/config/system/> set hostname example
admin@host:/config/system/> leave
admin@example:/>
admin@host:/>
```
The hostname is advertised over mDNS-SD in the `.local` domain. If
@@ -201,6 +201,82 @@ admin@host:/>
> and then re-enter configure context to use your editor of choice.
## NTP Client Configuration
Below is an example configuration for enabling NTP
with a specific server and the `iburst` option for faster initial
synchronization.
```
admin@host:/> configure
admin@host:/config/> set system ntp enabled
admin@host:/config/> set system ntp server ntp-pool
admin@host:/config/> set system ntp server ntp-pool udp address pool.ntp.org
admin@host:/config/> set system ntp server ntp-pool iburst
admin@host:/config/> set system ntp server ntp-pool prefer
```
This configuration enables the NTP client and sets the NTP server to
`pool.ntp.org` with the `iburst` and `prefer` options. The `iburst`
option ensures faster initial synchronization, and the `prefer` option
designates this server as preferred.
* `prefer false`: The NTP client will choose the best available source
based on several factors, such as network delay, stratum, and other
metrics (default config).
* `prefer true`: The NTP client will try to use the preferred server
as the primary source unless it becomes unreachable or unusable.
### Show NTP Status
To check the status of NTP synchronization, use the following command:
```
admin@host:/> show ntp
Reference ID : C0248F86 (192.36.143.134)
Stratum : 2
Ref time (UTC) : Mon Oct 21 10:06:45 2024
System time : 0.000000001 seconds slow of NTP time
Last offset : -3845.151367188 seconds
RMS offset : 3845.151367188 seconds
Frequency : 4.599 ppm slow
Residual freq : +1293.526 ppm
Skew : 12.403 ppm
Root delay : 1.024467230 seconds
Root dispersion : 0.273462683 seconds
Update interval : 0.0 seconds
Leap status : Normal
admin@host:/>
```
This output provides detailed information about the NTP status, including
reference ID, stratum, time offsets, frequency, and root delay.
### Show NTP Sources
To view the sources being used by the NTP client, run:
```
admin@host:/> show ntp sources
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current best, '+' = combined, '-' = not combined,
| / 'x' = may be in error, '~' = too variable, '?' = unusable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 192.36.143.134 1 6 177 9 +278ms[ -3845s] +/- 514ms
admin@host:/>
```
> The system uses `chronyd` for Network Time Protocol (NTP)
> synchronization. The output shown here is best explained in the
> [Chrony documentation](https://chrony-project.org/doc/4.6.1/chronyc.html).
[1]: https://www.rfc-editor.org/rfc/rfc7317
[2]: https://github.com/kernelkit/infix/blob/main/src/confd/yang/infix-system%402024-02-29.yang
[3]: https://www.rfc-editor.org/rfc/rfc8341
+1 -1
View File
@@ -17,7 +17,7 @@ Tenets
It is also much more practical and economical to build large virtual
networks than physical ones.
- **Avoid CLI scipting & scraping**. Reliably interacting with a DUT
- **Avoid CLI scripting & scraping**. Reliably interacting with a DUT
over a serial line in a robust way is _very_ hard to get right.
Given that we have a proper API (RESTCONF), we should leverage that
when testing. Front-ends can be tested by other means.
+5 -1
View File
@@ -1,7 +1,10 @@
menu "Packages"
source "$BR2_EXTERNAL_INFIX_PATH/package/bin/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/confd/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/test-mode/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/confd-test-mode/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/curios-httpd/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/curios-nftables/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/execd/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/gencert/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/statd/Config.in"
@@ -33,4 +36,5 @@ source "$BR2_EXTERNAL_INFIX_PATH/package/sysrepo-cpp/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/rousette/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/nghttp2-asio/Config.in"
source "$BR2_EXTERNAL_INFIX_PATH/package/date-cpp/Config.in"
endmenu
+8
View File
@@ -0,0 +1,8 @@
config BR2_PACKAGE_BIN
bool "bin"
select BR2_PACKAGE_SYSREPO
select BR2_PACKAGE_LIBITE
help
Misc. tools for CLI and shell users.
https://github.com/kernelkit/infix
+1
View File
@@ -0,0 +1 @@
sha256 d2f96418893ac66156d0e691cda189b0d85ae1d814065d1d9aa1845383100f46 LICENSE
+21
View File
@@ -0,0 +1,21 @@
################################################################################
#
# bin
#
################################################################################
BIN_VERSION = 1.0
BIN_SITE_METHOD = local
BIN_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/bin
BIN_LICENSE = BSD-3-Clause
BIN_LICENSE_FILES = LICENSE
BIN_REDISTRIBUTE = NO
BIN_DEPENDENCIES = sysrepo libite
BIN_CONF_OPTS = --prefix= --disable-silent-rules
BIN_AUTORECONF = YES
define BIN_CONF_ENV
CFLAGS="$(INFIX_CFLAGS)"
endef
$(eval $(autotools-package))
+10
View File
@@ -0,0 +1,10 @@
config BR2_PACKAGE_CONFD_TEST_MODE
bool "confd test mode"
depends on BR2_PACKAGE_CONFD
select BR2_PACKAGE_LIBITE
select BR2_PACKAGE_LIBYANG
select BR2_PACKAGE_SYSREPO
select BR2_PACKAGE_LIBSRX
help
A companion plugin to confd providing functionality required to
run tests with Infamy, i.e., enable Infix test mode.
@@ -0,0 +1,32 @@
CONFD_TEST_MODE_VERSION = 1.0
CONFD_TEST_MODE_SITE_METHOD = local
CONFD_TEST_MODE_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/test-mode
CONFD_TEST_MODE_LICENSE = BSD-3-Clause
CONFD_TEST_MODE_LICENSE_FILES = LICENSE
CONFD_TEST_MODE_REDISTRIBUTE = NO
CONFD_TEST_MODE_DEPENDENCIES = sysrepo libite libyang confd
CONFD_TEST_MODE_AUTORECONF = YES
CONFD_TEST_MODE_SYSREPO_SHM_PREFIX = sr_buildroot$(subst /,_,$(CONFIG_DIR))_test_mode
COMMON_SYSREPO_ENV = \
SYSREPO_SHM_PREFIX=$(CONFD_SYSREPO_SHM_PREFIX) \
SYSREPOCTL_EXECUTABLE="$(HOST_DIR)/bin/sysrepoctl" \
SYSREPOCFG_EXECUTABLE="$(HOST_DIR)/bin/sysrepocfg" \
SEARCH_PATH="$(TARGET_DIR)/usr/share/yang/modules/confd/"
define CONFD_TEST_MODE_INSTALL_YANG_MODULES
$(COMMON_SYSREPO_ENV) \
SEARCH_PATH="$(TARGET_DIR)/usr/share/yang/modules/test-mode/" $(BR2_EXTERNAL_INFIX_PATH)/utils/sysrepo-load-modules.sh $(@D)/yang/test-mode.inc
endef
define CONFD_TEST_MODE_PERMISSIONS
/etc/sysrepo/data/ r 660 root wheel - - - - -
/etc/sysrepo/data d 770 root wheel - - - - -
endef
define CONFD_TEST_MODE_CLEANUP
rm -f /dev/shm/$(CONFD_TEST_MODE_SYSREPO_SHM_PREFIX)*
endef
CONFD_TEST_MODE_PRE_INSTALL_TARGET_HOOKS += CONFD_TEST_MODE_CLEANUP
CONFD_TEST_MODE_POST_INSTALL_TARGET_HOOKS += CONFD_TEST_MODE_INSTALL_YANG_MODULES
$(eval $(autotools-package))
+1 -1
View File
@@ -4,7 +4,7 @@
#
################################################################################
CONFD_VERSION = 1.1
CONFD_VERSION = 1.2
CONFD_SITE_METHOD = local
CONFD_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/confd
CONFD_LICENSE = BSD-3-Clause
+3 -3
View File
@@ -2,8 +2,8 @@ config BR2_PACKAGE_CURIOS_HTTPD
bool "curiOS-httpd"
help
Example of how to bundle an OCI archive of curiOS-httpd in
/lib/oci for the given target architecture. OCI archives
can also be bundled in post-build.sh, but with packaging
the "source" is bundled in SDK builds.
/lib/oci for the given target architecture. OCI archives can
also be bundled in post-build.sh, but with packaging all the
"source" tarballs are bundled for SDK builds (archiving).
https://github.com/kernelkit/curiOS
+2 -2
View File
@@ -9,11 +9,11 @@ CURIOS_HTTPD_SOURCE = curios-httpd-oci-$(GO_GOARCH)-$(CURIOS_HTTPD_VERSION).tar.
CURIOS_HTTPD_SITE = https://github.com/kernelkit/curiOS/releases/download/$(CURIOS_HTTPD_VERSION)
CURIOS_HTTPD_LICENSE = GPL
CURIOS_HTTPD_LICENSE_FILES = COPYING
CURIOS_HTTPD_INSTALL_TARGET = YES
define CURIOS_HTTPD_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/lib/oci
(cd $(@D)/.. && $(TAR) cfz $(TARGET_DIR)/lib/oci/$(notdir $(@D)).tar.gz $(notdir $(@D)))
cp $(CURIOS_HTTPD_DL_DIR)/$(CURIOS_HTTPD_SOURCE) \
$(TARGET_DIR)/lib/oci/$(notdir $(@D)).tar.gz
endef
$(eval $(generic-package))
+9
View File
@@ -0,0 +1,9 @@
config BR2_PACKAGE_CURIOS_NFTABLES
bool "curiOS-nftables"
help
Example of how to bundle an OCI archive of curiOS-nftables in
/lib/oci for the given target architecture. OCI archives can
also be bundled in post-build.sh, but with packaging all the
"source" tarballs are bundled for SDK builds (archiving).
https://github.com/kernelkit/curiOS
@@ -0,0 +1,4 @@
# Locally computed
sha256 ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6 COPYING
sha256 f25651505bf4fc635dc8d391f377b1116837e99dee522ce0691c15b090cee818 curios-nftables-oci-arm64-v24.05.0.tar.gz
sha256 025c2a5d6c71c62ebbe6f96d8b9ffa3235d6812e87b51645f6e89357d9762669 curios-nftables-oci-amd64-v24.05.0.tar.gz
@@ -0,0 +1,20 @@
################################################################################
#
# curios-nftables
#
################################################################################
CURIOS_NFTABLES_VERSION = v24.05.0
CURIOS_NFTABLES_SOURCE = curios-nftables-oci-$(GO_GOARCH)-$(CURIOS_NFTABLES_VERSION).tar.gz
CURIOS_NFTABLES_SITE = https://github.com/kernelkit/curiOS/releases/download/$(CURIOS_NFTABLES_VERSION)
CURIOS_NFTABLES_LICENSE = GPL
CURIOS_NFTABLES_LICENSE_FILES = COPYING
CURIOS_NFTABLES_INSTALL_TARGET = YES
define CURIOS_NFTABLES_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/lib/oci
cp $(CURIOS_NFTABLES_DL_DIR)/$(CURIOS_NFTABLES_SOURCE) \
$(TARGET_DIR)/lib/oci/$(notdir $(@D)).tar.gz
endef
$(eval $(generic-package))
@@ -0,0 +1,67 @@
From 46ffa81f5c88ce95db011369d8bfb802313e4217 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Thu, 17 Oct 2024 14:23:24 +0200
Subject: [PATCH 1/6] Only mark rdeps dirty if main service is nohup
Organization: Addiva Elektronik
This patch changes a behavior that's been default since Finit 4.0,
introduced in 4d05bf9 with 4.0-rc2.
If service B depends on A and A needs to be reloaded, then B may be
affected. If A is declared as NOHUP <!>, then A will be stopped and
restarted, during which time the condition it provides is removed,
and B will also be stopped.
However, and as of this patch, if A is declared supporting HUP, then the
condition A provides will only go into flux, during which time B will be
SIGSTOPed instead of needing to be reloaded.
Fix #415
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/service.c | 8 ++++++++
src/svc.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/src/service.c b/src/service.c
index 61be85c..b995ff4 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2001,6 +2001,10 @@ static void svc_mark_affected(char *cond)
* Called on conf_reload() to update service reverse dependencies.
* E.g., if ospfd depends on zebra and the zebra Finit conf has
* changed, we need to mark the ospfd Finit conf as changed too.
+ *
+ * However, a daemon that depends on syslogd (sysklogd project), need
+ * not be reloeaded (SIGHUP'ed or stop/started) because syslogd support
+ * reloading its configuration file on SIGHUP.
*/
void service_update_rdeps(void)
{
@@ -2012,6 +2016,10 @@ void service_update_rdeps(void)
if (!svc_is_changed(svc))
continue;
+ /* Service supports reloading conf without stop/start */
+ if (!svc_is_nohup(svc))
+ continue; /* Yup, no need to stop start rdeps */
+
svc_mark_affected(mkcond(svc, cond, sizeof(cond)));
}
}
diff --git a/src/svc.h b/src/svc.h
index d00ac14..e2f6bd8 100644
--- a/src/svc.h
+++ b/src/svc.h
@@ -259,6 +259,7 @@ static inline int svc_is_tty (svc_t *svc) { return svc && SVC_TYPE_TTY
static inline int svc_is_runtask (svc_t *svc) { return svc && (SVC_TYPE_RUNTASK & svc->type);}
static inline int svc_is_forking (svc_t *svc) { return svc && svc->forking; }
static inline int svc_is_manual (svc_t *svc) { return svc && svc->manual; }
+static inline int svc_is_nohup (svc_t *svc) { return svc && (0 == svc->sighup); }
static inline int svc_in_runlevel (svc_t *svc, int runlevel) { return svc && ISSET(svc->runlevels, runlevel); }
static inline int svc_nohup (svc_t *svc) { return svc && (0 == svc->sighup || 0 != svc->args_dirty); }
--
2.43.0
@@ -1,70 +0,0 @@
From c2218236546908ecab5eab4b32e698d7bb3d984a Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Sat, 3 Feb 2024 17:30:30 +0100
Subject: [PATCH] shutdown: use cond_clear_noupdate() to prevent nested
service_stop()
Organization: Addiva Elektronik
When the system shuts down, or user changes runlevels, we don't have to
call cond_clear_update(), because this can lead to nested service_stop()
calls, which in turn lead to out of sync progress updates:
[ .. ] Stopping Foo
[ OK ] Stopping Bar
[ OK ]
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/cond-w.c | 6 +++++-
src/service.c | 4 +++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/cond-w.c b/src/cond-w.c
index 2502264..0546282 100644
--- a/src/cond-w.c
+++ b/src/cond-w.c
@@ -35,6 +35,7 @@
#include "cond.h"
#include "pid.h"
#include "service.h"
+#include "sm.h"
struct cond_boot {
TAILQ_ENTRY(cond_boot) link;
@@ -214,7 +215,10 @@ static int do_delete(const char *fpath, const struct stat *sb, int tflag, struct
err(1, "Failed removing condition %s", fpath);
cond = ptr + strlen(COND_BASE) + 1;
- cond_update(cond);
+ if (sm_is_in_teardown(&sm))
+ cond_clear_noupdate(cond);
+ else
+ cond_update(cond);
return 0;
}
diff --git a/src/service.c b/src/service.c
index 8175757..eca9ed0 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2261,7 +2261,7 @@ static void svc_set_state(svc_t *svc, svc_state_t new_state)
/* if PID isn't collected within SVC_TERM_TIMEOUT msec, kill it! */
if (new_state == SVC_STOPPING_STATE) {
dbg("%s is stopping, wait %d sec before sending SIGKILL ...",
- svc_ident(svc, NULL, 0), svc->killdelay / 1000);
+ svc_ident(svc, NULL, 0), svc->killdelay / 1000);
service_timeout_cancel(svc);
service_timeout_after(svc, svc->killdelay, service_kill);
}
@@ -2299,6 +2299,8 @@ static void svc_set_state(svc_t *svc, svc_state_t new_state)
if ((old_state == SVC_RUNNING_STATE && new_state == SVC_PAUSED_STATE) ||
(old_state == SVC_PAUSED_STATE && new_state == SVC_RUNNING_STATE))
; /* only paused during reload, don't clear conds. */
+ else if (sm_is_in_teardown(&sm))
+ cond_clear_noupdate(cond);
else
cond_clear(cond);
--
2.34.1
@@ -0,0 +1,33 @@
From 119e66a7e9c95283918639b51dd03a3d666955f8 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Mon, 28 Oct 2024 10:58:04 +0100
Subject: [PATCH 2/6] Reset color attributes and clear screen when starting up
Organization: Addiva Elektronik
Some boot loaders, like GRUB, leave background color artifacts from
their boot menu. This patch resets the foreground and background
color attributes, and then clears the screen, without clearing the
scrollback buffer.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/helpers.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/helpers.c b/src/helpers.c
index 8768de8..99c4557 100644
--- a/src/helpers.c
+++ b/src/helpers.c
@@ -87,6 +87,9 @@ void console_init(void)
/* Enable line wrap, if disabled previously, e.g., qemu */
dprint(STDOUT_FILENO, "\033[?7h", 5);
+ /* Reset atttributes, background and foreground color */
+ dprint(STDOUT_FILENO, "\033[49m\033[39m\e[2J", 14);
+
log_init();
}
--
2.43.0
@@ -1,27 +0,0 @@
From 5998342b3e55638b0f7248383e939a64f53fa8ff Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Mon, 26 Feb 2024 08:41:14 +0100
Subject: [PATCH] system: drop debug mode from udevd
Organization: Addiva Elektronik
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
system/10-hotplug.conf.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system/10-hotplug.conf.in b/system/10-hotplug.conf.in
index 49ea081..a4f64b5 100644
--- a/system/10-hotplug.conf.in
+++ b/system/10-hotplug.conf.in
@@ -19,7 +19,7 @@
# Check for systemd-udevd and eudev, if we find both, we opt for the latter.
service nowarn [S12345789] cgroup.system name:udevd notify:none pid:udevd log /lib/systemd/systemd-udevd -- Device event daemon (udev)
-service nowarn [S12345789] cgroup.system name:udevd notify:none pid:udevd log udevd -D -- Device event daemon (udev)
+service nowarn [S12345789] cgroup.system name:udevd notify:none pid:udevd log udevd -- Device event daemon (udev)
# Wait for udevd to start, then trigger coldplug events and module loading.
# The last 'settle' call waits for it to finalize processing all uevents.
--
2.34.1
@@ -1,47 +0,0 @@
From c1ed3733986486f3255e77dec47ae1d4b2836e2f Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Mon, 11 Mar 2024 15:46:38 +0100
Subject: [PATCH 3/4] Fix #397: drop ttinit() for PID 1
Organization: Addiva Elektronik
After reports from the field, see issue #397, of lockups at reboot,
we've decided to drop this code from PID 1. It was added before the 4.x
series, when the current progress output was introduced. For the older
style progress it served a purpose since the placement of [OK]/[FAIL]
was on the right hand side.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/log.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/src/log.c b/src/log.c
index ea49705..b776525 100644
--- a/src/log.c
+++ b/src/log.c
@@ -42,8 +42,6 @@ static int loglevel = LOG_INFO;
void log_init(void)
{
- ttinit();
-
if (debug)
loglevel = LOG_DEBUG;
else
@@ -53,13 +51,6 @@ void log_init(void)
/* If we enabled terse mode at boot, restore to previous setting at shutdown */
void log_exit(void)
{
- /*
- * Unless in debug mode at shutdown, Reinitialize screen,
- * terminal may have been resized at runtime
- */
- if (!debug)
- ttinit();
-
enable_progress(1);
}
--
2.34.1
@@ -0,0 +1,196 @@
From 0c0e880f3fdd38f7bbde618408378dc0a19ff005 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Sun, 3 Nov 2024 09:39:46 +0100
Subject: [PATCH 3/6] plugins: refactor rtc.so
Organization: Addiva Elektronik
Factor out time_set() and time_get() for readability and reuse.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
plugins/rtc.c | 116 +++++++++++++++++++++++++++++---------------------
1 file changed, 68 insertions(+), 48 deletions(-)
diff --git a/plugins/rtc.c b/plugins/rtc.c
index 238791f..9520c7d 100644
--- a/plugins/rtc.c
+++ b/plugins/rtc.c
@@ -68,6 +68,60 @@ static void tz_restore(char *tz)
tzset();
}
+static int time_set(struct tm *tm)
+{
+ struct tm fallback = { 0 };
+ struct timeval tv = { 0 };
+ char tz[128];
+ int rc = 0;
+
+ tz_set(tz, sizeof(tz));
+
+ if (!tm) {
+ logit(LOG_NOTICE, "Resetting system clock to kernel default, %s.", rtc_timestamp);
+ tm = &fallback;
+
+ /* Attempt to set RTC to a sane value ... */
+ tv.tv_sec = rtc_date_fallback;
+ if (!gmtime_r(&tv.tv_sec, tm)) {
+ rc = 1;
+ goto out;
+ }
+ }
+
+ tm->tm_isdst = -1; /* Use tzdata to figure it out, please. */
+ tv.tv_sec = mktime(tm);
+ if (tv.tv_sec == (time_t)-1 || tv.tv_sec < rtc_date_fallback) {
+ errno = EINVAL;
+ rc = 2;
+ } else {
+ if (settimeofday(&tv, NULL) == -1)
+ rc = 1;
+ }
+out:
+ tz_restore(tz);
+ return rc;
+}
+
+static int time_get(struct tm *tm)
+{
+ struct timeval tv = { 0 };
+ char tz[128];
+ int rc = 0;
+
+ tz_set(tz, sizeof(tz));
+
+ rc = gettimeofday(&tv, NULL);
+ if (rc < 0 || tv.tv_sec < rtc_date_fallback)
+ rc = 2;
+ else
+ gmtime_r(&tv.tv_sec, tm);
+
+ tz_restore(tz);
+
+ return rc;
+}
+
static int rtc_open(void)
{
char *alt[] = {
@@ -91,10 +145,8 @@ static int rtc_open(void)
static void rtc_save(void *arg)
{
- struct timeval tv = { 0 };
struct tm tm = { 0 };
int fd, rc = 0;
- char tz[128];
if (rescue) {
dbg("Skipping %s plugin in rescue mode.", __FILE__);
@@ -105,38 +157,26 @@ static void rtc_save(void *arg)
if (fd < 0)
return;
- tz_set(tz, sizeof(tz));
- rc = gettimeofday(&tv, NULL);
- if (rc < 0 || tv.tv_sec < rtc_date_fallback) {
+ if ((rc = time_get(&tm))) {
print_desc(NULL, "System clock invalid, not saving to RTC");
- invalid:
- logit(LOG_ERR, "System clock invalid, before %s, not saving to RTC", rtc_timestamp);
- rc = 2;
- goto out;
+ } else {
+ print_desc(NULL, "Saving system clock (UTC) to RTC");
+ rc = ioctl(fd, RTC_SET_TIME, &tm);
}
- print_desc(NULL, "Saving system time (UTC) to RTC");
-
- gmtime_r(&tv.tv_sec, &tm);
- if (ioctl(fd, RTC_SET_TIME, &tm) < 0) {
- if (EINVAL == errno)
- goto invalid;
- rc = 1;
- goto out;
+ if (rc && errno == EINVAL) {
+ logit(LOG_ERR, "System clock invalid, before %s, not saving to RTC", rtc_timestamp);
+ rc = 2;
}
-out:
- tz_restore(tz);
print(rc, NULL);
close(fd);
}
static void rtc_restore(void *arg)
{
- struct timeval tv = { 0 };
struct tm tm = { 0 };
int fd, rc = 0;
- char tz[128];
if (rescue) {
dbg("Skipping %s plugin in rescue mode.", __FILE__);
@@ -149,16 +189,19 @@ static void rtc_restore(void *arg)
return;
}
- tz_set(tz, sizeof(tz));
- if (ioctl(fd, RTC_RD_TIME, &tm) < 0) {
+ if ((rc = ioctl(fd, RTC_RD_TIME, &tm)) < 0) {
char msg[120];
snprintf(msg, sizeof(msg), "Failed restoring system clock, %s",
EINVAL == errno ? "RTC time is too old" :
ENOENT == errno ? "RTC has no saved time" : "see log for details");
print_desc(NULL, msg);
+ } else {
+ print_desc(NULL, "Restoring system clock (UTC) from RTC");
+ rc = time_set(&tm);
+ }
- invalid:
+ if (rc) {
logit(LOG_ERR, "Failed restoring system clock from RTC.");
if (EINVAL == errno)
logit(LOG_ERR, "RTC time is too old (before %s)", rtc_timestamp);
@@ -167,33 +210,10 @@ static void rtc_restore(void *arg)
else
logit(LOG_ERR, "RTC error code %d: %s", errno, strerror(errno));
- /* Been here already? */
- if (rc)
- goto out;
-
- /* Attempt to set RTC to a sane value ... */
- tv.tv_sec = rtc_date_fallback;
- if (!gmtime_r(&tv.tv_sec, &tm))
- goto out;
-
- logit(LOG_NOTICE, "Resetting RTC to kernel default, %s.", rtc_timestamp);
+ time_set(NULL);
rc = 2;
}
- if (!rc)
- print_desc(NULL, "Restoring system clock (UTC) from RTC");
- tm.tm_isdst = -1; /* Use tzdata to figure it out, please. */
- tv.tv_sec = mktime(&tm);
- if (tv.tv_sec == (time_t)-1 || tv.tv_sec < rtc_date_fallback) {
- errno = EINVAL;
- goto invalid;
- }
-
- if (settimeofday(&tv, NULL) == -1)
- rc = 1;
-
-out:
- tz_restore(tz);
print(rc, NULL);
close(fd);
}
--
2.43.0
@@ -1,30 +0,0 @@
From 146bf5512208cb906edddb3f0108cf6f7c525044 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Mon, 11 Mar 2024 15:55:39 +0100
Subject: [PATCH 4/4] Fix #398: display unsupported initctl command (number) in
log
Organization: Addiva Elektronik
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/api.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/api.c b/src/api.c
index c19c0d8..8d29a23 100644
--- a/src/api.c
+++ b/src/api.c
@@ -377,7 +377,9 @@ static void api_cb(uev_t *w, void *arg, int events)
case INIT_CMD_POWEROFF:
case INIT_CMD_SUSPEND:
if (IS_RESERVED_RUNLEVEL(runlevel)) {
- warnx("Unsupported command in runlevel S and 6/0.");
+ strterm(rq.data, sizeof(rq.data));
+ warnx("Unsupported command (cmd: %d, data: %s) in runlevel S and 6/0.",
+ rq.cmd, rq.data);
goto leave;
}
default:
--
2.34.1
@@ -0,0 +1,239 @@
From bc8118d515839dc598f437aa01f07a771646968d Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Sun, 3 Nov 2024 09:47:16 +0100
Subject: [PATCH 4/6] Fix #418: support systems with a broken RTC
Organization: Addiva Elektronik
This patch introduces a new configure option --with-rtc-file=FILE. When
enabled the RTC plugin detects missing RTC device and falls back to save
and restore system time from a file instead. When --with-rtc-file is
used without an argument the default file is /var/lib/misc/rtc, but the
feature itself is disabled by default.
The usefulness of this feature may not be obvious at first, but some
systems are equipped with an RTC that resets to a random date at power
on. This can be really bad in the case the date is far in the future,
because an NTP sync would then cause time skips backwards, which shows
up in logs and causes a whole lot of pain in alarm systems.
The solution is to disable the RTC driver or device tree node, and when
Finit starts up, the RTC plugin detects a the device node and instead
restores time from the last save game. Meaning time will always only
move forwards.
NOTE: when Finit is built --with-rtc-file we always save to disk, but
only restore from the "save game" if restoring from RTC fails.
If the system has no RTC we always restore from disk.
As an added bonus, this change also makes sure to periodically
sync also the RTC with the system clock. Useful for systems
that do not run an NTP client.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
configure.ac | 12 ++++++
plugins/rtc.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 110 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 483457f..ae7cd23 100644
--- a/configure.ac
+++ b/configure.ac
@@ -180,6 +180,10 @@ AC_ARG_WITH(rtc-date,
AS_HELP_STRING([--with-rtc-date=DATE], [If RTC date/time is too old, restore to DATE, format "YYYY-MM-DD HH:MM", default "2000-01-01 00:00"]),
[rtc_date=$withval], [rtc_date=no])
+AC_ARG_WITH(rtc-file,
+ AS_HELP_STRING([--with-rtc-file=FILE], [If RTC is missing, save and restore system clock from this file, default: no]),
+ [rtc_file=$withval], [rtc_file=no])
+
### Enable features ###########################################################################
# Create config.h from selected features and fallback defaults
@@ -281,6 +285,13 @@ AS_IF([test "x$rtc_date" != "xno"], [
AC_DEFINE(RTC_TIMESTAMP_CUSTOM, "$rtc_date", [Custom RTC restore date, default: 2000-01-01 00:00])], [
rtc_date=""])
+AS_IF([test "x$rtc_file" != "xno"], [
+ AS_IF([test "x$rtc_file" = "xyes"], [
+ rtc_file=/var/lib/misc/rtc])
+ AC_EXPAND_DIR(rtcfile_path, "$rtc_file")
+ AC_DEFINE_UNQUOTED(RTC_FILE, "$rtcfile_path", [Save and restore system time from this file if /dev/rtc is missing.])],[
+ AC_DEFINE_UNQUOTED(RTC_FILE, NULL)])
+
AS_IF([test "x$with_keventd" != "xno"], [with_keventd=yes])
AS_IF([test "x$with_sulogin" != "xno"], [
@@ -387,6 +398,7 @@ Behavior:
Boot heading..........: $heading
Plugins...............: $plugins
RTC restore date......: $RTC_DATE
+ RTC fallback file.....: $rtc_file
Optional features:
Install doc/..........: $enable_doc
diff --git a/plugins/rtc.c b/plugins/rtc.c
index 9520c7d..9b4eeae 100644
--- a/plugins/rtc.c
+++ b/plugins/rtc.c
@@ -36,8 +36,15 @@
#include "helpers.h"
#include "plugin.h"
-/* Kernel RTC driver validates against this date for sanity check */
+/*
+ * Kernel RTC driver validates against this date for sanity check. The
+ * on NTP sync the driver can also update the RTC every 11 mins. We use
+ * the same update interval to handle manual time set and file save.
+ */
#define RTC_TIMESTAMP_BEGIN_2000 "2000-01-01 00:00:00"
+#define RTC_FMT "%Y-%m-%d %H:%M:%S"
+#define RTC_PERIOD (11 * 60 * 1000)
+
#ifdef RTC_TIMESTAMP_CUSTOM
static char *rtc_timestamp = RTC_TIMESTAMP_CUSTOM;
#else
@@ -45,6 +52,10 @@ static char *rtc_timestamp = RTC_TIMESTAMP_BEGIN_2000;
#endif
static time_t rtc_date_fallback = 946684800LL;
+static char *rtc_file = RTC_FILE;
+static uev_t rtc_timer;
+
+
static void tz_set(char *tz, size_t len)
{
char *ptr;
@@ -122,6 +133,68 @@ static int time_get(struct tm *tm)
return rc;
}
+static void file_save(void *arg)
+{
+ struct tm tm = { 0 };
+ int rc = 0;
+ FILE *fp;
+
+ fp = fopen(rtc_file, "w");
+ if (!fp) {
+ logit(LOG_WARNING, "Failed saving system clock to %s, code %d: %s",
+ rtc_file, errno, strerror(errno));
+ return;
+ }
+
+ if ((rc = time_get(&tm))) {
+ logit(LOG_ERR, "System clock invalid, before %s, not saving", rtc_timestamp);
+ print_desc(NULL, "System clock invalid, skipping");
+ } else {
+ char buf[32] = { 0 };
+
+ print_desc(NULL, "Saving system clock to file");
+ strftime(buf, sizeof(buf), RTC_FMT, &tm);
+ fprintf(fp, "%s\n", buf);
+ }
+
+ print(rc, NULL);
+ fclose(fp);
+}
+
+static void file_restore(void *arg)
+{
+ struct tm tm = { 0 };
+ int rc = 1;
+ FILE *fp;
+
+ if (!rtc_file) {
+ logit(LOG_NOTICE, "System has no RTC (missing driver?), skipping restore.");
+ return;
+ }
+
+ print_desc(NULL, "Restoring system clock from backup");
+
+ fp = fopen(rtc_file, "r");
+ if (fp) {
+ char buf[32];
+
+ if (fgets(buf, sizeof(buf), fp)) {
+ chomp(buf);
+ strptime(buf, RTC_FMT, &tm);
+ rc = time_set(&tm);
+ }
+ fclose(fp);
+ } else
+ logit(LOG_WARNING, "Missing %s", rtc_file);
+
+ if (rc) {
+ time_set(NULL);
+ rc = 2;
+ }
+
+ print(rc, NULL);
+}
+
static int rtc_open(void)
{
char *alt[] = {
@@ -185,7 +258,7 @@ static void rtc_restore(void *arg)
fd = rtc_open();
if (fd < 0) {
- logit(LOG_NOTICE, "System has no RTC (missing driver?), skipping restore.");
+ file_restore(arg);
return;
}
@@ -210,21 +283,37 @@ static void rtc_restore(void *arg)
else
logit(LOG_ERR, "RTC error code %d: %s", errno, strerror(errno));
- time_set(NULL);
- rc = 2;
- }
+ print(2, NULL);
+
+ /* Try restoring from last save game */
+ if (rtc_file)
+ file_restore(arg);
+ } else
+ print(0, NULL);
- print(rc, NULL);
close(fd);
}
+
+static void save(void *arg)
+{
+ rtc_save(arg);
+ file_save(arg);
+}
+
+static void update(uev_t *w, void *arg, int events)
+{
+ save(arg);
+}
+
+
static plugin_t plugin = {
.name = __FILE__,
.hook[HOOK_BASEFS_UP] = {
.cb = rtc_restore
},
.hook[HOOK_SHUTDOWN] = {
- .cb = rtc_save
+ .cb = save
}
};
@@ -237,6 +326,8 @@ PLUGIN_INIT(plugin_init)
else
rtc_timestamp = RTC_TIMESTAMP_BEGIN_2000;
+ uev_timer_init(ctx, &rtc_timer, update, NULL, RTC_PERIOD, RTC_PERIOD);
+
plugin_register(&plugin);
}
--
2.43.0
@@ -0,0 +1,73 @@
From 6be16f2f6d093ef495d0fe4313f7b05b4ba3e08f Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Sun, 3 Nov 2024 10:38:38 +0100
Subject: [PATCH 5/6] Fix buggy --with-rtc-date=DATE, introduced in Finit v4.4
Organization: Addiva Elektronik
In 42ef3d3c, for v4.4-rc1, support for setting a custom RTC restore date
was introduced. Unfortunately the configure script was wrong and caused
config.h to contain
#define RTC_TIMESTAMP_CUSTOM "$rtc_date"
instead of
#define RTC_TIMESTAMP_CUSTOM "2023-04-10 14:35:42"
Furthermore, the error handling for strptime() was wrong, so the restore
date was always reverted to the default.
This patch fixes both issues and extends the DATE of --with-rtc-date to
also include seconds.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
configure.ac | 4 ++--
plugins/rtc.c | 8 +++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index ae7cd23..58b78ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,7 +177,7 @@ AC_ARG_WITH(plugin-path,
[plugin_path=$withval], [plugin_path=yes])
AC_ARG_WITH(rtc-date,
- AS_HELP_STRING([--with-rtc-date=DATE], [If RTC date/time is too old, restore to DATE, format "YYYY-MM-DD HH:MM", default "2000-01-01 00:00"]),
+ AS_HELP_STRING([--with-rtc-date=DATE], [If RTC date/time is too old, restore to DATE, format "YYYY-MM-DD HH:MM:SS", default "2000-01-01 00:00:00"]),
[rtc_date=$withval], [rtc_date=no])
AC_ARG_WITH(rtc-file,
@@ -282,7 +282,7 @@ AS_IF([test "x$with_random_seed" != "xno"], [
AC_DEFINE_UNQUOTED(RANDOMSEED, "$random_path", [Improve random at boot by seeding it with sth from before.])])
AS_IF([test "x$rtc_date" != "xno"], [
- AC_DEFINE(RTC_TIMESTAMP_CUSTOM, "$rtc_date", [Custom RTC restore date, default: 2000-01-01 00:00])], [
+ AC_DEFINE_UNQUOTED(RTC_TIMESTAMP_CUSTOM, "$rtc_date", [Custom RTC restore date, default: 2000-01-01 00:00])], [
rtc_date=""])
AS_IF([test "x$rtc_file" != "xno"], [
diff --git a/plugins/rtc.c b/plugins/rtc.c
index 9b4eeae..a733f75 100644
--- a/plugins/rtc.c
+++ b/plugins/rtc.c
@@ -321,10 +321,12 @@ PLUGIN_INIT(plugin_init)
{
struct tm tm = { 0 };
- if (!strptime(rtc_timestamp, "%Y-%m-%d %H:%M", &tm))
- rtc_date_fallback = mktime(&tm);
- else
+ if (!strptime(rtc_timestamp, RTC_FMT, &tm)) {
+ logit(LOG_ERR, "Invalid restore date '%s', reverting to '%s'",
+ rtc_timestamp, RTC_TIMESTAMP_BEGIN_2000);
rtc_timestamp = RTC_TIMESTAMP_BEGIN_2000;
+ } else
+ rtc_date_fallback = mktime(&tm);
uev_timer_init(ctx, &rtc_timer, update, NULL, RTC_PERIOD, RTC_PERIOD);
--
2.43.0
@@ -1,29 +0,0 @@
From 90a4df8d1281fd64d048ec1bc91e8cec5f96df06 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Mon, 11 Mar 2024 18:53:22 +0100
Subject: [PATCH 5/6] plugins: on error-retry, don't print "Restoring RTC"
twice
Organization: Addiva Elektronik
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
plugins/rtc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/rtc.c b/plugins/rtc.c
index 31c99e0..238791f 100644
--- a/plugins/rtc.c
+++ b/plugins/rtc.c
@@ -180,7 +180,8 @@ static void rtc_restore(void *arg)
rc = 2;
}
- print_desc(NULL, "Restoring system clock (UTC) from RTC");
+ if (!rc)
+ print_desc(NULL, "Restoring system clock (UTC) from RTC");
tm.tm_isdst = -1; /* Use tzdata to figure it out, please. */
tv.tv_sec = mktime(&tm);
if (tv.tv_sec == (time_t)-1 || tv.tv_sec < rtc_date_fallback) {
--
2.34.1
@@ -1,81 +0,0 @@
From bf4a584e2ebfa512a2d6cfe5e43a81ee741e3296 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Tue, 12 Mar 2024 05:18:35 +0100
Subject: [PATCH 6/7] plugins: add support for hwrng and check if seed file is
empty
Organization: Addiva Elektronik
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
plugins/urandom.c | 41 ++++++++++++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 11 deletions(-)
diff --git a/plugins/urandom.c b/plugins/urandom.c
index 64a3fa7..2da8035 100644
--- a/plugins/urandom.c
+++ b/plugins/urandom.c
@@ -47,6 +47,7 @@ static void setup(void *arg)
#ifdef RANDOMSEED
struct rand_pool_info *rpi;
ssize_t len = 0;
+ struct stat st;
int rc = -1;
int fd, err;
@@ -55,7 +56,7 @@ static void setup(void *arg)
return;
}
- if (!fexist(RANDOMSEED)) {
+ if (stat(RANDOMSEED, &st) || st.st_size < 512) {
int ret = 1;
mode_t prev;
FILE *fp;
@@ -64,16 +65,34 @@ static void setup(void *arg)
prev = umask(077);
fp = fopen(RANDOMSEED, "w");
if (fp) {
- int iter = 128;
- struct timeval tv;
-
- gettimeofday(&tv, NULL);
- srandom(tv.tv_sec % 3600);
- while (iter--) {
- uint32_t i, prng = random();
-
- for (i = 0; i < sizeof(prng); i++)
- fputc((prng >> (i * CHAR_BIT)) & UCHAR_MAX, fp);
+ const char *hwrng = "/dev/hwrng";
+ FILE *hw;
+
+ hw = fopen(hwrng, "r");
+ if (hw) {
+ char buf[512];
+ size_t len;
+
+ len = fread(buf, sizeof(buf[0]), sizeof(buf), hw);
+ if (len == 0) {
+ fclose(hw);
+ goto no_hwrng;
+ }
+
+ len = fwrite(buf, sizeof(buf[0]), len, fp);
+ fclose(hw);
+ } else {
+ struct timeval tv;
+ int iter = 128;
+no_hwrng:
+ gettimeofday(&tv, NULL);
+ srandom(tv.tv_sec % 3600);
+ while (iter--) {
+ uint32_t i, prng = random();
+
+ for (i = 0; i < sizeof(prng); i++)
+ fputc((prng >> (i * CHAR_BIT)) & UCHAR_MAX, fp);
+ }
}
ret = fclose(fp);
}
--
2.34.1
@@ -0,0 +1,85 @@
From 49c0557cedd8d3c1a2f74d27fa7db83dd529914a Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Sun, 3 Nov 2024 20:49:04 +0100
Subject: [PATCH 6/6] plugins: reduce log level LOG_ERR -> LOG_WARNING
Organization: Addiva Elektronik
These plugins signal success and failure directly to the console, the
user should inspect syslog for more information.
This change is a follow-up to 340cae4, where kernel logs of LOG_ERR and
higher are allowed to log directly to the console. Since syslogd has
not been started before these plugins, the log messages would otherwise
leak to the console.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
plugins/rtc.c | 14 +++++++-------
plugins/urandom.c | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/plugins/rtc.c b/plugins/rtc.c
index a733f75..96203a0 100644
--- a/plugins/rtc.c
+++ b/plugins/rtc.c
@@ -147,7 +147,7 @@ static void file_save(void *arg)
}
if ((rc = time_get(&tm))) {
- logit(LOG_ERR, "System clock invalid, before %s, not saving", rtc_timestamp);
+ logit(LOG_WARNING, "System clock invalid, before %s, not saving", rtc_timestamp);
print_desc(NULL, "System clock invalid, skipping");
} else {
char buf[32] = { 0 };
@@ -238,7 +238,7 @@ static void rtc_save(void *arg)
}
if (rc && errno == EINVAL) {
- logit(LOG_ERR, "System clock invalid, before %s, not saving to RTC", rtc_timestamp);
+ logit(LOG_WARNING, "System clock invalid, before %s, not saving to RTC", rtc_timestamp);
rc = 2;
}
@@ -275,13 +275,13 @@ static void rtc_restore(void *arg)
}
if (rc) {
- logit(LOG_ERR, "Failed restoring system clock from RTC.");
+ logit(LOG_WARNING, "Failed restoring system clock from RTC.");
if (EINVAL == errno)
- logit(LOG_ERR, "RTC time is too old (before %s)", rtc_timestamp);
+ logit(LOG_WARNING, "RTC time is too old (before %s)", rtc_timestamp);
else if (ENOENT == errno)
- logit(LOG_ERR, "RTC has no previously saved (valid) time.");
+ logit(LOG_WARNING, "RTC has no previously saved (valid) time.");
else
- logit(LOG_ERR, "RTC error code %d: %s", errno, strerror(errno));
+ logit(LOG_WARNING, "RTC error code %d: %s", errno, strerror(errno));
print(2, NULL);
@@ -322,7 +322,7 @@ PLUGIN_INIT(plugin_init)
struct tm tm = { 0 };
if (!strptime(rtc_timestamp, RTC_FMT, &tm)) {
- logit(LOG_ERR, "Invalid restore date '%s', reverting to '%s'",
+ logit(LOG_WARNING, "Invalid restore date '%s', reverting to '%s'",
rtc_timestamp, RTC_TIMESTAMP_BEGIN_2000);
rtc_timestamp = RTC_TIMESTAMP_BEGIN_2000;
} else
diff --git a/plugins/urandom.c b/plugins/urandom.c
index b9f6039..6f82779 100644
--- a/plugins/urandom.c
+++ b/plugins/urandom.c
@@ -154,7 +154,7 @@ static void setup(void *arg)
close(fd);
free(rpi);
if (rc < 0)
- logit(LOG_ERR, "Failed adding entropy to kernel random pool: %s", strerror(err));
+ logit(LOG_WARNING, "Failed adding entropy to kernel random pool: %s", strerror(err));
print_result(rc < 0);
return;
fallback:
--
2.43.0
@@ -1,40 +0,0 @@
From b49f55ab3d1aec48bbfdf2106fd8f500406a5348 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Wed, 13 Mar 2024 11:48:47 +0100
Subject: [PATCH 7/7] tmpfiles.d: ignore x/X command, no cleanup at runtime
with Finit
Organization: Addiva Elektronik
Silence log warnings for command x/X (ignore clean for path), because
Finit does not do tmpfiles cleaning at runtime.
x /tmp/podman-run-*
x /tmp/containers-user-*
x /tmp/run-*/libpod
D! /var/lib/containers/storage/tmp 0700 root root
D! /run/podman 0700 root root
D! /var/lib/cni/networks
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/tmpfiles.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/tmpfiles.c b/src/tmpfiles.c
index d62b09f..15b463c 100644
--- a/src/tmpfiles.c
+++ b/src/tmpfiles.c
@@ -434,6 +434,10 @@ static void tmpfiles(char *line)
}
}
break;
+ case 'X':
+ case 'x':
+ dbg("Unsupported x/X command, ignoring %s, no support for clean at runtime.", path);
+ break;
case 'Z':
opts = "-R";
/* fallthrough */
--
2.34.1
@@ -1,41 +0,0 @@
From 052136cb9927379e75bc346d46c86d728f1e33ef Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Tue, 2 Apr 2024 16:03:31 +0200
Subject: [PATCH 08/12] initctl: touch does not respect -n switch
Organization: Addiva Elektronik
Fixes #402
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/serv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/serv.c b/src/serv.c
index e14d5ec..1cace46 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -377,9 +377,9 @@ int serv_touch(char *arg)
fn = conf(path, sizeof(path), arg, 0);
if (!fexist(fn)) {
if (!strstr(arg, "finit.conf"))
- ERRX(72, "%s not available.", arg);
+ ERRX(noerr ? 0 : 72, "%s not available.", arg);
if (is_builtin(arg))
- ERRX(4, "%s is a built-in service.", arg);
+ ERRX(noerr ? 0 : 4, "%s is a built-in service.", arg);
strlcpy(path, finit_conf, sizeof(path));
fn = path;
@@ -387,7 +387,7 @@ int serv_touch(char *arg)
/* libite:touch() follows symlinks */
if (utimensat(AT_FDCWD, fn, NULL, AT_SYMLINK_NOFOLLOW))
- ERR(71, "failed marking %s for reload", fn);
+ ERR(noerr ? 0 : 71, "failed marking %s for reload", fn);
return 0;
}
--
2.34.1
@@ -1,76 +0,0 @@
From 7b501f255b5730ce9da5c72aa6abd87bbf20ba11 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Wed, 3 Apr 2024 06:46:18 +0200
Subject: [PATCH 09/12] initctl: touch does not support template services
Organization: Addiva Elektronik
Fixes #403
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/serv.c | 10 ++++++++++
src/util.h | 20 ++++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/src/serv.c b/src/serv.c
index 1cace46..6344ce3 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -374,6 +374,15 @@ int serv_touch(char *arg)
return serv_list("enabled");
}
+ /* 1. Try /etc/finit.d/enabled/$arg.conf to handle template@.conf */
+ paste(path, sizeof(path), finit_rcsd, "enabled/");
+ strlcat(path, arg, sizeof(path));
+ if (!suffix(path, sizeof(path), ".conf") && fexist(path)) {
+ fn = path;
+ goto touchit;
+ }
+
+ /* 2. Try /etc/finit.d/available/$arg.conf and other combos (legacy) */
fn = conf(path, sizeof(path), arg, 0);
if (!fexist(fn)) {
if (!strstr(arg, "finit.conf"))
@@ -385,6 +394,7 @@ int serv_touch(char *arg)
fn = path;
}
+touchit:
/* libite:touch() follows symlinks */
if (utimensat(AT_FDCWD, fn, NULL, AT_SYMLINK_NOFOLLOW))
ERR(noerr ? 0 : 71, "failed marking %s for reload", fn);
diff --git a/src/util.h b/src/util.h
index 9f0cbf0..80e1c51 100644
--- a/src/util.h
+++ b/src/util.h
@@ -109,6 +109,26 @@ static inline int paste(char *buf, size_t len, const char *dir, const char *file
fisslashdir(dir) ? "" : file[0] == '/' ? "" : "/", file);
}
+/* ensure path has suffix */
+static inline int suffix(char *path, size_t len, const char *sfx)
+{
+ size_t slen = strlen(sfx);
+ size_t plen = strlen(path);
+
+ if (plen < slen)
+ slen = strlcat(path, sfx, len);
+ else {
+ plen -= slen;
+ if (strcmp(&path[plen], sfx))
+ slen = strlcat(path, sfx, len);
+ }
+
+ if (slen >= len)
+ return -1;
+
+ return 0;
+}
+
#endif /* FINIT_UTIL_H_ */
/**
--
2.34.1
@@ -1,117 +0,0 @@
From 6a89e60fc84b90e5f09f61d37892f3b17bd14631 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Wed, 24 Apr 2024 11:33:35 +0200
Subject: [PATCH 10/11] Fix #405: parsing >1 active consoles in tty @console
setups
Organization: Addiva Elektronik
Systems that have the following tty setup and multiple consoles listed
in /sys/class/tty/console/active misbehave:
tty [12345789] @console 0 xterm noclear passenv
Only the first listed console is started properly, the remaining ones
were registered using the wrong :ID and no arguments to getty.
This patch fixes the parsing and re-use of the base paramenters for
all consoles listed in the active file.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/service.c | 45 +++++++++++++++++++++++----------------------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/src/service.c b/src/service.c
index eca9ed0..95a04b8 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1633,10 +1633,16 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
if (type == SVC_TYPE_TTY) {
size_t i, len = 0;
+ char *ptr;
if (tty_parse_args(&tty, cmd, &args))
return errno;
+ if (tty_isatcon(tty.dev))
+ dev = tty_atcon();
+ else
+ dev = tty.dev;
+ next:
if (tty.cmd)
len += strlen(tty.cmd);
else
@@ -1659,14 +1665,22 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
if (!cmd)
return errno;
- if (tty_isatcon(tty.dev))
- dev = tty_atcon();
- else
- dev = tty.dev;
-
/* tty's always respawn, never incr. restart_cnt */
respawn = 1;
- next:
+
+ /* Create name:id tuple for identity, e.g., tty:S0 */
+ ptr = strrchr(dev, '/');
+ if (ptr)
+ ptr++;
+ else
+ ptr = dev;
+ if (!strncmp(ptr, "tty", 3))
+ ptr += 3;
+
+ name = "tty";
+ if (!id || id[0] == 0)
+ id = ptr;
+
svc = svc_find_by_tty(dev);
} else
svc = svc_find(name, id);
@@ -1722,8 +1736,6 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
conf_parse_cond(svc, cond);
if (type == SVC_TYPE_TTY) {
- char *ptr;
-
if (dev)
strlcpy(svc->dev, dev, sizeof(svc->dev));
if (tty.baud)
@@ -1738,19 +1750,6 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
/* TTYs cannot be redirected */
log = NULL;
-
- /* Create name:id tuple for identity, e.g., tty:S0 */
- ptr = strrchr(svc->dev, '/');
- if (ptr)
- ptr++;
- else
- ptr = svc->dev;
- if (!strncmp(ptr, "tty", 3))
- ptr += 3;
- if (!id || id[0] == 0)
- id = ptr;
- strlcpy(svc->name, "tty", sizeof(svc->name));
- strlcpy(svc->id, id, sizeof(svc->id));
}
parse_cmdline_args(svc, cmd, &args);
@@ -1870,8 +1869,10 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
/* continue expanding any 'tty @console ...' */
if (tty_isatcon(tty.dev)) {
dev = tty_atcon();
- if (dev)
+ if (dev) {
+ id = NULL; /* reset for next tty:ID */
goto next;
+ }
}
return 0;
--
2.34.1
@@ -1,89 +0,0 @@
From 340cae4afd0d11979322a6c2f4d40a12ea59817b Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Wed, 24 Apr 2024 12:46:59 +0200
Subject: [PATCH 11/11] Change default behavior, allow kernel logs to console
Organization: Addiva Elektronik
A Linux system booted with the kernel command line option 'quiet' only
logs error (and above) severity messages to the console. For embedded
systems, which is the primary target for Finit, this is what you want
to see.
Hence, and after careful consideration, this patch changes the default
behavior of Finit to allow kernel logs to the console. A build-time
configure flags, --disable-kernel-logging, has been added to restore
legacy behavior.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
configure.ac | 9 +++++++++
src/finit.c | 14 +++++++++++---
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index a4470d0..31f4cff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,6 +71,10 @@ AC_ARG_ENABLE(redirect,
AS_HELP_STRING([--disable-redirect], [Disable redirection of service output to /dev/null]),,[
enable_redirect=yes])
+AC_ARG_ENABLE(kernel_logging,
+ AS_HELP_STRING([--disable-kernel-logging], [Disable kernel logging to console (use 'quiet' instead!]),,[
+ enable_kernel_logging=yes])
+
AC_ARG_ENABLE(logrotate,
AS_HELP_STRING([--disable-logrotate], [Disable built-in rotation of /var/log/wtmp]),,[
enable_logrotate=yes])
@@ -181,6 +185,9 @@ AS_IF([test "x$enable_auto_reload" = "xyes"], [
AS_IF([test "x$enable_kernel_cmdline" = "xyes"], [
AC_DEFINE(KERNEL_CMDLINE, 1, [Dumpster diving after init args from /proc/cmdline])])
+AS_IF([test "x$enable_kernel_logging" = "xyes"], [
+ AC_DEFINE(KERNEL_LOGGING, 1, [Keep kernel warn/err logs to console])])
+
AS_IF([test "x$enable_fastboot" = "xyes"], [
AC_DEFINE(FAST_BOOT, 1, [Skip fsck check on filesystems listed in /etc/fstab])])
@@ -382,6 +389,8 @@ Optional features:
Built-in sulogin......: $with_sulogin $sulogin
Built-in watchdogd....: $with_watchdog $watchdog
Built-in logrotate....: $enable_logrotate
+ Parse kernel cmdline..: $enable_kernel_cmdline
+ Keep kernel logging...: $enable_kernel_logging
Skip fsck check.......: $enable_fastboot
Run fsck fix mode.....: $enable_fsckfix
Redirect output.......: $enable_redirect
diff --git a/src/finit.c b/src/finit.c
index 27b81e9..38b1278 100644
--- a/src/finit.c
+++ b/src/finit.c
@@ -87,14 +87,22 @@ svc_t *wdog = NULL; /* No watchdog by default */
*/
static void banner(void)
{
+#ifndef KERNEL_LOGGING
/*
* Silence kernel logs, assuming users have sysklogd or
- * similar enabled to start emptying /dev/kmsg, but for
- * our progress we want to own the console.
+ * similar enabled to start emptying /dev/kmsg.
+ *
+ * Instead of using `configure --disable-kernel-logging`, we
+ * recommend adjusting the kernel log level in the kernel's
+ * menuconfig, or using sysctl kernel.printk, or setting the
+ * desired log level, on the kernel cmdline, e.g. 'quiet'.
+ *
+ * By default KERNEL_LOGGING is enabled so you can see any
+ * warnings/errors or higher on your system console.
*/
if (!debug && !kerndebug)
klogctl(6, NULL, 0);
-
+#endif
/*
* First level hooks, if you want to run here, you're
* pretty much on your own. Nothing's up yet ...
--
2.34.1
@@ -1,41 +0,0 @@
From 13b107b7b15e6d4823627ea4707a12108fd5a1c7 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Fri, 21 Jun 2024 10:24:35 +0200
Subject: [PATCH] Fix #407: extend initctl poll timeout
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/client.c | 6 ++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/client.c b/src/client.c
index c3fd3aef..a8c06ac4 100644
--- a/src/client.c
+++ b/src/client.c
@@ -29,6 +29,8 @@
#include "client.h"
#include "log.h"
+#define REQUEST_TIMEOUT 15000
+
static int sd = -1;
int client_connect(void)
@@ -85,7 +87,7 @@ int client_request(struct init_request *rq, ssize_t len)
pfd.fd = sd;
pfd.events = POLLOUT;
- if (poll(&pfd, 1, 2000) <= 0) {
+ if (poll(&pfd, 1, REQUEST_TIMEOUT) <= 0) {
warn("Timed out waiting for Finit, errno %d", errno);
return -1;
}
@@ -107,7 +109,7 @@ int client_request(struct init_request *rq, ssize_t len)
pfd.fd = sd;
pfd.events = POLLIN | POLLERR | POLLHUP;
- if ((rc = poll(&pfd, 1, 2000)) <= 0) {
+ if ((rc = poll(&pfd, 1, REQUEST_TIMEOUT)) <= 0) {
if (rc) {
if (errno == EINTR) /* shutdown/reboot */
return -1;
@@ -1,64 +0,0 @@
From ab62b5282b0461b14464a4a5de49f3b1fa0604fe Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Sat, 25 May 2024 19:33:21 +0200
Subject: [PATCH 12/12] runparts: add -b (batch) mode for syslog output
Organization: Addiva Elektronik
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/runparts.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/src/runparts.c b/src/runparts.c
index 5af2c2d..c4225ce 100644
--- a/src/runparts.c
+++ b/src/runparts.c
@@ -26,18 +26,27 @@
#else
#include <sys/prctl.h>
+const char *active_msg = NULL;
+int interactive = 1;
int debug;
static void print_desc(const char *prefix, const char *msg)
{
- fprintf(stderr, "\e[1m[\e[0m\e[1;33m ⋯ \e[0m\e[1m]\e[0m %s %s", prefix, msg);
+ if (interactive)
+ fprintf(stderr, "\e[1m[\e[0m\e[1;33m ⋯ \e[0m\e[1m]\e[0m %s %s", prefix, msg);
+ else
+ fprintf(stderr, "%s %s ...\n", prefix, msg);
+ active_msg = msg;
}
static void print_result(int rc)
{
- if (rc)
- fputs("\r\e[1m[\e[0m\e[1;31mFAIL\e[0m\e[1m]\e[0m\n", stderr);
- else
- fputs("\r\e[1m[\e[0m\e[1;32m OK \e[0m\e[1m]\e[0m\n", stderr);
+ if (interactive) {
+ if (rc)
+ fputs("\r\e[1m[\e[0m\e[1;31mFAIL\e[0m\e[1m]\e[0m\n", stderr);
+ else
+ fputs("\r\e[1m[\e[0m\e[1;32m OK \e[0m\e[1m]\e[0m\n", stderr);
+ } else
+ fprintf(stderr, "[%s] %s\n", rc ? "FAIL" : " OK ", active_msg ?: "");
}
void sig_unblock(void)
@@ -193,8 +202,11 @@ int main(int argc, char *argv[])
int rc, c, progress = 0, sysv = 0;
char *dir;
- while ((c = getopt(argc, argv, "dh?ps")) != EOF) {
+ while ((c = getopt(argc, argv, "bdh?ps")) != EOF) {
switch(c) {
+ case 'b': /* batch mode */
+ interactive = 0;
+ break;
case 'd':
debug = 1;
break;
--
2.34.1
+15 -2
View File
@@ -165,7 +165,6 @@ config BR2_PACKAGE_FINIT_PLUGIN_RTC
For lxc/docker application builds you do not need this.
if BR2_PACKAGE_FINIT_PLUGIN_RTC
config BR2_PACKAGE_FINIT_RTC_DATE
string "Fallback RTC date"
help
@@ -184,7 +183,21 @@ config BR2_PACKAGE_FINIT_RTC_DATE
Ensuring the default system time to be closer to actual time
for a period after releasing a firmware image.
endif
config BR2_PACKAGE_FINIT_RTC_FILE
string "Fallback file if /dev/rtc is missing"
help
For systems with broken RTC, where the default value can be
completely random, e.g., a time far in the future, it might
be better to disable the RTC driver or device tree node.
Enable this to allow the RTC plugin to save and restore the
system clock from a file when the plugin does not find any
usable device node.
Since /var/lib/misc is usually persistent across reboots, we
recommend using: /var/lib/misc/rtc
endif # RTC_PLUGIN
config BR2_PACKAGE_FINIT_PLUGIN_TTY
bool "TTY plugin"
+1 -1
View File
@@ -1,5 +1,5 @@
# From https://github.com/troglobit/finit/releases/
sha256 139adcb81ec8a5bb628249f92e2144b20f7e14c53aa56bb86a2fd42c5e7dca11 finit-4.7.tar.gz
sha256 5026965e33f31b8fa4e2e465b9521e805fa01c31cade884c07d0fcff97cd0ddf finit-4.8.tar.gz
# Locally calculated
sha256 2fd62c0fe6ea6d1861669f4c87bda83a0b5ceca64f4baa4d16dd078fbd218c14 LICENSE
+28 -11
View File
@@ -4,7 +4,7 @@
#
################################################################################
FINIT_VERSION = 4.7
FINIT_VERSION = 4.8
FINIT_SITE = https://github.com/troglobit/finit/releases/download/$(FINIT_VERSION)
FINIT_LICENSE = MIT
FINIT_LICENSE_FILES = LICENSE
@@ -13,11 +13,19 @@ FINIT_DEPENDENCIES = host-pkgconf libite libuev
FINIT_INSTALL_STAGING = YES
FINIT_D = $(TARGET_DIR)/etc/finit.d
# Create configure script using autoreconf when building from git
# Create configure script using autoreconf when building from git,
# or when patching any of the GNU build files (*.ac, *.am, etc.)
#FINIT_VERSION = 438d6b4e638418a2a22024a3cead2f47909d72b9
#FINIT_SITE = $(call github,troglobit,finit,$(FINIT_VERSION))
#FINIT_AUTORECONF = YES
#FINIT_DEPENDENCIES += host-automake host-autoconf host-libtool
FINIT_AUTORECONF = YES
FINIT_DEPENDENCIES += host-automake host-autoconf host-libtool
# Strip "" from variables
FINIT_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME))
FINIT_GROUP = $(call qstrip,$(BR2_PACKAGE_FINIT_INITCTL_GROUP))
FINIT_FSTAB = $(call qstrip,$(BR2_PACKAGE_FINIT_CUSTOM_FSTAB))
FINIT_RTC_DATE = $(call qstrip,$(BR2_PACKAGE_FINIT_RTC_DATE))
FINIT_RTC_FILE = $(call qstrip,$(BR2_PACKAGE_FINIT_RTC_FILE))
# Buildroot defaults to /usr for both prefix and exec-prefix, this we
# must override because we want to install into /sbin and /bin for the
@@ -31,7 +39,7 @@ FINIT_CONF_OPTS = \
--disable-contrib \
--disable-rescue \
--disable-silent-rules \
--with-group=$(BR2_PACKAGE_FINIT_INITCTL_GROUP)
--with-group="$(FINIT_GROUP)"
ifeq ($(BR2_ROOTFS_MERGED_USR),y)
FINIT_CONF_OPTS += --exec-prefix=/usr
@@ -40,8 +48,8 @@ FINIT_CONF_OPTS += --exec-prefix=
endif
ifeq ($(BR2_PACKAGE_FINIT_ADVANCED),y)
ifneq ($(BR2_PACKAGE_FINIT_CUSTOM_FSTAB),)
FINIT_CONF_OPTS += --with-fstab=$(BR2_PACKAGE_FINIT_CUSTOM_FSTAB)
ifneq ($(FINIT_FSTAB),)
FINIT_CONF_OPTS += --with-fstab="$(FINIT_FSTAB)"
else
FINIT_CONF_OPTS += --without-fstab
endif
@@ -101,12 +109,18 @@ else
FINIT_CONF_OPTS += --disable-rtc-plugin
endif
ifeq ($(BR2_PACKAGE_FINIT_RTC_DATE),y)
FINIT_CONF_OPTS += --with-rtc-date="$(BR2_PACKAGE_FINIT_RTC_DATE)"
ifneq ($(FINIT_RTC_DATE),)
FINIT_CONF_OPTS += --with-rtc-date="$(FINIT_RTC_DATE)"
else
FINIT_CONF_OPTS += --without-rtc-date
endif
ifneq ($(FINIT_RTC_FILE),)
FINIT_CONF_OPTS += --with-rtc-file="$(FINIT_RTC_FILE)"
else
FINIT_CONF_OPTS += --without-rtc-file
endif
ifeq ($(BR2_PACKAGE_FINIT_PLUGIN_TTY),y)
FINIT_CONF_OPTS += --enable-tty-plugin
else
@@ -119,8 +133,11 @@ else
FINIT_CONF_OPTS += --disable-urandom-plugin
endif
ifneq ($(SKELETON_INIT_COMMON_HOSTNAME),)
FINIT_CONF_OPTS += --with-hostname="$(SKELETON_INIT_COMMON_HOSTNAME)"
ifneq ($(FINIT_HOSTNAME),)
FINIT_CONF_OPTS += --with-hostname="$(FINIT_HOSTNAME)"
else
FINIT_CONF_OPTS += --without-hostname
endif
# Disable/Enable features depending on other packages
@@ -1,3 +1,3 @@
# Locally calculated
sha256 9d9d33b873917ca5d0bdcc47a36d2fd385971ab0c045d1472fcadf95ee5bcf5b LICENCE
sha256 7c8c1cc2234331bb8123893356562cce6731448dbaf5b80db72e34490da55b48 klish-plugin-sysrepo-261c615b903233f63c695f91c1dbe58ac063ba13-br1.tar.gz
sha256 58b6b271912f9331ea78a815a8cec073924b423403868dd9fcc48de0942f49f8 klish-plugin-sysrepo-213cd51aa8863e7ef66944137db3dffc88d58cc1-br1.tar.gz
@@ -4,7 +4,7 @@
#
################################################################################
KLISH_PLUGIN_SYSREPO_VERSION = 261c615b903233f63c695f91c1dbe58ac063ba13
KLISH_PLUGIN_SYSREPO_VERSION = 213cd51aa8863e7ef66944137db3dffc88d58cc1
KLISH_PLUGIN_SYSREPO_SITE = https://github.com/kernelkit/klish-plugin-sysrepo.git
#KLISH_PLUGIN_SYSREPO_VERSION = cdd3eb51a7f7ee0ed5bd925fa636061d3b1b85fb
#KLISH_PLUGIN_SYSREPO_SITE = https://src.libcode.org/pkun/klish-plugin-sysrepo.git
+1
View File
@@ -1,6 +1,7 @@
config BR2_PACKAGE_KLISH
bool "klish"
depends on BR2_USE_MMU
select BR2_PACKAGE_BIN
select BR2_PACKAGE_FAUX
select BR2_PACKAGE_LIBXML2
help
@@ -204,6 +204,14 @@ endif
endif # BR2_PACKAGE_QUAGGA
ifeq ($(BR2_PACKAGE_RNG_TOOLS),y)
define SKELETON_INIT_FINIT_SET_RNGD
cp $(SKELETON_INIT_FINIT_AVAILABLE)/rngd.conf $(FINIT_D)/available/
ln -sf ../available/rngd.conf $(FINIT_D)/enabled/rngd.conf
endef
SKELETON_INIT_FINIT_POST_INSTALL_TARGET_HOOKS += SKELETON_INIT_FINIT_SET_RNGD
endif
ifeq ($(BR2_PACKAGE_SMCROUTE),y)
define SKELETON_INIT_FINIT_SET_SMCROUTE
cp $(SKELETON_INIT_FINIT_AVAILABLE)/smcroute.conf $(FINIT_D)/available/
@@ -0,0 +1 @@
service [S12345789] log rngd -f -- Entropy gathering daemon (rngd)
+1 -1
View File
@@ -10,7 +10,7 @@ STATD_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/statd
STATD_LICENSE = BSD-3-Clause
STATD_LICENSE_FILES = LICENSE
STATD_REDISTRIBUTE = NO
STATD_DEPENDENCIES = sysrepo libev libsrx jansson python-statd libyang
STATD_DEPENDENCIES = sysrepo libev libsrx jansson python-statd libyang libite
STATD_AUTORECONF = YES
define STATD_CONF_ENV
-10
View File
@@ -1,10 +0,0 @@
config BR2_PACKAGE_TEST_MODE
bool "test-mode"
select BR2_PACKAGE_LIBITE
select BR2_PACKAGE_LIBYANG
select BR2_PACKAGE_SYSREPO
select BR2_PACKAGE_LIBSRX
select BR2_PACKAGE_CONFD
help
A plugin to sysrepo that provides functionality required to
run tests with infamy.
-32
View File
@@ -1,32 +0,0 @@
TEST_MODE_VERSION = 1.0
TEST_MODE_SITE_METHOD = local
TEST_MODE_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/test-mode
TEST_MODE_LICENSE = BSD-3-Clause
TEST_MODE_LICENSE_FILES = LICENSE
TEST_MODE_REDISTRIBUTE = NO
TEST_MODE_DEPENDENCIES = sysrepo libite libyang confd
TEST_MODE_AUTORECONF = YES
TEST_MODE_SYSREPO_SHM_PREFIX = sr_buildroot$(subst /,_,$(CONFIG_DIR))_test_mode
COMMON_SYSREPO_ENV = \
SYSREPO_SHM_PREFIX=$(CONFD_SYSREPO_SHM_PREFIX) \
SYSREPOCTL_EXECUTABLE="$(HOST_DIR)/bin/sysrepoctl" \
SYSREPOCFG_EXECUTABLE="$(HOST_DIR)/bin/sysrepocfg" \
SEARCH_PATH="$(TARGET_DIR)/usr/share/yang/modules/confd/"
define TEST_MODE_INSTALL_YANG_MODULES
$(COMMON_SYSREPO_ENV) \
SEARCH_PATH="$(TARGET_DIR)/usr/share/yang/modules/test-mode/" $(BR2_EXTERNAL_INFIX_PATH)/utils/sysrepo-load-modules.sh $(@D)/yang/test-mode.inc
endef
define TEST_MODE_PERMISSIONS
/etc/sysrepo/data/ r 660 root wheel - - - - -
/etc/sysrepo/data d 770 root wheel - - - - -
endef
define TEST_MODE_CLEANUP
rm -f /dev/shm/$(TEST_MODE_SYSREPO_SHM_PREFIX)*
endef
TEST_MODE_PRE_INSTALL_TARGET_HOOKS += TEST_MODE_CLEANUP
TEST_MODE_POST_INSTALL_TARGET_HOOKS += TEST_MODE_INSTALL_YANG_MODULES
$(eval $(autotools-package))
+1 -1
View File
@@ -1,5 +1,5 @@
# Host build of critical components, for Coverity Scan mostly
APPS = confd execd factory keyack statd
APPS = bin confd execd factory keyack statd
.PHONY: all
all:
+31
View File
@@ -0,0 +1,31 @@
*~
*.o
copy
erase
files
/aclocal.m4
/autom4te.cache/
/aux
/clixon.xml
/compile
/config.h
/config.h.in
/config.guess
/config.log
/config.status
/config.sub
/configure
/depcomp
/.deps/
/install-sh
/libtool
/ltmain.sh
/m4
/missing
GPATH
GRTAGS
GTAGS
Makefile
Makefile.in

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