./common/ contains files that are common to all hosts, they can be copied to
host directories with just merge-with-common and can be removed with
just remove-common.
These steps are done automatically during build steps.
Modes can be re-generated with just make-modes when adding new files, but be
wary if existing entries change from previous values.
Persistent disks should be added manually to virtual machines, partitioned manually and then can be added to fstab creation in the IMGBUILD. This is so no automatic process touches them.
Attach a new disk to the virtual machine, it should show up as /dev/vdb.
# Deps if not installed
apk add uuidgen findmnt
# Partitioning
parted -s -- /dev/vdb mklabel msdos \
mkpart primary 4096s -1s
partprobe /dev/vdb
# Generate disk UUID, save this
uuidgen
# Formatting
mkfs.ext4 -q -F -U SAVED_UUID /dev/vdb1
# Mount
mkdir /mnt/persistent
mount /dev/vdb1 /mnt/persistent
# Save mount options
findmnt -no OPTIONS /dev/vdb1
Add to the end of the IMGBUILD setup function:
echo "UUID=REPLACE_WITH_UUID /mnt/persistent ext4 REPLACE_WITH_OPTIONS 0 2" >> "${imgroot}/etc/fstab"