Consolidate empty password and $factory$ hash extraction to a common
function called before set_pasword(). The purpose is to ensure all
error handling and log messages are in the same place, except for
missing factory-password-hash, which is now treated as a PANIC and
logged to /dev/console.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When syncing interface defaults at boot, some settings are read-only and
some are write-only. Filter these out so sysctl does not log any bogus
Permission Denied messages.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
cp: cannot stat '/home/lazzer/Documents/addiva/infix/board/common/rootfs/bin/onieprom': No such file or directory
Signed-off-by: Mattias Walström <lazzer@gmail.com>
From https://en.wikipedia.org/wiki/exFAT:
... a file system optimized for flash memory such as USB flash
drives and SD cards.
... has been adopted by the SD Association as the default file
system for SDXC and SDUC cards larger than 32 GB.
The exfatprogs is also a default installed package on most modern
distros, compared to dosfstools (mkfs.vfat) which is not.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This change builds on top of the earlier work to bootstrap Infix YANG
modules at build time. Adding a step at the end of post-build.sh to
call the yangdoc tool. The resulting yangdoc.html is a stand-alone HTML
file of (almost) all YANG nodes. Almost because some top-level nodes
are unused by Infix atm. and have been filtered out for readability.
Fixes#432
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
With the recent changes to confd to support: hostname format specifiers,
$factory$ default keyword for password, and on-the-fly generation of the
NETCONF SSH host keys, the system no longer depend on the very intricate
confd gen-* scripts to create factory-config and failure-config.
This patch set adds support for detecting and installing product/vendor
specific static factory-config and failure-config files. See the confd
README for details.
To facilitate generation, e.g., of the NETCONF SSH host keys, the confd
daemon must be running when bootstrapping the first startup-config from
eithe generated or static factory-config. This is why the bootstrap and
load helper scripts have been changed.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This patch adds support for an empty "genkey" pair in the keystore for
the NETCONF hostkeys. Primarily intended for static factory-config.
When a configuration is loaded and confd detects a missing public or
private key in the "genkey" asymmetric key, it loads generated keys
from disk and store in the running datastore.
Fixes#435
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Add metadata 'version' field to ietf-system to be able to detect .cfg
file version. Fixes#308
Add early boot script to automatically migrate configuration files of
older version to new syntax. Fixes#178
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Since a user has access to the shell in developer mode, we might as
well allow booting through the standard boot scripts as well. This
means that a product with a bootloader only accepting images signed by
Company A can now be configured to netboot a regular developer image
without any special user interaction.
We no longer need to set bootdelay on development platforms. You can
now always get to the bootmenu with a Ctrl-C, from there you can get
to the shell if developer mode is enabled. Therefore, override the
default dev-mode detection to statically enable it on the CRB.
If we receive an option 67 (bootfile) matching http://IP/rootfs.itb,
use U-Boot's wget implementation to download the file. The web server
must listen on port 80. tftp:// is also supported.
Without a protocol prefix, assume that the bootfile should be fetched
using TFTP from ${serverip}.
Generate a boot menu, accessible with C-c during a short window, where
a user can interactively select a custom boot source and/or trigger a
factory reset of the device.
With this in place, we should always be able to unbrick a device, as
the image can be fed over the network, and local data can be ignored
by opting in to a factory reset.
By default, Linux will map an IP packet's TOS field into skb->priority
when acting as a router. Unfortunately this is only globally
configurable (per network namespace), which leaves us with the
following dilemma:
If we keep reclassification enabled, then a setup like this...
vlan1 vlan2
\ /
br0
/ \
e1 e2
...would likely not work as expected because any priority information
from hardware, that might be mapped to skb->priority via vlan1's
ingress-qos-map, would then be replaced by the standard TOS-mapping on
the routing boundary.
On the other hand, if we disable reclassification, then we won't be
able to source priority information from the TOS field when no other
source is available, as is the case when the source interface is a
regular NIC.
Given that the primary use-case is to run on switchdev ports, we will
most likely always have priority information available from hardware,
which is why we opt to disable the reclassification.
If this ever becomes configurable per interface, then we could open up
the configuration to let users define the policy of which layer's
priority should take precedence.
Opportunistically look for interfaces with multiple transmit queues
and hardware support for the mqprio queuing discipline. For every
matching interface, set up mappings from kernel-internal packet
priorities, via traffic classes, to transmit queues such that as many
high priorities as possible are scheduled on separate queues.
This makes it easier to add more scripts without having to update the
finit config file, and it clarifies which of the scripts in
/libexec/infix only execute at boot.
This enables access to /restconf on port 443 over HTTP/1.1 and HTTP/2
via rousette when enabled.
Also, slight refactor to allow including /restconf and /netbrowse as
optional locations in the main servier directive.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When interface naming switched to use 1-based indices instead of
0-based, the topology generation was overlooked thus breaking tests
against a `make run` instance.
Bring everything back in sync.
- Add sshd 'UsePAM yes'
- Buildroot automatically adds and enables:
- /etc/pam.d/ with authentication for login, sshd, and sudo
- PAM support in BusyBox login
Also, prepare for adding RADIUS authentication support to ietf-system
the only tricky part is testing against a RADIUS server.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Since we don't have any VPD defined on this board, supply a default
password hash via the device tree instead.
Also, specify the path to external USB port, so that Infix will pick
it up in ietf-hardware.
Provide a patched device tree that:
- Uses the correct phy-mode for eth2, allowing it to be probed
properly
- Wires up the interrupt signal to the GPIO expander, so that the SFP
cage's I/O lines can be configured as interrupts, rather than having
to poll them
Assume that the caller always want to create a new partition table,
even in scenarios where one already exists. This allows devices to be
reprovisioned with a newer image, for example.
Fixes#394
This is not a production target, so we choose the more developer
friendly option of allowing the boot process to be interrupted.
Also, remove the old update cruft and rely on Marvell's `bubt`
instead.
The BootROM wants the bootloader to be located on LBA1, which is not
ideal when using a GPT to describe the partition table.
Make sure the `bubt` command targets SPI by default.
This fixes a serious security regression introduced late in the v24.04
release cycle. The root cause is the placement of the shadow file in
the rootfs overlay, which causes any changes made by the Buildroot
setting BR2_TARGET_ENABLE_ROOT_LOGIN to be discarded/overwritten just
before creating the squashfs image.
The fix in this commit relocates all files from b4eb450 to the skeleton
in Infix, package/skeleton-init-finit/skeleton/etc, which is one of the
first packages to be installed when starting a build.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>