Create /var/log with systemd-tmpfiles

*systemd-tmpfiles* can create btrfs subvolumes with the `v` entry type.
Using this mechanism instead of the `init-storage` script will allow for
greater flexibility when adding other subvolumes later.

Unfortunately, the default configuration for *systemd-tmpfiles* already
includes an entry for `/var/log` with the `d` (directory) type.  Since
individual entries cannot be overridden, we need to modify this entry.
gentoo
Dustin 2023-03-12 10:27:13 -05:00
parent 328b59e84a
commit 9d507c74ae
2 changed files with 1 additions and 2 deletions

View File

@ -66,7 +66,7 @@ if [ -f /mnt/gentoo/etc/udev/hwdb.bin ]; then
fi fi
rm -f /mnt/gentoo/lib/tmpfiles.d/provision.conf rm -f /mnt/gentoo/lib/tmpfiles.d/provision.conf
sed -i 's:d /var/log :v /var/log :' /mnt/gentoo/lib/tmpfiles.d/var.conf
systemd-tmpfiles --root=/mnt/gentoo -E --exclude-prefix=/var --create systemd-tmpfiles --root=/mnt/gentoo -E --exclude-prefix=/var --create
systemctl preset-all --root=/mnt/gentoo systemctl preset-all --root=/mnt/gentoo

View File

@ -27,7 +27,6 @@ format_dev() {
mount "${dev}" "${tmpdir}" || exit mount "${dev}" "${tmpdir}" || exit
btrfs subvolume create "${tmpdir}"/var || exit btrfs subvolume create "${tmpdir}"/var || exit
btrfs subvolume create "${tmpdir}"/var/log || exit
umount "${dev}" || exit umount "${dev}" || exit
} }