1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00
Commit Graph

58042 Commits

Author SHA1 Message Date
Jan Janssen
2581dbcb0f clang-format: Adjust style of pointers
We gernerally have our pointers aligned to the right. SpaceAroundPointerQualifiers
makes sure "const char * const" is formatted nicely.
2022-05-30 04:00:54 +09:00
Frantisek Sumsal
0fde92d3e4
Merge pull request #23550 from evverx/fuzz-i386
oss-fuzz: support i386
2022-05-29 18:35:03 +00:00
Zbigniew Jędrzejewski-Szmek
67f8ba714a
Merge pull request #23548 from tpgxyz/lua2
rpm: adjust lua trigger for udevadm
2022-05-29 20:08:05 +02:00
Evgeny Vereshchagin
b22f5ed5fb oss-fuzz: support i386
Closes https://github.com/systemd/systemd/issues/23532
2022-05-29 09:32:00 +00:00
Evgeny Vereshchagin
61ad4f25ed docs: mention how to build 32 bit fuzz targets 2022-05-29 09:12:38 +00:00
Evgeny Vereshchagin
8739f309f3 meson: exclude pcre2 when dependencies are skipped 2022-05-29 06:44:45 +00:00
Tomasz Paweł Gajc
744984aa2d rpm: adjust lua trigger for udevadm 2022-05-28 21:38:33 +02:00
Tomasz Paweł Gajc
7bde8293a4 rpm: use rpm.execute() instead of fork() and execp() for trigger scriplets 2022-05-28 21:29:00 +02:00
Michael Biebl
003a676161 Move homectl and userdbctl to bindir
Those binaries aren't needed during early boot.
2022-05-28 18:47:53 +02:00
Javkhlanbayar Khongorzul
01ae74c8c7 man: Fix minor typo 2022-05-28 18:38:47 +09:00
Yu Watanabe
89b6a3f13e sd-bus: fix buffer overflow
Fixes #23486.
2022-05-28 10:06:14 +02:00
Luca Boccassi
5ad69b04bf
Merge pull request #23518 from enr0n/sd-hwdb-from-path
Implement --root option for systemd-hwdb query
2022-05-27 22:51:36 +01:00
Zbigniew Jędrzejewski-Szmek
94b84a0703 Use descriptive name for nobody
This matches the changes pushed to Fedora [1,2].

[1] https://fedoraproject.org/wiki/Changes/RenameNobodyUser
[2] https://pagure.io/setup/c/f6fdb5ffc87fc8f1acc211867fef4e3f0856edfc
2022-05-27 22:09:24 +01:00
Nick Rosbrook
beff73f94e hwdb: implement --root option for systemd-hwdb query
Currently, the systemd-hwdb --root flag only has an effect for the
'update' verb. It would be useful to be able to use the --root option
for the 'query' verb too (e.g. for testing a hwdb.bin created with
systemd-hwdb update --root <path>).

Use sd_hwdb_new_from_path to initialize the hwdb if --root is passed to
systemd-hwdb query.

Note that this functionality was not added to 'udevadm hwdb' since that
command is deprecated.
2022-05-27 09:40:54 -04:00
Nick Rosbrook
60f0ba7556 sd-hwdb: add sd_hwdb_new_from_path
The existing sd_hwdb_new function always initializes the hwdb from the
first successful hwdb.bin it finds from hwdb_bin_paths. This means there
is currently no way to initialize a hwdb from an explicit path, which
would be useful for systemd-hwdb query.

Add sd_hwdb_new_from_path to allow a sd_hwdb to be initialized from a
custom path outside of hwdb_bin_paths.
2022-05-27 09:40:54 -04:00
Nick Rosbrook
9745b51c73 sd-hwdb: include sys/stat.h in hwdb-internal.h
Include this header to fix errors when including hwdb-internal.h:
  ../src/libsystemd/sd-hwdb/hwdb-internal.h:16:21: error: field ‘st’ has incomplete type
     16 |         struct stat st;
2022-05-27 09:40:54 -04:00
Luca Boccassi
e1a8917ae1
Merge pull request #23504 from keszybz/bls-reordering
Refactor the BLS and add a description of version sorts
2022-05-27 14:36:10 +01:00
Luca Boccassi
90abe62fd9
Merge pull request #23536 from mrc0mmand/TEST-69-tweaks
A couple of tweaks for TEST-69-SHUTDOWN
2022-05-27 14:34:52 +01:00
Luca Boccassi
df90d255fe
Merge pull request #23527 from keszybz/esp-detect-xbootldr
Fix xbootldr detection, fail early in kernel-install
2022-05-27 11:46:46 +01:00
Luca Boccassi
d20110b459
Merge pull request #23521 from keszybz/some-docs
Some docs
2022-05-27 11:42:01 +01:00
Pablo Ceballos
1a2134fb51 hwdb: Add Google Meet speakermic
It has the same issue as the Google Hangouts Meet speakermic but a
different VID/PID.
2022-05-27 11:38:13 +01:00
Frantisek Sumsal
47a00df1f0 test: fix a couple of pylint warnings 2022-05-27 11:54:47 +02:00
Frantisek Sumsal
3e624bb13b test: bump the post-reboot expect() timeout
as it may take a bit longer on slower machines:

```
[  OK  ] Reached target System Reboot.
Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
Failed to open watchdog device /dev/watchdog0, ignoring: No such file or directory
binfmt_misc is not mounted, not detaching entries.
Sending SIGTERM to remaining processes...
ERROR:test-shutdown:Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0x7f3d4bcd20b0>
command: /systemd-meson-build/systemd-nspawn
<...snip...>
buffer (last 100 chars): 'mbinfmt_misc is not mounted, not detaching entries.\x1b[0m\r\nSending SIGTERM to remaining processes...\r\n'
before (last 100 chars): 'mbinfmt_misc is not mounted, not detaching entries.\x1b[0m\r\nSending SIGTERM to remaining processes...\r\n'
after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 572528
child_fd: 5
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile('H login: ')
INFO:test-shutdown:killing child pid 572528
E: nspawn failed with exit code 1
```
2022-05-27 11:41:55 +02:00
Yu Watanabe
6d3bb9e7d1
Merge pull request #23517 from mrc0mmand/cryptsetup-switchroot-transition
test: cover initrd->sysroot transition in TEST-24
2022-05-27 07:36:17 +09:00
Eduard Tolosa
815068d3a3 loader.conf: Clarify the default value of timeout. 2022-05-27 06:48:18 +09:00
Zbigniew Jędrzejewski-Szmek
13d7c841a2 shared/find-esp: enhance logging
If something doesn't match, let's print the non-matching value.
If we can't query something, say what.
And make the messages in the udev and blkid paths different, so
we tell which approach failed from a log.
2022-05-26 21:50:18 +02:00
Zbigniew Jędrzejewski-Szmek
4e12442554 shared/find-esp: fix inverted check for XBOOTLDR type 2022-05-26 21:49:38 +02:00
Zbigniew Jędrzejewski-Szmek
5aa285b437 kernel-install: if a plugin fails, return error immediately
Since the first version in 81516adcb7,
kernel-install would "gather" a return value by summing the exit codes
of the plugins… This makes no sense, because those are not additive values.

Let's just break off immediately. We now implement cleanup via trap, so if we
break, we should leave no garbage behind.
2022-05-26 21:46:58 +02:00
Zbigniew Jędrzejewski-Szmek
53c26db4da docs/BLS: clear up the confusion about what $BOOT means
The text used was originally written for everything being on the ESP. It was
later generalized for support XBOOTLDR, and "$BOOT" was introduced to mean
something like "XBOOTLDR if present, the ESP otherwise", and most of the text
was changed to talk about $BOOT. Sadly, this doesn't work, because the two
partitions are not interchangeable. sd-boot loads entries from both partitions,
and its configuration, random-seed, etc. only from the ESP.

The terms are redefined: $BOOT now means either the ESP or the "boot partition"
playing the same role on MBR systems, and $XBOOTLDR is XBOOTLDR.

Like various previous commits, this makes the specification describe our
current implementation.

Also, the let's just accept the common practice of using /boot and /boot/efi.
Since both partitions need to be read to gather configuration, it isn't a
problem that one is mounted underneath the other one. I think having /boot and
/efi is OK, but not better in any measureable way, so let's stop trying to push
people towards this setup.

A note that XBOOTLDR must be on the same disk as ESP is added.
2022-05-26 20:21:09 +02:00
Zbigniew Jędrzejewski-Szmek
e5985a7d07
Merge pull request #23523 from evverx/oss-fuzz-links
docs: add a link to the OSS-Fuzz coverage report
2022-05-26 18:10:56 +02:00
Evgeny Vereshchagin
39e63b441b docs: be more specific about the OSS-Fuzz toolchain 2022-05-26 15:22:50 +00:00
Yu Watanabe
4fc69e8a09 core/device: do not downgrade device state if it is already enumerated
On switching root, a device may have a persistent databse. In that case,
Device.enumerated_found may have DEVICE_FOUND_UDEV flag, and it is not
necessary to downgrade the Device.deserialized_found and
Device.deserialized_state. Otherwise, the state of the device unit may
be changed plugged -> dead -> plugged, if the device has not been mounted.

Fixes #23429.

[mwilck: cherry-picked from #23437]
2022-05-26 17:07:59 +02:00
Evgeny Vereshchagin
7d7c92ef8c docs: update OSS-Fuzz links 2022-05-26 14:16:17 +00:00
Martin Wilck
cf1ac0cfe4 core/device: device_coldplug(): don't set DEVICE_DEAD
dm-crypt device units generated by systemd-cryptsetup-generator
habe BindsTo= dependencies on their backend devices. The dm-crypt
devices have the db_persist flag set, and thus survive the udev db
cleanup while switching root. But backend devices usually don't survive.
These devices are neither mounted nor used for swap, thus they will
seen as DEVICE_NOT_FOUND after switching root.

The BindsTo dependency will cause systemd to schedule a stop
job for the dm-crypt device, breaking boot:

[   68.929457] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Unit is stopped because bound to inactive unit dev-disk-by\x2duuid-3bf91f73\x2d1ee8\x2d4cfc\x2d9048\x2d93ba349b786d.device.
[   68.945660] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Trying to enqueue job systemd-cryptsetup@cr_root.service/stop/replace
[   69.473459] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Installed new job systemd-cryptsetup@cr_root.service/stop as 343

Avoid this by not setting the state of the backend devices to
DEVICE_DEAD.

Fixes the LUKS setup issue reported in #23429.
2022-05-26 15:06:41 +02:00
Frantisek Sumsal
6b70d3cf81 test: store the key on a separate device 2022-05-26 15:06:41 +02:00
Frantisek Sumsal
b22d90e594 test: generate a custom initrd for TEST-24 if $INITRD is unset
Co-Authored-By: Yu Watanabe <watanabe.yu+github@gmail.com>
2022-05-26 15:04:56 +02:00
Zbigniew Jędrzejewski-Szmek
b72308d344 man/homectl: adjust man page to match code
Fixes #22966. Since there are competing conventions, let's not
change our code, but make the docs match what is implemented.
2022-05-26 14:29:50 +02:00
Zbigniew Jędrzejewski-Szmek
8f24777156 man/sd-bus: discuss negative-return values and add example
Fixes #22816.
2022-05-26 14:29:50 +02:00
Zbigniew Jędrzejewski-Szmek
5ee38adea4 man/shutdown: explain -h more
Fixes #23401
2022-05-26 14:29:50 +02:00
Zbigniew Jędrzejewski-Szmek
223a359f21 man/automount: say that automounts should not be nested
Fixes #21832.
2022-05-26 14:29:50 +02:00
Zbigniew Jędrzejewski-Szmek
93dbc22a95 man/systemd.automount: move the main description up and clarify deps 2022-05-26 14:29:50 +02:00
Zbigniew Jędrzejewski-Szmek
3844a42138 TODO: drop entry
Implemented in 14e6e444dd.
2022-05-26 14:29:50 +02:00
Zbigniew Jędrzejewski-Szmek
19cb82799e man: do not say "additional symlinks" for mount/automount aliases
"additional" implies that the unit itself is a symlink, which it is not.
Also "link to the mount unit", not "link to the mount".
2022-05-26 14:23:47 +02:00
Zbigniew Jędrzejewski-Szmek
a6e334649d systemctl: make show/status honour --state and --type
This makes the interface more flexible, by allowing the same filtering
for show and status as is done for list-units.

Fixes #23207.
2022-05-26 10:37:35 +09:00
Yu Watanabe
c7a0c74c7f
Merge pull request #23513 from keszybz/bootctl-version-print
bootctl: print version comparison when updating
2022-05-26 10:30:16 +09:00
Frantisek Sumsal
1fb7f8e15e test: cover initrd->sysroot transition in TEST-24
This should cover cases regarding devices with `OPTIONS+="db_persist"`
during initrd->sysroot transition.

See:
  * https://github.com/systemd/systemd/issues/23429
  * https://github.com/systemd/systemd/pull/23218
  * https://github.com/systemd/systemd/pull/23489
  * https://bugzilla.redhat.com/show_bug.cgi?id=2087225
2022-05-25 18:19:46 +02:00
Zbigniew Jędrzejewski-Szmek
892fcb8955 bootctl: when comparing versions, show the result
In Fedora there was a mixup with versions (the version was prefixed with "v", and
"v251" < "250"). This makes this easier to debug.
2022-05-25 16:02:35 +02:00
Zbigniew Jędrzejewski-Szmek
f90ee9ff66 basic: add helper function to print </==/> 2022-05-25 16:02:25 +02:00
Zbigniew Jędrzejewski-Szmek
c20b2f2421 analyze: use '' instead of the empty string when showing versions
It looks like garbled output… I didn't use shell-escape, because the other
characters that are special for the shell that are used in versions should
not be escaped.
2022-05-25 16:01:14 +02:00
Rahil Bhimjiani
97e7d4945d [sd-boot] improve documentation of beep 2022-05-25 14:20:14 +02:00