1 # SPDX-License-Identifier: LGPL-2.1-or-later
3 with_runlevels = conf.get('HAVE_SYSV_COMPAT') == 1
7 ['blockdev@.target', ''],
8 ['bluetooth.target', ''],
9 ['boot-complete.target', ''],
10 ['cryptsetup-pre.target', 'HAVE_LIBCRYPTSETUP'],
11 ['cryptsetup.target', 'HAVE_LIBCRYPTSETUP',
12 'sysinit.target.wants/'],
13 ['veritysetup-pre.target', 'HAVE_LIBCRYPTSETUP'],
14 ['veritysetup.target', 'HAVE_LIBCRYPTSETUP',
15 'sysinit.target.wants/'],
16 ['dev-hugepages.mount', '',
17 'sysinit.target.wants/'],
18 ['dev-mqueue.mount', '',
19 'sysinit.target.wants/'],
20 ['emergency.target', ''],
23 ['first-boot-complete.target', ''],
25 'multi-user.target.wants/'],
26 ['getty-pre.target', ''],
27 ['graphical.target', '',
28 'default.target' + (with_runlevels ? ' runlevel5.target' : '')],
30 ['hibernate.target', 'ENABLE_HIBERNATE'],
31 ['hybrid-sleep.target', 'ENABLE_HIBERNATE'],
32 ['suspend-then-hibernate.target', 'ENABLE_HIBERNATE'],
33 ['initrd-cleanup.service', 'ENABLE_INITRD'],
34 ['initrd-fs.target', 'ENABLE_INITRD'],
35 ['initrd-parse-etc.service', 'ENABLE_INITRD'],
36 ['initrd-root-device.target', 'ENABLE_INITRD'],
37 ['initrd-root-fs.target', 'ENABLE_INITRD'],
38 ['initrd-switch-root.service', 'ENABLE_INITRD'],
39 ['initrd-switch-root.target', 'ENABLE_INITRD'],
40 ['initrd-udevadm-cleanup-db.service', 'ENABLE_INITRD'],
41 ['initrd-usr-fs.target', 'ENABLE_INITRD'],
42 ['initrd.target', 'ENABLE_INITRD'],
44 ['ldconfig.service', 'ENABLE_LDCONFIG',
45 'sysinit.target.wants/'],
46 ['local-fs-pre.target', ''],
47 ['local-fs.target', ''],
48 ['machine.slice', 'ENABLE_MACHINED'],
49 ['machines.target', 'ENABLE_MACHINED'],
50 ['modprobe@.service', ''],
51 ['multi-user.target', '',
52 (with_runlevels ? 'runlevel2.target runlevel3.target runlevel4.target' : '')],
53 ['network-online.target', ''],
54 ['network-pre.target', ''],
55 ['network.target', ''],
56 ['nss-lookup.target', ''],
57 ['nss-user-lookup.target', ''],
59 ['poweroff.target', '',
60 (with_runlevels ? 'runlevel0.target' : '')],
61 ['printer.target', ''],
62 ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT',
63 'sysinit.target.wants/'],
64 ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'],
66 'ctrl-alt-del.target' + (with_runlevels ? ' runlevel6.target' : '')],
67 ['remote-cryptsetup.target', 'HAVE_LIBCRYPTSETUP',
68 'initrd-root-device.target.wants/'],
69 ['remote-veritysetup.target', 'HAVE_LIBCRYPTSETUP',
70 'initrd-root-device.target.wants/'],
71 ['remote-fs-pre.target', ''],
72 ['remote-fs.target', ''],
74 (with_runlevels ? 'runlevel1.target' : '')],
75 ['rpcbind.target', ''],
76 ['shutdown.target', ''],
77 ['sigpwr.target', ''],
79 ['slices.target', ''],
80 ['smartcard.target', ''],
81 ['sockets.target', ''],
83 ['suspend.target', ''],
85 ['sys-fs-fuse-connections.mount', '',
86 'sysinit.target.wants/'],
87 ['sys-kernel-config.mount', '',
88 'sysinit.target.wants/'],
89 ['sys-kernel-debug.mount', '',
90 'sysinit.target.wants/'],
91 ['sys-kernel-tracing.mount', '',
92 'sysinit.target.wants/'],
93 ['sysinit.target', ''],
94 ['syslog.socket', ''],
95 ['system-systemd\\x2dcryptsetup.slice', 'HAVE_LIBCRYPTSETUP'],
96 ['system-update.target', ''],
97 ['system-update-pre.target', ''],
98 ['system-update-cleanup.service', ''],
99 ['systemd-ask-password-console.path', '',
100 'sysinit.target.wants/'],
101 ['systemd-ask-password-console.service', ''],
102 ['systemd-ask-password-wall.path', '',
103 'multi-user.target.wants/'],
104 ['systemd-ask-password-wall.service', ''],
105 ['systemd-boot-system-token.service', 'ENABLE_EFI',
106 'sysinit.target.wants/'],
107 ['systemd-coredump.socket', 'ENABLE_COREDUMP',
108 'sockets.target.wants/'],
109 ['systemd-exit.service', ''],
110 ['systemd-firstboot.service', 'ENABLE_FIRSTBOOT',
111 'sysinit.target.wants/'],
112 ['systemd-halt.service', ''],
113 ['systemd-homed-activate.service', 'ENABLE_HOMED'],
114 ['systemd-initctl.socket', 'HAVE_SYSV_COMPAT',
115 'sockets.target.wants/'],
116 ['systemd-journal-catalog-update.service', '',
117 'sysinit.target.wants/'],
118 ['systemd-journal-flush.service', '',
119 'sysinit.target.wants/'],
120 ['systemd-journal-gatewayd.socket', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
121 ['systemd-journal-remote.socket', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
122 ['systemd-journald-audit.socket', '',
123 'sockets.target.wants/'],
124 ['systemd-journald-dev-log.socket', '',
125 'sockets.target.wants/'],
126 ['systemd-journald.socket', '',
127 'sockets.target.wants/'],
128 ['systemd-kexec.service', ''],
129 ['systemd-machine-id-commit.service', '',
130 'sysinit.target.wants/'],
131 ['systemd-journald@.socket', ''],
132 ['systemd-journald-varlink@.socket', ''],
133 ['systemd-networkd.socket', 'ENABLE_NETWORKD'],
134 ['systemd-poweroff.service', ''],
135 ['systemd-reboot.service', ''],
136 ['systemd-rfkill.socket', 'ENABLE_RFKILL'],
137 ['systemd-sysext.service', 'ENABLE_SYSEXT'],
138 ['systemd-sysusers.service', 'ENABLE_SYSUSERS',
139 'sysinit.target.wants/'],
140 ['systemd-tmpfiles-clean.service', 'ENABLE_TMPFILES'],
141 ['systemd-tmpfiles-clean.timer', 'ENABLE_TMPFILES',
142 'timers.target.wants/'],
143 ['systemd-tmpfiles-setup-dev.service', 'ENABLE_TMPFILES',
144 'sysinit.target.wants/'],
145 ['systemd-tmpfiles-setup.service', 'ENABLE_TMPFILES',
146 'sysinit.target.wants/'],
147 ['systemd-udevd-control.socket', '',
148 'sockets.target.wants/'],
149 ['systemd-udev-settle.service', ''],
150 ['systemd-udev-trigger.service', '',
151 'sysinit.target.wants/'],
152 ['systemd-udevd-kernel.socket', '',
153 'sockets.target.wants/'],
154 ['systemd-userdbd.socket', 'ENABLE_USERDB'],
155 ['time-set.target', ''],
156 ['time-sync.target', ''],
157 ['timers.target', ''],
159 'local-fs.target.wants/'],
160 ['umount.target', ''],
161 ['usb-gadget.target', ''],
163 ['var-lib-machines.mount', 'ENABLE_MACHINED',
164 'remote-fs.target.wants/ machines.target.wants/'],
168 ['console-getty.service', ''],
169 ['container-getty@.service', ''],
170 ['debug-shell.service', ''],
171 ['emergency.service', ''],
172 ['getty@.service', '',
174 ['kmod-static-nodes.service', 'HAVE_KMOD ENABLE_TMPFILES',
175 'sysinit.target.wants/'],
176 ['quotaon.service', 'ENABLE_QUOTACHECK'],
177 ['rc-local.service', 'HAVE_SYSV_COMPAT'],
178 ['rescue.service', ''],
179 ['serial-getty@.service', ''],
180 ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'],
181 ['systemd-binfmt.service', 'ENABLE_BINFMT',
182 'sysinit.target.wants/'],
183 ['systemd-bless-boot.service', 'ENABLE_EFI HAVE_BLKID'],
184 ['systemd-boot-check-no-failures.service', ''],
185 ['systemd-coredump@.service', 'ENABLE_COREDUMP'],
186 ['systemd-pstore.service', 'ENABLE_PSTORE'],
187 ['systemd-fsck-root.service', ''],
188 ['systemd-fsck@.service', ''],
189 ['systemd-hibernate-resume@.service', 'ENABLE_HIBERNATE'],
190 ['systemd-hibernate.service', 'ENABLE_HIBERNATE'],
191 ['systemd-hybrid-sleep.service', 'ENABLE_HIBERNATE'],
192 ['systemd-suspend-then-hibernate.service', 'ENABLE_HIBERNATE'],
193 ['systemd-hostnamed.service', 'ENABLE_HOSTNAMED',
194 'dbus-org.freedesktop.hostname1.service'],
195 ['systemd-hwdb-update.service', 'ENABLE_HWDB',
196 'sysinit.target.wants/'],
197 ['systemd-importd.service', 'ENABLE_IMPORTD',
198 'dbus-org.freedesktop.import1.service'],
199 ['systemd-initctl.service', 'HAVE_SYSV_COMPAT'],
200 ['systemd-journal-gatewayd.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
201 ['systemd-journal-remote.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
202 ['systemd-journal-upload.service', 'ENABLE_REMOTE HAVE_LIBCURL'],
203 ['systemd-journald.service', '',
204 'sysinit.target.wants/'],
205 ['systemd-journald@.service', ''],
206 ['systemd-localed.service', 'ENABLE_LOCALED',
207 'dbus-org.freedesktop.locale1.service'],
208 ['systemd-logind.service', 'ENABLE_LOGIND',
209 'multi-user.target.wants/ dbus-org.freedesktop.login1.service'],
210 ['systemd-machined.service', 'ENABLE_MACHINED',
211 'dbus-org.freedesktop.machine1.service'],
212 ['systemd-modules-load.service', 'HAVE_KMOD',
213 'sysinit.target.wants/'],
214 ['systemd-network-generator.service', 'ENABLE_NETWORKD'],
215 ['systemd-networkd.service', 'ENABLE_NETWORKD'],
216 ['systemd-networkd-wait-online.service', 'ENABLE_NETWORKD'],
217 ['systemd-nspawn@.service', ''],
218 ['systemd-oomd.service', 'ENABLE_OOMD',
219 'dbus-org.freedesktop.oom1.service'],
220 ['systemd-portabled.service', 'ENABLE_PORTABLED',
221 'dbus-org.freedesktop.portable1.service'],
222 ['systemd-userdbd.service', 'ENABLE_USERDB'],
223 ['systemd-homed.service', 'ENABLE_HOMED'],
224 ['systemd-quotacheck.service', 'ENABLE_QUOTACHECK'],
225 ['systemd-random-seed.service', 'ENABLE_RANDOMSEED',
226 'sysinit.target.wants/'],
227 ['systemd-remount-fs.service', ''],
228 ['systemd-resolved.service', 'ENABLE_RESOLVE'],
229 ['systemd-rfkill.service', 'ENABLE_RFKILL'],
230 ['systemd-suspend.service', ''],
231 ['systemd-sysctl.service', '',
232 'sysinit.target.wants/'],
233 ['systemd-timedated.service', 'ENABLE_TIMEDATED',
234 'dbus-org.freedesktop.timedate1.service'],
235 ['systemd-timesyncd.service', 'ENABLE_TIMESYNCD'],
236 ['systemd-time-wait-sync.service', 'ENABLE_TIMESYNCD'],
237 ['systemd-udevd.service', '',
238 'sysinit.target.wants/'],
239 ['systemd-update-done.service', '',
240 'sysinit.target.wants/'],
241 ['systemd-update-utmp-runlevel.service', 'ENABLE_UTMP HAVE_SYSV_COMPAT',
242 'multi-user.target.wants/ graphical.target.wants/ rescue.target.wants/'],
243 ['systemd-update-utmp.service', 'ENABLE_UTMP',
244 'sysinit.target.wants/'],
245 ['systemd-user-sessions.service', 'HAVE_PAM',
246 'multi-user.target.wants/'],
247 ['systemd-vconsole-setup.service', 'ENABLE_VCONSOLE'],
248 ['systemd-volatile-root.service', 'ENABLE_INITRD'],
249 ['systemd-repart.service', 'ENABLE_REPART',
250 'sysinit.target.wants/ initrd-root-fs.target.wants/'],
251 ['user-runtime-dir@.service', ''],
252 ['user@.service', ''],
257 foreach tuple : in_units
260 # we do this here because install_data does not accept custom_target output
261 conds = tuple[1].split(' ')
262 install = ((conds.get(0, '') == '' or conf.get(conds[0]) == 1) and
263 (conds.get(1, '') == '' or conf.get(conds[1]) == 1))
267 input : file + '.in',
269 command : [meson_render_jinja2, config_h, '@INPUT@'],
272 install_dir : systemunitdir)
274 if install and tuple.length() > 2
275 foreach target : tuple[2].split()
276 add_wants += [systemunitdir, target, file]
281 foreach tuple : units
283 input = tuple.get(3, file)
285 conds = tuple[1].split(' ')
286 install = ((conds.get(0, '') == '' or conf.get(conds[0]) == 1) and
287 (conds.get(1, '') == '' or conf.get(conds[1]) == 1))
291 install_dir : systemunitdir)
293 if tuple.length() > 2
294 foreach target : tuple[2].split()
295 add_wants += [systemunitdir, target, file]
301 meson.add_install_script('meson-add-wants.sh', add_wants)
303 install_data('user-.slice.d/10-defaults.conf',
304 install_dir : systemunitdir + '/user-.slice.d')
306 ############################################################
308 if install_sysconfdir
309 meson.add_install_script(meson_make_symlink,
310 join_paths(pkgsysconfdir, 'user'),
311 join_paths(sysconfdir, 'xdg/systemd/user'))
313 meson.add_install_script(meson_make_symlink,
314 join_paths(dbussystemservicedir, 'org.freedesktop.systemd1.service'),
315 join_paths(dbussessionservicedir, 'org.freedesktop.systemd1.service'))
316 if conf.get('HAVE_SYSV_COMPAT') == 1
317 foreach i : [1, 2, 3, 4, 5]
318 meson.add_install_script(
320 mkdir_p.format(join_paths(systemunitdir, 'runlevel@0@.target.wants'.format(i))))