Commit Graph
3974 Commits
Author SHA1 Message Date
Richard AlpeandJoachim Wiberg 02ac6a7ea7 src/confd: add the ability to change MotD in cli
Add the ability to set and delete system MotD (Message Of The Day)
using the cli.

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

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

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

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

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

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

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

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

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

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

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

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

Reuse code from mech, verified and working.

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

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

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

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

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

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

Initially we add:

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

Well-known verbs like abort, leave, end, etc.
2023-03-31 17:31:34 +02:00
Joachim Wiberg abd001f57d package/confd: start netopeer2-server along with sysrepo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-31 11:03:44 +02:00
Joachim Wiberg cfef79bbf9 configs: enable netopeer2-cli and add klish to defconfigs
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-31 11:02:45 +02:00
Joachim Wiberg 3cce1e6427 src/confd: drop shortname yang module aliases and load with version
Drop the shortname yang aliases, installed they become copies of
their versioned counterpart, which is not the intention, but also,
no other yang consumer does this.

We'd like to use ly_ctx_load_module() directly, or a slim sysrepo
wrapper of the same, but no such API (load by yang module *name*
with optional revision) exists currently.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-29 13:00:10 +02:00
Tobias Waldekranz d66dc16600 package/klish-plugin-sysrepo: Bump to latest master
This adds completion support for nodes nested under choice and case
nodes.
2023-03-29 11:32:09 +02:00
Joachim Wiberg 24a1eb542d src/confd: add support for enabling yang features
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-29 08:03:37 +02:00
Joachim Wiberg 708b756eba src/confd: minor, coding style
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-29 07:43:48 +02:00
Joachim Wiberg 3bbc5c49cd src/confd: derive YANG module search path from configure
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-29 07:12:13 +02:00
Joachim Wiberg 41db19ffaa src/confd: import updated yang models from mech
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-29 06:22:27 +02:00
Joachim Wiberg 1907bd6a75 src/confd: adjust Denis' copyright year, last changed 2020
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-29 06:22:27 +02:00
Joachim Wiberg d1444b900a package/confd: allow klishd to run in NETCONF mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:53:55 +02:00
Joachim Wiberg 737f99e35e package/klish: make sure to enable libxml2 in configure
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:53:41 +02:00
Tobias WaldekranzandJoachim Wiberg b549ddd88a package/klish-plugin-sysrepo: Add version 1.0.0
Adds a klish interface to local datastores managed by sysrepo.
2023-03-28 20:29:31 +02:00
Tobias WaldekranzandJoachim Wiberg 5d8e0ec123 package/klish: Add version 3.0.0
Extensible CLI application
2023-03-28 20:29:31 +02:00
Tobias WaldekranzandJoachim Wiberg fdfcac70eb package/faux: Add version 2.1.0
Used by the upcoming klish package
2023-03-28 20:29:31 +02:00
Joachim Wiberg 7a69c21e9d configs: change default NETCONF to use sysrepo instead of clixon
Extended evaluation of sysrepo due to problems parsing yang v1.1 models
with the built-in yang parser in Clixon.  Problems not seen with libyang

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:27:18 +02:00
Joachim Wiberg b1be357a41 package/confd: new package
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-03-28 20:27:18 +02:00