1 diff --git a/data/bios-settings.d/meson.build b/data/bios-settings.d/meson.build
2 index b0ff5b106..13ac380d0 100644
3 --- a/data/bios-settings.d/meson.build
4 +++ b/data/bios-settings.d/meson.build
6 if build_standalone and host_machine.system() == 'linux'
7 install_data('README.md',
8 - install_dir: join_paths(sysconfdir, 'fwupd', 'bios-settings.d')
9 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'bios-settings.d')
12 diff --git a/data/meson.build b/data/meson.build
13 index e13da4adf..6858c240f 100644
14 --- a/data/meson.build
15 +++ b/data/meson.build
16 @@ -26,7 +26,7 @@ endif
19 install_data(['fwupd.conf'],
20 - install_dir: join_paths(sysconfdir, 'fwupd'),
21 + install_dir: join_paths(sysconfdir_install, 'fwupd'),
22 install_mode: 'rw-r-----',
24 plugin_quirks += files([
25 diff --git a/data/pki/meson.build b/data/pki/meson.build
26 index 3649fecea..c3462744b 100644
27 --- a/data/pki/meson.build
28 +++ b/data/pki/meson.build
29 @@ -12,13 +12,13 @@ install_data([
30 'GPG-KEY-Linux-Foundation-Firmware',
31 'GPG-KEY-Linux-Vendor-Firmware-Service',
33 - install_dir: join_paths(sysconfdir, 'pki', 'fwupd')
34 + install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd')
37 'GPG-KEY-Linux-Foundation-Metadata',
38 'GPG-KEY-Linux-Vendor-Firmware-Service',
40 - install_dir: join_paths(sysconfdir, 'pki', 'fwupd-metadata')
41 + install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd-metadata')
45 @@ -26,11 +26,11 @@ if supported_pkcs7
49 - install_dir: join_paths(sysconfdir, 'pki', 'fwupd')
50 + install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd')
55 - install_dir: join_paths(sysconfdir, 'pki', 'fwupd-metadata')
56 + install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd-metadata')
59 diff --git a/data/remotes.d/meson.build b/data/remotes.d/meson.build
60 index c20a1a05e..5354bac7f 100644
61 --- a/data/remotes.d/meson.build
62 +++ b/data/remotes.d/meson.build
63 @@ -15,14 +15,14 @@ if build_standalone and get_option('lvfs') != 'false'
67 - install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
68 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
71 input: 'lvfs-testing.conf',
72 output: 'lvfs-testing.conf',
75 - install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
76 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
79 input: 'lvfs.metainfo.xml',
80 @@ -56,12 +56,12 @@ configure_file(
81 output: 'vendor.conf',
83 install: get_option('vendor_metadata'),
84 - install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
85 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
88 input: 'vendor-directory.conf',
89 output: 'vendor-directory.conf',
92 - install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
93 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
95 diff --git a/meson.build b/meson.build
96 index ca6ccdf92..0a3097d90 100644
99 @@ -195,6 +195,12 @@ endif
100 mandir = join_paths(prefix, get_option('mandir'))
101 localedir = join_paths(prefix, get_option('localedir'))
103 +if get_option('sysconfdir_install') != ''
104 + sysconfdir_install = join_paths(prefix, get_option('sysconfdir_install'))
106 + sysconfdir_install = sysconfdir
109 diffcmd = find_program('diff')
110 gio = dependency('gio-2.0', version: '>= 2.68.0')
111 giounix = dependency('gio-unix-2.0', version: '>= 2.68.0', required: false)
113 diff --git a/meson_options.txt b/meson_options.txt
114 index 877891126..986d0ee31 100644
115 --- a/meson_options.txt
116 +++ b/meson_options.txt
118 +option('sysconfdir_install',
121 + description: 'sysconfdir to use during installation'
126 diff --git a/plugins/uefi-capsule/meson.build b/plugins/uefi-capsule/meson.build
127 index eb196c21e..c9a29f680 100644
128 --- a/plugins/uefi-capsule/meson.build
129 +++ b/plugins/uefi-capsule/meson.build
130 @@ -20,7 +20,7 @@ if host_machine.system() == 'linux'
134 - install_dir: join_paths(sysconfdir, 'grub.d')
135 + install_dir: join_paths(sysconfdir_install, 'grub.d')
137 elif host_machine.system() == 'freebsd'
138 backend_srcs += 'fu-uefi-backend-freebsd.c'