1
0
mirror of https://github.com/systemd/systemd synced 2026-04-26 17:04:50 +02:00

Compare commits

...

8 Commits

Author SHA1 Message Date
Yu Watanabe
fa2ba7aea8
Merge pull request #23205 from DaanDeMeyer/tmpfiles-networkd
tmpfiles: Split networkd entries into a separate file
2022-05-04 11:48:21 +09:00
Yu Watanabe
e370edbefc
Merge pull request #23257 from evverx/install-valgrind
tests: make it possible to install valgrind
2022-05-04 11:47:59 +09:00
Daan De Meyer
206c0897a2 sd-network: Keep inotify watch if watch descriptor didn't change
In sd_network_monitor_flush(), we shouldn't remove the inotify
watch for the current directory if the directory the network
monitor is waiting for wasn't created yet.

inotify_add_watch() returns the same unique watch descriptor if a
path is already being watched. Let's return the watch descriptor
from monitor_add_inotify_watch() so we can check if it's the same
as the watch descriptor of the inotify event. If they are equal,
we're still watching the same path and we don't need to remove the
inotify watch just yet.
2022-05-04 07:00:56 +09:00
Evgeny Vereshchagin
8e78dca982 tests: make valgrind_wrapper track file descriptors 2022-05-03 20:51:56 +00:00
Evgeny Vereshchagin
c66e2f6c2c tests: make it possible to install valgrind 2022-05-03 20:50:39 +00:00
rodin-ia
d31b8a66d1
Adding a description of the keyboard shortcut Fn+F12 for the HP EliteBook 845 G7 device. (#23253)
udevadm info /dev/input/event4
P: /devices/platform/i8042/serio0/input/input4/event4
N: input/event4
L: 0
S: input/by-path/platform-i8042-serio-0-event-kbd
E: DEVPATH=/devices/platform/i8042/serio0/input/input4/event4
E: DEVNAME=/dev/input/event4
E: MAJOR=13
E: MINOR=68
E: SUBSYSTEM=input
E: USEC_INITIALIZED=4165584
E: KEYBOARD_KEY_81=f20
E: KEYBOARD_KEY_89=battery
E: KEYBOARD_KEY_8a=screenlock
E: KEYBOARD_KEY_8b=camera
E: KEYBOARD_KEY_8c=media
E: KEYBOARD_KEY_8e=dvd
E: KEYBOARD_KEY_92=brightnessdown
E: KEYBOARD_KEY_97=brightnessup
E: KEYBOARD_KEY_b1=help
E: KEYBOARD_KEY_b3=unknown
E: KEYBOARD_KEY_d7=wlan
E: KEYBOARD_KEY_ee=switchvideomode
E: KEYBOARD_KEY_68=unknown
E: ID_INPUT=1
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: ID_BUS=i8042
E: ID_SERIAL=noserial
E: ID_PATH=platform-i8042-serio-0
E: ID_PATH_TAG=platform-i8042-serio-0
E: XKBMODEL=pc105
E: XKBLAYOUT=us
E: BACKSPACE=guess
E: LIBINPUT_DEVICE_GROUP=11/1/1:isa0060/serio0
E: DEVLINKS=/dev/input/by-path/platform-i8042-serio-0-event-kbd
E: TAGS=:power-switch:
E: CURRENT_TAGS=:power-switch:
2022-05-04 05:40:55 +09:00
Daan De Meyer
52fdbf8ce7 meson: Sort lines in tmpfiles.d/meson.build 2022-05-03 20:46:16 +02:00
Daan De Meyer
eb1446f8f1 tmpfiles: Split networkd entries into a separate file
Many distributions ship systemd-networkd as a separate file so we
need to be able to ship the tmpfiles networkd entries as part of
that separate networkd package. Let's split the networkd entries
into a separate file to make that possible.
2022-05-03 20:46:14 +02:00
7 changed files with 55 additions and 33 deletions

7
NEWS
View File

@ -71,6 +71,13 @@ CHANGES WITH 251:
(as exposed via the SystemCallFilter= setting in service unit files). (as exposed via the SystemCallFilter= setting in service unit files).
It is apparently used by the linker now. It is apparently used by the linker now.
* The tmpfiles entries that create the /run/systemd/netif directory and
its subdirectories were moved from tmpfiles.d/systemd.conf to
tmpfiles.d/systemd-network.conf.
Users might need to adjust their files that override tmpfiles.d/systemd.conf
to account for this change.
Changes in the Boot Loader Specification, kernel-install and sd-boot: Changes in the Boot Loader Specification, kernel-install and sd-boot:
* kernel-install's and bootctl's Boot Loader Specification Type #1 * kernel-install's and bootctl's Boot Loader Specification Type #1

View File

@ -699,6 +699,10 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP:pnHPEliteBookFolioG1:*
KEYBOARD_KEY_64=calendar KEYBOARD_KEY_64=calendar
KEYBOARD_KEY_81=f20 KEYBOARD_KEY_81=f20
# HP EliteBook 845 G7
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP*:pnHPEliteBook845G7*:pvr*
KEYBOARD_KEY_68=unknown # Fn+F12 HP Programmable Key
# HP ProBook 650 # HP ProBook 650
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP*ProBook*650*:* evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP*ProBook*650*:*
KEYBOARD_KEY_f8=wlan # Wireless HW switch button KEYBOARD_KEY_f8=wlan # Wireless HW switch button

View File

@ -413,25 +413,25 @@ static sd_network_monitor* FD_TO_MONITOR(int fd) {
} }
static int monitor_add_inotify_watch(int fd) { static int monitor_add_inotify_watch(int fd) {
int k; int wd;
k = inotify_add_watch(fd, "/run/systemd/netif/links/", IN_MOVED_TO|IN_DELETE); wd = inotify_add_watch(fd, "/run/systemd/netif/links/", IN_MOVED_TO|IN_DELETE);
if (k >= 0) if (wd >= 0)
return 0; return wd;
else if (errno != ENOENT) else if (errno != ENOENT)
return -errno; return -errno;
k = inotify_add_watch(fd, "/run/systemd/netif/", IN_CREATE|IN_ISDIR); wd = inotify_add_watch(fd, "/run/systemd/netif/", IN_CREATE|IN_ISDIR);
if (k >= 0) if (wd >= 0)
return 0; return wd;
else if (errno != ENOENT) else if (errno != ENOENT)
return -errno; return -errno;
k = inotify_add_watch(fd, "/run/systemd/", IN_CREATE|IN_ISDIR); wd = inotify_add_watch(fd, "/run/systemd/", IN_CREATE|IN_ISDIR);
if (k < 0) if (wd < 0)
return -errno; return -errno;
return 0; return wd;
} }
int sd_network_monitor_new(sd_network_monitor **m, const char *category) { int sd_network_monitor_new(sd_network_monitor **m, const char *category) {
@ -470,7 +470,7 @@ sd_network_monitor* sd_network_monitor_unref(sd_network_monitor *m) {
int sd_network_monitor_flush(sd_network_monitor *m) { int sd_network_monitor_flush(sd_network_monitor *m) {
union inotify_event_buffer buffer; union inotify_event_buffer buffer;
ssize_t l; ssize_t l;
int fd, k; int fd;
assert_return(m, -EINVAL); assert_return(m, -EINVAL);
@ -486,13 +486,16 @@ int sd_network_monitor_flush(sd_network_monitor *m) {
FOREACH_INOTIFY_EVENT(e, buffer, l) { FOREACH_INOTIFY_EVENT(e, buffer, l) {
if (e->mask & IN_ISDIR) { if (e->mask & IN_ISDIR) {
k = monitor_add_inotify_watch(fd); int wd;
if (k < 0)
return k;
k = inotify_rm_watch(fd, e->wd); wd = monitor_add_inotify_watch(fd);
if (k < 0) if (wd < 0)
return -errno; return wd;
if (wd != e->wd) {
if (inotify_rm_watch(fd, e->wd) < 0)
return -errno;
}
} }
} }

View File

@ -752,17 +752,17 @@ install_valgrind() {
local valgrind_bins valgrind_libs valgrind_dbg_and_supp local valgrind_bins valgrind_libs valgrind_dbg_and_supp
valgrind_bins="$(strace -e execve valgrind /bin/true 2>&1 >/dev/null | perl -lne 'print $1 if /^execve\("([^"]+)"/')" readarray -t valgrind_bins < <(strace -e execve valgrind /bin/true 2>&1 >/dev/null | perl -lne 'print $1 if /^execve\("([^"]+)"/')
image_install "$valgrind_bins" image_install "${valgrind_bins[@]}"
valgrind_libs="$(LD_DEBUG=files valgrind /bin/true 2>&1 >/dev/null | perl -lne 'print $1 if m{calling init: (/.*vgpreload_.*)}')" readarray -t valgrind_libs < <(LD_DEBUG=files valgrind /bin/true 2>&1 >/dev/null | perl -lne 'print $1 if m{calling init: (/.*vgpreload_.*)}')
image_install "$valgrind_libs" image_install "${valgrind_libs[@]}"
valgrind_dbg_and_supp="$( readarray -t valgrind_dbg_and_supp < <(
strace -e open valgrind /bin/true 2>&1 >/dev/null | strace -e open valgrind /bin/true 2>&1 >/dev/null |
perl -lne 'if (my ($fname) = /^open\("([^"]+).*= (?!-)\d+/) { print $fname if $fname =~ /debug|\.supp$/ }' perl -lne 'if (my ($fname) = /^open\("([^"]+).*= (?!-)\d+/) { print $fname if $fname =~ /debug|\.supp$/ }'
)" )
image_install "$valgrind_dbg_and_supp" image_install "${valgrind_dbg_and_supp[@]}"
} }
create_valgrind_wrapper() { create_valgrind_wrapper() {
@ -772,7 +772,7 @@ create_valgrind_wrapper() {
#!/usr/bin/env bash #!/usr/bin/env bash
mount -t proc proc /proc mount -t proc proc /proc
exec valgrind --leak-check=full --log-file=/valgrind.out $ROOTLIBDIR/systemd "\$@" exec valgrind --leak-check=full --track-fds=yes --log-file=/valgrind.out $ROOTLIBDIR/systemd "\$@"
EOF EOF
chmod 0755 "$valgrind_wrapper" chmod 0755 "$valgrind_wrapper"
} }

View File

@ -5,12 +5,13 @@ enable_tmpfiles = conf.get('ENABLE_TMPFILES') == 1
files = [['README', ''], files = [['README', ''],
['home.conf', ''], ['home.conf', ''],
['journal-nocow.conf', ''], ['journal-nocow.conf', ''],
['portables.conf', 'ENABLE_PORTABLED'],
['systemd-network.conf', 'ENABLE_NETWORKD'],
['systemd-nologin.conf', 'HAVE_PAM'], ['systemd-nologin.conf', 'HAVE_PAM'],
['systemd-nspawn.conf', 'ENABLE_MACHINED'], ['systemd-nspawn.conf', 'ENABLE_MACHINED'],
['systemd-pstore.conf', 'ENABLE_PSTORE'],
['systemd-resolve.conf', 'ENABLE_RESOLVE'], ['systemd-resolve.conf', 'ENABLE_RESOLVE'],
['systemd-tmp.conf', ''], ['systemd-tmp.conf', ''],
['portables.conf', 'ENABLE_PORTABLED'],
['systemd-pstore.conf', 'ENABLE_PSTORE'],
['tmp.conf', ''], ['tmp.conf', ''],
['x11.conf', ''], ['x11.conf', ''],
] ]

View File

@ -0,0 +1,13 @@
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# See tmpfiles.d(5) for details
d /run/systemd/netif 0755 systemd-network systemd-network -
d /run/systemd/netif/links 0755 systemd-network systemd-network -
d /run/systemd/netif/leases 0755 systemd-network systemd-network -
d /run/systemd/netif/lldp 0755 systemd-network systemd-network -

View File

@ -18,12 +18,6 @@ d /run/systemd/sessions 0755 root root -
d /run/systemd/users 0755 root root - d /run/systemd/users 0755 root root -
d /run/systemd/machines 0755 root root - d /run/systemd/machines 0755 root root -
d /run/systemd/shutdown 0755 root root - d /run/systemd/shutdown 0755 root root -
{% if ENABLE_NETWORKD %}
d /run/systemd/netif 0755 systemd-network systemd-network -
d /run/systemd/netif/links 0755 systemd-network systemd-network -
d /run/systemd/netif/leases 0755 systemd-network systemd-network -
d /run/systemd/netif/lldp 0755 systemd-network systemd-network -
{% endif %}
d /run/log 0755 root root - d /run/log 0755 root root -