Store FIT headers separately on aux, and place the raw SquashFS images
on primary/secondary. This removes the need to muck about with the
device mapper to setup the rootfs, and it allows us to boot using
syslinux files.
With the recent `if:<cond>` addition to Finit we can simplify a lot of
the logic for disabling and enabling features in Infix. Standardizing
on conditions that Finit provides.
We create boot/netconf, boot/etc, and boot/profinet conditions early,
after all filesystems have been mounted (and cleaned), so they are all
set before Finit loads its configuration files in runlevel S.
The default is still to boot into a managed NETCONF mode, since the end
goal remains to integrate PROFINET as yet another service. The other
mode, native /etc, should then be the only exception.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Split tmpfiles config in two, one for snmpd and one for profeth.
Add logging and redirect profeth logs to /log/profinet.log with
default log rotation.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This is not the full environment used by U-Boot, just the bits needed
for U-Boot to know which slot to boot and for Infix to know how the
boot process went.
U-Boot will selectively import/export only these keys during boot,
which avoids a malicious user from altering the boot in a way that
might bypass signature validation.
The blkmap patches were not included in the original U-Boot Secure
Boot changeset.
Fixes: d243c80 ("aarch64: Convenience target to configure a QEMU compatible U-Boot")
Now that the uncut FIT is stored in primary/secondary, we don't create
any FIT header files.
Fixes: 499a8f7 ("common: Create (e)MMC image with redundant root filesystems")
Now that we have dialog on target we can add a user-friendly factory
reset dialog. The new `yorn` script handles any form of yes-or-no
question, with or without dialog, to call a command.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This change adds support for setting the system boot mode to native /etc
style for systems where it's difficult, or close to impossible, to set
the Finit boot condition to 'etc'.
Note: this also moves the check for factory reset before we check if we
should use_etc, rather than NETCONF. This to allow clearing out any of
the state files (.use_etc) before proceeding to boot in the default mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This image contains:
- A partition to hold bootloader config ("aux").
- Two redundant copies of the FIT framed rootfs (which will be
upgradable by RAUC from within Infix).
- A partition to store critical configuration data ("cfg")
- A partition to store data created dynamically by Infix ("var")
mkimage will generate an FIT image containing a signature of the
rootfs, where the data is kept out of the DTB data structure, i.e.:
.---------.
| DTB |
:---------:
| Padding |
:---------:
| |
| |
| rootfs |
| |
| |
'---------'
This is the on-disk format of Infix. At boot, we extract kernel and
device trees from the rootfs, and then use Linux's device mapper to
create a virtual block device that exposes the rootfs (squash).
This ensures that U-Boot images that we build can always:
- Rely on the environment extensions in env.dtsi being available
- Access the configured signing keys
- Use SD/eMMC cards
- Extract files from SquashFS filesystems
All of which are foundations that we intend to design our image
loading around.
Ensure that whenever U-Boot is built:
- The chosen signing key and is converted to the expected format and
installed in the build tree.
- Infix's environment extensions are installed in the build tree
Keep a shared in-tree key that can be used to sign Infix images during
development. The idea is that this will also be included in developer
builds of U-Boot.
Keep the transient files in the system's /mnt/tmp, and only persist
startup_db in /cfg.
This design (with a symlink) means that /cfg/startup_db _must_ exist
in order for clixon to start properly. Therefore run
/lib/infix/prep-db to take care of this.
At the moment, this just creates an empty factory config, and copies
it to startup if it doesn't exist. In the future, prep-db could select
a factory config based on some hardware identifier, or even build one
dynamically, based on available ports etc.
This reverts commit 2ddf9448fe.
Two reasons:
1. We will move to a debian-style /etc/ssh/ssh_config.d/ structure
soon.
2. In a managed scenario, NETCONF could be disabled, so mech should be
responsible for activating it at boot.
The allows remote NETCONF access to the Clixon example (for now). This
will be replaced later with the Clixon Infix system.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Double quoting to prevent word splitting
- local keyword is undefined in POSIX sh
- `-m 0755` only applies to deepest directory (ignore)
- Useless cat
- Redirect to null, lilke the other mount_rw statements
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
In the new model, we have three sources of storage:
- /mnt/var: Mountpoint for a disk with the label "var"
- /mnt/cfg: Mountpoint for a disk with the label "cfg"
- /mnt/tmp: Mountpoint for a ramdisk
These sources are used for the following overlays:
- **/cfg, /home, /root**: /mnt/cfg if available, else /mnt/tmp
- **/etc**: /mnt/cfg if available and the boot/etc finit condition is
set, else /mnt/tmp
- **/var**: /mnt/var if available, else /mnt/tmp
- **/var/lib**: /mnt/var if available, else /mnt/cfg if available,
else /mnt/tmp
See board/common/rootfs/lib/infix/mnt for more information.