Jan Janssen
85d2f13b6f
boot: Add PC speaker support
...
Fixes : #17508
2022-01-16 10:34:01 +00:00
Zbigniew Jędrzejewski-Szmek
e47a3af44e
sd-device: drop unnecessary parenthesis
2022-01-15 13:38:49 +01:00
Zbigniew Jędrzejewski-Szmek
376ee2c312
sd-device: silence gcc warning with newest gcc
2022-01-15 13:38:30 +01:00
Yu Watanabe
9e3e592946
Merge pull request #22098 from DaanDeMeyer/journal-corrupt-2
...
journal: Fixes for handling of corrupt entry objects
2022-01-14 21:23:32 +09:00
Daan De Meyer
8d801e35cb
journal: Fix entry array iteration corruption checks
...
Previously, we'd try to handle corruption by bumping the index even
if it was an entry array object that was corrupted (which we can't
deal with).
Now, we only try to deal with corrupted entry objects by moving the
corruption handling into generic_array_get().
On top, we also add an additional check for -EADDRNOTAVAIL which can
also be caused by corrupted journal data.
2022-01-14 11:33:32 +00:00
Zbigniew Jędrzejewski-Szmek
100433e05a
networkctl: use xsprintf a bit more
2022-01-14 16:24:27 +09:00
Zbigniew Jędrzejewski-Szmek
d821e40ca9
networkctl: open the bus just once
...
We'd connect to the bus twice: the first time to check networkd namespace,
and then the second time to do the deed we were asked to do. It's nicer
to open the bus just once, for efficience and also to avoid the open call
in all functions.
An ASSERT_PTR helper is added:
- sd_bus *bus = userdata;
...
- assert(bus);
+ sd_bus *bus = ASSERT_PTR(userdata);
...
It can be used in other place too, but I'm leaving that for a later
refactoring.
2022-01-14 16:24:04 +09:00
Luca Boccassi
e6d692ddfd
Merge pull request #22111 from medhefgo/boot-cleanup
...
boot: Cleanup
2022-01-13 22:50:52 +00:00
Yu Watanabe
902bbdc4b6
network: use scope link for direct unicast routes by default
...
Strictly speaking, this breaks the backward compatibility, but I guess
in most cases people already sets Scope=link for such routes.
This behavior matches with how 'ip route' command adds such route by
default.
Prompted by https://twitter.com/jplitza/status/1480500562391179270 .
2022-01-13 22:46:52 +00:00
Luca Boccassi
fad7ad2b8b
Merge pull request #22106 from yuwata/dhcp6-broken-NTP
...
sd-dhcp6-client: handle broken NTP server option gracefully
2022-01-13 22:43:07 +00:00
Daan De Meyer
4d6455c075
journal: Don't discard -b arg when followed by -e
...
Allowing -e to be used to view the last logs of a previous boot seems
like a useful feature so let's not discard -b options anymore when
followed by -e.
Fixes #22107
2022-01-14 01:10:22 +09:00
Jan Janssen
2d1ac308c5
boot: Use FreePool from boot services directly
...
This should hopefully allow the compiler to optimize this a bit even
when gnu-efi is not compiled with LTO.
2022-01-13 14:30:51 +01:00
Jan Janssen
27c106bab8
boot: Add missing assert to file_read()
2022-01-13 14:30:51 +01:00
Jan Janssen
e1e086d1f7
boot: Use _cleanup_ in shim
...
Also, better be safe than sorry and check the return value.
2022-01-13 14:30:51 +01:00
Jan Janssen
acd28f3912
boot: Don't try to free loaded_image
...
EFI_LOADED_IMAGE is a protocol pointer and thus, we shouldn't try
to free it.
2022-01-13 14:29:46 +01:00
Jan Janssen
85eb489e23
boot: Use EFI_FILE* instead of EFI_FILE_HANDLE
...
They are both the same, but the former is shorter and also closer
to how file handles are represented in the UEFI spec.
2022-01-13 14:26:43 +01:00
Jan Janssen
41b74a18b2
boot: Fix invalid free
...
LocateDevicePath() advances the device path pointer, making it invalid
when freed.
2022-01-13 14:19:32 +01:00
Yu Watanabe
2ebb69bc09
boot: add missing error check
...
Follow-up for 661615a0af .
Fixes CID#1468973.
2022-01-13 14:17:15 +01:00
Yu Watanabe
95c514e9a5
test: add testcase for broken NTP server option
...
For issue #22099 .
2022-01-13 20:21:40 +09:00
Yu Watanabe
37408dd264
test: voidify test functions
...
This also drops unnecessary arguments, and unbreak several lines.
2022-01-13 20:20:48 +09:00
Yu Watanabe
16de849fd8
sd-dhcp6-client: expose client_parse_message()
...
To introduce tests for the function in later commits.
2022-01-13 20:20:19 +09:00
Yu Watanabe
0ac9daa4a1
sd-dhcp6-client: ignore broken non-critical options
...
The commit b89a3758e9 made the validity
check of the received message stricter. E.g. if the client received a
message with broken NTP server option, then the entire message is
dropped.
This relaxes the check. If some non-critical options are broken, then
ignore the options, but the message itself is still accepted.
Fixes #22099 .
2022-01-13 20:20:19 +09:00
Daan De Meyer
df207ccb7b
journal: Skip data objects with invalid offsets
...
We already skip invalid objects, but don't yet skip invalid offsets.
Let's skip these as well to improve robustness when we're dealing with
corrupted journals.
Before:
```
➜ systemd git:(main) build/journalctl -r -n 5 --file ~/Downloads/system@0005d2b275abaaf8-f243a2818cb39b98.journal_
Failed to get journal fields: Cannot assign requested address
-- No entries --
```
After:
```
➜ systemd git:(main) ✗ build/journalctl -r -n 5 --file ~/Downloads/system@0005d2b275abaaf8-f243a2818cb39b98.journal_
Dec 09 08:32:38 snowball3 NetworkManager[911]: <info> [1639038758.1464] device (wlp1s0): supplicant interface state: scanning -> authenticating
Dec 09 08:32:38 snowball3 kernel: wlp1s0: send auth to ec:a9:40:79:fb:ad (try 1/3)
Dec 09 08:32:38 snowball3 kernel: wlp1s0: authenticate with ec:a9:40:79:fb:ad
Dec 09 08:32:38 snowball3 wpa_supplicant[1003]: wlp1s0: SME: Trying to authenticate with ec:a9:40:79:fb:ad (SSID='UPC949397B' freq=5500 MHz)
```
2022-01-12 22:16:40 +01:00
Daan De Meyer
f2eceb5268
journal: Remove unused arguments from journal_file_next_entry_for_data()
2022-01-12 17:31:57 +00:00
Benjamin Berg
6d0aef1dd1
xdg-autostart-service: Ignore missing desktop-sepcific condition binary
...
If a desktop specific ExecCondition= binary does not exist, this just
means that the desktop environment is not available. As such, it is not
an error condition that should prevent the service from being installed
in the .wants target.
Fix this by simply returning zero.
2022-01-12 16:11:09 +01:00
Zbigniew Jędrzejewski-Szmek
ffb8c82715
Merge pull request #22092 from keszybz/docs-links
...
Add more doc pages, adjust links, add explanatory headers to examples and relax license to CC-0
2022-01-12 16:06:39 +01:00
Zbigniew Jędrzejewski-Szmek
d6e2c1ab71
policy files: adjust landing page link
2022-01-12 16:05:59 +01:00
Zbigniew Jędrzejewski-Szmek
b85c1905e0
shutdown: adjust log message
...
Instead of saying "with options 'n/a'", let's just say "with options ''".
We really don't have any options.
2022-01-12 16:05:59 +01:00
Yu Watanabe
0a1f0bf405
Merge pull request #21728 from Werkov/bfq-io-weight
...
bfq.io.weight followups and cleanup
2022-01-12 22:22:43 +09:00
Yu Watanabe
174eab0066
Merge pull request #22037 from fbuihuu/watchdog-minor-improvements
...
Watchdog minor improvements
2022-01-12 22:09:50 +09:00
Lidong Zhong
edc6390e29
shutdown: release the watchdog finally
...
During reboot or kexec, watchdog will be setup before systemd is
replaced by systemd-shutdown binary. But while systemd-shutdown is
executed, the watchdog will not really be released. Log shown as
following:
[ 39.371202] watchdog: watchdog0: watchdog did not stop!
[ 39.383659] systemd-shutdown[1]: Syncing filesystems and block
devices.
[ 39.423727] systemd-shutdown[1]: Sending SIGTERM to remaining
processes...
[ 39.440857] systemd-journald[526]: Received SIGTERM from PID 1
(systemd-shutdow).
[ 39.461047] systemd-shutdown[1]: Sending SIGKILL to remaining
processes...
[ 39.466736] systemd-shutdown[1]: Using hardware watchdog 'iTCO_wdt',
version 0, device /dev/watchdog
[ 39.467835] systemd-shutdown[1]: Unmounting file systems.
[ 39.469721] [2171]: Remounting '/' read-only in with options
'attr2,inode64,logbufs=8,logbsize=32k,noquota'.
[ 39.550266] systemd-shutdown[1]: All filesystems unmounted.
[ 39.550274] systemd-shutdown[1]: Deactivating swaps.
[ 39.550443] systemd-shutdown[1]: All swaps deactivated.
[ 39.550449] systemd-shutdown[1]: Detaching loop devices.
[ 39.550697] systemd-shutdown[1]: All loop devices detached.
[ 39.550703] systemd-shutdown[1]: Detaching DM devices.
[ 39.551269] systemd-shutdown[1]: Not all DM devices detached, 1
left.
[ 39.551277] systemd-shutdown[1]: Cannot finalize remaining DM
devices, continuing.
[ 39.580044] systemd-shutdown[1]: Successfully changed into root
pivot.
[ 39.580050] systemd-shutdown[1]: Returning to initrd...
[ 39.587921] watchdog: watchdog0: watchdog did not stop!
[ 39.774130] dracut Warning: Break before pre-shutdown
after applying fix
[ 59.520379] watchdog: watchdog0: watchdog did not stop!
[ 59.542286] systemd-shutdown[1]: Syncing filesystems and block
devices.
[ 59.583313] systemd-shutdown[1]: Sending SIGTERM to remaining
processes...
[ 59.600133] systemd-journald[517]: Received SIGTERM from PID 1
(systemd-shutdow).
[ 59.624435] systemd-shutdown[1]: Sending SIGKILL to remaining
processes...
[ 59.629288] systemd-shutdown[1]: Using hardware watchdog
'iTCO_wdt', version 0, device /dev/watchdog
[ 59.630468] systemd-shutdown[1]: Unmounting file systems.
[ 59.632219] [2172]: Remounting '/' read-only in with options
'attr2,inode64,logbufs=8,logbsize=32k,noquota'.
[ 59.727588] systemd-shutdown[1]: All filesystems unmounted.
[ 59.727596] systemd-shutdown[1]: Deactivating swaps.
[ 59.727719] systemd-shutdown[1]: All swaps deactivated.
[ 59.727725] systemd-shutdown[1]: Detaching loop devices.
[ 59.727974] systemd-shutdown[1]: All loop devices detached.
[ 59.727979] systemd-shutdown[1]: Detaching DM devices.
[ 59.728547] systemd-shutdown[1]: Not all DM devices detached, 1
left.
[ 59.728556] systemd-shutdown[1]: Cannot finalize remaining DM
devices, continuing.
[ 59.758160] systemd-shutdown[1]: Successfully changed into root
pivot.
[ 59.758167] systemd-shutdown[1]: Returning to initrd...
[ 59.950305] dracut Warning: Break before pre-shutdown
2022-01-12 22:07:17 +09:00
Luca Boccassi
e80b51dad2
Merge pull request #22043 from medhefgo/boot-bitlocker
...
boot: Add BitLocker TPM key sealing workaround
2022-01-12 13:05:30 +00:00
Yu Watanabe
d5ff7bdbb7
Merge pull request #22088 from medhefgo/meson
...
meson: Small improvements
2022-01-12 22:01:27 +09:00
yangmingtai
647082cf7f
fix test-string-util failed when locale is not utf8
2022-01-12 05:06:05 +09:00
Yu Watanabe
d5f8fd5b00
network: dhcp6: do not request address if UseAddress=no
...
Fixes #22068 .
2022-01-11 17:05:12 +00:00
Luca Boccassi
1d18a466c4
Merge pull request #22086 from keszybz/nss-no-proc-cmdline
...
Avoid looking at /prcc/cmdline from nss modules
2022-01-11 15:29:24 +00:00
Jan Janssen
68a06b3cdf
meson: Add check argument to remaining run_command() calls
2022-01-11 14:56:30 +01:00
Jan Janssen
bbec46c817
meson: Use files() for fuzzers
...
Not having to provide the full path in the source tree is much
nicer and the produced lists can also be used anywhere in the source
tree.
2022-01-11 14:15:54 +01:00
Jan Janssen
e1eeebbb11
meson: Use files() for tests
...
Not having to provide the full path in the source tree is much
nicer and the produced lists can also be used anywhere in the source
tree.
2022-01-11 14:15:54 +01:00
Zbigniew Jędrzejewski-Szmek
a7d15a2465
nss: only read logging config from environment variables
...
log_parse_environment() uses should_parse_proc_cmdline() to determine whether
it should parse settings from the kernel command line. But the checks that
should_parse_proc_cmdline() apply to the whole process, and we could get a positive
answer also when log_parse_environment() was called from one of the nss modules.
In case of nss-modules, we don't want to look at the kernel command line.
log_parse_environment_variables() that only looks at the environment variables
is split out and used in the nss modules.
Fixes #22020 .
2022-01-11 13:39:52 +01:00
Zbigniew Jędrzejewski-Szmek
56a5f4969b
nss: drop dummy setup_logging() helpers
...
log_parse_environment() stopped being a macro in 9fdee66f2d .
As reported by @bauen1 in https://github.com/systemd/systemd/issues/22020 ,
the comment was out of date.
2022-01-11 13:39:52 +01:00
Zbigniew Jędrzejewski-Szmek
49927ad813
bootctl: do not update sd-boot if it wasn't installed in the first place
...
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2038289 .
2022-01-11 10:57:36 +01:00
Zbigniew Jędrzejewski-Szmek
d9f048b5d1
bootctl: split out the check whether sd-boot is installed
2022-01-11 10:56:29 +01:00
Jan Janssen
ed3abbfbde
boot: Fix readdir_harder() on VirtualBox
...
Fixes : #22073
2022-01-10 21:40:52 +01:00
Zbigniew Jędrzejewski-Szmek
e07a80476b
Merge pull request #22050 from wat-ze-hex/bpf-lsm-check-for-link-error-2022-01-07
...
bpf: check if lsm link ptr is libbpf error
2022-01-10 21:38:56 +01:00
Jan Janssen
9818ec8ea5
boot: Change boot entry sorting
...
There are a few undesirable properties to how boot entries are
currently sorted.
First, it sorts by entry file name only, which may not correspond
to the title that is shown (for exmaple because it is prefixed by
machine-id). The file ending will also create unexpected ordering
("arch-lts.conf" would come before "arch.conf").
While the list is sorted alphabetically ascending, it is also
lower version/priority first, which is unintuitive. In particular,
a boot-counted entry that is bad (0 tries left) will be at the very
top.
Additionally, the Windows and Mac loaders should be sorted with
the rest of the loaders.
2022-01-10 21:34:12 +01:00
Michal Koutný
bec17e801a
core/cgroup: Factor out BFQ weight setting
...
No functional change.
2022-01-10 18:23:20 +01:00
Michal Koutný
d2bd0bfa36
cgroup-util: Move macros to macros and tests to tests
...
Friends to friends to be consistent with the other macros and make tests
separate from main code.
2022-01-10 18:22:41 +01:00
Michal Koutný
d43ffcac84
core/cgroup: Provide information about applied BFQ scaling
...
The BFQ weights are not passed verbatim to the kernel, provide that
information in a form of debug message so that users are not
surprised/confused when IOWeight != io.bfq.weight.
2022-01-10 18:22:27 +01:00
Luca Boccassi
3f3d4b4167
Merge pull request #22071 from keszybz/xdg-autostart-logs
...
Improve logs in systemd-xdg-autostart-generator
2022-01-10 16:55:14 +00:00