From 9d507c74ae2ab717cf8e934cea82e67546212b48 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 12 Mar 2023 10:27:13 -0500 Subject: [PATCH] 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. --- build-rootfs.sh | 2 +- overlay/usr/libexec/init-storage | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/build-rootfs.sh b/build-rootfs.sh index 1f73627..c18a94f 100755 --- a/build-rootfs.sh +++ b/build-rootfs.sh @@ -66,7 +66,7 @@ if [ -f /mnt/gentoo/etc/udev/hwdb.bin ]; then fi 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 systemctl preset-all --root=/mnt/gentoo diff --git a/overlay/usr/libexec/init-storage b/overlay/usr/libexec/init-storage index 1e963c4..304a810 100755 --- a/overlay/usr/libexec/init-storage +++ b/overlay/usr/libexec/init-storage @@ -27,7 +27,6 @@ format_dev() { mount "${dev}" "${tmpdir}" || exit btrfs subvolume create "${tmpdir}"/var || exit - btrfs subvolume create "${tmpdir}"/var/log || exit umount "${dev}" || exit }