Set the IP origin "random" for avahi IPv4LL addresses. The reason we
use random and not link-layer for link-local IPv4 addresses is the
fact that they are not based on link-layer info, such as IPv6 eui64
generated LL addresses.
Signed-off-by: Richard Alpe <richard@bit42.se>
Add a pristine copy of the current version of avahi-autoipd.action.
This script will be modified by us in later commits.
Signed-off-by: Richard Alpe <richard@bit42.se>
This currently includes cli-pretty tests. It could be executed
separately to clarify test results in github actions. This commit
includes it in the main test execution. The most important thing is
that it's executed.
Signed-off-by: Richard Alpe <richard@bit42.se>
Flush addresses during shutdown and renewal with new address.
This is kind of a hack and needs further testing.
Signed-off-by: Richard Alpe <richard@bit42.se>
This fixes one bug in Infix, namely that dhcp removes all other
statically configured addresses. However it introduces a new one
where dhcp renewals with new ip addresses are added as "duplicates",
we fix this in a later commit in this patchset.
Signed-off-by: Richard Alpe <richard@bit42.se>
Add a pristine version of default.script to our local board override.
The reason for this commit is to track changes we do to it.
Signed-off-by: Richard Alpe <richard@bit42.se>
This file is read by iproute2 and creates valid names for ip proto.
Such as "static" in:
ip addr add dev e0 192.168.1.1/24 proto static
Signed-off-by: Richard Alpe <richard@bit42.se>
This allows us to show empty values easier, while not affecting the
if statements.
This allows for a greater flexibility in which values are shown and
not. For example, we want to show empty columns for data that the
user adds/removes, such as IP addresses.
...
ipv4 addresses :
...
However, we don't want to show empty columns for information that
should never exist for a particular interface type.
Signed-off-by: Richard Alpe <richard@bit42.se>
The old version (bash) where slow and cluttered. This version is much
faster and easier to read / maintain.
Signed-off-by: Richard Alpe <richard@bit42.se>
The port marker is intended to be used as a hint to the
auto-factory-config generator, so that it can create a bridge for all
switch ports by default. Therefore, revert to only include ports that
devlink reports as "flavour physical".
If we want to test this functionality in QEMU, we can use Rocker, the
virtual switch, instead.
The old assumption was that only virtual links would have specific
"linkinfo" data. However, somewhere between 5.19 and 6.1, DSA ports
gained the ability to report its "conduit" interface via the
"linkinfo" attribute. That's great, but unfortunately it broke our
heuristic assumptions.
The new assumption is that only physical ports will report a
"parentbus" attribute. Let's see how long that will last :)
Bootstrap and daemon-specific helper scripts, sometimes known as foot
guns, should not be in $PATH.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The script resides with confd and sets up our system for confd, this
should make it easier to rememeber where it's located.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
On some system, certain interfaces are not usable by an end-user. The
canonical example of this is the ethernet MAC connected to a switch,
i.e. the DSA port.
Avoid having these be picked up in the generated factory-config, which
would be confusing to a user, by classifying them as "internal" ports
to be ignored by confd and friends.
For some reason, the controller disables the bus power sometime after
it was enabled by the driver. The reference manual says, in Table 645,
about the SD_BUS_POWER bit:
> ... It will be cleared if one of the following occurs: the
> sd_bus_vlt and the voltage support in the Capabilities Register 1 do
> not match or if a card removal state was detected.
Further investigation will be needed to find the (electrical?)
root-cause of this issue.
The kernel's mounting of the rootfs may race against the underlying
device being probed - especially for media like MMC cards and USB
sticks.
Therefore, tell the kernel to wait for the root device to show up.
In the future we want to build disk images from builds where we
haven't locally built Infix, we've just downloaded an existing
release. In those cases we also have to create rauc.status, even
though we're not creating a bundle.
This is the layout expected by the "distro boot" effort in U-Boot.
As far as I understand, the contract is:
- U-Boot built for `fooboard` by `vendor`, will set the `fdtfile`
variable to `vendor/fooboard.dtb` - or more precisely: matching
whatever path the dtb is built at in the kernel tree.
- A distro (e.g. Infix) then just needs to specify the `fdtdir` in its
syslinux config (/boot in our case), and U-Boot will be able to find
the correct dtb.
Make the traditional FITs smaller by:
- Filtering out the kernel image from the rootfs, since the FIT way is
to ship it separately.
- Gzipping the kernel in the FIT, since aarch64 uses the uncompressed
"Image" format, and squashfs won't take care of it for us.
Add source, such as "ethernet" to the show ietf interfaces command.
This is translated from the somewhat obscure ietf type, such as
iana-if-type:ethernetCsmacd => ethernet
Signed-off-by: Richard Alpe <richard@bit42.se>
Replace the old "ip" output with data from the sysrepo operational
datastore. This data is piped through the new json-cfg-pretty script,
which formats the data in a nice human readable way.
Signed-off-by: Richard Alpe <richard@bit42.se>
This patch adds a new infix-interface-type, derived from the IANA base
type, allowing us to limit the list of supported native interface types.
Basing on IANA interface type ensure compatibility with other models,
e.g., standard/ieee/published/802.3/ieee802-ethernet-interface.yang,
which attaches itself to all interfaces of type ianaift:ethernetCsmacd.
Tested with yanglint and in Infix using ieee802-ethernet-interface.yang,
the 'ethernet' container was properly attached to interfaces of type
infixift:ethernet.
Tab completion in the CLI now lists only the supported types.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This patch restricts the possible user shells to a subset of the list in
/etc/shells, which is generated by Buildroot. The default is 'false' to
prevent accidental shell access for non-admin role users.
The default shell for the admin user is now /bin/clish, which can be
further locked down before Infix v24.02 LTS.
In case of internal error the default fallback shell is now set to the
customizable LOGIN_SHELL, which currently is /bin/bash.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Always respect the requested model to emulate. Before this change, a
device configured to run in TAP mode would ignore a user's requested
model and always emulate a e1000.
This worked on x86_64 where that driver is part of the kernel, but
that is not true for aarch64.
- Always supply a mactab. It was very confusing that the interface
names would change, in Infix, depending on the selected networking
mode.
- Remove old decoy variables that were assigned but never used
anywhere.
- Separately setup the host and target side of a nic (i.e. use a
-netdev/-device pair instead of the -nic shortcut). This lets us
share the host side setup across all modes.
This reverts an earlier change where nano was made the default editor in
a misguided attemt by yours truly to accomodate beginner users.
With the recent improvements of the CLI and the fact that the NETCONF
support has matured greatly, the need for a user-friendly editor have
diminished drastically. Editing system files is now limited to devs
and the core team prefers Mg over nano and vi.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This is not just for online viewing, these markdown documents are also
made available in the CLI itself from admin-exec as:
help [introduction | keybindings | tutorial]
With this commit we also add lowdown and the real less application to
be the Infix help system.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit enables a basic sanity check of usernames in BusyBox that by
default is disabled (!). The rules enabled by this are:
- the user or group name should consist only of letters, digits,
underscores, periods, and dashes¹, and not start with a dash (as
defined by IEEE Std 1003.1-2001), or periods²
- for compatibility with Samba machine accounts, $ is supported at the
end of names
- max length of user or group name is 256 chars
Changes in this commit also includes a sync with latest BusyBox 1.36,
which adds: tree, tsort, SHA hw acceleration, and a separate script
for udhcpc6.
_____
¹) The documentation actually mentions "and at-signs" as well, but that
has been explicitly removed from the source code.
²) The documentation does not mention that leading periods are not
allowed, though this is also explicitly mentioned in the source code.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Add /bin/clish (symlink) to /etc/shells, as well as the traditional
/bin/{true,false} for completeness
- Validate shell string, with fallback to /bin/bash and /bin/sh
- Step infix-system revision, keeping old model in tree
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This allows an application to set a larger socket receive buffer size.
The default size is left unchanged (212992). 1MB is arbitrary chosen.
The main reason for this is to allow netlink kernel sockets to
hold more interface data while user-space is processing it. Typically
useful during main configuration changes where lots of kernel side
changes occur in short period of time, such as VLAN creation.
Signed-off-by: Richard Alpe <richard@bit42.se>