summaryrefslogtreecommitdiffstats
path: root/src/core/meson.build (follow)
Commit message (Collapse)AuthorAgeFilesLines
* core: add credentials logicLennart Poettering2020-08-251-1/+2
| | | | Fixes: #15778 #16060
* AppArmor: Support for loading a set of pre-compiled profiles at startup timeYmrDtnJu2020-06-091-0/+2
| | | | | | | | | | | | | | | Let systemd load a set of pre-compiled AppArmor profile files from a policy cache at /etc/apparmor/earlypolicy. Maintenance of that policy cache must be done outside of systemd. After successfully loading the profiles systemd will attempt to change to a profile named systemd. If systemd is already confined in a profile, it will not load any profile files and will not attempt to change it's profile. If anything goes wrong, systemd will only log failures. It will not fail to start.
* Split out generator directory setup to a src/core/generator-setup.cZbigniew Jędrzejewski-Szmek2020-03-271-0/+2
| | | | Those functions have only one non-test user, so we can move them to src/core/.
* core: add user/group resolution varlink interface to PID 1Lennart Poettering2020-01-151-0/+2
|
* Revert "Drop dbus activation stub service"Lennart Poettering2019-12-201-0/+2
| | | | | | | | | | | | | | | This reverts commit 07125d24eedb71693b3bf2b1f0730cd01aaac2dd. In contrast to what is claimed in #13396 dbus-broker apparently does care for the service file to be around, and otherwise will claim "Service Not Activatable" in the time between systemd starting up the broker and connecting to it, which the stub service file is supposed to make go away. Reverting this makes the integration test suite pass again on host with dbus-broker (i.e. current Fedora desktop). Tested with dbus-broker-21-6.fc31.x86_64.
* chown-recursive: move src/core/chown-recursive.[ch] → src/shared/Lennart Poettering2019-12-171-2/+0
| | | | | We want to use it outside of the core, hence let's moved it to the shared code directory.
* Drop dbus activation stub serviceMichael Biebl2019-08-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | This fixes the following problem: > At the very end of the boot, just after the first user logs in > (usually using sddm / X) I get the following messages in my logs: > Nov 18 07:02:33 samd dbus-daemon[2879]: [session uid=1000 pid=2877] Activated service 'org.freedesktop.systemd1' failed: Process org.freedesktop.systemd1 exited with status 1 > Nov 18 07:02:33 samd dbus-daemon[2879]: [session uid=1000 pid=2877] Activated service 'org.freedesktop.systemd1' failed: Process org.freedesktop.systemd1 exited with status 1 These messages are caused by the "stub" service files that systemd installs. It installed them because early versions of systemd activation required them to exist. Since dbus 1.11.0, a dbus-daemon that is run with --systemd-activation automatically assumes that o.fd.systemd1 is an activatable service. As a result, with a new enough dbus version, /usr/share/dbus-1/services/org.freedesktop.systemd1.service and /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service should become unnecessary, and they can be removed. dbus 1.11.0 was released 2015-12-02. Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=914015
* meson: create (empty) /etc/systemd/system during installationZbigniew Jędrzejewski-Szmek2019-08-051-4/+3
| | | | | | | | | We explicitly create /etc/systemd/user and other parts of the basic directory tree. I think we should create /etc/systemd/system too. (The alternative would be to not create those other directories too, but I think it's nice to have the basic directory structure in place after installation.) https://bugzilla.redhat.com/show_bug.cgi?id=1737362
* core: take random seed from boot loader and credit it to kernel entropy poolLennart Poettering2019-07-251-0/+2
|
* Add config and kernel commandline option to use short identifiersZbigniew Jędrzejewski-Szmek2019-07-101-3/+1
| | | | | | | No functional change, just docs and configuration and parsing. v2: - change ShortIdentifiers=yes|no to StatusUnitFormat=name|description.
* meson: stop creating .wants directories for {multi-user,getty}.target (#12569)Michael Biebl2019-05-171-4/+0
| | | | | | Since preset is supposed to be used to enable the services, there is no need to pre-create those directories either. Follow-up for #12164
* Revert "build: install /etc/systemd/{system,user}-generators"Lennart Poettering2019-04-021-2/+0
| | | | This reverts commit 509276f2b7d44d472b66e79cbfa531c1de4c3801.
* build: install /etc/systemd/{system,user}-generatorsTopi Miettinen2019-04-021-0/+2
| | | | | Manual page systemd.generators refers to /etc/systemd/{system,user}-generators, but the paths do not exist, so let's install them.
* meson: drop "_la_" from variable nameZbigniew Jędrzejewski-Szmek2019-03-051-2/+2
| | | | A left-over from libtool times.
* meson: use a convenience library for the sources shared between core/ and ↵Zbigniew Jędrzejewski-Szmek2019-03-051-8/+21
| | | | | | | | | | | the outside This avoids double compilation. Those files are tiny, so it doesn't save time, but we avoid repeated warnings and errors, and it's generally cleaner to it this way. The number of commands in 'ninja -C build clean && ninja -C build' drops from 1462 to 1455 for me.
* shutdown: rearrange shutdown sources in source treeLennart Poettering2019-03-051-10/+0
| | | | | | | | | | Let's move the shutdown binary into its own subdirectory in src/shutdown, after all it is relatively isolated from the normal PID 1 sources, being a different binary and all. Unfortunately it's not possible to move some of the code, since it is shared with PID 1, that I wished we could move, but I still think it's worth it.
* meson: declare version.h as dep for various targets that include build.hZbigniew Jędrzejewski-Szmek2019-02-251-1/+2
| | | | Should fix #11565.
* meson: simplify handling of pkgconfigdatadir=no, pkgconfiglibdir=noZbigniew Jędrzejewski-Szmek2018-12-211-14/+7
| | | | | | | | | | | The idea was that those vars could be configured to 'no' to not install the .pc files, or they could be set to '', and then they would be built but not installed. This was inherited from the autoconf build system. This couldn't work because '' is replaced by the default value. Also, having this level of control doesn't seem necessary, since creating those files is very quick. Skipping with 'no' was implemented only for systemd.pc and not the other .pc files. Let's simplify things and skip installation if the target dir is configured as 'no' for all .pc files.
* core: support cgroup v2 device controllerRoman Gushchin2018-10-091-0/+2
| | | | | | | | Cgroup v2 provides the eBPF-based device controller, which isn't currently supported by systemd. This commit aims to provide such support. There are no user-visible changes, just the device policy and whitelist start working if cgroup v2 is used.
* Drop my copyright headersZbigniew Jędrzejewski-Szmek2018-06-141-2/+0
| | | | | | | perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-1/+1
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* meson: generate m4 preprocessor from config.h (#8914)Yu Watanabe2018-05-071-1/+1
|
* meson: do not link libsystemd_static into libcore (#8813)Zbigniew Jędrzejewski-Szmek2018-04-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (or in terms of the names of the actual files on disk, do not link libsystemd-shared-238.a into libcore.a). libsystemd_static is linked into libsystemd_shared, which in turn means that anything that links to libcore and libsystemd_shared will get libsystemd_static twice: $ cc -o systemd 'systemd@exe/src_core_main.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -pie -DVALGRIND -Wl,--start-group src/core/libcore.a src/shared/libsystemd-shared-238.a src/shared/libsystemd-shared-238.so -pthread -lrt -lseccomp -lselinux -lmount -lblkid -Wl,--end-group -lseccomp -lpam -L/lib64 -laudit -lkmod -lmount -lrt -lcap -lacl -lcryptsetup -lgcrypt -lip4tc -lip6tc -lseccomp -lselinux -lidn -llzma -llz4 -lblkid '-Wl,-rpath,$ORIGIN/src/shared' -Wl,-rpath-link,/home/zbyszek/src/systemd/build/src/shared This propagation of the dependency seems correct (in the sense that meson is doing the expected thing based on the given configuration). Linking was done this way in the original meson conversion. I was probably trying to get everything to compile and link, I'm not sure why this particular choice was made. In the meantime, meson has gotten better at propagating dependencies, so it's possible that this had slightly different effect in the original conversion, but I did not verify this. Either way, I think we should drop this. With the patch: $ cc -o systemd 'systemd@exe/src_core_main.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -pie -DVALGRIND -Wl,--start-group src/core/libcore.a src/shared/libsystemd-shared-238.so -pthread -lrt -lseccomp -lselinux -lmount -Wl,--end-group -lblkid -lrt -lseccomp -lpam -L/lib64 -laudit -lkmod -lselinux -lmount '-Wl,-rpath,$ORIGIN/src/shared' -Wl,-rpath-link,/home/zbyszek/src/systemd/build/src/shared This is more correct because we're not linking the same code twice. With the patch, libystemd_static is used in exactly four places: - src/shared/libsystemd-shared-238.so - src/udev/libudev.so.1.6.10 - pam_systemd.so - test-bus-error (compared to a bunch more executables before, including systemd, systemd-analyze, test-hostname, test-ns, etc.) Size savings are also noticable: $ size /var/tmp/inst?/usr/lib/systemd/libsystemd-shared-238.so text data bss dec hex filename 2397826 578488 15920 2992234 2da86a /var/tmp/inst1/usr/lib/systemd/libsystemd-shared-238.so 2397826 578488 15920 2992234 2da86a /var/tmp/inst2/usr/lib/systemd/libsystemd-shared-238.so $ size /var/tmp/inst?/usr/lib/systemd/systemd text data bss dec hex filename 1858790 261688 9320 2129798 207f86 /var/tmp/inst1/usr/lib/systemd/systemd 1556358 258704 8072 1823134 1bd19e /var/tmp/inst2/usr/lib/systemd/systemd $ du -s /var/tmp/inst? 52216 /var/tmp/inst1 50844 /var/tmp/inst2 https://github.com/google/oss-fuzz/issues/1330#issuecomment-384054530 might be related.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Merge pull request #8202 from keszybz/avoid-msgmergeMichael Biebl2018-02-181-12/+5
|\ | | | | Replace msgmerge use by gettext-domain= references
| * meson: drop double .in suffix for o.fd.systemd1.policy fileZbigniew Jędrzejewski-Szmek2018-02-161-1/+1
| | | | | | | | | | This file is now undergoing just one transformation, so drop the unnecessary suffix.
| * Gettextize policy filesGunnar Hjalmarsson2018-02-161-11/+4
| | | | | | | | | | | | | | * Don't merge translations into the files * Add gettext-domain="systemd" to description and message Closes #8162, replaces #8118.
* | meson: add -Dmemory-accounting-default=true|falseZbigniew Jędrzejewski-Szmek2018-02-151-3/+3
|/ | | | | This makes it easy to set the default for distributions and users which want to default to off because they primarily use older kernels.
* core: add dbus-util.[ch] to simplify creating transient unitsYu Watanabe2018-01-011-0/+2
| | | | The functions and macros introduced by them will be used in later commits.
* Add license headers and SPDX identifiers to meson.build filesZbigniew Jędrzejewski-Szmek2017-11-191-0/+17
| | | | | | | So far I avoided adding license headers to meson files, but they are pretty big and important and should carry license headers like everything else. I added my own copyright, even though other people modified those files too. But this is mostly symbolic, so I hope that's OK.
* po: add a copy of polkit its rulesZbigniew Jędrzejewski-Szmek2017-11-141-0/+1
| | | | | It's just a few lines, but this way we avoid a dependency on polkit, and can use meson's i18n stuff on older distros.
* i18n: drop intltool use, use meson's merge_file directlyZbigniew Jędrzejewski-Szmek2017-11-131-13/+2
| | | | | | | | | | | | | | | | | | This didn't work during the initial conversion to meson, but should now. A sufficiently new polkit is also required, for the .its rules files. Note that https://github.com/mesonbuild/meson/blob/master/docs/markdown/i18n-module.md says that 'install' argument was added in meson 0.43.0. If this is accurate, warnigs might be generated with older mesons. Fedora has 0.43.0 across the board, but other distros probably don't, but I guess that a warning is prefereable to having to update do latest meson. The advantages are: - one less dependency (intltool) - using the generic implementation instead of our open-coded calls - we don't need to use the fake "_" prefixes in XML Replaces #1609, fixes #7300.
* core: chown() StateDirectory= and friends recursively when starting a serviceLennart Poettering2017-10-021-0/+2
| | | | | | | This is particularly useful when used in conjunction with DynamicUser=1, where the UID might change for every invocation, but is useful in other cases too, for example, when these directories are shared between systems where the UID assignments differ slightly.
* Add firewall eBPF compilerDaniel Mack2017-09-221-0/+2
|
* Add IP address address ACL representation and parserDaniel Mack2017-09-221-87/+89
| | | | | | | Add a config directive parser that takes multiple space separated IPv4 or IPv6 addresses with optional netmasks in CIDR notation rvalue and puts a parsed version of it to linked list of IPAddressAccessItem objects. The code actually using this will be added later.
* Drop bus-policy bitsZbigniew Jędrzejewski-Szmek2017-07-231-2/+0
|
* Drop busname unit typeZbigniew Jędrzejewski-Szmek2017-07-231-4/+0
| | | | | | | Since busname units are only useful with kdbus, they weren't actively used. This was dead code, only compile-tested. If busname units are ever added back, it'll be cleaner to start from scratch (possibly reverting parts of this patch).
* meson: Add missing dependency on libseccomp for libcoreJohn Paul Adrian Glaubitz2017-05-091-0/+1
|
* meson: reindent all files with 8 spacesZbigniew Jędrzejewski-Szmek2017-04-241-178/+176
| | | | | | | The indentation for emacs'es meson-mode is added .dir-locals. All files are reindented automatically, using the lasest meson-mode from git. Indentation should now be fairly consistent.
* meson: use join_paths consistentlyMichael Biebl2017-04-241-4/+4
| | | | | With -Dsplit-usr=true, we set rootprefix to /. This leads to //lib/systemd or //lib/udev for various dir variables. Using join_paths() avoids this.
* meson: properly conditionalize polkit installationZbigniew Jędrzejewski-Szmek2017-04-241-2/+2
| | | | | | | ... including pkla installation on Debian. v2: - fix polkit-gobject-1 pkgconfig name
* meson: create dirs and touch /usrZbigniew Jędrzejewski-Szmek2017-04-241-0/+14
| | | | | | | | | This is the equivalent of $(INSTALL_DIRS) and install-touch-usr-hook. I did not bother to create the directories into which we install files, since they will be created anyway. v2: - remove bashism
* meson: create a static version of libshared and link libcore and some tests ↵Zbigniew Jędrzejewski-Szmek2017-04-241-1/+1
| | | | | | | | | | | | | | | to it This is what autoconf-based build does, and it makes test-bus-error and test-engine able to access the bus error mapping table. OTOH, this is a heavy price to pay: it would be excellent to link libcore.a to libsystemd-shared-NNN.so. Otherwise we duplicate the same code in 'systemd' and 'libsystemd-shared-NNN.so'. -rwxrwxr-x. 1 4075544 Apr 6 20:30 systemd* <-- libcore linked against libsystemd-shared.so -rwxrwxr-x. 1 5596504 Apr 9 14:07 systemd* <-- libcore linked against libsystemd-shared.a v2: - update for 6b5cf3ea621a5bfd218cd2249e066a52c0e73657
* meson: build systemd using mesonZbigniew Jędrzejewski-Szmek2017-04-241-0/+222
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