This is a shell script that runs as a systemd generator very early in the boot process. It is intended to be used on a device with an A/B partition scheme, in coordination with RAUC. Because RAUC does not handle mounting additional slots into the filesystem tree, this script's job is to automatically select and mount additional partitions using generated systemd
/usr/lib/systemd/system-generators. Ensure it is executable. Then, write a configuration file; see below.
The configuration file is an INI-formatted file placed at
/etc/bootslot-mounts.conf. This has three sections, as follows.
[mountpoints] section specifies names for mountpoints referred to in
slot sections. The key of each entry is a "friendly name" of the mountpoint, and the value is the absolute path in the filesystem.
[slot] section has heading format
BOOTNAME is the value of the
rauc.slot string passed on the kernel command line. The key of each entry in these sections is the friendly name of each mountpoint in the
mountpoints section, and the value is the name of the block device to mount.
mount functionality, such as manually specifying mount options, is not supported at this time.
Specifying the root filesystem device is not supported (although this would not be difficult). But typically this is passed in by the bootloader.
The following configuration file defines two mountpoints,
var, and three slots,
boot mountpoint has an A/B scheme and is backed by either
/dev/mmcblk0p2, depending on the active boot slot. Likewise,
var is mounted at
recovery partition only mounts its special
var and does not mount
boot at all.