[Unit] Description=Memory-backed directories # What brintos-sysinit runs first under busybox init: on a read-only root, the # tmpfs over the homes, /var/spool and /var/cache, before anything writes there. DefaultDependencies=no After=systemd-remount-fs.service Before=local-fs.target systemd-tmpfiles-setup.service systemd-journal-flush.service [Service] Type=oneshot RemainAfterExit=yes # systemd mounts /run shared, and the script moves each home's tmpfs out of # /run/brintos-volatile: a mount under a shared one cannot be moved. ExecStartPre=-/bin/mount --make-private /run ExecStart=/usr/sbin/brintos-volatile # A write probe, not ConditionPathIsReadWrite: on a snapshot the superblock # stays read-write and only the backend refuses. ExecStartPost=/bin/sh -c 'mkdir /var/lib/.brintos-rw.$$$$ 2>/dev/null && rmdir /var/lib/.brintos-rw.$$$$ || : > /run/brintos-read-only-root' [Install] WantedBy=local-fs.target