1 # SPDX-License-Identifier: LGPL-2.1-or-later
3 with_runlevels = conf.get('HAVE_SYSV_COMPAT') == 1
6 { 'file' : 'basic.target' },
7 { 'file' : 'blockdev@.target' },
8 { 'file' : 'bluetooth.target' },
9 { 'file' : 'boot-complete.target' },
10 { 'file' : 'console-getty.service.in' },
11 { 'file' : 'container-getty@.service.in' },
13 'file' : 'cryptsetup-pre.target',
14 'conditions' : ['HAVE_LIBCRYPTSETUP'],
17 'file' : 'cryptsetup.target',
18 'conditions' : ['HAVE_LIBCRYPTSETUP'],
19 'symlinks' : ['sysinit.target.wants/'],
21 { 'file' : 'debug-shell.service.in' },
23 'file' : 'dev-hugepages.mount',
24 'symlinks' : ['sysinit.target.wants/'],
27 'file' : 'dev-mqueue.mount',
28 'symlinks' : ['sysinit.target.wants/'],
30 { 'file' : 'emergency.service.in' },
31 { 'file' : 'emergency.target' },
32 { 'file' : 'exit.target' },
33 { 'file' : 'factory-reset.target' },
34 { 'file' : 'final.target' },
35 { 'file' : 'first-boot-complete.target' },
36 { 'file' : 'getty-pre.target' },
38 'file' : 'getty.target',
39 'symlinks' : ['multi-user.target.wants/'],
42 'file' : 'getty@.service.in',
43 'symlinks' : ['autovt@.service'],
46 'file' : 'graphical.target',
47 'symlinks' : ['default.target'] + (with_runlevels ? ['runlevel5.target'] : []),
49 { 'file' : 'halt.target' },
51 'file' : 'hibernate.target',
52 'conditions' : ['ENABLE_HIBERNATE'],
55 'file' : 'hybrid-sleep.target',
56 'conditions' : ['ENABLE_HIBERNATE'],
59 'file' : 'systemd-battery-check.service.in',
60 'conditions' : ['ENABLE_INITRD'],
61 'symlinks' : ['initrd.target.wants/'],
64 'file' : 'initrd-cleanup.service',
65 'conditions' : ['ENABLE_INITRD'],
68 'file' : 'initrd-fs.target',
69 'conditions' : ['ENABLE_INITRD'],
72 'file' : 'initrd-parse-etc.service.in',
73 'conditions' : ['ENABLE_INITRD'],
76 'file' : 'initrd-root-device.target',
77 'conditions' : ['ENABLE_INITRD'],
80 'file' : 'initrd-root-fs.target',
81 'conditions' : ['ENABLE_INITRD'],
84 'file' : 'initrd-switch-root.service',
85 'conditions' : ['ENABLE_INITRD'],
88 'file' : 'initrd-switch-root.target',
89 'conditions' : ['ENABLE_INITRD'],
92 'file' : 'initrd-udevadm-cleanup-db.service',
93 'conditions' : ['ENABLE_INITRD'],
96 'file' : 'initrd-usr-fs.target',
97 'conditions' : ['ENABLE_INITRD'],
100 'file' : 'initrd.target',
101 'conditions' : ['ENABLE_INITRD'],
104 'file' : 'integritysetup-pre.target',
105 'conditions' : ['HAVE_LIBCRYPTSETUP'],
108 'file' : 'integritysetup.target',
109 'conditions' : ['HAVE_LIBCRYPTSETUP'],
110 'symlinks' : ['sysinit.target.wants/'],
112 { 'file' : 'kexec.target' },
114 'file' : 'kmod-static-nodes.service.in',
115 'conditions' : ['HAVE_KMOD', 'ENABLE_TMPFILES'],
116 'symlinks' : ['sysinit.target.wants/'],
119 'file' : 'ldconfig.service',
120 'conditions' : ['ENABLE_LDCONFIG'],
121 'symlinks' : ['sysinit.target.wants/'],
123 { 'file' : 'local-fs-pre.target' },
124 { 'file' : 'local-fs.target' },
126 'file' : 'machine.slice',
127 'conditions' : ['ENABLE_MACHINED'],
130 'file' : 'machines.target',
131 'conditions' : ['ENABLE_MACHINED'],
133 { 'file' : 'modprobe@.service' },
135 'file' : 'multi-user.target',
136 'symlinks' : with_runlevels ? ['runlevel2.target', 'runlevel3.target', 'runlevel4.target'] : [],
138 { 'file' : 'network-online.target' },
139 { 'file' : 'network-pre.target' },
140 { 'file' : 'network.target' },
141 { 'file' : 'nss-lookup.target' },
142 { 'file' : 'nss-user-lookup.target' },
143 { 'file' : 'paths.target' },
145 'file' : 'poweroff.target',
146 'symlinks' : with_runlevels ? ['runlevel0.target'] : [],
148 { 'file' : 'printer.target' },
150 'file' : 'proc-sys-fs-binfmt_misc.automount',
151 'conditions' : ['ENABLE_BINFMT'],
152 'symlinks' : ['sysinit.target.wants/'],
155 'file' : 'proc-sys-fs-binfmt_misc.mount',
156 'conditions' : ['ENABLE_BINFMT'],
159 'file' : 'quotaon.service.in',
160 'conditions' : ['ENABLE_QUOTACHECK'],
163 'file' : 'rc-local.service.in',
164 'conditions' : ['HAVE_SYSV_COMPAT'],
167 'file' : 'reboot.target',
168 'symlinks' : ['ctrl-alt-del.target'] + (with_runlevels ? ['runlevel6.target'] : []),
171 'file' : 'remote-cryptsetup.target',
172 'conditions' : ['HAVE_LIBCRYPTSETUP'],
173 'symlinks' : ['initrd-root-device.target.wants/'],
175 { 'file' : 'remote-fs-pre.target' },
176 { 'file' : 'remote-fs.target' },
178 'file' : 'remote-veritysetup.target',
179 'conditions' : ['HAVE_LIBCRYPTSETUP'],
180 'symlinks' : ['initrd-root-device.target.wants/'],
182 { 'file' : 'rescue.service.in' },
184 'file' : 'rescue.target',
185 'symlinks' : with_runlevels ? ['runlevel1.target'] : [],
187 { 'file' : 'rpcbind.target' },
188 { 'file' : 'serial-getty@.service.in' },
189 { 'file' : 'shutdown.target' },
190 { 'file' : 'sigpwr.target' },
191 { 'file' : 'sleep.target' },
192 { 'file' : 'slices.target' },
193 { 'file' : 'smartcard.target' },
194 { 'file' : 'sockets.target' },
195 { 'file' : 'soft-reboot.target' },
196 { 'file' : 'sound.target' },
198 'file' : 'suspend-then-hibernate.target',
199 'conditions' : ['ENABLE_HIBERNATE'],
201 { 'file' : 'suspend.target' },
202 { 'file' : 'swap.target' },
204 'file' : 'sys-fs-fuse-connections.mount',
205 'symlinks' : ['sysinit.target.wants/'],
208 'file' : 'sys-kernel-config.mount',
209 'symlinks' : ['sysinit.target.wants/'],
212 'file' : 'sys-kernel-debug.mount',
213 'symlinks' : ['sysinit.target.wants/'],
216 'file' : 'sys-kernel-tracing.mount',
217 'symlinks' : ['sysinit.target.wants/'],
219 { 'file' : 'sysinit.target' },
220 { 'file' : 'syslog.socket' },
222 'file' : 'system-systemd\\x2dcryptsetup.slice',
223 'conditions' : ['HAVE_LIBCRYPTSETUP'],
226 'file' : 'system-systemd\\x2dveritysetup.slice',
227 'conditions' : ['HAVE_LIBCRYPTSETUP'],
229 { 'file' : 'system-update-cleanup.service' },
230 { 'file' : 'system-update-pre.target' },
231 { 'file' : 'system-update.target' },
233 'file' : 'systemd-ask-password-console.path',
234 'symlinks' : ['sysinit.target.wants/'],
236 { 'file' : 'systemd-ask-password-console.service' },
238 'file' : 'systemd-ask-password-wall.path',
239 'symlinks' : ['multi-user.target.wants/'],
241 { 'file' : 'systemd-ask-password-wall.service' },
243 'file' : 'systemd-backlight@.service.in',
244 'conditions' : ['ENABLE_BACKLIGHT'],
247 'file' : 'systemd-binfmt.service.in',
248 'conditions' : ['ENABLE_BINFMT'],
249 'symlinks' : ['sysinit.target.wants/'],
252 'file' : 'systemd-bless-boot.service.in',
253 'conditions' : ['ENABLE_BOOTLOADER', 'HAVE_BLKID'],
255 { 'file' : 'systemd-boot-check-no-failures.service.in' },
257 'file' : 'systemd-boot-random-seed.service',
258 'conditions' : ['ENABLE_BOOTLOADER'],
259 'symlinks' : ['sysinit.target.wants/'],
262 'file' : 'systemd-boot-update.service',
263 'conditions' : ['ENABLE_BOOTLOADER'],
266 'file' : 'systemd-confext.service',
267 'conditions' : ['ENABLE_SYSEXT'],
270 'file' : 'systemd-coredump.socket',
271 'conditions' : ['ENABLE_COREDUMP'],
272 'symlinks' : ['sockets.target.wants/'],
275 'file' : 'systemd-coredump@.service.in',
276 'conditions' : ['ENABLE_COREDUMP'],
278 { 'file' : 'systemd-exit.service' },
280 'file' : 'systemd-firstboot.service',
281 'conditions' : ['ENABLE_FIRSTBOOT'],
282 'symlinks' : ['sysinit.target.wants/'],
284 { 'file' : 'systemd-fsck-root.service.in' },
285 { 'file' : 'systemd-fsck@.service.in' },
286 { 'file' : 'systemd-growfs-root.service.in' },
287 { 'file' : 'systemd-growfs@.service.in' },
288 { 'file' : 'systemd-halt.service' },
290 'file' : 'systemd-hibernate.service.in',
291 'conditions' : ['ENABLE_HIBERNATE'],
294 'file' : 'systemd-homed-activate.service',
295 'conditions' : ['ENABLE_HOMED'],
298 'file' : 'systemd-homed.service.in',
299 'conditions' : ['ENABLE_HOMED'],
302 'file' : 'systemd-hostnamed.service.in',
303 'conditions' : ['ENABLE_HOSTNAMED'],
304 'symlinks' : ['dbus-org.freedesktop.hostname1.service'],
307 'file' : 'systemd-hwdb-update.service.in',
308 'conditions' : ['ENABLE_HWDB'],
309 'symlinks' : ['sysinit.target.wants/'],
312 'file' : 'systemd-hybrid-sleep.service.in',
313 'conditions' : ['ENABLE_HIBERNATE'],
316 'file' : 'systemd-importd.service.in',
317 'conditions' : ['ENABLE_IMPORTD'],
318 'symlinks' : ['dbus-org.freedesktop.import1.service'],
321 'file' : 'systemd-initctl.service.in',
322 'conditions' : ['HAVE_SYSV_COMPAT'],
325 'file' : 'systemd-initctl.socket',
326 'conditions' : ['HAVE_SYSV_COMPAT'],
327 'symlinks' : ['sockets.target.wants/'],
330 'file' : 'systemd-journal-catalog-update.service',
331 'symlinks' : ['sysinit.target.wants/'],
334 'file' : 'systemd-journal-flush.service',
335 'symlinks' : ['sysinit.target.wants/'],
338 'file' : 'systemd-journal-gatewayd.service.in',
339 'conditions' : ['ENABLE_REMOTE', 'HAVE_MICROHTTPD'],
342 'file' : 'systemd-journal-gatewayd.socket',
343 'conditions' : ['ENABLE_REMOTE', 'HAVE_MICROHTTPD'],
346 'file' : 'systemd-journal-remote.service.in',
347 'conditions' : ['ENABLE_REMOTE', 'HAVE_MICROHTTPD'],
350 'file' : 'systemd-journal-remote.socket',
351 'conditions' : ['ENABLE_REMOTE', 'HAVE_MICROHTTPD'],
354 'file' : 'systemd-journal-upload.service.in',
355 'conditions' : ['ENABLE_REMOTE', 'HAVE_LIBCURL'],
357 { 'file' : 'systemd-journald-audit.socket' },
359 'file' : 'systemd-journald-dev-log.socket',
360 'symlinks' : ['sockets.target.wants/'],
362 { 'file' : 'systemd-journald-varlink@.socket' },
364 'file' : 'systemd-journald.service.in',
365 'symlinks' : ['sysinit.target.wants/'],
368 'file' : 'systemd-journald.socket',
369 'symlinks' : ['sockets.target.wants/'],
371 { 'file' : 'systemd-journald@.service.in' },
372 { 'file' : 'systemd-journald@.socket' },
373 { 'file' : 'systemd-kexec.service' },
375 'file' : 'systemd-localed.service.in',
376 'conditions' : ['ENABLE_LOCALED'],
377 'symlinks' : ['dbus-org.freedesktop.locale1.service'],
380 'file' : 'systemd-logind.service.in',
381 'conditions' : ['ENABLE_LOGIND'],
382 'symlinks' : ['multi-user.target.wants/', 'dbus-org.freedesktop.login1.service'],
385 'file' : 'systemd-machine-id-commit.service',
386 'symlinks' : ['sysinit.target.wants/'],
389 'file' : 'systemd-machined.service.in',
390 'conditions' : ['ENABLE_MACHINED'],
391 'symlinks' : ['dbus-org.freedesktop.machine1.service'],
394 'file' : 'systemd-modules-load.service.in',
395 'conditions' : ['HAVE_KMOD'],
396 'symlinks' : ['sysinit.target.wants/'],
398 { 'file' : 'systemd-network-generator.service.in' },
400 'file' : 'systemd-networkd-wait-online.service.in',
401 'conditions' : ['ENABLE_NETWORKD'],
404 'file' : 'systemd-networkd-wait-online@.service.in',
405 'conditions' : ['ENABLE_NETWORKD'],
408 'file' : 'systemd-networkd.service.in',
409 'conditions' : ['ENABLE_NETWORKD'],
412 'file' : 'systemd-networkd.socket',
413 'conditions' : ['ENABLE_NETWORKD'],
415 { 'file' : 'systemd-nspawn@.service.in' },
417 'file' : 'systemd-oomd.service.in',
418 'conditions' : ['ENABLE_OOMD'],
421 'file' : 'systemd-oomd.socket',
422 'conditions' : ['ENABLE_OOMD'],
425 'file' : 'systemd-pcrfs-root.service.in',
426 'conditions' : ['ENABLE_BOOTLOADER', 'HAVE_OPENSSL', 'HAVE_TPM2'],
429 'file' : 'systemd-pcrfs@.service.in',
430 'conditions' : ['ENABLE_BOOTLOADER', 'HAVE_OPENSSL', 'HAVE_TPM2'],
433 'file' : 'systemd-pcrmachine.service.in',
434 'conditions' : ['ENABLE_BOOTLOADER', 'HAVE_OPENSSL', 'HAVE_TPM2'],
435 'symlinks' : ['sysinit.target.wants/'],
438 'file' : 'systemd-pcrphase-initrd.service.in',
439 'conditions' : ['ENABLE_BOOTLOADER', 'HAVE_OPENSSL', 'HAVE_TPM2', 'ENABLE_INITRD'],
440 'symlinks' : ['initrd.target.wants/'],
443 'file' : 'systemd-pcrphase-sysinit.service.in',
444 'conditions' : ['ENABLE_BOOTLOADER', 'HAVE_OPENSSL', 'HAVE_TPM2'],
445 'symlinks' : ['sysinit.target.wants/'],
448 'file' : 'systemd-pcrphase.service.in',
449 'conditions' : ['ENABLE_BOOTLOADER', 'HAVE_OPENSSL', 'HAVE_TPM2'],
450 'symlinks' : ['sysinit.target.wants/'],
453 'file' : 'systemd-portabled.service.in',
454 'conditions' : ['ENABLE_PORTABLED'],
455 'symlinks' : ['dbus-org.freedesktop.portable1.service'],
457 { 'file' : 'systemd-poweroff.service' },
459 'file' : 'systemd-pstore.service.in',
460 'conditions' : ['ENABLE_PSTORE'],
463 'file' : 'systemd-quotacheck.service.in',
464 'conditions' : ['ENABLE_QUOTACHECK'],
467 'file' : 'systemd-random-seed.service.in',
468 'conditions' : ['ENABLE_RANDOMSEED'],
469 'symlinks' : ['sysinit.target.wants/'],
471 { 'file' : 'systemd-reboot.service' },
472 { 'file' : 'systemd-remount-fs.service.in' },
474 'file' : 'systemd-repart.service.in',
475 'conditions' : ['ENABLE_REPART'],
476 'symlinks' : ['sysinit.target.wants/', 'initrd-root-fs.target.wants/'],
479 'file' : 'systemd-resolved.service.in',
480 'conditions' : ['ENABLE_RESOLVE'],
483 'file' : 'systemd-rfkill.service.in',
484 'conditions' : ['ENABLE_RFKILL'],
487 'file' : 'systemd-rfkill.socket',
488 'conditions' : ['ENABLE_RFKILL'],
490 { 'file' : 'systemd-soft-reboot.service' },
492 'file' : 'systemd-suspend-then-hibernate.service.in',
493 'conditions' : ['ENABLE_HIBERNATE'],
495 { 'file' : 'systemd-suspend.service.in' },
497 'file' : 'systemd-sysctl.service.in',
498 'symlinks' : ['sysinit.target.wants/'],
501 'file' : 'systemd-sysext.service',
502 'conditions' : ['ENABLE_SYSEXT'],
505 'file' : 'systemd-sysupdate-reboot.service.in',
506 'conditions' : ['ENABLE_SYSUPDATE'],
509 'file' : 'systemd-sysupdate-reboot.timer',
510 'conditions' : ['ENABLE_SYSUPDATE'],
513 'file' : 'systemd-sysupdate.service.in',
514 'conditions' : ['ENABLE_SYSUPDATE'],
517 'file' : 'systemd-sysupdate.timer',
518 'conditions' : ['ENABLE_SYSUPDATE'],
521 'file' : 'systemd-sysusers.service',
522 'conditions' : ['ENABLE_SYSUSERS'],
523 'symlinks' : ['sysinit.target.wants/'],
526 'file' : 'systemd-time-wait-sync.service.in',
527 'conditions' : ['ENABLE_TIMESYNCD'],
530 'file' : 'systemd-timedated.service.in',
531 'conditions' : ['ENABLE_TIMEDATED'],
532 'symlinks' : ['dbus-org.freedesktop.timedate1.service'],
535 'file' : 'systemd-timesyncd.service.in',
536 'conditions' : ['ENABLE_TIMESYNCD'],
539 'file' : 'systemd-tmpfiles-clean.service',
540 'conditions' : ['ENABLE_TMPFILES'],
543 'file' : 'systemd-tmpfiles-clean.timer',
544 'conditions' : ['ENABLE_TMPFILES'],
545 'symlinks' : ['timers.target.wants/'],
548 'file' : 'systemd-tmpfiles-setup-dev-early.service',
549 'conditions' : ['ENABLE_TMPFILES'],
550 'symlinks' : ['sysinit.target.wants/'],
553 'file' : 'systemd-tmpfiles-setup-dev.service',
554 'conditions' : ['ENABLE_TMPFILES'],
555 'symlinks' : ['sysinit.target.wants/'],
558 'file' : 'systemd-tmpfiles-setup.service',
559 'conditions' : ['ENABLE_TMPFILES'],
560 'symlinks' : ['sysinit.target.wants/'],
562 { 'file' : 'systemd-udev-settle.service' },
564 'file' : 'systemd-udev-trigger.service',
565 'symlinks' : ['sysinit.target.wants/'],
568 'file' : 'systemd-udevd-control.socket',
569 'symlinks' : ['sockets.target.wants/'],
572 'file' : 'systemd-udevd-kernel.socket',
573 'symlinks' : ['sockets.target.wants/'],
576 'file' : 'systemd-udevd.service.in',
577 'symlinks' : ['sysinit.target.wants/'],
580 'file' : 'systemd-update-done.service.in',
581 'symlinks' : ['sysinit.target.wants/'],
584 'file' : 'systemd-update-utmp-runlevel.service.in',
585 'conditions' : ['ENABLE_UTMP', 'HAVE_SYSV_COMPAT'],
586 'symlinks' : ['multi-user.target.wants/', 'graphical.target.wants/', 'rescue.target.wants/'],
589 'file' : 'systemd-update-utmp.service.in',
590 'conditions' : ['ENABLE_UTMP'],
591 'symlinks' : ['sysinit.target.wants/'],
594 'file' : 'systemd-user-sessions.service.in',
595 'conditions' : ['HAVE_PAM'],
596 'symlinks' : ['multi-user.target.wants/'],
599 'file' : 'systemd-userdbd.service.in',
600 'conditions' : ['ENABLE_USERDB'],
603 'file' : 'systemd-userdbd.socket',
604 'conditions' : ['ENABLE_USERDB'],
607 'file' : 'systemd-vconsole-setup.service.in',
608 'conditions' : ['ENABLE_VCONSOLE'],
611 'file' : 'systemd-volatile-root.service.in',
612 'conditions' : ['ENABLE_INITRD'],
614 { 'file' : 'time-set.target' },
615 { 'file' : 'time-sync.target' },
616 { 'file' : 'timers.target' },
618 'file' : 'tmp.mount',
619 'symlinks' : ['local-fs.target.wants/'],
621 { 'file' : 'umount.target' },
622 { 'file' : 'usb-gadget.target' },
623 { 'file' : 'user-runtime-dir@.service.in' },
624 { 'file' : 'user.slice' },
625 { 'file' : 'user@.service.in' },
627 'file' : 'var-lib-machines.mount',
628 'conditions' : ['ENABLE_MACHINED'],
629 'symlinks' : ['remote-fs.target.wants/', 'machines.target.wants/'],
632 'file' : 'veritysetup-pre.target',
633 'conditions' : ['HAVE_LIBCRYPTSETUP'],
636 'file' : 'veritysetup.target',
637 'conditions' : ['HAVE_LIBCRYPTSETUP'],
638 'symlinks' : ['sysinit.target.wants/'],
645 source = unit.get('file')
647 if source.endswith('.in')
649 name = source.substring(0, -3)
650 assert(name + '.in' == source)
655 source = files(source)
658 foreach cond : unit.get('conditions', [])
659 if conf.get(cond) != 1
670 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
672 install_dir : systemunitdir)
675 install_dir : systemunitdir)
679 foreach target : unit.get('symlinks', [])
680 add_wants += [systemunitdir, target, name]
685 meson.add_install_script('meson-add-wants.sh', add_wants)
687 install_data('user-.slice.d/10-defaults.conf',
688 install_dir : systemunitdir + '/user-.slice.d')
690 install_data('user@.service.d/10-login-barrier.conf',
691 install_dir : systemunitdir + '/user@.service.d')
692 install_data('user@0.service.d/10-login-barrier.conf',
693 install_dir : systemunitdir + '/user@0.service.d')
695 ############################################################
697 if install_sysconfdir
698 meson.add_install_script(meson_make_symlink,
699 pkgsysconfdir / 'user',
700 sysconfdir / 'xdg/systemd/user')
702 meson.add_install_script(meson_make_symlink,
703 dbussystemservicedir / 'org.freedesktop.systemd1.service',
704 dbussessionservicedir / 'org.freedesktop.systemd1.service')
705 if conf.get('HAVE_SYSV_COMPAT') == 1
706 foreach i : [1, 2, 3, 4, 5]
707 meson.add_install_script(
709 mkdir_p.format(systemunitdir / 'runlevel@0@.target.wants'.format(i)))