2020-11-09 07:23:58 +03:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2017-11-18 20:32:01 +03:00
2020-04-29 00:11:55 +03:00
with_runlevels = conf . get ( 'HAVE_SYSV_COMPAT' ) == 1
meson: build systemd using meson
It's crucial that we can build systemd using VS2010!
... er, wait, no, that's not the official reason. We need to shed old systems
by requring python 3! Oh, no, it's something else. Maybe we need to throw out
345 years of knowlege accumulated in autotools? Whatever, this new thing is
cool and shiny, let's use it.
This is not complete, I'm throwing it out here for your amusement and critique.
- rules for sd-boot are missing. Those might be quite complicated.
- rules for tests are missing too. Those are probably quite simple and
repetitive, but there's lots of them.
- it's likely that I didn't get all the conditions right, I only tested "full"
compilation where most deps are provided and nothing is disabled.
- busname.target and all .busname units are skipped on purpose.
Otherwise, installation into $DESTDIR has the same list of files and the
autoconf install, except for .la files.
It'd be great if people had a careful look at all the library linking options.
I added stuff until things compiled, and in the end there's much less linking
then in the old system. But it seems that there's still a lot of unnecessary
deps.
meson has a `shared_module` statement, which sounds like something appropriate
for our nss and pam modules. Unfortunately, I couldn't get it to work. For the
nss modules, we need an .so version of '2', but `shared_module` disallows the
version argument. For the pam module, it also didn't work, I forgot the reason.
The handling of .m4 and .in and .m4.in files is rather awkward. It's likely
that this could be simplified. If make support is ever dropped, I think it'd
make sense to switch to a different templating system so that two different
languages and not required, which would make everything simpler yet.
v2:
- use get_pkgconfig_variable
- use sh not bash
- use add_project_arguments
v3:
- drop required:true and fix progs/prog typo
v4:
- use find_library('bz2')
- add TTY_GID definition
- define __SANE_USERSPACE_TYPES__
- use join_paths(prefix, ...) is used on all paths to make them all absolute
v5:
- replace all declare_dependency's with []
- add more conf.get guards around optional components
v6:
- drop -pipe, -Wall which are the default in meson
- use compiler.has_function() and compiler.has_header_symbol instead of the
hand-rolled checks.
- fix duplication in 'liblibsystemd' library name
- use the right .sym file for pam_systemd
- rename 'compiler' to 'cc': shorter, and more idiomatic.
v7:
- use ENABLE_ENVIRONMENT_D not HAVE_ENVIRONMENT_D
- rename prefix to prefixdir, rootprefix to rootprefixdir
("prefix" is too common of a name and too easy to overwrite by mistake)
- wrap more stuff with conf.get('ENABLE...') == 1
- use rootprefix=='/' and rootbindir as install_dir, to fix paths under
split-usr==true.
v8:
- use .split() also for src/coredump. Now everything is consistent ;)
- add rootlibdir option and use it on the libraries that require it
v9:
- indentation
v10:
- fix check for qrencode and libaudit
v11:
- unify handling of executable paths, provide options for all progs
This makes the meson build behave slightly differently than the
autoconf-based one, because we always first try to find the executable in the
filesystem, and fall back to the default. I think different handling of
loadkeys, setfont, and telinit was just a historical accident.
In addition to checking in $PATH, also check /usr/sbin/, /sbin for programs.
In Fedora $PATH includes /usr/sbin, (and /sbin is is a symlink to /usr/sbin),
but in Debian, those directories are not included in the path.
C.f. https://github.com/mesonbuild/meson/issues/1576.
- call all the options 'xxx-path' for clarity.
- sort man/rules/meson.build properly so it's stable
2017-04-05 06:03:47 +03:00
units = [
2023-06-16 04:38:25 +03:00
{ 'file' : 'basic.target' } ,
{ 'file' : 'blockdev@.target' } ,
{ 'file' : 'bluetooth.target' } ,
{ 'file' : 'boot-complete.target' } ,
2024-03-26 15:36:28 +03:00
{ 'file' : 'capsule@.service.in' } ,
{ 'file' : 'capsule.slice' } ,
2023-06-16 04:38:25 +03:00
{ 'file' : 'console-getty.service.in' } ,
{ 'file' : 'container-getty@.service.in' } ,
{
'file' : 'cryptsetup-pre.target' ,
'conditions' : [ 'HAVE_LIBCRYPTSETUP' ] ,
} ,
{
'file' : 'cryptsetup.target' ,
'conditions' : [ 'HAVE_LIBCRYPTSETUP' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{ 'file' : 'debug-shell.service.in' } ,
{
'file' : 'dev-hugepages.mount' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'dev-mqueue.mount' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{ 'file' : 'emergency.service.in' } ,
{ 'file' : 'emergency.target' } ,
{ 'file' : 'exit.target' } ,
{ 'file' : 'factory-reset.target' } ,
{ 'file' : 'final.target' } ,
{ 'file' : 'first-boot-complete.target' } ,
{ 'file' : 'getty-pre.target' } ,
{
'file' : 'getty.target' ,
'symlinks' : [ 'multi-user.target.wants/' ] ,
} ,
{
'file' : 'getty@.service.in' ,
'symlinks' : [ 'autovt@.service' ] ,
} ,
{
'file' : 'graphical.target' ,
'symlinks' : [ 'default.target' ] + ( with_runlevels ? [ 'runlevel5.target' ] : [ ] ) ,
} ,
{ 'file' : 'halt.target' } ,
{
'file' : 'hibernate.target' ,
'conditions' : [ 'ENABLE_HIBERNATE' ] ,
} ,
{
'file' : 'hybrid-sleep.target' ,
'conditions' : [ 'ENABLE_HIBERNATE' ] ,
} ,
2023-06-28 16:04:42 +03:00
{
2023-06-30 18:09:21 +03:00
'file' : 'systemd-battery-check.service.in' ,
2023-06-28 16:04:42 +03:00
'conditions' : [ 'ENABLE_INITRD' ] ,
2023-06-30 18:09:21 +03:00
'symlinks' : [ 'initrd.target.wants/' ] ,
2023-06-28 16:04:42 +03:00
} ,
2023-08-06 19:09:27 +03:00
{
'file' : 'systemd-bsod.service.in' ,
2023-08-22 16:54:43 +03:00
'conditions' : [ 'HAVE_QRENCODE' , 'ENABLE_INITRD' ] ,
2023-08-06 19:09:27 +03:00
'symlinks' : [ 'initrd.target.wants/' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'initrd-cleanup.service' ,
'conditions' : [ 'ENABLE_INITRD' ] ,
} ,
{
'file' : 'initrd-fs.target' ,
'conditions' : [ 'ENABLE_INITRD' ] ,
} ,
{
'file' : 'initrd-parse-etc.service.in' ,
'conditions' : [ 'ENABLE_INITRD' ] ,
} ,
{
'file' : 'initrd-root-device.target' ,
'conditions' : [ 'ENABLE_INITRD' ] ,
} ,
{
'file' : 'initrd-root-fs.target' ,
'conditions' : [ 'ENABLE_INITRD' ] ,
} ,
{
'file' : 'initrd-switch-root.service' ,
'conditions' : [ 'ENABLE_INITRD' ] ,
} ,
{
'file' : 'initrd-switch-root.target' ,
'conditions' : [ 'ENABLE_INITRD' ] ,
} ,
{
'file' : 'initrd-udevadm-cleanup-db.service' ,
'conditions' : [ 'ENABLE_INITRD' ] ,
} ,
{
'file' : 'initrd-usr-fs.target' ,
'conditions' : [ 'ENABLE_INITRD' ] ,
} ,
{
'file' : 'initrd.target' ,
'conditions' : [ 'ENABLE_INITRD' ] ,
} ,
{
'file' : 'integritysetup-pre.target' ,
'conditions' : [ 'HAVE_LIBCRYPTSETUP' ] ,
} ,
{
'file' : 'integritysetup.target' ,
'conditions' : [ 'HAVE_LIBCRYPTSETUP' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{ 'file' : 'kexec.target' } ,
{
'file' : 'kmod-static-nodes.service.in' ,
'conditions' : [ 'HAVE_KMOD' , 'ENABLE_TMPFILES' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'ldconfig.service' ,
'conditions' : [ 'ENABLE_LDCONFIG' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{ 'file' : 'local-fs-pre.target' } ,
{ 'file' : 'local-fs.target' } ,
{
'file' : 'machine.slice' ,
'conditions' : [ 'ENABLE_MACHINED' ] ,
} ,
{
'file' : 'machines.target' ,
'conditions' : [ 'ENABLE_MACHINED' ] ,
} ,
{ 'file' : 'modprobe@.service' } ,
{
'file' : 'multi-user.target' ,
'symlinks' : with_runlevels ? [ 'runlevel2.target' , 'runlevel3.target' , 'runlevel4.target' ] : [ ] ,
} ,
{ 'file' : 'network-online.target' } ,
{ 'file' : 'network-pre.target' } ,
{ 'file' : 'network.target' } ,
{ 'file' : 'nss-lookup.target' } ,
{ 'file' : 'nss-user-lookup.target' } ,
{ 'file' : 'paths.target' } ,
{
'file' : 'poweroff.target' ,
'symlinks' : with_runlevels ? [ 'runlevel0.target' ] : [ ] ,
} ,
{ 'file' : 'printer.target' } ,
{
'file' : 'proc-sys-fs-binfmt_misc.automount' ,
'conditions' : [ 'ENABLE_BINFMT' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'proc-sys-fs-binfmt_misc.mount' ,
'conditions' : [ 'ENABLE_BINFMT' ] ,
} ,
{
2022-09-19 17:57:48 +03:00
'file' : 'quotaon@.service.in' ,
'conditions' : [ 'ENABLE_QUOTACHECK' ] ,
} ,
{
'file' : 'quotaon-root.service.in' ,
2023-06-16 04:38:25 +03:00
'conditions' : [ 'ENABLE_QUOTACHECK' ] ,
} ,
{
'file' : 'rc-local.service.in' ,
'conditions' : [ 'HAVE_SYSV_COMPAT' ] ,
} ,
{
'file' : 'reboot.target' ,
'symlinks' : [ 'ctrl-alt-del.target' ] + ( with_runlevels ? [ 'runlevel6.target' ] : [ ] ) ,
} ,
{
'file' : 'remote-cryptsetup.target' ,
'conditions' : [ 'HAVE_LIBCRYPTSETUP' ] ,
'symlinks' : [ 'initrd-root-device.target.wants/' ] ,
} ,
{ 'file' : 'remote-fs-pre.target' } ,
{ 'file' : 'remote-fs.target' } ,
{
'file' : 'remote-veritysetup.target' ,
'conditions' : [ 'HAVE_LIBCRYPTSETUP' ] ,
'symlinks' : [ 'initrd-root-device.target.wants/' ] ,
} ,
{ 'file' : 'rescue.service.in' } ,
{
'file' : 'rescue.target' ,
'symlinks' : with_runlevels ? [ 'runlevel1.target' ] : [ ] ,
} ,
{ 'file' : 'rpcbind.target' } ,
{ 'file' : 'serial-getty@.service.in' } ,
{ 'file' : 'shutdown.target' } ,
{ 'file' : 'sigpwr.target' } ,
{ 'file' : 'sleep.target' } ,
{ 'file' : 'slices.target' } ,
{ 'file' : 'smartcard.target' } ,
{ 'file' : 'sockets.target' } ,
{ 'file' : 'soft-reboot.target' } ,
{ 'file' : 'sound.target' } ,
2024-03-12 20:44:33 +03:00
{ 'file' : 'ssh-access.target' } ,
2023-06-16 04:38:25 +03:00
{
'file' : 'suspend-then-hibernate.target' ,
'conditions' : [ 'ENABLE_HIBERNATE' ] ,
} ,
{ 'file' : 'suspend.target' } ,
{ 'file' : 'swap.target' } ,
{
'file' : 'sys-fs-fuse-connections.mount' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'sys-kernel-config.mount' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'sys-kernel-debug.mount' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'sys-kernel-tracing.mount' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{ 'file' : 'sysinit.target' } ,
{ 'file' : 'syslog.socket' } ,
{
'file' : 'system-systemd\\x2dcryptsetup.slice' ,
'conditions' : [ 'HAVE_LIBCRYPTSETUP' ] ,
} ,
{
'file' : 'system-systemd\\x2dveritysetup.slice' ,
'conditions' : [ 'HAVE_LIBCRYPTSETUP' ] ,
} ,
{ 'file' : 'system-update-cleanup.service' } ,
{ 'file' : 'system-update-pre.target' } ,
{ 'file' : 'system-update.target' } ,
{
'file' : 'systemd-ask-password-console.path' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{ 'file' : 'systemd-ask-password-console.service' } ,
{
'file' : 'systemd-ask-password-wall.path' ,
'symlinks' : [ 'multi-user.target.wants/' ] ,
} ,
{ 'file' : 'systemd-ask-password-wall.service' } ,
{
'file' : 'systemd-backlight@.service.in' ,
'conditions' : [ 'ENABLE_BACKLIGHT' ] ,
} ,
{
'file' : 'systemd-binfmt.service.in' ,
'conditions' : [ 'ENABLE_BINFMT' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-bless-boot.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_BLKID' ] ,
} ,
{ 'file' : 'systemd-boot-check-no-failures.service.in' } ,
{
'file' : 'systemd-boot-random-seed.service' ,
'conditions' : [ 'ENABLE_BOOTLOADER' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-boot-update.service' ,
'conditions' : [ 'ENABLE_BOOTLOADER' ] ,
} ,
2024-02-12 19:30:31 +03:00
{
2024-03-08 20:08:50 +03:00
'file' : 'systemd-bootctl@.service' ,
2024-02-12 19:30:31 +03:00
'conditions' : [ 'ENABLE_BOOTLOADER' ] ,
} ,
{
'file' : 'systemd-bootctl.socket' ,
'conditions' : [ 'ENABLE_BOOTLOADER' ] ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-confext.service' ,
'conditions' : [ 'ENABLE_SYSEXT' ] ,
} ,
{
'file' : 'systemd-coredump.socket' ,
'conditions' : [ 'ENABLE_COREDUMP' ] ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
{
'file' : 'systemd-coredump@.service.in' ,
'conditions' : [ 'ENABLE_COREDUMP' ] ,
} ,
2023-11-24 00:22:27 +03:00
{
'file' : 'systemd-creds.socket' ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
{ 'file' : 'systemd-creds@.service' } ,
2023-06-16 04:38:25 +03:00
{ 'file' : 'systemd-exit.service' } ,
{
'file' : 'systemd-firstboot.service' ,
'conditions' : [ 'ENABLE_FIRSTBOOT' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{ 'file' : 'systemd-fsck-root.service.in' } ,
{ 'file' : 'systemd-fsck@.service.in' } ,
{ 'file' : 'systemd-growfs-root.service.in' } ,
{ 'file' : 'systemd-growfs@.service.in' } ,
{ 'file' : 'systemd-halt.service' } ,
units: introduce systemd-hibernate-clear.service that clears
stale HibernateLocation EFI variable
Currently, if the HibernateLocation EFI variable exists,
but we failed to resume from it, the boot carries on
without clearing the stale variable. Therefore, the subsequent
boots would still be waiting for the device timeout,
unless the variable is purged manually.
There's no point to keep trying to resume after a successful
switch-root, because the hibernation image state
would have been invalidated by then. OTOH, we don't
want to clear the variable prematurely either,
i.e. in initrd, since if the resume device is the same
as root one, the boot won't succeed and the user might
be able to try resuming again. So, let's introduce a
unit that only runs after switch-root and clears the var.
Fixes #32021
2024-03-31 15:52:39 +03:00
{
'file' : 'systemd-hibernate-clear.service.in' ,
'conditions' : [ 'ENABLE_HIBERNATE' , 'ENABLE_EFI' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
hibernate-resume: split out the logic of finding hibernate location
Before this commit, the hibernate location logic only exists in
the generator. Also, we compare device nodes (devnode_same()) and
clear EFI variable HibernateLocation in the generator too. This is
not ideal though: when the generator gets to run, udev hasn't yet
started, so effectively devnode_same() always fails. Moreover, if
the boot process is interrupted by e.g. battery-check, the hibernate
information is lost.
Therefore, let's split out the logic of finding hibernate location.
The generator only does the initial validation of system info and
enables systemd-hibernate-resume.service, and when the service
actually runs we validate everything again, which includes comparing
the device nodes and clearing the EFI variable. This should make
things more robust, plus systems that don't utilize a systemd-enabled
initrd can use the exact same logic to resume using the EFI variable.
I.e., systemd-hibernate-resume can be used standalone.
2023-09-05 16:50:04 +03:00
{
'file' : 'systemd-hibernate-resume.service.in' ,
'conditions' : [ 'ENABLE_HIBERNATE' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-hibernate.service.in' ,
'conditions' : [ 'ENABLE_HIBERNATE' ] ,
} ,
{
'file' : 'systemd-homed-activate.service' ,
'conditions' : [ 'ENABLE_HOMED' ] ,
} ,
2023-11-22 12:58:14 +03:00
{
'file' : 'systemd-homed-firstboot.service' ,
'conditions' : [ 'ENABLE_HOMED' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-homed.service.in' ,
'conditions' : [ 'ENABLE_HOMED' ] ,
} ,
{
'file' : 'systemd-hostnamed.service.in' ,
'conditions' : [ 'ENABLE_HOSTNAMED' ] ,
'symlinks' : [ 'dbus-org.freedesktop.hostname1.service' ] ,
} ,
2024-01-08 17:13:07 +03:00
{
'file' : 'systemd-hostnamed.socket' ,
'conditions' : [ 'ENABLE_HOSTNAMED' ] ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-hwdb-update.service.in' ,
'conditions' : [ 'ENABLE_HWDB' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-hybrid-sleep.service.in' ,
'conditions' : [ 'ENABLE_HIBERNATE' ] ,
} ,
{
'file' : 'systemd-importd.service.in' ,
'conditions' : [ 'ENABLE_IMPORTD' ] ,
'symlinks' : [ 'dbus-org.freedesktop.import1.service' ] ,
} ,
2024-05-08 12:11:43 +03:00
{
'file' : 'systemd-importd.socket' ,
'conditions' : [ 'ENABLE_IMPORTD' ] ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-initctl.service.in' ,
'conditions' : [ 'HAVE_SYSV_COMPAT' ] ,
} ,
{
'file' : 'systemd-initctl.socket' ,
'conditions' : [ 'HAVE_SYSV_COMPAT' ] ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
{
'file' : 'systemd-journal-catalog-update.service' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-journal-flush.service' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-journal-gatewayd.service.in' ,
'conditions' : [ 'ENABLE_REMOTE' , 'HAVE_MICROHTTPD' ] ,
} ,
{
'file' : 'systemd-journal-gatewayd.socket' ,
'conditions' : [ 'ENABLE_REMOTE' , 'HAVE_MICROHTTPD' ] ,
} ,
{
'file' : 'systemd-journal-remote.service.in' ,
'conditions' : [ 'ENABLE_REMOTE' , 'HAVE_MICROHTTPD' ] ,
} ,
{
'file' : 'systemd-journal-remote.socket' ,
'conditions' : [ 'ENABLE_REMOTE' , 'HAVE_MICROHTTPD' ] ,
} ,
{
'file' : 'systemd-journal-upload.service.in' ,
'conditions' : [ 'ENABLE_REMOTE' , 'HAVE_LIBCURL' ] ,
} ,
{ 'file' : 'systemd-journald-audit.socket' } ,
{
'file' : 'systemd-journald-dev-log.socket' ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
2024-05-02 00:18:52 +03:00
{ 'file' : 'systemd-journald-sync@.service' } ,
2023-06-16 04:38:25 +03:00
{ 'file' : 'systemd-journald-varlink@.socket' } ,
{
'file' : 'systemd-journald.service.in' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-journald.socket' ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
{ 'file' : 'systemd-journald@.service.in' } ,
{ 'file' : 'systemd-journald@.socket' } ,
{ 'file' : 'systemd-kexec.service' } ,
{
'file' : 'systemd-localed.service.in' ,
'conditions' : [ 'ENABLE_LOCALED' ] ,
'symlinks' : [ 'dbus-org.freedesktop.locale1.service' ] ,
} ,
{
'file' : 'systemd-logind.service.in' ,
'conditions' : [ 'ENABLE_LOGIND' ] ,
'symlinks' : [ 'multi-user.target.wants/' , 'dbus-org.freedesktop.login1.service' ] ,
} ,
{
'file' : 'systemd-machine-id-commit.service' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-machined.service.in' ,
'conditions' : [ 'ENABLE_MACHINED' ] ,
'symlinks' : [ 'dbus-org.freedesktop.machine1.service' ] ,
} ,
{
'file' : 'systemd-modules-load.service.in' ,
'conditions' : [ 'HAVE_KMOD' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{ 'file' : 'systemd-network-generator.service.in' } ,
2024-02-26 04:33:20 +03:00
{
'file' : 'systemd-networkd-persistent-storage.service' ,
'conditions' : [ 'ENABLE_NETWORKD' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-networkd-wait-online.service.in' ,
'conditions' : [ 'ENABLE_NETWORKD' ] ,
} ,
{
'file' : 'systemd-networkd-wait-online@.service.in' ,
'conditions' : [ 'ENABLE_NETWORKD' ] ,
} ,
{
'file' : 'systemd-networkd.service.in' ,
'conditions' : [ 'ENABLE_NETWORKD' ] ,
} ,
{
'file' : 'systemd-networkd.socket' ,
'conditions' : [ 'ENABLE_NETWORKD' ] ,
} ,
{ 'file' : 'systemd-nspawn@.service.in' } ,
2024-02-07 20:22:39 +03:00
{
'file' : 'systemd-vmspawn@.service.in' ,
'conditions' : [ 'ENABLE_VMSPAWN' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-oomd.service.in' ,
'conditions' : [ 'ENABLE_OOMD' ] ,
} ,
{
'file' : 'systemd-oomd.socket' ,
'conditions' : [ 'ENABLE_OOMD' ] ,
} ,
2023-09-25 17:28:24 +03:00
{
'file' : 'systemd-pcrextend@.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
} ,
{
'file' : 'systemd-pcrextend.socket' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-pcrfs-root.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
} ,
{
'file' : 'systemd-pcrfs@.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
} ,
{
'file' : 'systemd-pcrmachine.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-pcrphase-initrd.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' , 'ENABLE_INITRD' ] ,
'symlinks' : [ 'initrd.target.wants/' ] ,
} ,
{
'file' : 'systemd-pcrphase-sysinit.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-pcrphase.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
2023-09-26 22:25:53 +03:00
{
'file' : 'systemd-tpm2-setup.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-tpm2-setup-early.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
2023-10-23 13:02:53 +03:00
{
'file' : 'systemd-pcrlock-make-policy.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
} ,
{
'file' : 'systemd-pcrlock-secureboot-policy.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
} ,
{
'file' : 'systemd-pcrlock-secureboot-authority.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
} ,
{
'file' : 'systemd-pcrlock-file-system.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
} ,
{
'file' : 'systemd-pcrlock-machine-id.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
} ,
{
'file' : 'systemd-pcrlock-firmware-code.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
} ,
{
'file' : 'systemd-pcrlock-firmware-config.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
} ,
2024-02-02 17:17:09 +03:00
{
'file' : 'systemd-pcrlock@.service.in' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
} ,
{
'file' : 'systemd-pcrlock.socket' ,
'conditions' : [ 'ENABLE_BOOTLOADER' , 'HAVE_OPENSSL' , 'HAVE_TPM2' ] ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-portabled.service.in' ,
'conditions' : [ 'ENABLE_PORTABLED' ] ,
'symlinks' : [ 'dbus-org.freedesktop.portable1.service' ] ,
} ,
{ 'file' : 'systemd-poweroff.service' } ,
{
'file' : 'systemd-pstore.service.in' ,
'conditions' : [ 'ENABLE_PSTORE' ] ,
} ,
{
2022-09-19 17:57:48 +03:00
'file' : 'systemd-quotacheck@.service.in' ,
'conditions' : [ 'ENABLE_QUOTACHECK' ] ,
} ,
{
'file' : 'systemd-quotacheck-root.service.in' ,
2023-06-16 04:38:25 +03:00
'conditions' : [ 'ENABLE_QUOTACHECK' ] ,
} ,
{
'file' : 'systemd-random-seed.service.in' ,
'conditions' : [ 'ENABLE_RANDOMSEED' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{ 'file' : 'systemd-reboot.service' } ,
{ 'file' : 'systemd-remount-fs.service.in' } ,
{
2024-03-08 20:08:50 +03:00
'file' : 'systemd-repart.service' ,
2023-06-16 04:38:25 +03:00
'conditions' : [ 'ENABLE_REPART' ] ,
'symlinks' : [ 'sysinit.target.wants/' , 'initrd-root-fs.target.wants/' ] ,
} ,
{
'file' : 'systemd-resolved.service.in' ,
'conditions' : [ 'ENABLE_RESOLVE' ] ,
} ,
{
'file' : 'systemd-rfkill.service.in' ,
'conditions' : [ 'ENABLE_RFKILL' ] ,
} ,
{
'file' : 'systemd-rfkill.socket' ,
'conditions' : [ 'ENABLE_RFKILL' ] ,
} ,
{ 'file' : 'systemd-soft-reboot.service' } ,
{
'file' : 'systemd-suspend-then-hibernate.service.in' ,
'conditions' : [ 'ENABLE_HIBERNATE' ] ,
} ,
{ 'file' : 'systemd-suspend.service.in' } ,
{
'file' : 'systemd-sysctl.service.in' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-sysext.service' ,
'conditions' : [ 'ENABLE_SYSEXT' ] ,
} ,
2023-10-09 19:57:41 +03:00
{
'file' : 'systemd-sysext.socket' ,
'conditions' : [ 'ENABLE_SYSEXT' ] ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
{
'file' : 'systemd-sysext@.service' ,
'conditions' : [ 'ENABLE_SYSEXT' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-sysupdate-reboot.service.in' ,
'conditions' : [ 'ENABLE_SYSUPDATE' ] ,
} ,
{
'file' : 'systemd-sysupdate-reboot.timer' ,
'conditions' : [ 'ENABLE_SYSUPDATE' ] ,
} ,
{
'file' : 'systemd-sysupdate.service.in' ,
'conditions' : [ 'ENABLE_SYSUPDATE' ] ,
} ,
2023-06-30 05:58:41 +03:00
{
'file' : 'systemd-sysupdated.service.in' ,
'conditions' : [ 'ENABLE_SYSUPDATE' ] ,
'symlinks' : [ 'dbus-org.freedesktop.sysupdate1.service' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-sysupdate.timer' ,
'conditions' : [ 'ENABLE_SYSUPDATE' ] ,
} ,
{
'file' : 'systemd-sysusers.service' ,
'conditions' : [ 'ENABLE_SYSUSERS' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
storagetm: add new systemd-storagetm component
This implements a "storage target mode", similar to what MacOS provides
since a long time as "Target Disk Mode":
https://en.wikipedia.org/wiki/Target_Disk_Mode
This implementation is relatively simple:
1. a new generic target "storage-target-mode.target" is added, which
when booted into defines the target mode.
2. a small tool and service "systemd-storagetm.service" is added which
exposes a specific device or all devices as NVMe-TCP devices over the
network. NVMe-TCP appears to be hot shit right now how to expose
block devices over the network. And it's really simple to set up via
configs, hence our code is relatively short and neat.
The idea is that systemd-storagetm.target can be extended sooner or
later, for example to expose block devices also as USB mass storage
devices and similar, in case the system has "dual mode" USB controller
that can also work as device, not just as host. (And people could also
plug in sharing as NBD, iSCSI, whatever they want.)
How to use this? Boot into your system with a kernel cmdline of
"rd.systemd.unit=storage-target-mode.target ip=link-local", and you'll see on
screen the precise "nvme connect" command line to make the relevant
block devices available locally on some other machine. This all requires
that the target mode stuff is included in the initrd of course. And the
system will the stay in the initrd forever.
Why bother? Primarily three use-cases:
1. Debug a broken system: with very few dependencies during boot get
access to the raw block device of a broken machine.
2. Migrate from system to another system, by dd'ing the old to the new
directly.
3. Installing an OS remotely on some device (for example via Thunderbolt
networking)
(And there might be more, for example the ability to boot from a
laptop's disk on another system)
Limitations:
1. There's no authentication/encryption. Hence: use this on local links
only.
2. NVMe target mode on Linux supports r/w operation only. Ideally, we'd
have a read-only mode, for security reasons, and default to it.
Future love:
1. We should have another mode, where we simply expose the homed LUKS
home dirs like that.
2. Some lightweight hookup with plymouth, to display a (shortened)
version of the info we write to the console.
To test all this, just run:
mkosi --kernel-command-line-extra="rd.systemd.unit=storage-target-mode.target" qemu
2023-10-27 15:25:49 +03:00
{
'file' : 'systemd-storagetm.service.in' ,
'conditions' : [ 'ENABLE_STORAGETM' ] ,
} ,
{
'file' : 'storage-target-mode.target' ,
'conditions' : [ 'ENABLE_STORAGETM' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-time-wait-sync.service.in' ,
'conditions' : [ 'ENABLE_TIMESYNCD' ] ,
} ,
{
'file' : 'systemd-timedated.service.in' ,
'conditions' : [ 'ENABLE_TIMEDATED' ] ,
'symlinks' : [ 'dbus-org.freedesktop.timedate1.service' ] ,
} ,
{
'file' : 'systemd-timesyncd.service.in' ,
'conditions' : [ 'ENABLE_TIMESYNCD' ] ,
} ,
{
'file' : 'systemd-tmpfiles-clean.service' ,
'conditions' : [ 'ENABLE_TMPFILES' ] ,
} ,
{
'file' : 'systemd-tmpfiles-clean.timer' ,
'conditions' : [ 'ENABLE_TMPFILES' ] ,
'symlinks' : [ 'timers.target.wants/' ] ,
} ,
2023-08-12 01:54:32 +03:00
{
'file' : 'systemd-tmpfiles-setup-dev-early.service' ,
'conditions' : [ 'ENABLE_TMPFILES' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-tmpfiles-setup-dev.service' ,
'conditions' : [ 'ENABLE_TMPFILES' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-tmpfiles-setup.service' ,
'conditions' : [ 'ENABLE_TMPFILES' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
2024-04-04 22:04:31 +03:00
{ 'file' : 'systemd-udev-load-credentials.service' } ,
2023-06-16 04:38:25 +03:00
{ 'file' : 'systemd-udev-settle.service' } ,
{
'file' : 'systemd-udev-trigger.service' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-udevd-control.socket' ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
{
'file' : 'systemd-udevd-kernel.socket' ,
'symlinks' : [ 'sockets.target.wants/' ] ,
} ,
{
'file' : 'systemd-udevd.service.in' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-update-done.service.in' ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-update-utmp-runlevel.service.in' ,
'conditions' : [ 'ENABLE_UTMP' , 'HAVE_SYSV_COMPAT' ] ,
'symlinks' : [ 'multi-user.target.wants/' , 'graphical.target.wants/' , 'rescue.target.wants/' ] ,
} ,
{
'file' : 'systemd-update-utmp.service.in' ,
'conditions' : [ 'ENABLE_UTMP' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
{
'file' : 'systemd-user-sessions.service.in' ,
'conditions' : [ 'HAVE_PAM' ] ,
'symlinks' : [ 'multi-user.target.wants/' ] ,
} ,
{
'file' : 'systemd-userdbd.service.in' ,
'conditions' : [ 'ENABLE_USERDB' ] ,
} ,
{
'file' : 'systemd-userdbd.socket' ,
'conditions' : [ 'ENABLE_USERDB' ] ,
} ,
2023-03-09 14:27:29 +03:00
{
'file' : 'systemd-mountfsd.service.in' ,
'conditions' : [ 'ENABLE_MOUNTFSD' ] ,
} ,
{
'file' : 'systemd-mountfsd.socket' ,
'conditions' : [ 'ENABLE_MOUNTFSD' ] ,
} ,
2023-04-20 20:07:33 +03:00
{
'file' : 'systemd-nsresourced.service.in' ,
'conditions' : [ 'ENABLE_NSRESOURCED' ] ,
} ,
{
'file' : 'systemd-nsresourced.socket' ,
'conditions' : [ 'ENABLE_NSRESOURCED' ] ,
} ,
2023-06-16 04:38:25 +03:00
{
'file' : 'systemd-vconsole-setup.service.in' ,
'conditions' : [ 'ENABLE_VCONSOLE' ] ,
} ,
{
'file' : 'systemd-volatile-root.service.in' ,
'conditions' : [ 'ENABLE_INITRD' ] ,
} ,
{ 'file' : 'time-set.target' } ,
{ 'file' : 'time-sync.target' } ,
{ 'file' : 'timers.target' } ,
{
'file' : 'tmp.mount' ,
'symlinks' : [ 'local-fs.target.wants/' ] ,
} ,
2023-11-24 20:01:56 +03:00
{ 'file' : 'tpm2.target' } ,
2023-06-16 04:38:25 +03:00
{ 'file' : 'umount.target' } ,
{ 'file' : 'usb-gadget.target' } ,
{ 'file' : 'user-runtime-dir@.service.in' } ,
{ 'file' : 'user.slice' } ,
{ 'file' : 'user@.service.in' } ,
{
'file' : 'var-lib-machines.mount' ,
'conditions' : [ 'ENABLE_MACHINED' ] ,
'symlinks' : [ 'remote-fs.target.wants/' , 'machines.target.wants/' ] ,
} ,
{
'file' : 'veritysetup-pre.target' ,
'conditions' : [ 'HAVE_LIBCRYPTSETUP' ] ,
} ,
{
'file' : 'veritysetup.target' ,
'conditions' : [ 'HAVE_LIBCRYPTSETUP' ] ,
'symlinks' : [ 'sysinit.target.wants/' ] ,
} ,
2017-04-13 03:58:55 +03:00
]
2023-06-16 04:38:25 +03:00
foreach unit : units
source = unit . get ( 'file' )
2017-04-10 06:43:53 +03:00
2023-06-16 04:38:25 +03:00
if source . endswith ( '.in' )
needs_jinja = true
name = source . substring ( 0 , - 3 )
assert ( name + '.in' == source )
else
needs_jinja = false
name = source
2017-04-18 02:25:00 +03:00
endif
2023-06-16 04:38:25 +03:00
source = files ( source )
meson: build systemd using meson
It's crucial that we can build systemd using VS2010!
... er, wait, no, that's not the official reason. We need to shed old systems
by requring python 3! Oh, no, it's something else. Maybe we need to throw out
345 years of knowlege accumulated in autotools? Whatever, this new thing is
cool and shiny, let's use it.
This is not complete, I'm throwing it out here for your amusement and critique.
- rules for sd-boot are missing. Those might be quite complicated.
- rules for tests are missing too. Those are probably quite simple and
repetitive, but there's lots of them.
- it's likely that I didn't get all the conditions right, I only tested "full"
compilation where most deps are provided and nothing is disabled.
- busname.target and all .busname units are skipped on purpose.
Otherwise, installation into $DESTDIR has the same list of files and the
autoconf install, except for .la files.
It'd be great if people had a careful look at all the library linking options.
I added stuff until things compiled, and in the end there's much less linking
then in the old system. But it seems that there's still a lot of unnecessary
deps.
meson has a `shared_module` statement, which sounds like something appropriate
for our nss and pam modules. Unfortunately, I couldn't get it to work. For the
nss modules, we need an .so version of '2', but `shared_module` disallows the
version argument. For the pam module, it also didn't work, I forgot the reason.
The handling of .m4 and .in and .m4.in files is rather awkward. It's likely
that this could be simplified. If make support is ever dropped, I think it'd
make sense to switch to a different templating system so that two different
languages and not required, which would make everything simpler yet.
v2:
- use get_pkgconfig_variable
- use sh not bash
- use add_project_arguments
v3:
- drop required:true and fix progs/prog typo
v4:
- use find_library('bz2')
- add TTY_GID definition
- define __SANE_USERSPACE_TYPES__
- use join_paths(prefix, ...) is used on all paths to make them all absolute
v5:
- replace all declare_dependency's with []
- add more conf.get guards around optional components
v6:
- drop -pipe, -Wall which are the default in meson
- use compiler.has_function() and compiler.has_header_symbol instead of the
hand-rolled checks.
- fix duplication in 'liblibsystemd' library name
- use the right .sym file for pam_systemd
- rename 'compiler' to 'cc': shorter, and more idiomatic.
v7:
- use ENABLE_ENVIRONMENT_D not HAVE_ENVIRONMENT_D
- rename prefix to prefixdir, rootprefix to rootprefixdir
("prefix" is too common of a name and too easy to overwrite by mistake)
- wrap more stuff with conf.get('ENABLE...') == 1
- use rootprefix=='/' and rootbindir as install_dir, to fix paths under
split-usr==true.
v8:
- use .split() also for src/coredump. Now everything is consistent ;)
- add rootlibdir option and use it on the libraries that require it
v9:
- indentation
v10:
- fix check for qrencode and libaudit
v11:
- unify handling of executable paths, provide options for all progs
This makes the meson build behave slightly differently than the
autoconf-based one, because we always first try to find the executable in the
filesystem, and fall back to the default. I think different handling of
loadkeys, setfont, and telinit was just a historical accident.
In addition to checking in $PATH, also check /usr/sbin/, /sbin for programs.
In Fedora $PATH includes /usr/sbin, (and /sbin is is a symlink to /usr/sbin),
but in Debian, those directories are not included in the path.
C.f. https://github.com/mesonbuild/meson/issues/1576.
- call all the options 'xxx-path' for clarity.
- sort man/rules/meson.build properly so it's stable
2017-04-05 06:03:47 +03:00
2023-06-16 04:38:25 +03:00
install = true
foreach cond : unit . get ( 'conditions' , [ ] )
if conf . get ( cond ) != 1
install = false
break
endif
endforeach
meson: build systemd using meson
It's crucial that we can build systemd using VS2010!
... er, wait, no, that's not the official reason. We need to shed old systems
by requring python 3! Oh, no, it's something else. Maybe we need to throw out
345 years of knowlege accumulated in autotools? Whatever, this new thing is
cool and shiny, let's use it.
This is not complete, I'm throwing it out here for your amusement and critique.
- rules for sd-boot are missing. Those might be quite complicated.
- rules for tests are missing too. Those are probably quite simple and
repetitive, but there's lots of them.
- it's likely that I didn't get all the conditions right, I only tested "full"
compilation where most deps are provided and nothing is disabled.
- busname.target and all .busname units are skipped on purpose.
Otherwise, installation into $DESTDIR has the same list of files and the
autoconf install, except for .la files.
It'd be great if people had a careful look at all the library linking options.
I added stuff until things compiled, and in the end there's much less linking
then in the old system. But it seems that there's still a lot of unnecessary
deps.
meson has a `shared_module` statement, which sounds like something appropriate
for our nss and pam modules. Unfortunately, I couldn't get it to work. For the
nss modules, we need an .so version of '2', but `shared_module` disallows the
version argument. For the pam module, it also didn't work, I forgot the reason.
The handling of .m4 and .in and .m4.in files is rather awkward. It's likely
that this could be simplified. If make support is ever dropped, I think it'd
make sense to switch to a different templating system so that two different
languages and not required, which would make everything simpler yet.
v2:
- use get_pkgconfig_variable
- use sh not bash
- use add_project_arguments
v3:
- drop required:true and fix progs/prog typo
v4:
- use find_library('bz2')
- add TTY_GID definition
- define __SANE_USERSPACE_TYPES__
- use join_paths(prefix, ...) is used on all paths to make them all absolute
v5:
- replace all declare_dependency's with []
- add more conf.get guards around optional components
v6:
- drop -pipe, -Wall which are the default in meson
- use compiler.has_function() and compiler.has_header_symbol instead of the
hand-rolled checks.
- fix duplication in 'liblibsystemd' library name
- use the right .sym file for pam_systemd
- rename 'compiler' to 'cc': shorter, and more idiomatic.
v7:
- use ENABLE_ENVIRONMENT_D not HAVE_ENVIRONMENT_D
- rename prefix to prefixdir, rootprefix to rootprefixdir
("prefix" is too common of a name and too easy to overwrite by mistake)
- wrap more stuff with conf.get('ENABLE...') == 1
- use rootprefix=='/' and rootbindir as install_dir, to fix paths under
split-usr==true.
v8:
- use .split() also for src/coredump. Now everything is consistent ;)
- add rootlibdir option and use it on the libraries that require it
v9:
- indentation
v10:
- fix check for qrencode and libaudit
v11:
- unify handling of executable paths, provide options for all progs
This makes the meson build behave slightly differently than the
autoconf-based one, because we always first try to find the executable in the
filesystem, and fall back to the default. I think different handling of
loadkeys, setfont, and telinit was just a historical accident.
In addition to checking in $PATH, also check /usr/sbin/, /sbin for programs.
In Fedora $PATH includes /usr/sbin, (and /sbin is is a symlink to /usr/sbin),
but in Debian, those directories are not included in the path.
C.f. https://github.com/mesonbuild/meson/issues/1576.
- call all the options 'xxx-path' for clarity.
- sort man/rules/meson.build properly so it's stable
2017-04-05 06:03:47 +03:00
2023-06-16 04:38:25 +03:00
if needs_jinja
custom_target (
name ,
input : source ,
output : name ,
command : [ jinja2_cmdline , '@INPUT@' , '@OUTPUT@' ] ,
install : install ,
install_dir : systemunitdir )
elif install
install_data ( source ,
2017-04-18 02:25:00 +03:00
install_dir : systemunitdir )
2023-06-16 04:38:25 +03:00
endif
2017-04-10 06:43:53 +03:00
2023-06-16 04:38:25 +03:00
if install
foreach target : unit . get ( 'symlinks' , [ ] )
2023-08-08 04:38:47 +03:00
if target . endswith ( '/' )
install_emptydir ( systemunitdir / target )
meson . add_install_script ( sh , '-c' ,
ln_s . format ( systemunitdir / name ,
systemunitdir / target / name ) )
else
meson . add_install_script ( sh , '-c' ,
ln_s . format ( systemunitdir / name ,
systemunitdir / target ) )
endif
2023-06-16 04:38:25 +03:00
endforeach
2017-04-18 02:25:00 +03:00
endif
meson: build systemd using meson
It's crucial that we can build systemd using VS2010!
... er, wait, no, that's not the official reason. We need to shed old systems
by requring python 3! Oh, no, it's something else. Maybe we need to throw out
345 years of knowlege accumulated in autotools? Whatever, this new thing is
cool and shiny, let's use it.
This is not complete, I'm throwing it out here for your amusement and critique.
- rules for sd-boot are missing. Those might be quite complicated.
- rules for tests are missing too. Those are probably quite simple and
repetitive, but there's lots of them.
- it's likely that I didn't get all the conditions right, I only tested "full"
compilation where most deps are provided and nothing is disabled.
- busname.target and all .busname units are skipped on purpose.
Otherwise, installation into $DESTDIR has the same list of files and the
autoconf install, except for .la files.
It'd be great if people had a careful look at all the library linking options.
I added stuff until things compiled, and in the end there's much less linking
then in the old system. But it seems that there's still a lot of unnecessary
deps.
meson has a `shared_module` statement, which sounds like something appropriate
for our nss and pam modules. Unfortunately, I couldn't get it to work. For the
nss modules, we need an .so version of '2', but `shared_module` disallows the
version argument. For the pam module, it also didn't work, I forgot the reason.
The handling of .m4 and .in and .m4.in files is rather awkward. It's likely
that this could be simplified. If make support is ever dropped, I think it'd
make sense to switch to a different templating system so that two different
languages and not required, which would make everything simpler yet.
v2:
- use get_pkgconfig_variable
- use sh not bash
- use add_project_arguments
v3:
- drop required:true and fix progs/prog typo
v4:
- use find_library('bz2')
- add TTY_GID definition
- define __SANE_USERSPACE_TYPES__
- use join_paths(prefix, ...) is used on all paths to make them all absolute
v5:
- replace all declare_dependency's with []
- add more conf.get guards around optional components
v6:
- drop -pipe, -Wall which are the default in meson
- use compiler.has_function() and compiler.has_header_symbol instead of the
hand-rolled checks.
- fix duplication in 'liblibsystemd' library name
- use the right .sym file for pam_systemd
- rename 'compiler' to 'cc': shorter, and more idiomatic.
v7:
- use ENABLE_ENVIRONMENT_D not HAVE_ENVIRONMENT_D
- rename prefix to prefixdir, rootprefix to rootprefixdir
("prefix" is too common of a name and too easy to overwrite by mistake)
- wrap more stuff with conf.get('ENABLE...') == 1
- use rootprefix=='/' and rootbindir as install_dir, to fix paths under
split-usr==true.
v8:
- use .split() also for src/coredump. Now everything is consistent ;)
- add rootlibdir option and use it on the libraries that require it
v9:
- indentation
v10:
- fix check for qrencode and libaudit
v11:
- unify handling of executable paths, provide options for all progs
This makes the meson build behave slightly differently than the
autoconf-based one, because we always first try to find the executable in the
filesystem, and fall back to the default. I think different handling of
loadkeys, setfont, and telinit was just a historical accident.
In addition to checking in $PATH, also check /usr/sbin/, /sbin for programs.
In Fedora $PATH includes /usr/sbin, (and /sbin is is a symlink to /usr/sbin),
but in Debian, those directories are not included in the path.
C.f. https://github.com/mesonbuild/meson/issues/1576.
- call all the options 'xxx-path' for clarity.
- sort man/rules/meson.build properly so it's stable
2017-04-05 06:03:47 +03:00
endforeach
2017-12-08 00:25:26 +03:00
install_data ( 'user-.slice.d/10-defaults.conf' ,
install_dir : systemunitdir + '/user-.slice.d' )
2022-07-07 13:02:04 +03:00
install_data ( 'user@.service.d/10-login-barrier.conf' ,
install_dir : systemunitdir + '/user@.service.d' )
install_data ( 'user@0.service.d/10-login-barrier.conf' ,
install_dir : systemunitdir + '/user@0.service.d' )
2017-04-13 03:58:55 +03:00
############################################################
2023-08-08 04:38:47 +03:00
install_emptydir ( dbussessionservicedir )
meson . add_install_script ( sh , '-c' ,
ln_s . format ( dbussystemservicedir / 'org.freedesktop.systemd1.service' ,
dbussessionservicedir / 'org.freedesktop.systemd1.service' ) )
2017-10-03 11:41:51 +03:00
if conf . get ( 'HAVE_SYSV_COMPAT' ) == 1
2017-04-18 02:25:00 +03:00
foreach i : [ 1 , 2 , 3 , 4 , 5 ]
2023-08-08 04:38:47 +03:00
install_emptydir ( systemunitdir / 'runlevel@0@.target.wants' . format ( i ) )
2017-04-18 02:25:00 +03:00
endforeach
2017-04-10 06:55:05 +03:00
endif
meson: build systemd using meson
It's crucial that we can build systemd using VS2010!
... er, wait, no, that's not the official reason. We need to shed old systems
by requring python 3! Oh, no, it's something else. Maybe we need to throw out
345 years of knowlege accumulated in autotools? Whatever, this new thing is
cool and shiny, let's use it.
This is not complete, I'm throwing it out here for your amusement and critique.
- rules for sd-boot are missing. Those might be quite complicated.
- rules for tests are missing too. Those are probably quite simple and
repetitive, but there's lots of them.
- it's likely that I didn't get all the conditions right, I only tested "full"
compilation where most deps are provided and nothing is disabled.
- busname.target and all .busname units are skipped on purpose.
Otherwise, installation into $DESTDIR has the same list of files and the
autoconf install, except for .la files.
It'd be great if people had a careful look at all the library linking options.
I added stuff until things compiled, and in the end there's much less linking
then in the old system. But it seems that there's still a lot of unnecessary
deps.
meson has a `shared_module` statement, which sounds like something appropriate
for our nss and pam modules. Unfortunately, I couldn't get it to work. For the
nss modules, we need an .so version of '2', but `shared_module` disallows the
version argument. For the pam module, it also didn't work, I forgot the reason.
The handling of .m4 and .in and .m4.in files is rather awkward. It's likely
that this could be simplified. If make support is ever dropped, I think it'd
make sense to switch to a different templating system so that two different
languages and not required, which would make everything simpler yet.
v2:
- use get_pkgconfig_variable
- use sh not bash
- use add_project_arguments
v3:
- drop required:true and fix progs/prog typo
v4:
- use find_library('bz2')
- add TTY_GID definition
- define __SANE_USERSPACE_TYPES__
- use join_paths(prefix, ...) is used on all paths to make them all absolute
v5:
- replace all declare_dependency's with []
- add more conf.get guards around optional components
v6:
- drop -pipe, -Wall which are the default in meson
- use compiler.has_function() and compiler.has_header_symbol instead of the
hand-rolled checks.
- fix duplication in 'liblibsystemd' library name
- use the right .sym file for pam_systemd
- rename 'compiler' to 'cc': shorter, and more idiomatic.
v7:
- use ENABLE_ENVIRONMENT_D not HAVE_ENVIRONMENT_D
- rename prefix to prefixdir, rootprefix to rootprefixdir
("prefix" is too common of a name and too easy to overwrite by mistake)
- wrap more stuff with conf.get('ENABLE...') == 1
- use rootprefix=='/' and rootbindir as install_dir, to fix paths under
split-usr==true.
v8:
- use .split() also for src/coredump. Now everything is consistent ;)
- add rootlibdir option and use it on the libraries that require it
v9:
- indentation
v10:
- fix check for qrencode and libaudit
v11:
- unify handling of executable paths, provide options for all progs
This makes the meson build behave slightly differently than the
autoconf-based one, because we always first try to find the executable in the
filesystem, and fall back to the default. I think different handling of
loadkeys, setfont, and telinit was just a historical accident.
In addition to checking in $PATH, also check /usr/sbin/, /sbin for programs.
In Fedora $PATH includes /usr/sbin, (and /sbin is is a symlink to /usr/sbin),
but in Debian, those directories are not included in the path.
C.f. https://github.com/mesonbuild/meson/issues/1576.
- call all the options 'xxx-path' for clarity.
- sort man/rules/meson.build properly so it's stable
2017-04-05 06:03:47 +03:00
subdir ( 'user' )