Dynamically generates mountpoints based on the active RAUC bootslot (barebox version)
|LICENSE||1 year ago|
|README.md||1 year ago|
|bootslot-mounts||1 year ago|
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
slotsections. 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
BOOTNAMEis the value of the
rauc.slotstring passed on the kernel command line. The key of each entry in these sections is the friendly name of each mountpoint in the
mountpointssection, 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.
[mountpoints] boot=/boot var=/var [slot_A] boot=/dev/mmcblk0p1 var=/dev/mmcblk0p5 [slot_B] boot=/dev/mmcblk0p2 var=/dev/mmcblk0p6 [slot_recovery] var=/dev/mmcblk0p7