1
0
mirror of https://github.com/systemd/systemd synced 2026-03-23 15:24:54 +01:00

Compare commits

...

8 Commits

Author SHA1 Message Date
Luca Boccassi
c1597f07bf
Merge pull request #20319 from keszybz/meson-0.53.2
Bump required meson version to 0.53.2
2021-07-27 23:15:18 +01:00
Luca Boccassi
59ff79f19f
Merge pull request #20318 from poettering/seccomp-getrandom-fix
seccomp: getrandom() fix + more
2021-07-27 21:17:38 +01:00
Zbigniew Jędrzejewski-Szmek
0b5f1bd49e meson: use maps for udev program paths 2021-07-27 18:58:42 +02:00
Zbigniew Jędrzejewski-Szmek
68e101da7a meson: adjust comment about find_program() usage
The FIXME was not correct: with 'dirs' we'd put the fixed path first
(see the docs for find_program()).
2021-07-27 18:53:31 +02:00
Zbigniew Jędrzejewski-Szmek
81875efe20 meson: use project_build_root
As documented in /meson.build where the variable is defined,
meson.build_root() doesn't work as expected with project nesting. I have
no idea why anyone would want to embed systemd in another meson project,
but let's use the variable if we have it.
2021-07-27 18:53:22 +02:00
Lennart Poettering
7df660e456 seccomp: move sched_getaffinity() from @system-service to @default
See: https://github.com/systemd/systemd/pull/20191#issuecomment-881982739

In general, we shouldn't blanket move syscalls like this into @default,
given that glibc actually does have fallbacks, afaics. However, as
long as the syscalls are "read-only" and thus benign, I figure it's a
safe thing to do. But we should probably stick to a "if in doubt, don't"
rule, and put these syscalls in @system-service as default, but not into
@default.

I think in the real world @system-service is the sensible group people
should use, and not @default actually.
2021-07-27 17:14:06 +02:00
Lennart Poettering
67347f3740 seccomp: drop getrandom() from @system-service
It's included in @default now, since
14f4b1b568907350d023d1429c1aa4aaa8925f22, and since @system-service
pulls that in we can drop it from @system-service.

Follow-up for #20191
2021-07-27 17:13:53 +02:00
Zbigniew Jędrzejewski-Szmek
9247df5a88 meson: require 0.53.2 and drop some workarounds for old meson
Ubuntu Bionic 18.04 has 0.45, so it was below the previously required
minimum version already. Focal 20.04 has 0.53.2. Let's require that
and use various features that are available.
2021-07-27 16:46:46 +02:00
6 changed files with 33 additions and 36 deletions

View File

@ -10,7 +10,7 @@ project('systemd', 'c',
'localstatedir=/var', 'localstatedir=/var',
'warning_level=2', 'warning_level=2',
], ],
meson_version : '>= 0.47', meson_version : '>= 0.53.2',
) )
libsystemd_version = '0.32.0' libsystemd_version = '0.32.0'
@ -382,7 +382,7 @@ if cc.get_id() == 'gcc'
endif endif
# --as-needed and --no-undefined are provided by meson by default, # --as-needed and --no-undefined are provided by meson by default,
# run mesonconf to see what is enabled # run 'meson configure' to see what is enabled
possible_link_flags = [ possible_link_flags = [
'-Wl,-z,relro', '-Wl,-z,relro',
'-Wl,-z,now', '-Wl,-z,now',
@ -597,7 +597,7 @@ test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
mkdir_p = 'mkdir -p $DESTDIR/@0@' mkdir_p = 'mkdir -p $DESTDIR/@0@'
splash_bmp = files('test/splash.bmp') splash_bmp = files('test/splash.bmp')
# if -Dxxx-path option is found, use that. Otherwise, check in $PATH, # If -Dxxx-path option is found, use that. Otherwise, check in $PATH,
# /usr/sbin, /sbin, and fall back to the default from middle column. # /usr/sbin, /sbin, and fall back to the default from middle column.
progs = [['quotaon', '/usr/sbin/quotaon' ], progs = [['quotaon', '/usr/sbin/quotaon' ],
['quotacheck', '/usr/sbin/quotacheck' ], ['quotacheck', '/usr/sbin/quotacheck' ],
@ -909,10 +909,6 @@ conf.set10('LOG_TRACE', get_option('log-trace'))
default_user_path = get_option('user-path') default_user_path = get_option('user-path')
if default_user_path != '' if default_user_path != ''
conf.set_quoted('DEFAULT_USER_PATH', default_user_path) conf.set_quoted('DEFAULT_USER_PATH', default_user_path)
default_user_path_display = default_user_path
else
# meson 0.49 fails when ?: is used in .format()
default_user_path_display = '(same as system services)'
endif endif
@ -952,9 +948,11 @@ if want_bpf_framework == 'false'
else else
clang = find_program('clang', required : bpf_framework_required) clang = find_program('clang', required : bpf_framework_required)
llvm_strip = find_program('llvm-strip', required : bpf_framework_required) llvm_strip = find_program('llvm-strip', required : bpf_framework_required)
# Debian installs this in /usr/sbin/ which is not in $PATH
# FIXME: use the 'dirs' parameter once we bump Meson version to >= 0.53 # Debian installs this in /usr/sbin/ which is not in $PATH.
# We check for 'bpftool' first, honouring $PATH, and in /usr/sbin/ for Debian.
bpftool = find_program('bpftool', '/usr/sbin/bpftool', required : bpf_framework_required) bpftool = find_program('bpftool', '/usr/sbin/bpftool', required : bpf_framework_required)
bpf_arches = ['x86_64'] bpf_arches = ['x86_64']
deps_found = libbpf.found() and clang.found() and llvm_strip.found() and bpftool.found() deps_found = libbpf.found() and clang.found() and llvm_strip.found() and bpftool.found()
# Can build BPF program from source code in restricted C # Can build BPF program from source code in restricted C
@ -3817,7 +3815,8 @@ status = [
'default net.naming-scheme setting: @0@'.format(default_net_naming_scheme), 'default net.naming-scheme setting: @0@'.format(default_net_naming_scheme),
'default KillUserProcesses setting: @0@'.format(kill_user_processes), 'default KillUserProcesses setting: @0@'.format(kill_user_processes),
'default locale: @0@'.format(default_locale), 'default locale: @0@'.format(default_locale),
'default user $PATH: @0@'.format(default_user_path_display), 'default user $PATH: @0@'.format(
default_user_path != '' ? default_user_path : '(same as system services)'),
'systemd service watchdog: @0@'.format(watchdog_opt)] 'systemd service watchdog: @0@'.format(watchdog_opt)]
alt_dns_servers = '\n '.join(dns_servers.split(' ')) alt_dns_servers = '\n '.join(dns_servers.split(' '))

View File

@ -331,6 +331,7 @@ const SyscallFilterSet syscall_filter_sets[_SYSCALL_FILTER_SET_MAX] = {
"restart_syscall\0" "restart_syscall\0"
"rseq\0" "rseq\0"
"rt_sigreturn\0" "rt_sigreturn\0"
"sched_getaffinity\0"
"sched_yield\0" "sched_yield\0"
"set_robust_list\0" "set_robust_list\0"
"set_thread_area\0" "set_thread_area\0"
@ -859,7 +860,6 @@ const SyscallFilterSet syscall_filter_sets[_SYSCALL_FILTER_SET_MAX] = {
"get_mempolicy\0" "get_mempolicy\0"
"getcpu\0" "getcpu\0"
"getpriority\0" "getpriority\0"
"getrandom\0"
"ioctl\0" "ioctl\0"
"ioprio_get\0" "ioprio_get\0"
"kcmp\0" "kcmp\0"
@ -875,7 +875,6 @@ const SyscallFilterSet syscall_filter_sets[_SYSCALL_FILTER_SET_MAX] = {
"remap_file_pages\0" "remap_file_pages\0"
"sched_get_priority_max\0" "sched_get_priority_max\0"
"sched_get_priority_min\0" "sched_get_priority_min\0"
"sched_getaffinity\0"
"sched_getattr\0" "sched_getattr\0"
"sched_getparam\0" "sched_getparam\0"
"sched_getscheduler\0" "sched_getscheduler\0"

View File

@ -15,7 +15,7 @@ path = run_command(sh, '-c', 'echo "$PATH"').stdout().strip()
test_env = environment() test_env = environment()
test_env.set('SYSTEMD_KBD_MODEL_MAP', kbd_model_map) test_env.set('SYSTEMD_KBD_MODEL_MAP', kbd_model_map)
test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map) test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map)
test_env.set('PATH', '@0@:@1@'.format(meson.build_root(), path)) test_env.set('PATH', project_build_root + ':' + path)
############################################################ ############################################################

View File

@ -115,42 +115,40 @@ libudevd_core = static_library(
link_with : udev_link_with, link_with : udev_link_with,
dependencies : [libblkid, libkmod]) dependencies : [libblkid, libkmod])
udev_id_progs = [['ata_id/ata_id.c'], udev_progs = [['ata_id/ata_id.c'],
['cdrom_id/cdrom_id.c'], ['cdrom_id/cdrom_id.c'],
['fido_id/fido_id.c', ['fido_id/fido_id.c',
'fido_id/fido_id_desc.c', 'fido_id/fido_id_desc.c',
'fido_id/fido_id_desc.h'], 'fido_id/fido_id_desc.h'],
['scsi_id/scsi_id.c', ['scsi_id/scsi_id.c',
'scsi_id/scsi_id.h', 'scsi_id/scsi_id.h',
'scsi_id/scsi_serial.c', 'scsi_id/scsi_serial.c',
'scsi_id/scsi.h'], 'scsi_id/scsi.h'],
['v4l_id/v4l_id.c'], ['v4l_id/v4l_id.c'],
['mtd_probe/mtd_probe.c', ['mtd_probe/mtd_probe.c',
'mtd_probe/mtd_probe.h', 'mtd_probe/mtd_probe.h',
'mtd_probe/probe_smartmedia.c']] 'mtd_probe/probe_smartmedia.c']]
dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'mips'] dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'mips']
if dmi_arches.contains(host_machine.cpu_family()) if dmi_arches.contains(host_machine.cpu_family())
udev_id_progs += [['dmi_memory_id/dmi_memory_id.c']] udev_progs += [['dmi_memory_id/dmi_memory_id.c']]
endif endif
foreach prog : udev_id_progs udev_prog_paths = {}
foreach prog : udev_progs
name = prog[0].split('/')[0] name = prog[0].split('/')[0]
exe = executable( exe = executable(
name, name,
prog, prog,
include_directories : includes, include_directories : includes,
dependencies : [versiondep], dependencies : versiondep,
link_with : udev_link_with, link_with : udev_link_with,
install_rpath : udev_rpath, install_rpath : udev_rpath,
install : true, install : true,
install_dir : udevlibexecdir) install_dir : udevlibexecdir)
# TODO: let's use a dictionary instead as soon as we can depend on meson >= 0.47. udev_prog_paths += {name : exe.full_path()}
if name == 'dmi_memory_id'
dmi_memory_id_path = exe.full_path()
endif
endforeach endforeach
if install_sysconfdir_samples if install_sysconfdir_samples

View File

@ -145,7 +145,9 @@ if want_tests != 'false' and dmi_arches.contains(host_machine.cpu_family())
test(name, test(name,
udev_dmi_memory_id_test, udev_dmi_memory_id_test,
args : [dmi_memory_id_path, source, source + '.txt']) args : [udev_prog_paths['dmi_memory_id'],
source,
source + '.txt'])
endforeach endforeach
endif endif

View File

@ -37,8 +37,7 @@ foreach pair : in_files
# do nothing # do nothing
elif pair[1] == '' or conf.get(pair[1]) == 1 elif pair[1] == '' or conf.get(pair[1]) == 1
custom_target( custom_target(
# XXX: workaround for old meson. Drop when upgrading. pair[0],
'tmpfiles+' + pair[0],
input : pair[0] + '.in', input : pair[0] + '.in',
output: pair[0], output: pair[0],
command : [meson_render_jinja2, config_h, '@INPUT@'], command : [meson_render_jinja2, config_h, '@INPUT@'],