mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-16 08:02:06 +00:00
fu-common: Use environment variables for systemd managed directories
The systemd unit will set these, create these directories and set all permissions. If that has happened, use them.
This commit is contained in:
parent
921e426f5a
commit
277c196369
@ -1025,14 +1025,23 @@ fu_common_get_path (FuPathKind path_kind)
|
||||
#endif
|
||||
/* /etc/fwupd */
|
||||
case FU_PATH_KIND_SYSCONFDIR_PKG:
|
||||
tmp = g_getenv ("CONFIGURATION_DIRECTORY");
|
||||
if (tmp != NULL)
|
||||
return g_build_filename (tmp, NULL);
|
||||
basedir = fu_common_get_path (FU_PATH_KIND_SYSCONFDIR);
|
||||
return g_build_filename (basedir, PACKAGE_NAME, NULL);
|
||||
/* /var/lib/fwupd */
|
||||
case FU_PATH_KIND_LOCALSTATEDIR_PKG:
|
||||
tmp = g_getenv ("STATE_DIRECTORY");
|
||||
if (tmp != NULL)
|
||||
return g_build_filename (tmp, NULL);
|
||||
basedir = fu_common_get_path (FU_PATH_KIND_LOCALSTATEDIR);
|
||||
return g_build_filename (basedir, "lib", PACKAGE_NAME, NULL);
|
||||
/* /var/cache/fwupd */
|
||||
case FU_PATH_KIND_CACHEDIR_PKG:
|
||||
tmp = g_getenv ("CACHE_DIRECTORY");
|
||||
if (tmp != NULL)
|
||||
return g_build_filename (tmp, NULL);
|
||||
basedir = fu_common_get_path (FU_PATH_KIND_LOCALSTATEDIR);
|
||||
return g_build_filename (basedir, "cache", PACKAGE_NAME, NULL);
|
||||
case FU_PATH_KIND_POLKIT_ACTIONS:
|
||||
|
Loading…
Reference in New Issue
Block a user