Skip to content

Use systemd-tmpfiles for creating /var directories on systemd systems

Max Gautier requested to merge vannten/pacman:feat/tmpfiles_for_var into master

Putting packages files in /var prevent makes new install start with an already populated /var, which prevent taking advantage of the systemd provided tmpfiles.d/var.conf, which notably has this line: q /var 0755 - - - -> on supported filesystems (currently that means btrfs), this creates /var as a subvolume on boot, which has the benefit (probably there is other but this is the one I'm concerned about) of excluding it from root ('/') snapshots. But currently this won't work on pacman+systemd (like Archlinux), because when we're pacstrapping into the new install chroot, we're already creating /var.

The added tmpfiles.d configuration files ensure that the directories will be present on boot, without further configuration (we don't use the age cleanup feature of tmpfiles)

On non-systemd system, the meson install behavior stays the same, /var/lib/pacman and /var/cache/pacman/pkg are included in DESTDIR.

Edited by Max Gautier

Merge request reports