Skip to content

Commit 5b100fb

Browse files
committed
doc: collapse about + introduction into a single index.md
In the spirit of my uni English teacher; "simplify, Simplify, SIMPLIFY!" This commit collapses the About and Introduction into a single document, doc/index.md. Also, relocate the System Boot section to doc/boot.md, which we alrady have and covers the initial bootloader part of it. Signed-off-by: Joachim Wiberg <[email protected]>
1 parent dc8fc40 commit 5b100fb

File tree

6 files changed

+165
-156
lines changed

6 files changed

+165
-156
lines changed

doc/boot.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,77 @@ is also possible to permanently configure the default partition from
124124
Infix using the [Bootloader Configuration](#configuration).
125125

126126

127+
## System Boot
128+
129+
After the system firmware (BIOS or and [boot loader](boot.md) start
130+
Linux the following happens. The various failure modes, e.g., missing
131+
password in VPD, are detailed later in this section.
132+
133+
![System boot flowchart](img/fail-secure.svg)
134+
135+
1. Before mounting `/cfg` and `/var` partitions, hosting read-writable
136+
data like `startup-config` and container images, the system first
137+
checks if a factory reset has been requested by the user, if so it
138+
wipes the contents of these partitions
139+
2. Linux boots with a device tree which is used for detecting generic
140+
make and model of the device, e.g., number of interfaces. It may
141+
also reference an EEPROM with [Vital Product Data](vpd.md). That is
142+
where the base MAC address and per-device password hash is stored.
143+
(Generic builds use the same MAC address and password)
144+
3. On every boot the system's `factory-config` and `failure-config` are
145+
generated from the YANG[^2] models of the current firmware version.
146+
This ensures that a factory reset device can always boot, and that
147+
there is a working fail safe, or rather *fail secure*, mode
148+
4. On first power-on, and after a factory reset, the system does not
149+
have a `startup-config`, in which case `factory-config` is copied
150+
to `startup-config` -- if a per-product specific version exists it
151+
is preferred over the generated one
152+
5. Provided the integrity of the `startup-config` is OK, a system
153+
service loads and activates the configuration
154+
155+
### Failure Modes
156+
157+
So, what happens if any of the steps above fail?
158+
159+
**VPD Fail**
160+
161+
The per-device password cannot be read, or is corrupt, so the system
162+
`factory-config` and `failure-config` are not generated:
163+
164+
1. First boot, or after factory reset: `startup-config` cannot be
165+
created or loaded, and `failure-config` cannot be loaded. The
166+
system ends up in an unrecoverable state, i.e., **RMA[^3] Mode**
167+
2. The system has booted (at least) once with correct VPD and password
168+
and already has a `startup-config`. Provided the `startup-config`
169+
is OK (see below), it is loaded and system boots successfully
170+
171+
In both cases, external factory reset modes/button will not help, and
172+
in the second case will cause the device to fail on the next boot.
173+
174+
> The second case does not yet have any warning or event that can be
175+
> detected from the outside. This is planned for a later release.
176+
177+
**Broken startup-config**
178+
179+
If loading `startup-config` fails for some reason, e.g., invalid JSON
180+
syntax, failed validation against the system's YANG model, or a bug in
181+
the system's `confd` service, the *Fail Secure Mode* is triggered and
182+
`failure-config` is loaded (unless VPD Failure, see above).
183+
184+
> [!TIP]
185+
> Please see the [Branding & Releases](branding.md) document for how to
186+
> provide per-product `failure-config`, or `factory-config` to suit your
187+
> product's preferences.
188+
189+
*Fail Secure Mode* is a fail-safe mode provided for debugging the
190+
system. The default[^4] creates a setup of isolated interfaces with
191+
communication only to the management CPU, SSH and console login using
192+
the device's factory reset password, IP connectivity only using IPv6
193+
link-local, and device discovery protocols: LLDP, mDNS-SD. The login
194+
and shell prompt are set to `failure-c0-ff-ee`, the last three octets of
195+
the device's base MAC address.
196+
197+
127198
System Upgrade
128199
--------------
129200

@@ -337,6 +408,18 @@ If `var` is not available, Infix will still persist `/var/lib` using
337408
`cfg` as the backing storage.
338409

339410
[^1]: See [Upgrade & Boot Order](upgrade.md) for more information.
411+
[^2]: YANG is a modeling language from IETF, replacing that used for
412+
SNMP (MIB), used to describe the subsystems and properties of
413+
the system.
414+
[^3]: Return Merchandise Authorization (RMA), i.e., broken beyond repair
415+
by end-user and eligible for return to manufacturer.
416+
[^4]: Customer specific builds can define their own `failure-config`.
417+
It may be the same as `factory-config`, with the hostname set to
418+
`failure`, or a dedicated configuration that isolates interfaces, or
419+
even disables ports, to ensure that the device does not cause any
420+
security problems on the network. E.g., start forwarding traffic
421+
between previously isolated VLANs.
422+
340423

341424
[2]: netboot.md
342425
[FIT]: https://u-boot.readthedocs.io/en/latest/usage/fit.html

doc/branding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ at boot. This also ensures the device can always be restored to a known
5050
state after a factory reset, since the `factory-config` is guaranteed to
5151
be compatible with the YANG models for the given software version. (For
5252
more information on how the system boots, please see the section [Key
53-
Concepts](introduction.md#key-concepts) in the Introduction document.)
53+
Concepts](index.md#key-concepts) in the Introduction document.)
5454

5555
However, for custom builds of Infix it is possible to override this with
5656
a single static `/etc/factory-config.cfg` (and failure-config) in your

doc/index.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Introduction
2+
13
![Infix - Linux <3 NETCONF](logo.png){ align=right width="480" }
24

35
Welcome to Infix, your immutable, friendly, and secure operating system!
@@ -11,3 +13,80 @@ regression test system solely relies on NETCONF and RESTCONF.
1113
> [!TIP]
1214
> The CLI documentation is also available from inside the CLI itself
1315
> using the `help` command in admin-exec mode.
16+
17+
This document provides an introduction of key concepts, details how
18+
the system boots, including failure modes, and provides links to
19+
other documents for further study.
20+
21+
## Command Line Interface
22+
23+
The command line interface (CLI, see-ell-i) is the traditional way of
24+
interacting with single network equipment like switches and routers.
25+
Today users have come to expect more advanced graphical GUIs, like a web
26+
interface, to manage a device or NETCONF-based tools that allow for
27+
managing entire fleets of installed equipment.
28+
29+
Nevertheless, when it comes to initial deployment and debugging, it
30+
is very useful to know how to navigate and use the CLI.
31+
32+
> [!INFO]
33+
> For more information, see the [CLI Introduction](cli/introduction.md)
34+
> and the [CLI Configuration Tutorial](cli/configure.md).
35+
36+
## Key Concepts
37+
38+
The two modes in the CLI are the admin-exec and the configure context.
39+
40+
However, when logging in to the system, from the console port or SSH,
41+
you land in a standard UNIX shell, Bash. This is for advanced users
42+
and remote scripting purposes (production equipment):
43+
44+
```
45+
Run the command 'cli' for interactive OAM
46+
47+
admin@example:~$
48+
```
49+
50+
To enter the CLI, follow the instructions, for interactive Operations,
51+
Administration, and Management (OAM), type:
52+
53+
```
54+
admin@example:~$ cli
55+
admin@example:/>
56+
```
57+
58+
The prompt, constructed from your username and the device's hostname,
59+
changes slightly. You are now in the admin-exec context of the CLI.
60+
Here you can inspect system status and do operations to debug networking
61+
issues, e.g. ping. You can also enter configure context by typing:
62+
`configure` followed by commands to `set`, `edit`, apply changes using
63+
`leave`, or `abort` and return to admin-exec.
64+
65+
> [!TIP]
66+
> If you haven't already, the [CLI Introduction](cli/introduction.md)
67+
> would be useful to skim through at this point.
68+
69+
## Datastores
70+
71+
The system has several datastores (or files):
72+
73+
- `factory-config` consists of a set of default configurations, some
74+
static and others generated per-device, e.g., a unique hostname and
75+
number of ports/interfaces. This file is generated at boot.
76+
- `failure-config` is also generated at boot, from the same YANG models
77+
as `factory-config`, and holds the system *Fail Secure Mode*
78+
- `startup-config` is created from `factory-config` at boot if it does
79+
not exist. It is loaded as the system configuration on each boot.
80+
- `running-config` is what is actively running on the system. If no
81+
changes have been made since the system booted, it is the same as
82+
`startup-config`.
83+
- `candidate-config` is created from `running-config` when entering the
84+
configure context. Any changes made here can be discarded (`abort`,
85+
`rollback`) or committed (`commit`, `leave`) to `running-config`.
86+
87+
> [!TIP]
88+
> Please see the [Branding & Releases](branding.md) document for more
89+
> in-depth information on how `factory-config` and `failure-config` can
90+
> be adapted to different customer requirements. Including how you can
91+
> override the generated versions of these files with plain per-product
92+
> ones -- this may even protect against some of the failure modes below.

doc/introduction.md

Lines changed: 0 additions & 152 deletions
This file was deleted.

doc/upgrade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Continued configuration is done as with any unit after factory reset.
418418

419419
[1]: netboot.md
420420
[2]: https://github.com/kernelkit/infix/blob/main/src/confd/yang/confd/infix-system-software.yang
421-
[3]: introduction.md#system-boot
421+
[3]: boot.md#system-boot
422422
[4]: management.md#console-port
423423
[5]: scripting.md#-backup-configuration-using-sysrepocfg-and-scp
424424

mkdocs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ exclude_docs: |
1414
TODO.org
1515
1616
nav:
17-
- About: index.md
18-
- Introduction: introduction.md
17+
- Introduction: index.md
1918
- CLI:
2019
- Introduction: cli/introduction.md
2120
- Configuration: cli/configure.md

0 commit comments

Comments
 (0)