1
0
mirror of https://github.com/systemd/systemd synced 2025-10-05 19:54:46 +02:00

Compare commits

...

12 Commits

Author SHA1 Message Date
Luca Boccassi
bcc73cafdb bootctl: automatically set --graceful when running in chroot
Installing stuff in a chroot should not fail because efivars are
not available. When running in a container touching efivars is
completely disabled, but there are some cases (recovery) where
it is needed to touch them in a chroot, so don't disable them but
avoid failing the run instead.
2025-07-25 20:44:03 +01:00
Luca Boccassi
a3eb0e99d3 cgroup-util: enforce alignment of f_handle
The change in 4d2e61211df7244fae6aaeb8cae0916b4a0e78bd
broke armv7 where uintptr_t is 4 bytes:

/* test_id */
Assertion '((uintptr_t) _p) % alignof(uint64_t) == 0' failed at src/basic/cgroup-util.c:108, function cg_get_cgroupid_at(). Aborting.

(gdb) p (uintptr_t)fh.file_handle.f_handle % _Alignof(uint64_t)
$9 = 4

Enforce that the structure is aligned as expected

Follow-up for 4d2e61211df7244fae6aaeb8cae0916b4a0e78bd
2025-07-25 20:42:23 +01:00
Luca Boccassi
d6a70c1523
syscalls table: add sh (#38338) 2025-07-25 19:23:00 +01:00
Luca Boccassi
a50c687b01 syscalls-table: add sh and regenerated table 2025-07-25 17:17:28 +01:00
Luca Boccassi
481e2ceaed
Meson: clean up "finding" of helper scripts (#38335)
Simplify meson definitions and use `files()` instead of `find_program()`
for internal scripts to make build logs cleaner.
2025-07-25 17:10:27 +01:00
Zbigniew Jędrzejewski-Szmek
5e405f612e meson: add instructions for adding new arch to syscall.h 2025-07-25 17:53:48 +02:00
Zbigniew Jędrzejewski-Szmek
4c4a63a876 meson: indent find_program() calls for readability 2025-07-25 14:04:17 +02:00
Zbigniew Jędrzejewski-Szmek
c5dcbd073e meson: use files() not find_program() for helper scripts
We went back and forth between 'prog.sh', files('prog.sh'), and
find_program('prog.sh'). We want to use files() or find_program() so that we
get a good error message if the file is missing. Behaviour of meson changed
over time, and in the past not all forms could be used in all places. For
example 0f4c4f3824891aea6a76b2e861f38a6045b2a246 added find_program() in many
places to avoid repeated messages. But it seems that all recent meson versions
work fine with files().

find_program prints silly messages:
  Program tools/make-man-index.py found: YES
       (/home/zbyszek/src/systemd/tools/make-man-index.py)
  Program tools/meson-render-jinja2.py found: YES
       (/home/zbyszek/src/systemd/tools/meson-render-jinja2.py)
  ...
We know that those files will be found, they are part of the git checkout.
With files() this is gone and the meson output is easier to read.
2025-07-25 14:04:17 +02:00
Zbigniew Jędrzejewski-Szmek
8aedfd979f tools: make all .py program files executable
All those files are standalone programs that can be executed directly.
Some .py files were marked executable, others weren't, probably accidentally.
Mark them all as executable in preparation for subsequent changes.
2025-07-25 12:33:13 +02:00
Zbigniew Jędrzejewski-Szmek
0bf9bbecae tools: consistently use #!/usr/bin/env python3
It's ugly, but it's better to be consistently ugly.
2025-07-25 12:33:13 +02:00
Zbigniew Jędrzejewski-Szmek
0e371ebb12 man: consistently use #!/usr/bin/python
Some files were using that, others weren't. Since those are user-facing
docs, we should use the nice clean form, not the workaround for strange
systems that we use in other places.
2025-07-25 12:33:13 +02:00
Zbigniew Jędrzejewski-Szmek
0e031d5e0b meson: inline output file names
Before 7d247d3cb875e1778e6cc81dbf255b13092b29e0, we needed the file name
twice. But now we only need it once, so no need to overcomplicate things
by defining a variable with a single use.

When a variable is used, it's also easier to make a mistake and e.g.
accidentally reuse the variable later.
2025-07-25 12:33:13 +02:00
37 changed files with 673 additions and 122 deletions

2
.ycm_extra_conf.py Normal file → Executable file
View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# SPDX-License-Identifier: Unlicense
#

View File

@ -63,9 +63,8 @@ if conf.get('ENABLE_HWDB') == 1
endif
if want_tests != 'false'
parse_hwdb_py = find_program('parse_hwdb.py')
test('parse-hwdb',
parse_hwdb_py,
files('parse_hwdb.py'),
suite : 'dist',
args : [hwdb_files_test,
auto_suspend_rules],

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python
# SPDX-License-Identifier: MIT-0
"""

View File

@ -424,8 +424,9 @@
<term><option>--graceful</option></term>
<listitem><para>Ignore failure when the EFI System Partition cannot be found, when EFI variables
cannot be written, or a different or newer boot loader is already installed. Currently only applies
to <command>is-installed</command>, <command>update</command>, and <command>random-seed</command>
verbs.</para>
to <command>is-installed</command>, <command>update</command>, <command>random-seed</command> and
<command>install</command> verbs. Since version v258, it is implicitly enabled when running inside a
chroot.</para>
<xi:include href="version-info.xml" xpointer="v244"/></listitem>
</varlistentry>

0
man/check-os-release-simple.py Normal file → Executable file
View File

0
man/check-os-release.py Normal file → Executable file
View File

2
man/notify-selfcontained-example.py Normal file → Executable file
View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python
# SPDX-License-Identifier: MIT-0
#
# Implement the systemd notify protocol without external dependencies.

View File

@ -345,7 +345,7 @@ cc = meson.get_compiler('c')
userspace_c_args = []
userspace_c_ld_args = []
userspace_sources = []
meson_build_sh = find_program('tools/meson-build.sh')
meson_build_sh = files('tools/meson-build.sh')
want_tests = get_option('tests')
want_slow_tests = want_tests != 'false' and get_option('slow-tests')
@ -610,20 +610,20 @@ endforeach
#####################################################################
awk = find_program('awk')
diff = find_program('diff')
echo = find_program('echo')
env = find_program('env')
find = find_program('find')
awk = find_program('awk')
diff = find_program('diff')
echo = find_program('echo')
env = find_program('env')
find = find_program('find')
getent = find_program('getent', required : false)
git = find_program('git', required : false)
gperf = find_program('gperf')
id = find_program('id', required : false)
ln = find_program('ln')
rsync = find_program('rsync', required : false)
sed = find_program('sed')
sh = find_program('sh')
stat = find_program('stat')
git = find_program('git', required : false)
gperf = find_program('gperf')
id = find_program('id', required : false)
ln = find_program('ln')
rsync = find_program('rsync', required : false)
sed = find_program('sed')
sh = find_program('sh')
stat = find_program('stat')
ln_s = ln.full_path() + ' -frsT -- "${DESTDIR:-}@0@" "${DESTDIR:-}@1@"'
@ -1887,7 +1887,7 @@ conf.set10('ENABLE_UKIFY', want_ukify)
#####################################################################
check_efi_alignment_py = find_program('tools/check-efi-alignment.py')
check_efi_alignment_py = files('tools/check-efi-alignment.py')
#####################################################################
@ -1960,21 +1960,21 @@ conf.set10('HAVE_VMLINUX_H', use_provided_vmlinux_h or use_generated_vmlinux_h)
#####################################################################
check_version_history_py = find_program('tools/check-version-history.py')
elf2efi_py = find_program('tools/elf2efi.py')
export_dbus_interfaces_py = find_program('tools/dbus_exporter.py')
generate_gperfs = find_program('tools/generate-gperfs.py')
make_autosuspend_rules_py = find_program('tools/make-autosuspend-rules.py')
make_directive_index_py = find_program('tools/make-directive-index.py')
sync_docs_py = find_program('tools/sync-docs.py')
make_man_index_py = find_program('tools/make-man-index.py')
meson_render_jinja2 = find_program('tools/meson-render-jinja2.py')
update_dbus_docs_py = find_program('tools/update-dbus-docs.py')
update_hwdb_autosuspend_sh = find_program('tools/update-hwdb-autosuspend.sh')
update_hwdb_sh = find_program('tools/update-hwdb.sh')
update_man_rules_py = find_program('tools/update-man-rules.py')
update_syscall_tables_sh = find_program('tools/update-syscall-tables.sh')
xml_helper_py = find_program('tools/xml_helper.py')
check_version_history_py = files('tools/check-version-history.py')
elf2efi_py = files('tools/elf2efi.py')
export_dbus_interfaces_py = files('tools/dbus_exporter.py')
generate_gperfs = files('tools/generate-gperfs.py')
make_autosuspend_rules_py = files('tools/make-autosuspend-rules.py')
make_directive_index_py = files('tools/make-directive-index.py')
sync_docs_py = files('tools/sync-docs.py')
make_man_index_py = files('tools/make-man-index.py')
meson_render_jinja2 = files('tools/meson-render-jinja2.py')
update_dbus_docs_py = files('tools/update-dbus-docs.py')
update_hwdb_autosuspend_sh = files('tools/update-hwdb-autosuspend.sh')
update_hwdb_sh = files('tools/update-hwdb.sh')
update_man_rules_py = files('tools/update-man-rules.py')
update_syscall_tables_sh = files('tools/update-syscall-tables.sh')
xml_helper_py = files('tools/xml_helper.py')
#####################################################################
@ -2808,8 +2808,8 @@ endif
#####################################################################
check_help = find_program('tools/check-help.sh')
check_version = find_program('tools/check-version.sh')
check_help = files('tools/check-help.sh')
check_version = files('tools/check-version.sh')
foreach exec : public_programs
name = fs.name(exec.full_path())
@ -2850,10 +2850,9 @@ if git.found()
####################################################
git_contrib_sh = find_program('tools/git-contrib.sh')
run_target(
'git-contrib',
command : [git_contrib_sh])
command : files('tools/git-contrib.sh'))
####################################################
@ -2911,11 +2910,12 @@ if meson.version().version_compare('>=1.4.0')
endforeach
endif
check_api_docs_sh = find_program('tools/check-api-docs.sh')
run_target(
'check-api-docs',
depends : [man, libsystemd, libudev],
command : [check_api_docs_sh, libsystemd.full_path(), libudev.full_path()])
command : [files('tools/check-api-docs.sh'),
libsystemd.full_path(),
libudev.full_path()])
alias_target('update-dbus-docs', update_dbus_docs)
alias_target('update-man-rules', update_man_rules)
@ -2929,13 +2929,13 @@ if not meson.is_cross_build()
command : [export_dbus_interfaces_py, '@OUTPUT@', dbus_programs])
endif
meson_extract_unit_files = find_program('tools/meson-extract-unit-files.py')
custom_target(
output : 'installed-unit-files.txt',
capture : true,
install : want_tests != 'no' and install_tests,
install_dir : testdata_dir,
command : [meson_extract_unit_files, meson.project_build_root()])
command : [files('tools/meson-extract-unit-files.py'),
meson.project_build_root()])
#####################################################################

View File

@ -38,7 +38,7 @@
typedef union {
struct file_handle file_handle;
uint8_t space[offsetof(struct file_handle, f_handle) + sizeof(uint64_t)];
} cg_file_handle;
} _alignas_(uint64_t) cg_file_handle;
#define CG_FILE_HANDLE_INIT \
(cg_file_handle) { \

View File

@ -129,25 +129,22 @@ foreach item : [
['errno', [], '', ['<errno.h>'], ],
]
fname = '@0@-list.txt'.format(item[0])
generate_list = files('generate-@0@-list.sh'.format(item[0]))
list_txt = custom_target(
input : [generate_list, item[1]],
output : fname,
output : '@0@-list.txt'.format(item[0]),
command : [env, 'bash', generate_list, cpp, system_include_args],
capture : true)
fname = '@0@-from-name.gperf'.format(item[0])
gperf_file = custom_target(
input : list_txt,
output : fname,
output : '@0@-from-name.gperf'.format(item[0]),
command : [generate_gperfs, item[0], item[2], '@INPUT@'] + item[3],
capture : true)
fname = '@0@-from-name.inc'.format(item[0])
target1 = custom_target(
input : gperf_file,
output : fname,
output : '@0@-from-name.inc'.format(item[0]),
command : [gperf,
'-L', 'ANSI-C', '-t', '--ignore-case',
'-N', 'lookup_@0@'.format(item[0]),
@ -156,11 +153,10 @@ foreach item : [
'@INPUT@'],
capture : true)
fname = '@0@-to-name.inc'.format(item[0])
awkscript = '@0@-to-name.awk'.format(item[0])
target2 = custom_target(
input : [awkscript, list_txt],
output : fname,
output : '@0@-to-name.inc'.format(item[0]),
command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
capture : true)
@ -172,11 +168,12 @@ basic_sources += generated_gperf_headers
############################################################
check_filesystems = find_program('check-filesystems.sh')
r = run_command(
[
'env', '--chdir', meson.project_build_root(),
check_filesystems, cpp, files('filesystems-gperf.gperf'),
files('check-filesystems.sh'),
cpp,
files('filesystems-gperf.gperf'),
system_include_args,
],
check: false,
@ -190,21 +187,17 @@ filesystems_gperf_h = custom_target(
output : 'filesystems-gperf.h',
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
generate_filesystem_list = find_program('generate-filesystem-list.py')
fname = 'filesystem-list.inc'
filesystem_list_inc = custom_target(
input : 'filesystems-gperf.gperf',
output : fname,
command : [generate_filesystem_list,
output : 'filesystem-list.inc',
command : [files('generate-filesystem-list.py'),
'@INPUT@'],
capture : true)
generate_filesystem_switch_case_inc = find_program('generate-filesystem-switch-case.py')
fname = 'filesystem-switch-case.inc'
filesystem_switch_case_inc = custom_target(
input : 'filesystems-gperf.gperf',
output : fname,
command : [generate_filesystem_switch_case_inc,
output : 'filesystem-switch-case.inc',
command : [files('generate-filesystem-switch-case.py'),
'@INPUT@'],
capture : true)

0
src/boot/generate-hwids-section.py Normal file → Executable file
View File

View File

@ -27,13 +27,12 @@ efitest_base = {
efi_test_template = test_template + efitest_base
efi_fuzz_template = fuzz_template + efitest_base
generate_hwids_section_py = find_program('generate-hwids-section.py')
if conf.get('ENABLE_UKIFY') == 1
test_hwids_section_c = custom_target(
input : ['hwids/device1.json', 'hwids/device2.json', 'hwids/device3.json', 'hwids/device4.json'],
output : 'test-hwids-section.c',
command : [generate_hwids_section_py, meson.current_source_dir()/'hwids'],
command : [files('generate-hwids-section.py'),
meson.current_source_dir()/'hwids'],
capture : true,
build_by_default : want_tests != 'false')
else

View File

@ -37,6 +37,7 @@
#include "varlink-io.systemd.BootControl.h"
#include "varlink-util.h"
#include "verbs.h"
#include "virt.h"
/* EFI_BOOT_OPTION_DESCRIPTION_MAX sets the maximum length for the boot option description
* stored in NVRAM. The UEFI spec does not specify a minimum or maximum length for this
@ -641,6 +642,11 @@ static int parse_argv(int argc, char *argv[]) {
if (arg_secure_boot_auto_enroll && !arg_private_key)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Secure boot auto-enrollment requested but no private key provided");
if (!arg_graceful && running_in_chroot() > 0) {
log_full(arg_quiet ? LOG_DEBUG : LOG_INFO, "Running in a chroot, enabling --graceful.");
arg_graceful = true;
}
r = sd_varlink_invocation(SD_VARLINK_ALLOW_ACCEPT);
if (r < 0)
return log_error_errno(r, "Failed to check if invoked in Varlink mode: %m");

1
src/fuzz/fuzz-bootspec-gen.py Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
"""Generate sample input for fuzz-bootspec"""

5
src/include/override/sys/generate-syscall.py Normal file → Executable file
View File

@ -39,6 +39,9 @@ HEADER = '''\
*
* Use 'ninja -C build update-syscall-tables' to download new syscall tables,
* and 'ninja -C build update-syscall-header' to regenerate this file.
*
* To add a new architecture, extend the arch_list list in meson.build
* and the template in generate-syscall.py and then run the above commands.
*/
#pragma once
@ -97,6 +100,8 @@ DEF_TEMPLATE_B = '''\
# endif
# elif defined(__s390__)
# define systemd_NR_{syscall} {nr_s390}
# elif defined(__sh__)
# define systemd_NR_{syscall} {nr_sh}
# elif defined(__sparc__)
# define systemd_NR_{syscall} {nr_sparc}
# elif defined(__x86_64__)

View File

@ -17,6 +17,7 @@ arch_list = [
'powerpc64',
'riscv32',
'riscv64',
'sh',
's390',
's390x',
'sparc',
@ -31,11 +32,13 @@ syscall_list_txt = files('syscall-list.txt')
syscall_lists = []
foreach arch: arch_list
syscall_lists += files('syscalls-@0@.txt'.format(arch))
# We don't use files() here so that the 'update-syscall-tables' call
# above can run if arch_list is extended.
syscall_lists += meson.current_source_dir() / 'syscalls-@0@.txt'.format(arch)
endforeach
generate_syscall_py = find_program('generate-syscall.py')
run_target(
'update-syscall-header',
command : [generate_syscall_py, files('syscall.h')] + syscall_lists)
command : [files('generate-syscall.py'),
files('syscall.h'),
syscall_lists])

View File

@ -3,6 +3,9 @@
*
* Use 'ninja -C build update-syscall-tables' to download new syscall tables,
* and 'ninja -C build update-syscall-header' to regenerate this file.
*
* To add a new architecture, extend the arch_list list in meson.build
* and the template in generate-syscall.py and then run the above commands.
*/
#pragma once
@ -40,6 +43,7 @@
# error "Unknown RISC-V ABI"
# endif
# elif defined(__s390__)
# elif defined(__sh__)
# elif defined(__sparc__)
# elif defined(__x86_64__)
# if defined(__ILP32__)
@ -91,6 +95,8 @@
# endif
# elif defined(__s390__)
# define systemd_NR_close_range 436
# elif defined(__sh__)
# define systemd_NR_close_range 436
# elif defined(__sparc__)
# define systemd_NR_close_range 436
# elif defined(__x86_64__)
@ -159,6 +165,8 @@ static_assert(__NR_close_range == systemd_NR_close_range, "");
# endif
# elif defined(__s390__)
# define systemd_NR_fchmodat2 452
# elif defined(__sh__)
# define systemd_NR_fchmodat2 452
# elif defined(__sparc__)
# define systemd_NR_fchmodat2 452
# elif defined(__x86_64__)
@ -227,6 +235,8 @@ static_assert(__NR_fchmodat2 == systemd_NR_fchmodat2, "");
# endif
# elif defined(__s390__)
# define systemd_NR_mount_setattr 442
# elif defined(__sh__)
# define systemd_NR_mount_setattr 442
# elif defined(__sparc__)
# define systemd_NR_mount_setattr 442
# elif defined(__x86_64__)
@ -295,6 +305,8 @@ static_assert(__NR_mount_setattr == systemd_NR_mount_setattr, "");
# endif
# elif defined(__s390__)
# define systemd_NR_open_tree_attr 467
# elif defined(__sh__)
# define systemd_NR_open_tree_attr 467
# elif defined(__sparc__)
# define systemd_NR_open_tree_attr 467
# elif defined(__x86_64__)
@ -363,6 +375,8 @@ static_assert(__NR_open_tree_attr == systemd_NR_open_tree_attr, "");
# endif
# elif defined(__s390__)
# define systemd_NR_openat2 437
# elif defined(__sh__)
# define systemd_NR_openat2 437
# elif defined(__sparc__)
# define systemd_NR_openat2 437
# elif defined(__x86_64__)
@ -431,6 +445,8 @@ static_assert(__NR_openat2 == systemd_NR_openat2, "");
# endif
# elif defined(__s390__)
# define systemd_NR_quotactl_fd 443
# elif defined(__sh__)
# define systemd_NR_quotactl_fd 443
# elif defined(__sparc__)
# define systemd_NR_quotactl_fd 443
# elif defined(__x86_64__)
@ -499,6 +515,8 @@ static_assert(__NR_quotactl_fd == systemd_NR_quotactl_fd, "");
# endif
# elif defined(__s390__)
# define systemd_NR_removexattrat 466
# elif defined(__sh__)
# define systemd_NR_removexattrat 466
# elif defined(__sparc__)
# define systemd_NR_removexattrat 466
# elif defined(__x86_64__)
@ -567,6 +585,8 @@ static_assert(__NR_removexattrat == systemd_NR_removexattrat, "");
# endif
# elif defined(__s390__)
# define systemd_NR_setxattrat 463
# elif defined(__sh__)
# define systemd_NR_setxattrat 463
# elif defined(__sparc__)
# define systemd_NR_setxattrat 463
# elif defined(__x86_64__)

View File

@ -0,0 +1,528 @@
_llseek 140
_newselect 142
accept 344
accept4 358
access 33
acct 51
add_key 285
adjtimex 124
alarm 27
arc_gettls
arc_settls
arc_usr_cmpxchg
arch_prctl
arm_fadvise64_64
atomic_barrier
atomic_cmpxchg_32
bind 341
bpf 375
brk 45
cachectl
cacheflush 123
cachestat 451
capget 184
capset 185
chdir 12
chmod 15
chown 182
chown32 212
chroot 61
clock_adjtime 361
clock_adjtime64 405
clock_getres 266
clock_getres_time64 406
clock_gettime 265
clock_gettime64 403
clock_nanosleep 267
clock_nanosleep_time64 407
clock_settime 264
clock_settime64 404
clone 120
clone3
close 6
close_range 436
connect 342
copy_file_range 380
creat 8
delete_module 129
dipc
dup 41
dup2 63
dup3 330
epoll_create 254
epoll_create1 329
epoll_ctl 255
epoll_ctl_old
epoll_pwait 319
epoll_pwait2 441
epoll_wait 256
epoll_wait_old
eventfd 323
eventfd2 328
exec_with_loader
execv
execve 11
execveat 376
exit 1
exit_group 252
faccessat 307
faccessat2 439
fadvise64 250
fadvise64_64 272
fallocate 324
fanotify_init 337
fanotify_mark 338
fchdir 133
fchmod 94
fchmodat 306
fchmodat2 452
fchown 95
fchown32 207
fchownat 298
fcntl 55
fcntl64 221
fdatasync 148
fgetxattr 231
finit_module 368
flistxattr 234
flock 143
fork 2
fremovexattr 237
fsconfig 431
fsetxattr 228
fsmount 432
fsopen 430
fspick 433
fstat 108
fstat64 197
fstatat64 300
fstatfs 100
fstatfs64 269
fsync 118
ftruncate 93
ftruncate64 194
futex 240
futex_requeue 456
futex_time64 422
futex_wait 455
futex_waitv 449
futex_wake 454
futimesat 299
get_mempolicy 275
get_robust_list 312
get_thread_area
getcpu 318
getcwd 183
getdents 141
getdents64 220
getdomainname
getdtablesize
getegid 50
getegid32 202
geteuid 49
geteuid32 201
getgid 47
getgid32 200
getgroups 80
getgroups32 205
gethostname
getitimer 105
getpagesize
getpeername 346
getpgid 132
getpgrp 65
getpid 20
getppid 64
getpriority 96
getrandom 373
getresgid 171
getresgid32 211
getresuid 165
getresuid32 209
getrlimit 76
getrusage 77
getsid 147
getsockname 345
getsockopt 354
gettid 224
gettimeofday 78
getuid 24
getuid32 199
getxattr 229
getxattrat 464
getxgid
getxpid
getxuid
init_module 128
inotify_add_watch 291
inotify_init 290
inotify_init1 332
inotify_rm_watch 292
io_cancel 249
io_destroy 246
io_getevents 247
io_pgetevents
io_pgetevents_time64 416
io_setup 245
io_submit 248
io_uring_enter 426
io_uring_register 427
io_uring_setup 425
ioctl 54
ioperm
iopl
ioprio_get 289
ioprio_set 288
ipc 117
kcmp 367
kern_features
kexec_file_load
kexec_load 283
keyctl 287
kill 37
landlock_add_rule 445
landlock_create_ruleset 444
landlock_restrict_self 446
lchown 16
lchown32 198
lgetxattr 230
link 9
linkat 303
listen 343
listmount 458
listxattr 232
listxattrat 465
llistxattr 233
llseek
lookup_dcookie 253
lremovexattr 236
lseek 19
lsetxattr 227
lsm_get_self_attr 459
lsm_list_modules 461
lsm_set_self_attr 460
lstat 107
lstat64 196
madvise 219
map_shadow_stack 453
mbind 274
membarrier 378
memfd_create 374
memfd_secret
memory_ordering
migrate_pages 294
mincore 218
mkdir 39
mkdirat 296
mknod 14
mknodat 297
mlock 150
mlock2 379
mlockall 152
mmap 90
mmap2 192
modify_ldt
mount 21
mount_setattr 442
move_mount 429
move_pages 317
mprotect 125
mq_getsetattr 282
mq_notify 281
mq_open 277
mq_timedreceive 280
mq_timedreceive_time64 419
mq_timedsend 279
mq_timedsend_time64 418
mq_unlink 278
mremap 163
mseal 462
msgctl 402
msgget 399
msgrcv 401
msgsnd 400
msync 144
multiplexer
munlock 151
munlockall 153
munmap 91
name_to_handle_at 359
nanosleep 162
newfstatat
nice 34
old_adjtimex
oldfstat 28
oldlstat 84
oldolduname
oldstat 18
oldumount
olduname 109
open 5
open_by_handle_at 360
open_tree 428
open_tree_attr 467
openat 295
openat2 437
or1k_atomic
osf_fstat
osf_fstatfs
osf_fstatfs64
osf_getdirentries
osf_getdomainname
osf_getitimer
osf_getrusage
osf_getsysinfo
osf_gettimeofday
osf_lstat
osf_mount
osf_proplist_syscall
osf_select
osf_set_program_attributes
osf_setitimer
osf_setsysinfo
osf_settimeofday
osf_shmat
osf_sigprocmask
osf_sigstack
osf_stat
osf_statfs
osf_statfs64
osf_swapon
osf_syscall
osf_sysinfo
osf_usleep_thread
osf_utimes
osf_utsname
osf_wait4
pause 29
pciconfig_iobase
pciconfig_read
pciconfig_write
perf_event_open 336
perfctr
personality 136
pidfd_getfd 438
pidfd_open 434
pidfd_send_signal 424
pipe 42
pipe2 331
pivot_root 217
pkey_alloc 385
pkey_free 386
pkey_mprotect 384
poll 168
ppoll 309
ppoll_time64 414
prctl 172
pread64 180
preadv 333
preadv2 381
prlimit64 339
process_madvise 440
process_mrelease 448
process_vm_readv 365
process_vm_writev 366
pselect6 308
pselect6_time64 413
ptrace 26
pwrite64 181
pwritev 334
pwritev2 382
quotactl 131
quotactl_fd 443
read 3
readahead 225
readdir 89
readlink 85
readlinkat 305
readv 145
reboot 88
recv 350
recvfrom 351
recvmmsg 357
recvmmsg_time64 417
recvmsg 356
remap_file_pages 257
removexattr 235
removexattrat 466
rename 38
renameat 302
renameat2 371
request_key 286
restart_syscall 0
riscv_flush_icache
riscv_hwprobe
rmdir 40
rseq 387
rt_sigaction 174
rt_sigpending 176
rt_sigprocmask 175
rt_sigqueueinfo 178
rt_sigreturn 173
rt_sigsuspend 179
rt_sigtimedwait 177
rt_sigtimedwait_time64 421
rt_tgsigqueueinfo 335
rtas
s390_guarded_storage
s390_pci_mmio_read
s390_pci_mmio_write
s390_runtime_instr
s390_sthyi
sched_get_affinity
sched_get_priority_max 159
sched_get_priority_min 160
sched_getaffinity 242
sched_getattr 369
sched_getparam 155
sched_getscheduler 157
sched_rr_get_interval 161
sched_rr_get_interval_time64 423
sched_set_affinity
sched_setaffinity 241
sched_setattr 370
sched_setparam 154
sched_setscheduler 156
sched_yield 158
seccomp 372
select
semctl 394
semget 393
semop
semtimedop
semtimedop_time64 420
send 348
sendfile 187
sendfile64 239
sendmmsg 363
sendmsg 355
sendto 349
set_mempolicy 276
set_mempolicy_home_node 450
set_robust_list 311
set_thread_area
set_tid_address 258
setdomainname 121
setfsgid 139
setfsgid32 216
setfsuid 138
setfsuid32 215
setgid 46
setgid32 214
setgroups 81
setgroups32 206
sethae
sethostname 74
setitimer 104
setns 364
setpgid 57
setpgrp
setpriority 97
setregid 71
setregid32 204
setresgid 170
setresgid32 210
setresuid 164
setresuid32 208
setreuid 70
setreuid32 203
setrlimit 75
setsid 66
setsockopt 353
settimeofday 79
setuid 23
setuid32 213
setxattr 226
setxattrat 463
sgetmask 68
shmat 397
shmctl 396
shmdt 398
shmget 395
shutdown 352
sigaction 67
sigaltstack 186
signal 48
signalfd 321
signalfd4 327
sigpending 73
sigprocmask 126
sigreturn 119
sigsuspend 72
socket 340
socketcall 102
socketpair 347
splice 313
spu_create
spu_run
ssetmask 69
stat 106
stat64 195
statfs 99
statfs64 268
statmount 457
statx 383
stime 25
subpage_prot
swapcontext
swapoff 115
swapon 87
switch_endian
symlink 83
symlinkat 304
sync 36
sync_file_range 314
sync_file_range2 388
syncfs 362
sys_debug_setcontext
syscall
sysfs 135
sysinfo 116
syslog 103
sysmips
tee 315
tgkill 270
time 13
timer_create 259
timer_delete 263
timer_getoverrun 262
timer_gettime 261
timer_gettime64 408
timer_settime 260
timer_settime64 409
timerfd
timerfd_create 322
timerfd_gettime 326
timerfd_gettime64 410
timerfd_settime 325
timerfd_settime64 411
times 43
tkill 238
truncate 92
truncate64 193
ugetrlimit 191
umask 60
umount 22
umount2 52
uname 122
unlink 10
unlinkat 301
unshare 310
uretprobe
userfaultfd 377
ustat 62
utime 30
utimensat 320
utimensat_time64 412
utimes 271
utrap_install
vfork 190
vhangup 111
vm86
vm86old
vmsplice 316
wait4 114
waitid 284
waitpid 7
write 4
writev 146

View File

@ -51,4 +51,4 @@ if want_kernel_install
endif
endif
test_kernel_install_sh = find_program('test-kernel-install.sh')
test_kernel_install_sh = files('test-kernel-install.sh')

View File

@ -52,12 +52,13 @@ dns_type_list_txt = custom_target(
command : [sed, '-n', '-r', '-f', '@INPUT0@', '@INPUT1@'],
capture : true)
generate_dns_type_gperf = find_program('generate-dns_type-gperf.py')
gperf_file = custom_target(
input : dns_type_list_txt,
output : 'dns_type-from-name.gperf',
command : [generate_dns_type_gperf, 'dns_type', 'DNS_TYPE_', '@INPUT@'],
command : [files('generate-dns_type-gperf.py'),
'dns_type',
'DNS_TYPE_',
'@INPUT@'],
capture : true)
dns_type_from_name_inc = custom_target(

0
src/shared/ethtool-link-mode.py Normal file → Executable file
View File

View File

@ -231,12 +231,10 @@ if get_option('tests') != 'false'
shared_sources += files('tests.c')
endif
generate_syscall_list = find_program('generate-syscall-list.py')
fname = 'syscall-list.inc'
syscall_list_inc = custom_target(
input : syscall_list_txt,
output : fname,
command : [generate_syscall_list,
output : 'syscall-list.inc',
command : [files('generate-syscall-list.py'),
'@INPUT@'],
capture : true)
@ -266,17 +264,15 @@ ip_protocol_list_txt = custom_target(
command : [env, 'bash', generate_ip_protocol_list, cpp, system_include_args],
capture : true)
fname = 'ip-protocol-from-name.gperf'
gperf_file = custom_target(
input : ip_protocol_list_txt,
output : fname,
output : 'ip-protocol-from-name.gperf',
command : [generate_gperfs, 'ip_protocol', 'IPPROTO_', '@INPUT@', '<netinet/in.h>'],
capture : true)
fname = 'ip-protocol-from-name.inc'
target1 = custom_target(
input : gperf_file,
output : fname,
output : 'ip-protocol-from-name.inc',
command : [gperf,
'-L', 'ANSI-C', '-t', '--ignore-case',
'-N', 'lookup_ip_protocol',
@ -285,11 +281,10 @@ target1 = custom_target(
'@INPUT@'],
capture : true)
fname = 'ip-protocol-to-name.inc'
awkscript = 'ip-protocol-to-name.awk'
target2 = custom_target(
input : [awkscript, ip_protocol_list_txt],
output : fname,
output : 'ip-protocol-to-name.inc',
command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
capture : true)
@ -297,10 +292,9 @@ generated_sources += [target1, target2]
shared_sources += [target1, target2]
ethtool_link_mode_py = files('ethtool-link-mode.py')
fname = 'ethtool-link-mode.inc'
ethtool_link_mode_inc = custom_target(
input : [ethtool_link_mode_py, ethtool_link_mode_sources],
output : fname,
output : 'ethtool-link-mode.inc',
command : [python, ethtool_link_mode_py, '--header', cpp, system_include_args],
capture : true)
@ -308,10 +302,9 @@ generated_sources += ethtool_link_mode_inc
shared_sources += ethtool_link_mode_inc
sources += shared_sources
fname = 'ethtool-link-mode.xml'
ethtool_link_mode_xml = custom_target(
input : [ethtool_link_mode_py, ethtool_link_mode_sources],
output : fname,
output : 'ethtool-link-mode.xml',
command : [python, ethtool_link_mode_py, '--xml', cpp, system_include_args],
capture : true)
man_page_depends += ethtool_link_mode_xml

View File

@ -23,19 +23,29 @@ endif
############################################################
generate_sym_test_py = find_program('generate-sym-test.py')
generate_sym_test_py = files('generate-sym-test.py')
test_libsystemd_sym_c = custom_target(
input : [libsystemd_sym_path] + systemd_headers + libsystemd_sources,
input : [libsystemd_sym_path,
systemd_headers,
libsystemd_sources],
output : 'test-libsystemd-sym.c',
command : [generate_sym_test_py, libsystemd_sym_path, libsystemd_dir_path] + systemd_headers,
command : [generate_sym_test_py,
libsystemd_sym_path,
libsystemd_dir_path,
systemd_headers],
capture : true,
build_by_default : want_tests != 'false')
test_libudev_sym_c = custom_target(
input : [libudev_sym_path, libudev_h_path] + libudev_sources,
input : [libudev_sym_path,
libudev_h_path,
libudev_sources],
output : 'test-libudev-sym.c',
command : [generate_sym_test_py, libudev_sym_path, libudev_dir_path, libudev_h_path],
command : [generate_sym_test_py,
libudev_sym_path,
libudev_dir_path,
libudev_h_path],
capture : true,
build_by_default : want_tests != 'false')

View File

@ -69,17 +69,15 @@ keyboard_keys_list_txt = custom_target(
capture : true)
generate_keyboard_keys_gperf = files('generate-keyboard-keys-gperf.sh')
fname = 'keyboard-keys-from-name.gperf'
gperf_file = custom_target(
input : [generate_keyboard_keys_gperf, keyboard_keys_list_txt],
output : fname,
output : 'keyboard-keys-from-name.gperf',
command : [env, 'bash', '@INPUT@'],
capture : true)
fname = 'keyboard-keys-from-name.inc'
keyboard_keys_from_name_inc = custom_target(
input : gperf_file,
output : fname,
output : 'keyboard-keys-from-name.inc',
command : [gperf,
'-L', 'ANSI-C', '-t',
'-N', 'keyboard_lookup_key',

0
test/fuzz/generate-directives.py Normal file → Executable file
View File

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
generate_directives_py = find_program('generate-directives.py')
generate_directives_py = files('generate-directives.py')
fuzz_regression_tests = {}

View File

@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
"""Test wrapper command for driving integration tests."""

View File

@ -4,7 +4,7 @@
add_test_setup('integration')
add_test_setup('shell', env : {'TEST_SHELL' : '1'})
integration_test_wrapper = find_program('integration-test-wrapper.py')
integration_test_wrapper = files('integration-test-wrapper.py')
integration_tests = []
integration_test_template = {
'mkosi-args' : [],

View File

@ -38,10 +38,9 @@ endif
############################################################
if want_tests != 'false' and conf.get('ENABLE_HWDB') == 1
hwdb_test_sh = find_program('hwdb-test.sh')
exe = executables_by_name.get('systemd-hwdb')
test('hwdb-test',
hwdb_test_sh,
files('hwdb-test.sh'),
suite : 'dist',
args : exe.full_path(),
depends : exe,
@ -51,11 +50,10 @@ endif
############################################################
if want_tests != 'false'
test_systemctl_enable_sh = find_program('test-systemctl-enable.sh')
systemctl = executables_by_name.get('systemctl')
systemd_id128 = executables_by_name.get('systemd-id128')
test('test-systemctl-enable',
test_systemctl_enable_sh,
files('test-systemctl-enable.sh'),
# https://github.com/mesonbuild/meson/issues/2681
args : [systemctl.full_path(),
systemd_id128.full_path()],
@ -66,10 +64,9 @@ endif
############################################################
if want_tests != 'false' and conf.get('HAVE_SYSV_COMPAT') == 1
sysv_generator_test_py = find_program('sysv-generator-test.py')
exe = executables_by_name.get('systemd-sysv-generator')
test('sysv-generator-test',
sysv_generator_test_py,
files('sysv-generator-test.py'),
depends : exe,
suite : 'sysv')
endif
@ -77,10 +74,9 @@ endif
############################################################
if want_tests != 'false' and conf.get('HAVE_BLKID') == 1
test_bootctl_json_sh = find_program('test-bootctl-json.sh')
exe = executables_by_name.get('bootctl')
test('test-bootctl-json',
test_bootctl_json_sh,
files('test-bootctl-json.sh'),
args : exe.full_path(),
depends : exe,
suite : 'boot')
@ -89,7 +85,7 @@ endif
############################################################
if want_tests != 'false' and conf.get('ENABLE_TMPFILES') == 1
test_systemd_tmpfiles_py = find_program('test-systemd-tmpfiles.py')
test_systemd_tmpfiles_py = files('test-systemd-tmpfiles.py')
exe = executables_by_name.get('systemd-tmpfiles')
test('test-systemd-tmpfiles',
test_systemd_tmpfiles_py,
@ -125,10 +121,9 @@ endif
############################################################
rule_syntax_check_py = find_program('rule-syntax-check.py')
if want_tests != 'false'
test('rule-syntax-check',
rule_syntax_check_py,
files('rule-syntax-check.py'),
suite : 'dist',
args : all_rules)
@ -153,7 +148,7 @@ endif
############################################################
test_fstab_generator_sh = find_program('test-fstab-generator.sh')
test_fstab_generator_sh = files('test-fstab-generator.sh')
if want_tests != 'false'
exe = executables_by_name.get('systemd-fstab-generator')
test('test-fstab-generator',
@ -165,14 +160,14 @@ if want_tests != 'false'
suite : 'fstab')
endif
if install_tests
install_data('test-fstab-generator.sh',
install_data(test_fstab_generator_sh,
install_mode : 'rwxr-xr-x',
install_dir : unittestsdir)
endif
############################################################
test_network_generator_conversion_sh = find_program('test-network-generator-conversion.sh')
test_network_generator_conversion_sh = files('test-network-generator-conversion.sh')
if want_tests != 'false'
exe = executables_by_name.get('systemd-network-generator')
test('test-network-generator-conversion',
@ -183,7 +178,7 @@ if want_tests != 'false'
suite : 'network')
endif
if install_tests
install_data('test-network-generator-conversion.sh',
install_data(test_network_generator_conversion_sh,
install_mode : 'rwxr-xr-x',
install_dir : unittestsdir)
endif
@ -213,12 +208,11 @@ endif
rpm = find_program('rpm', required : false)
rpmspec = find_program('rpmspec', required : false)
test_rpm_macros = find_program('test-rpm-macros.sh')
if rpm.found() and rpmspec.found()
if want_tests != 'false'
test('test-rpm-macros',
test_rpm_macros,
files('test-rpm-macros.sh'),
suite : 'dist',
args : [meson.project_build_root()],
depends : rpm_depends)
@ -230,7 +224,7 @@ endif
############################################################
if want_tests != 'false' and conf.get('HAVE_DMI') == 1
udev_dmi_memory_id_test = find_program('udev-dmi-memory-id-test.sh')
udev_dmi_memory_id_test = files('udev-dmi-memory-id-test.sh')
exe = executables_by_name.get('dmi_memory_id')
if git.found() and fs.is_dir(meson.project_source_root() / '.git')

0
test/sd-script.py Normal file → Executable file
View File

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
# pylint: disable=consider-using-with

View File

@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
# vi: set tw=110 sw=4 ts=4 et:

0
tools/check-version-history.py Normal file → Executable file
View File

0
tools/chromiumos/gen_autosuspend_rules.py Normal file → Executable file
View File

2
tools/dump-auxv.py Normal file → Executable file
View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Note: the no-value-for-parameter here is expected, as the click module

0
tools/gdb-sd_dump_hashmaps.py Normal file → Executable file
View File

0
tools/list-discoverable-partitions.py Normal file → Executable file
View File