1
0
mirror of https://github.com/systemd/systemd synced 2025-09-27 15:54:47 +02:00

Compare commits

...

8 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
6bfbfce795 networkd-test: add final newlines in generated files, use .format() 2020-12-10 14:31:39 +09:00
Takashi Iwai
5926e592fa udev: Fix sound.target dependency
The recent bug report indicated a race at device creation and the
sound.target dependencies, and the cause turned out to be the condition
of the sound.target trigger.  Currently it's set for "card*", but this
is actually the parent object; i.e. the sound.target is triggered before
the sound devices are created.

For assuring the whole sound device creations beforehand, we need to use
"controlC*" instead of "card*"; as already described in
78-sound-card.rules, this is guaranteed to be the last device, and can
be used as a synchronization point.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1179363
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-10 14:29:50 +09:00
Yu Watanabe
44cc6bfef0
Merge pull request #17877 from yuwata/missing-syscall-sort
missing: sort architectures in missing_syscall.h
2020-12-10 12:42:35 +09:00
Yu Watanabe
105bfc9e72 missing: update warning messages 2020-12-08 15:35:57 +09:00
Yu Watanabe
6451baba82 missing: add missing syscalls for ia64, m68k, sparc, arc, and tilegx
These are not tested, but several syscalls are defined for these
architectures. Let's add syscalls comprehensively.
2020-12-08 15:32:25 +09:00
Yu Watanabe
ae32a94efe missing: drop redundant condition 2020-12-08 14:54:20 +09:00
Yu Watanabe
86b8637435 missing: support 32bit powerpc 2020-12-08 14:51:58 +09:00
Yu Watanabe
b8bcd4c69f missing: sort architectures in missing_syscall.h 2020-12-08 14:50:23 +09:00
3 changed files with 242 additions and 170 deletions

View File

@ -51,7 +51,7 @@ SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/blue
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0b????:*", ENV{ID_SMARTCARD_READER}="1" SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0b????:*", ENV{ID_SMARTCARD_READER}="1"
ENV{ID_SMARTCARD_READER}=="?*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="smartcard.target", ENV{SYSTEMD_USER_WANTS}+="smartcard.target" ENV{ID_SMARTCARD_READER}=="?*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="smartcard.target", ENV{SYSTEMD_USER_WANTS}+="smartcard.target"
SUBSYSTEM=="sound", KERNEL=="card*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sound.target", ENV{SYSTEMD_USER_WANTS}+="sound.target" SUBSYSTEM=="sound", KERNEL=="controlC*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sound.target", ENV{SYSTEMD_USER_WANTS}+="sound.target"
SUBSYSTEM=="printer", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target", ENV{SYSTEMD_USER_WANTS}+="printer.target" SUBSYSTEM=="printer", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target", ENV{SYSTEMD_USER_WANTS}+="printer.target"
SUBSYSTEM=="usb", KERNEL=="lp*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target", ENV{SYSTEMD_USER_WANTS}+="printer.target" SUBSYSTEM=="usb", KERNEL=="lp*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target", ENV{SYSTEMD_USER_WANTS}+="printer.target"

View File

@ -15,13 +15,11 @@
#include <asm/sgidefs.h> #include <asm/sgidefs.h>
#endif #endif
#if defined(__x86_64__) && defined(__ILP32__) #if defined(__alpha__)
# define systemd_SC_arch_bias(x) ((x) | /* __X32_SYSCALL_BIT */ 0x40000000) # define systemd_SC_arch_bias(x) (110 + (x))
#elif defined(__ia64__) #elif defined(__ia64__)
# define systemd_SC_arch_bias(x) (1024 + (x)) # define systemd_SC_arch_bias(x) (1024 + (x))
#elif defined __alpha__ #elif defined(_MIPS_SIM)
# define systemd_SC_arch_bias(x) (110 + (x))
#elif defined _MIPS_SIM
# if _MIPS_SIM == _MIPS_SIM_ABI32 # if _MIPS_SIM == _MIPS_SIM_ABI32
# define systemd_SC_arch_bias(x) (4000 + (x)) # define systemd_SC_arch_bias(x) (4000 + (x))
# elif _MIPS_SIM == _MIPS_SIM_NABI32 # elif _MIPS_SIM == _MIPS_SIM_NABI32
@ -31,6 +29,8 @@
# else # else
# error "Unknown MIPS ABI" # error "Unknown MIPS ABI"
# endif # endif
#elif defined(__x86_64__) && defined(__ILP32__)
# define systemd_SC_arch_bias(x) ((x) | /* __X32_SYSCALL_BIT */ 0x40000000)
#else #else
# define systemd_SC_arch_bias(x) (x) # define systemd_SC_arch_bias(x) (x)
#endif #endif
@ -53,19 +53,21 @@ static inline int missing_pivot_root(const char *new_root, const char *put_old)
/* ======================================================================= */ /* ======================================================================= */
#if defined __x86_64__ #if defined(__aarch64__)
# define systemd_NR_memfd_create systemd_SC_arch_bias(319)
#elif defined __arm__
# define systemd_NR_memfd_create 385
#elif defined __aarch64__
# define systemd_NR_memfd_create 279 # define systemd_NR_memfd_create 279
#elif defined __alpha__ #elif defined(__alpha__)
# define systemd_NR_memfd_create 512 # define systemd_NR_memfd_create 512
#elif defined(__powerpc__) #elif defined(__arc__) || defined(__tilegx__)
# define systemd_NR_memfd_create 360 # define systemd_NR_memfd_create 279
#elif defined __s390__ #elif defined(__arm__)
# define systemd_NR_memfd_create 350 # define systemd_NR_memfd_create 385
#elif defined _MIPS_SIM #elif defined(__i386__)
# define systemd_NR_memfd_create 356
#elif defined(__ia64__)
# define systemd_NR_memfd_create systemd_SC_arch_bias(316)
#elif defined(__m68k__)
# define systemd_NR_memfd_create 353
#elif defined(_MIPS_SIM)
# if _MIPS_SIM == _MIPS_SIM_ABI32 # if _MIPS_SIM == _MIPS_SIM_ABI32
# define systemd_NR_memfd_create systemd_SC_arch_bias(354) # define systemd_NR_memfd_create systemd_SC_arch_bias(354)
# elif _MIPS_SIM == _MIPS_SIM_NABI32 # elif _MIPS_SIM == _MIPS_SIM_NABI32
@ -73,12 +75,16 @@ static inline int missing_pivot_root(const char *new_root, const char *put_old)
# elif _MIPS_SIM == _MIPS_SIM_ABI64 # elif _MIPS_SIM == _MIPS_SIM_ABI64
# define systemd_NR_memfd_create systemd_SC_arch_bias(314) # define systemd_NR_memfd_create systemd_SC_arch_bias(314)
# endif # endif
#elif defined __i386__ #elif defined(__powerpc__)
# define systemd_NR_memfd_create 356 # define systemd_NR_memfd_create 360
#elif defined __arc__ #elif defined(__s390__)
# define systemd_NR_memfd_create 279 # define systemd_NR_memfd_create 350
#elif defined(__sparc__)
# define systemd_NR_memfd_create 348
#elif defined(__x86_64__)
# define systemd_NR_memfd_create systemd_SC_arch_bias(319)
#else #else
# warning "memfd_create() syscall number unknown for your architecture" # warning "memfd_create() syscall number is unknown for your architecture"
#endif #endif
/* may be (invalid) negative number due to libseccomp, see PR 13319 */ /* may be (invalid) negative number due to libseccomp, see PR 13319 */
@ -110,25 +116,21 @@ static inline int missing_memfd_create(const char *name, unsigned int flags) {
/* ======================================================================= */ /* ======================================================================= */
#if defined __x86_64__ #if defined(__aarch64__)
# define systemd_NR_getrandom systemd_SC_arch_bias(318)
#elif defined(__i386__)
# define systemd_NR_getrandom 355
#elif defined(__arm__)
# define systemd_NR_getrandom 384
#elif defined(__aarch64__)
# define systemd_NR_getrandom 278 # define systemd_NR_getrandom 278
#elif defined(__alpha__) #elif defined(__alpha__)
# define systemd_NR_getrandom 511 # define systemd_NR_getrandom 511
#elif defined(__arc__) || defined(__tilegx__)
# define systemd_NR_getrandom 278
#elif defined(__arm__)
# define systemd_NR_getrandom 384
#elif defined(__i386__)
# define systemd_NR_getrandom 355
#elif defined(__ia64__) #elif defined(__ia64__)
# define systemd_NR_getrandom systemd_SC_arch_bias(318) # define systemd_NR_getrandom systemd_SC_arch_bias(318)
#elif defined(__m68k__) #elif defined(__m68k__)
# define systemd_NR_getrandom 352 # define systemd_NR_getrandom 352
#elif defined(__s390x__) #elif defined(_MIPS_SIM)
# define systemd_NR_getrandom 349
#elif defined(__powerpc__)
# define systemd_NR_getrandom 359
#elif defined _MIPS_SIM
# if _MIPS_SIM == _MIPS_SIM_ABI32 # if _MIPS_SIM == _MIPS_SIM_ABI32
# define systemd_NR_getrandom systemd_SC_arch_bias(353) # define systemd_NR_getrandom systemd_SC_arch_bias(353)
# elif _MIPS_SIM == _MIPS_SIM_NABI32 # elif _MIPS_SIM == _MIPS_SIM_NABI32
@ -136,10 +138,16 @@ static inline int missing_memfd_create(const char *name, unsigned int flags) {
# elif _MIPS_SIM == _MIPS_SIM_ABI64 # elif _MIPS_SIM == _MIPS_SIM_ABI64
# define systemd_NR_getrandom systemd_SC_arch_bias(313) # define systemd_NR_getrandom systemd_SC_arch_bias(313)
# endif # endif
#elif defined(__arc__) #elif defined(__powerpc__)
# define systemd_NR_getrandom 278 # define systemd_NR_getrandom 359
#elif defined(__s390__)
# define systemd_NR_getrandom 349
#elif defined(__sparc__)
# define systemd_NR_getrandom 347
#elif defined(__x86_64__)
# define systemd_NR_getrandom systemd_SC_arch_bias(318)
#else #else
# warning "getrandom() syscall number unknown for your architecture" # warning "getrandom() syscall number is unknown for your architecture"
#endif #endif
/* may be (invalid) negative number due to libseccomp, see PR 13319 */ /* may be (invalid) negative number due to libseccomp, see PR 13319 */
@ -186,23 +194,21 @@ static inline pid_t missing_gettid(void) {
/* ======================================================================= */ /* ======================================================================= */
#if defined(__x86_64__) #if defined(__aarch64__)
# define systemd_NR_name_to_handle_at systemd_SC_arch_bias(303)
#elif defined(__i386__)
# define systemd_NR_name_to_handle_at 341
#elif defined(__arm__)
# define systemd_NR_name_to_handle_at 370
#elif defined __aarch64__
# define systemd_NR_name_to_handle_at 264 # define systemd_NR_name_to_handle_at 264
#elif defined(__alpha__) #elif defined(__alpha__)
# define systemd_NR_name_to_handle_at 497 # define systemd_NR_name_to_handle_at 497
#elif defined(__powerpc__) #elif defined(__arc__) || defined(__tilegx__)
# define systemd_NR_name_to_handle_at 345
#elif defined __s390__ || defined __s390x__
# define systemd_NR_name_to_handle_at 335
#elif defined(__arc__)
# define systemd_NR_name_to_handle_at 264 # define systemd_NR_name_to_handle_at 264
#elif defined _MIPS_SIM #elif defined(__arm__)
# define systemd_NR_name_to_handle_at 370
#elif defined(__i386__)
# define systemd_NR_name_to_handle_at 341
#elif defined(__ia64__)
# define systemd_NR_name_to_handle_at systemd_SC_arch_bias(302)
#elif defined(__m68k__)
# define systemd_NR_name_to_handle_at 340
#elif defined(_MIPS_SIM)
# if _MIPS_SIM == _MIPS_SIM_ABI32 # if _MIPS_SIM == _MIPS_SIM_ABI32
# define systemd_NR_name_to_handle_at systemd_SC_arch_bias(339) # define systemd_NR_name_to_handle_at systemd_SC_arch_bias(339)
# elif _MIPS_SIM == _MIPS_SIM_NABI32 # elif _MIPS_SIM == _MIPS_SIM_NABI32
@ -210,8 +216,16 @@ static inline pid_t missing_gettid(void) {
# elif _MIPS_SIM == _MIPS_SIM_ABI64 # elif _MIPS_SIM == _MIPS_SIM_ABI64
# define systemd_NR_name_to_handle_at systemd_SC_arch_bias(298) # define systemd_NR_name_to_handle_at systemd_SC_arch_bias(298)
# endif # endif
#elif defined(__powerpc__)
# define systemd_NR_name_to_handle_at 345
#elif defined(__s390__)
# define systemd_NR_name_to_handle_at 335
#elif defined(__sparc__)
# define systemd_NR_name_to_handle_at 332
#elif defined(__x86_64__)
# define systemd_NR_name_to_handle_at systemd_SC_arch_bias(303)
#else #else
# warning "name_to_handle_at number is not defined" # warning "name_to_handle_at() syscall number is unknown for your architecture"
#endif #endif
/* may be (invalid) negative number due to libseccomp, see PR 13319 */ /* may be (invalid) negative number due to libseccomp, see PR 13319 */
@ -249,23 +263,21 @@ static inline int missing_name_to_handle_at(int fd, const char *name, struct fil
/* ======================================================================= */ /* ======================================================================= */
#if defined __aarch64__ #if defined(__aarch64__)
# define systemd_NR_setns 268 # define systemd_NR_setns 268
#elif defined __arm__ #elif defined(__alpha__)
# define systemd_NR_setns 375
#elif defined __alpha__
# define systemd_NR_setns 501 # define systemd_NR_setns 501
#elif defined(__x86_64__) #elif defined(__arc__) || defined(__tilegx__)
# define systemd_NR_setns systemd_SC_arch_bias(308) # define systemd_NR_setns 268
#elif defined(__arm__)
# define systemd_NR_setns 375
#elif defined(__i386__) #elif defined(__i386__)
# define systemd_NR_setns 346 # define systemd_NR_setns 346
#elif defined(__powerpc__) #elif defined(__ia64__)
# define systemd_NR_setns 350 # define systemd_NR_setns systemd_SC_arch_bias(306)
#elif defined __s390__ || defined __s390x__ #elif defined(__m68k__)
# define systemd_NR_setns 339 # define systemd_NR_setns 344
#elif defined(__arc__) #elif defined(_MIPS_SIM)
# define systemd_NR_setns 268
#elif defined _MIPS_SIM
# if _MIPS_SIM == _MIPS_SIM_ABI32 # if _MIPS_SIM == _MIPS_SIM_ABI32
# define systemd_NR_setns systemd_SC_arch_bias(344) # define systemd_NR_setns systemd_SC_arch_bias(344)
# elif _MIPS_SIM == _MIPS_SIM_NABI32 # elif _MIPS_SIM == _MIPS_SIM_NABI32
@ -273,8 +285,16 @@ static inline int missing_name_to_handle_at(int fd, const char *name, struct fil
# elif _MIPS_SIM == _MIPS_SIM_ABI64 # elif _MIPS_SIM == _MIPS_SIM_ABI64
# define systemd_NR_setns systemd_SC_arch_bias(303) # define systemd_NR_setns systemd_SC_arch_bias(303)
# endif # endif
#elif defined(__powerpc__)
# define systemd_NR_setns 350
#elif defined(__s390__)
# define systemd_NR_setns 339
#elif defined(__sparc__)
# define systemd_NR_setns 337
#elif defined(__x86_64__)
# define systemd_NR_setns systemd_SC_arch_bias(308)
#else #else
# warning "setns() syscall number unknown for your architecture" # warning "setns() syscall number is unknown for your architecture"
#endif #endif
/* may be (invalid) negative number due to libseccomp, see PR 13319 */ /* may be (invalid) negative number due to libseccomp, see PR 13319 */
@ -316,15 +336,21 @@ static inline pid_t raw_getpid(void) {
/* ======================================================================= */ /* ======================================================================= */
#if defined __x86_64__ #if defined(__aarch64__)
# define systemd_NR_renameat2 systemd_SC_arch_bias(316)
#elif defined __arm__
# define systemd_NR_renameat2 382
#elif defined __aarch64__
# define systemd_NR_renameat2 276 # define systemd_NR_renameat2 276
#elif defined __alpha__ #elif defined(__alpha__)
# define systemd_NR_renameat2 510 # define systemd_NR_renameat2 510
#elif defined _MIPS_SIM #elif defined(__arc__) || defined(__tilegx__)
# define systemd_NR_renameat2 276
#elif defined(__arm__)
# define systemd_NR_renameat2 382
#elif defined(__i386__)
# define systemd_NR_renameat2 353
#elif defined(__ia64__)
# define systemd_NR_renameat2 systemd_SC_arch_bias(314)
#elif defined(__m68k__)
# define systemd_NR_renameat2 351
#elif defined(_MIPS_SIM)
# if _MIPS_SIM == _MIPS_SIM_ABI32 # if _MIPS_SIM == _MIPS_SIM_ABI32
# define systemd_NR_renameat2 systemd_SC_arch_bias(351) # define systemd_NR_renameat2 systemd_SC_arch_bias(351)
# elif _MIPS_SIM == _MIPS_SIM_NABI32 # elif _MIPS_SIM == _MIPS_SIM_NABI32
@ -332,16 +358,16 @@ static inline pid_t raw_getpid(void) {
# elif _MIPS_SIM == _MIPS_SIM_ABI64 # elif _MIPS_SIM == _MIPS_SIM_ABI64
# define systemd_NR_renameat2 systemd_SC_arch_bias(311) # define systemd_NR_renameat2 systemd_SC_arch_bias(311)
# endif # endif
#elif defined __i386__ #elif defined(__powerpc__)
# define systemd_NR_renameat2 353
#elif defined __powerpc64__
# define systemd_NR_renameat2 357 # define systemd_NR_renameat2 357
#elif defined __s390__ || defined __s390x__ #elif defined(__s390__)
# define systemd_NR_renameat2 347 # define systemd_NR_renameat2 347
#elif defined __arc__ #elif defined(__sparc__)
# define systemd_NR_renameat2 276 # define systemd_NR_renameat2 345
#elif defined(__x86_64__)
# define systemd_NR_renameat2 systemd_SC_arch_bias(316)
#else #else
# warning "renameat2() syscall number unknown for your architecture" # warning "renameat2() syscall number is unknown for your architecture"
#endif #endif
/* may be (invalid) negative number due to libseccomp, see PR 13319 */ /* may be (invalid) negative number due to libseccomp, see PR 13319 */
@ -425,23 +451,21 @@ static inline key_serial_t missing_request_key(const char *type, const char *des
/* ======================================================================= */ /* ======================================================================= */
#if defined(__x86_64__) #if defined(__aarch64__)
# define systemd_NR_copy_file_range systemd_SC_arch_bias(326) # define systemd_NR_copy_file_range 285
#elif defined(__alpha__)
# define systemd_NR_copy_file_range 519
#elif defined(__arc__) || defined(__tilegx__)
# define systemd_NR_copy_file_range 285
#elif defined(__arm__)
# define systemd_NR_copy_file_range 391
#elif defined(__i386__) #elif defined(__i386__)
# define systemd_NR_copy_file_range 377 # define systemd_NR_copy_file_range 377
#elif defined __s390__ #elif defined(__ia64__)
# define systemd_NR_copy_file_range 375 # define systemd_NR_copy_file_range systemd_SC_arch_bias(323)
#elif defined __arm__ #elif defined(__m68k__)
# define systemd_NR_copy_file_range 391 # define systemd_NR_copy_file_range 376
#elif defined __aarch64__ #elif defined(_MIPS_SIM)
# define systemd_NR_copy_file_range 285
#elif defined __alpha__
# define systemd_NR_copy_file_range 519
#elif defined __powerpc__
# define systemd_NR_copy_file_range 379
#elif defined __arc__
# define systemd_NR_copy_file_range 285
#elif defined _MIPS_SIM
# if _MIPS_SIM == _MIPS_SIM_ABI32 # if _MIPS_SIM == _MIPS_SIM_ABI32
# define systemd_NR_copy_file_range systemd_SC_arch_bias(360) # define systemd_NR_copy_file_range systemd_SC_arch_bias(360)
# elif _MIPS_SIM == _MIPS_SIM_NABI32 # elif _MIPS_SIM == _MIPS_SIM_NABI32
@ -449,8 +473,16 @@ static inline key_serial_t missing_request_key(const char *type, const char *des
# elif _MIPS_SIM == _MIPS_SIM_ABI64 # elif _MIPS_SIM == _MIPS_SIM_ABI64
# define systemd_NR_copy_file_range systemd_SC_arch_bias(320) # define systemd_NR_copy_file_range systemd_SC_arch_bias(320)
# endif # endif
#elif defined(__powerpc__)
# define systemd_NR_copy_file_range 379
#elif defined(__s390__)
# define systemd_NR_copy_file_range 375
#elif defined(__sparc__)
# define systemd_NR_copy_file_range 357
#elif defined(__x86_64__)
# define systemd_NR_copy_file_range systemd_SC_arch_bias(326)
#else #else
# warning "copy_file_range() syscall number unknown for your architecture" # warning "copy_file_range() syscall number is unknown for your architecture"
#endif #endif
/* may be (invalid) negative number due to libseccomp, see PR 13319 */ /* may be (invalid) negative number due to libseccomp, see PR 13319 */
@ -485,25 +517,21 @@ static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in,
/* ======================================================================= */ /* ======================================================================= */
#if defined __i386__ #if defined(__aarch64__)
# define systemd_NR_bpf 357
#elif defined __x86_64__
# define systemd_NR_bpf systemd_SC_arch_bias(321)
#elif defined __aarch64__
# define systemd_NR_bpf 280 # define systemd_NR_bpf 280
#elif defined __arm__ #elif defined(__alpha__)
# define systemd_NR_bpf 386
#elif defined __alpha__
# define systemd_NR_bpf 515 # define systemd_NR_bpf 515
#elif defined(__powerpc__) #elif defined(__arc__) || defined(__tilegx__)
# define systemd_NR_bpf 361
#elif defined __sparc__
# define systemd_NR_bpf 349
#elif defined __s390__
# define systemd_NR_bpf 351
#elif defined __tilegx__
# define systemd_NR_bpf 280 # define systemd_NR_bpf 280
#elif defined _MIPS_SIM #elif defined(__arm__)
# define systemd_NR_bpf 386
#elif defined(__i386__)
# define systemd_NR_bpf 357
#elif defined(__ia64__)
# define systemd_NR_bpf systemd_SC_arch_bias(317)
#elif defined(__m68k__)
# define systemd_NR_bpf 354
#elif defined(_MIPS_SIM)
# if _MIPS_SIM == _MIPS_SIM_ABI32 # if _MIPS_SIM == _MIPS_SIM_ABI32
# define systemd_NR_bpf systemd_SC_arch_bias(355) # define systemd_NR_bpf systemd_SC_arch_bias(355)
# elif _MIPS_SIM == _MIPS_SIM_NABI32 # elif _MIPS_SIM == _MIPS_SIM_NABI32
@ -511,8 +539,16 @@ static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in,
# elif _MIPS_SIM == _MIPS_SIM_ABI64 # elif _MIPS_SIM == _MIPS_SIM_ABI64
# define systemd_NR_bpf systemd_SC_arch_bias(315) # define systemd_NR_bpf systemd_SC_arch_bias(315)
# endif # endif
#elif defined(__powerpc__)
# define systemd_NR_bpf 361
#elif defined(__s390__)
# define systemd_NR_bpf 351
#elif defined(__sparc__)
# define systemd_NR_bpf 349
#elif defined(__x86_64__)
# define systemd_NR_bpf systemd_SC_arch_bias(321)
#else #else
# warning "bpf() syscall number unknown for your architecture" # warning "bpf() syscall number is unknown for your architecture"
#endif #endif
/* may be (invalid) negative number due to libseccomp, see PR 13319 */ /* may be (invalid) negative number due to libseccomp, see PR 13319 */
@ -547,21 +583,21 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) {
/* ======================================================================= */ /* ======================================================================= */
#ifndef __IGNORE_pkey_mprotect #ifndef __IGNORE_pkey_mprotect
# if defined __i386__ # if defined(__aarch64__)
# define systemd_NR_pkey_mprotect 380
# elif defined __x86_64__
# define systemd_NR_pkey_mprotect systemd_SC_arch_bias(329)
# elif defined __aarch64__
# define systemd_NR_pkey_mprotect 288 # define systemd_NR_pkey_mprotect 288
# elif defined __arm__ # elif defined(__alpha__)
# define systemd_NR_pkey_mprotect 394
# elif defined __alpha__
# define systemd_NR_pkey_mprotect 524 # define systemd_NR_pkey_mprotect 524
# elif defined __powerpc__ # elif defined(__arc__) || defined(__tilegx__)
# define systemd_NR_pkey_mprotect 386 # define systemd_NR_pkey_mprotect 226
# elif defined __s390__ # elif defined(__arm__)
# define systemd_NR_pkey_mprotect 384 # define systemd_NR_pkey_mprotect 394
# elif defined _MIPS_SIM # elif defined(__i386__)
# define systemd_NR_pkey_mprotect 380
# elif defined(__ia64__)
# define systemd_NR_pkey_mprotect systemd_SC_arch_bias(330)
# elif defined(__m68k__)
# define systemd_NR_pkey_mprotect 381
# elif defined(_MIPS_SIM)
# if _MIPS_SIM == _MIPS_SIM_ABI32 # if _MIPS_SIM == _MIPS_SIM_ABI32
# define systemd_NR_pkey_mprotect systemd_SC_arch_bias(363) # define systemd_NR_pkey_mprotect systemd_SC_arch_bias(363)
# elif _MIPS_SIM == _MIPS_SIM_NABI32 # elif _MIPS_SIM == _MIPS_SIM_NABI32
@ -569,8 +605,16 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) {
# elif _MIPS_SIM == _MIPS_SIM_ABI64 # elif _MIPS_SIM == _MIPS_SIM_ABI64
# define systemd_NR_pkey_mprotect systemd_SC_arch_bias(323) # define systemd_NR_pkey_mprotect systemd_SC_arch_bias(323)
# endif # endif
# elif defined(__powerpc__)
# define systemd_NR_pkey_mprotect 386
# elif defined(__s390__)
# define systemd_NR_pkey_mprotect 384
# elif defined(__sparc__)
# define systemd_NR_pkey_mprotect 362
# elif defined(__x86_64__)
# define systemd_NR_pkey_mprotect systemd_SC_arch_bias(329)
# else # else
# warning "pkey_mprotect() syscall number unknown for your architecture" # warning "pkey_mprotect() syscall number is unknown for your architecture"
# endif # endif
/* may be (invalid) negative number due to libseccomp, see PR 13319 */ /* may be (invalid) negative number due to libseccomp, see PR 13319 */
@ -590,21 +634,21 @@ assert_cc(__NR_pkey_mprotect == systemd_NR_pkey_mprotect);
/* ======================================================================= */ /* ======================================================================= */
#if defined __aarch64__ #if defined(__aarch64__)
# define systemd_NR_statx 291 # define systemd_NR_statx 291
#elif defined __arm__ #elif defined(__alpha__)
# define systemd_NR_statx 397
#elif defined __alpha__
# define systemd_NR_statx 522 # define systemd_NR_statx 522
#elif defined __i386__ || defined __powerpc64__ #elif defined(__arc__) || defined(__tilegx__)
# define systemd_NR_statx 291
#elif defined(__arm__)
# define systemd_NR_statx 397
#elif defined(__i386__)
# define systemd_NR_statx 383 # define systemd_NR_statx 383
#elif defined __s390__ || defined __s390x__ #elif defined(__ia64__)
# define systemd_NR_statx systemd_SC_arch_bias(326)
#elif defined(__m68k__)
# define systemd_NR_statx 379 # define systemd_NR_statx 379
#elif defined __sparc__ #elif defined(_MIPS_SIM)
# define systemd_NR_statx 360
#elif defined __x86_64__
# define systemd_NR_statx systemd_SC_arch_bias(332)
#elif defined _MIPS_SIM
# if _MIPS_SIM == _MIPS_SIM_ABI32 # if _MIPS_SIM == _MIPS_SIM_ABI32
# define systemd_NR_statx systemd_SC_arch_bias(366) # define systemd_NR_statx systemd_SC_arch_bias(366)
# elif _MIPS_SIM == _MIPS_SIM_NABI32 # elif _MIPS_SIM == _MIPS_SIM_NABI32
@ -612,8 +656,16 @@ assert_cc(__NR_pkey_mprotect == systemd_NR_pkey_mprotect);
# elif _MIPS_SIM == _MIPS_SIM_ABI64 # elif _MIPS_SIM == _MIPS_SIM_ABI64
# define systemd_NR_statx systemd_SC_arch_bias(326) # define systemd_NR_statx systemd_SC_arch_bias(326)
# endif # endif
#elif defined(__powerpc__)
# define systemd_NR_statx 383
#elif defined(__s390__)
# define systemd_NR_statx 379
#elif defined(__sparc__)
# define systemd_NR_statx 360
#elif defined(__x86_64__)
# define systemd_NR_statx systemd_SC_arch_bias(332)
#else #else
# warning "statx() syscall number unknown for your architecture" # warning "statx() syscall number is unknown for your architecture"
#endif #endif
/* may be (invalid) negative number due to libseccomp, see PR 13319 */ /* may be (invalid) negative number due to libseccomp, see PR 13319 */

View File

@ -192,33 +192,39 @@ class BridgeTest(NetworkdTestingUtilities, unittest.TestCase):
[NetDev] [NetDev]
Name=port1 Name=port1
Kind=dummy Kind=dummy
MACAddress=12:34:56:78:9a:bc''') MACAddress=12:34:56:78:9a:bc
''')
self.write_network('port2.netdev', '''\ self.write_network('port2.netdev', '''\
[NetDev] [NetDev]
Name=port2 Name=port2
Kind=dummy Kind=dummy
MACAddress=12:34:56:78:9a:bd''') MACAddress=12:34:56:78:9a:bd
''')
self.write_network('mybridge.netdev', '''\ self.write_network('mybridge.netdev', '''\
[NetDev] [NetDev]
Name=mybridge Name=mybridge
Kind=bridge''') Kind=bridge
''')
self.write_network('port1.network', '''\ self.write_network('port1.network', '''\
[Match] [Match]
Name=port1 Name=port1
[Network] [Network]
Bridge=mybridge''') Bridge=mybridge
''')
self.write_network('port2.network', '''\ self.write_network('port2.network', '''\
[Match] [Match]
Name=port2 Name=port2
[Network] [Network]
Bridge=mybridge''') Bridge=mybridge
''')
self.write_network('mybridge.network', '''\ self.write_network('mybridge.network', '''\
[Match] [Match]
Name=mybridge Name=mybridge
[Network] [Network]
DNS=192.168.250.1 DNS=192.168.250.1
Address=192.168.250.33/24 Address=192.168.250.33/24
Gateway=192.168.250.1''') Gateway=192.168.250.1
''')
subprocess.call(['systemctl', 'reset-failed', 'systemd-networkd', 'systemd-resolved']) subprocess.call(['systemctl', 'reset-failed', 'systemd-networkd', 'systemd-resolved'])
subprocess.check_call(['systemctl', 'start', 'systemd-networkd']) subprocess.check_call(['systemctl', 'start', 'systemd-networkd'])
@ -351,10 +357,11 @@ class ClientTestBase(NetworkdTestingUtilities):
self.start_unit('systemd-resolved') self.start_unit('systemd-resolved')
self.write_network(self.config, '''\ self.write_network(self.config, '''\
[Match] [Match]
Name={} Name={iface}
[Network] [Network]
DHCP={} DHCP={dhcp_mode}
{}'''.format(self.iface, dhcp_mode, extra_opts)) {extra_opts}
'''.format(iface=self.iface, dhcp_mode=dhcp_mode, extra_opts=extra_opts))
if coldplug: if coldplug:
# create interface first, then start networkd # create interface first, then start networkd
@ -476,14 +483,16 @@ DHCP={}
[NetDev] [NetDev]
Name=dummy0 Name=dummy0
Kind=dummy Kind=dummy
MACAddress=12:34:56:78:9a:bc''') MACAddress=12:34:56:78:9a:bc
''')
self.write_network('myvpn.network', '''\ self.write_network('myvpn.network', '''\
[Match] [Match]
Name=dummy0 Name=dummy0
[Network] [Network]
Address=192.168.42.100/24 Address=192.168.42.100/24
DNS=192.168.42.1 DNS=192.168.42.1
Domains= ~company''') Domains= ~company
''')
try: try:
self.do_test(coldplug=True, ipv6=False, self.do_test(coldplug=True, ipv6=False,
@ -508,13 +517,15 @@ Domains= ~company''')
self.write_network('myvpn.netdev', '''[NetDev] self.write_network('myvpn.netdev', '''[NetDev]
Name=dummy0 Name=dummy0
Kind=dummy Kind=dummy
MACAddress=12:34:56:78:9a:bc''') MACAddress=12:34:56:78:9a:bc
''')
self.write_network('myvpn.network', '''[Match] self.write_network('myvpn.network', '''[Match]
Name=dummy0 Name=dummy0
[Network] [Network]
Address=192.168.42.100/24 Address=192.168.42.100/24
DNS=192.168.42.1 DNS=192.168.42.1
Domains= ~company ~.''') Domains= ~company ~.
''')
try: try:
self.do_test(coldplug=True, ipv6=False, self.do_test(coldplug=True, ipv6=False,
@ -613,7 +624,8 @@ class DnsmasqClientTest(ClientTestBase, unittest.TestCase):
Name={} Name={}
[Network] [Network]
DHCP=ipv4 DHCP=ipv4
IPv6AcceptRA=False'''.format(self.iface)) IPv6AcceptRA=False
'''.format(self.iface))
# create second device/dnsmasq for a .company/.lab VPN interface # create second device/dnsmasq for a .company/.lab VPN interface
# static IPs for simplicity # static IPs for simplicity
@ -639,7 +651,8 @@ Name=testvpnclient
IPv6AcceptRA=False IPv6AcceptRA=False
Address=10.241.3.2/24 Address=10.241.3.2/24
DNS=10.241.3.1 DNS=10.241.3.1
Domains= ~company ~lab''') Domains= ~company ~lab
''')
self.start_unit('systemd-networkd') self.start_unit('systemd-networkd')
subprocess.check_call([NETWORKD_WAIT_ONLINE, '--interface', self.iface, subprocess.check_call([NETWORKD_WAIT_ONLINE, '--interface', self.iface,
@ -825,35 +838,37 @@ mount -t tmpfs none /run/systemd/network
mount -t tmpfs none /run/systemd/netif mount -t tmpfs none /run/systemd/netif
[ ! -e /run/dbus ] || mount -t tmpfs none /run/dbus [ ! -e /run/dbus ] || mount -t tmpfs none /run/dbus
# create router/client veth pair # create router/client veth pair
cat << EOF > /run/systemd/network/test.netdev cat <<EOF >/run/systemd/network/test.netdev
[NetDev] [NetDev]
Name=%(ifr)s Name={ifr}
Kind=veth Kind=veth
[Peer] [Peer]
Name=%(ifc)s Name={ifc}
EOF EOF
cat << EOF > /run/systemd/network/test.network cat <<EOF >/run/systemd/network/test.network
[Match] [Match]
Name=%(ifr)s Name={ifr}
[Network] [Network]
Address=192.168.5.1/24 Address=192.168.5.1/24
%(addr6)s {addr6}
DHCPServer=yes DHCPServer=yes
[DHCPServer] [DHCPServer]
PoolOffset=10 PoolOffset=10
PoolSize=50 PoolSize=50
DNS=192.168.5.1 DNS=192.168.5.1
%(dhopts)s {dhopts}
EOF EOF
# run networkd as in systemd-networkd.service # run networkd as in systemd-networkd.service
exec $(systemctl cat systemd-networkd.service | sed -n '/^ExecStart=/ { s/^.*=//; s/^[@+-]//; s/^!*//; p}') exec $(systemctl cat systemd-networkd.service | sed -n '/^ExecStart=/ {{ s/^.*=//; s/^[@+-]//; s/^!*//; p}}')
''' % {'ifr': self.if_router, 'ifc': self.iface, 'addr6': ipv6 and 'Address=2600::1/64' or '', '''.format(ifr=self.if_router,
'dhopts': dhcpserver_opts or ''}) ifc=self.iface,
addr6=('Address=2600::1/64' if ipv6 else ''),
dhopts=(dhcpserver_opts or '')))
os.fchmod(fd, 0o755) os.fchmod(fd, 0o755)
@ -902,14 +917,16 @@ exec $(systemctl cat systemd-networkd.service | sed -n '/^ExecStart=/ { s/^.*=//
[NetDev] [NetDev]
Name=dummy0 Name=dummy0
Kind=dummy Kind=dummy
MACAddress=12:34:56:78:9a:bc''') MACAddress=12:34:56:78:9a:bc
''')
self.write_network('test.network', '''\ self.write_network('test.network', '''\
[Match] [Match]
Name=dummy0 Name=dummy0
[Network] [Network]
Address=192.168.42.100/24 Address=192.168.42.100/24
DNS=192.168.42.1 DNS=192.168.42.1
Domains= one two three four five six seven eight nine ten''') Domains= one two three four five six seven eight nine ten
''')
self.start_unit('systemd-networkd') self.start_unit('systemd-networkd')
@ -929,16 +946,19 @@ Domains= one two three four five six seven eight nine ten''')
[NetDev] [NetDev]
Name=dummy0 Name=dummy0
Kind=dummy Kind=dummy
MACAddress=12:34:56:78:9a:bc''') MACAddress=12:34:56:78:9a:bc
''')
self.write_network('test.network', '''\ self.write_network('test.network', '''\
[Match] [Match]
Name=dummy0 Name=dummy0
[Network] [Network]
Address=192.168.42.100/24 Address=192.168.42.100/24
DNS=192.168.42.1''') DNS=192.168.42.1
''')
self.write_network_dropin('test.network', 'dns', '''\ self.write_network_dropin('test.network', 'dns', '''\
[Network] [Network]
DNS=127.0.0.1''') DNS=127.0.0.1
''')
self.start_unit('systemd-resolved') self.start_unit('systemd-resolved')
self.start_unit('systemd-networkd') self.start_unit('systemd-networkd')