]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoman/nspawn: os-release is only checked for booted containers 23565/head
Benjamin Franzke [Mon, 30 May 2022 18:21:48 +0000 (20:21 +0200)] 
man/nspawn: os-release is only checked for booted containers

/etc/os-release existence is only enforced in --boot mode,
therefore the term "starting" (which also applies to chroot-like mode)
is substituted with "booting" in this context.

3 years agoman/nspawn: add a sentence-connecting adverb to machinectl note
Benjamin Franzke [Sat, 28 May 2022 12:55:22 +0000 (14:55 +0200)] 
man/nspawn: add a sentence-connecting adverb to machinectl note

The recommendation to use machinectl login/shell instead of
trying to combine two distinct container instances seemed a
litte bit out of context and is now combined via "rather".

3 years agoman/nspawn: fix boot-option related wording
Benjamin Franzke [Sat, 28 May 2022 12:42:17 +0000 (14:42 +0200)] 
man/nspawn: fix boot-option related wording

3 years agoMerge pull request #23562 from yuwata/fix-typo
Yu Watanabe [Mon, 30 May 2022 16:52:39 +0000 (01:52 +0900)] 
Merge pull request #23562 from yuwata/fix-typo

Fix typo

3 years agoesp: fix typo 23562/head
Yu Watanabe [Mon, 30 May 2022 16:16:41 +0000 (01:16 +0900)] 
esp: fix typo

Follow-up for 13d7c841a24f784995a000230706f259c4baec96.

3 years agodoc: fix typo
Yu Watanabe [Mon, 30 May 2022 16:16:01 +0000 (01:16 +0900)] 
doc: fix typo

Follow-ups for #23504.

3 years agoMerge pull request #23354 from DaanDeMeyer/mount-implicit-device-dep-trace
Yu Watanabe [Mon, 30 May 2022 16:00:56 +0000 (01:00 +0900)] 
Merge pull request #23354 from DaanDeMeyer/mount-implicit-device-dep-trace

core: Add trace logging to mount_add_device_dependencies()

3 years agoMerge pull request #23529 from nabijaczleweli/dollar-asterisk
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 08:27:14 +0000 (10:27 +0200)] 
Merge pull request #23529 from nabijaczleweli/dollar-asterisk

Don't linebreak after each initrd in kernel-install verbose mode

3 years agomeson: Build header tests with -pedantic
Jan Janssen [Fri, 27 May 2022 19:15:22 +0000 (21:15 +0200)] 
meson: Build header tests with -pedantic

By using __extension__, we can silence pedantic errors we cannot or
do not want to fix.

This in particular silences:
 - enum values being outside of int range
 - variadic macros
 - long long being C99
 - type of bit-field ‘type’ is a GCC extension
 - use of C99 bool in public header functions

3 years agoMerge pull request #23542 from medhefgo/attributes
Yu Watanabe [Sun, 29 May 2022 19:07:41 +0000 (04:07 +0900)] 
Merge pull request #23542 from medhefgo/attributes

meson: Document why -Wimplicit-fallthrough is not used with clang

3 years agotests: link tests using fabs against libm explicitly
Evgeny Vereshchagin [Thu, 26 May 2022 16:16:22 +0000 (16:16 +0000)] 
tests: link tests using fabs against libm explicitly

Some compiler wrappers like honggfuzz pass -fno-builtin explicitly
and because of that the tests where fabs is used fail to compile
with something like
```
FAILED: test-bus-marshal
...
/usr/bin/ld: test-bus-marshal.p/src_libsystemd_sd-bus_test-bus-marshal.c.o: undefined reference to symbol 'fabs@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib64/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
```

Fun fact: it took honggfuzz less than a minute to discover
https://github.com/advisories/GHSA-gmc7-pqv9-966m used by
systemd to compress/descompress some stuff.

3 years agoclang-format: Adjust style of pointers
Jan Janssen [Sat, 28 May 2022 12:25:15 +0000 (14:25 +0200)] 
clang-format: Adjust style of pointers

We gernerally have our pointers aligned to the right. SpaceAroundPointerQualifiers
makes sure "const char * const" is formatted nicely.

3 years agoMerge pull request #23550 from evverx/fuzz-i386
Frantisek Sumsal [Sun, 29 May 2022 18:35:03 +0000 (18:35 +0000)] 
Merge pull request #23550 from evverx/fuzz-i386

oss-fuzz: support i386

3 years agoMerge pull request #23548 from tpgxyz/lua2
Zbigniew Jędrzejewski-Szmek [Sun, 29 May 2022 18:08:05 +0000 (20:08 +0200)] 
Merge pull request #23548 from tpgxyz/lua2

rpm: adjust lua trigger for udevadm

3 years agooss-fuzz: support i386 23550/head
Evgeny Vereshchagin [Sun, 29 May 2022 06:52:54 +0000 (06:52 +0000)] 
oss-fuzz: support i386

Closes https://github.com/systemd/systemd/issues/23532

3 years agodocs: mention how to build 32 bit fuzz targets
Evgeny Vereshchagin [Sun, 29 May 2022 07:36:33 +0000 (07:36 +0000)] 
docs: mention how to build 32 bit fuzz targets

3 years agomeson: exclude pcre2 when dependencies are skipped
Evgeny Vereshchagin [Sun, 29 May 2022 06:44:45 +0000 (06:44 +0000)] 
meson: exclude pcre2 when dependencies are skipped

3 years agorpm: adjust lua trigger for udevadm 23548/head
Tomasz Paweł Gajc [Sat, 28 May 2022 19:38:33 +0000 (21:38 +0200)] 
rpm: adjust lua trigger for udevadm

3 years agorpm: use rpm.execute() instead of fork() and execp() for trigger scriplets 23539/head
Tomasz Paweł Gajc [Fri, 27 May 2022 14:15:01 +0000 (16:15 +0200)] 
rpm: use rpm.execute() instead of fork() and execp() for trigger scriplets

3 years agoMove homectl and userdbctl to bindir
Michael Biebl [Sat, 28 May 2022 10:00:08 +0000 (12:00 +0200)] 
Move homectl and userdbctl to bindir

Those binaries aren't needed during early boot.

3 years agomeson: Document why -Wimplicit-fallthrough is not used with clang 23542/head
Jan Janssen [Sat, 28 May 2022 09:41:10 +0000 (11:41 +0200)] 
meson: Document why -Wimplicit-fallthrough is not used with clang

This changes the macro to ensure proper fallthrough attributes are
used with clang in case this option is added in the future.

3 years agoman: Fix minor typo
Javkhlanbayar Khongorzul [Sat, 28 May 2022 09:10:58 +0000 (11:10 +0200)] 
man: Fix minor typo

3 years agomacro: Move attribute defintions to macro-fundamental
Jan Janssen [Sat, 28 May 2022 09:25:33 +0000 (11:25 +0200)] 
macro: Move attribute defintions to macro-fundamental

This also sorts them.

3 years agosd-bus: fix buffer overflow
Yu Watanabe [Thu, 26 May 2022 19:23:10 +0000 (04:23 +0900)] 
sd-bus: fix buffer overflow

Fixes #23486.

3 years agoMerge pull request #23518 from enr0n/sd-hwdb-from-path
Luca Boccassi [Fri, 27 May 2022 21:51:36 +0000 (22:51 +0100)] 
Merge pull request #23518 from enr0n/sd-hwdb-from-path

Implement --root option for systemd-hwdb query

3 years agoUse descriptive name for nobody
Zbigniew Jędrzejewski-Szmek [Fri, 27 May 2022 12:09:24 +0000 (14:09 +0200)] 
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

3 years agohwdb: implement --root option for systemd-hwdb query 23518/head
Nick Rosbrook [Tue, 24 May 2022 17:15:13 +0000 (13:15 -0400)] 
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.

3 years agosd-hwdb: add sd_hwdb_new_from_path
Nick Rosbrook [Tue, 24 May 2022 17:08:06 +0000 (13:08 -0400)] 
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.

3 years agosd-hwdb: include sys/stat.h in hwdb-internal.h
Nick Rosbrook [Thu, 26 May 2022 18:32:20 +0000 (14:32 -0400)] 
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;

3 years agoMerge pull request #23504 from keszybz/bls-reordering
Luca Boccassi [Fri, 27 May 2022 13:36:10 +0000 (14:36 +0100)] 
Merge pull request #23504 from keszybz/bls-reordering

Refactor the BLS and add a description of version sorts

3 years agoMerge pull request #23536 from mrc0mmand/TEST-69-tweaks
Luca Boccassi [Fri, 27 May 2022 13:34:52 +0000 (14:34 +0100)] 
Merge pull request #23536 from mrc0mmand/TEST-69-tweaks

A couple of tweaks for TEST-69-SHUTDOWN

3 years agoMerge pull request #23527 from keszybz/esp-detect-xbootldr
Luca Boccassi [Fri, 27 May 2022 10:46:46 +0000 (11:46 +0100)] 
Merge pull request #23527 from keszybz/esp-detect-xbootldr

Fix xbootldr detection, fail early in kernel-install

3 years agoMerge pull request #23521 from keszybz/some-docs
Luca Boccassi [Fri, 27 May 2022 10:42:01 +0000 (11:42 +0100)] 
Merge pull request #23521 from keszybz/some-docs

Some docs

3 years agohwdb: Add Google Meet speakermic
Pablo Ceballos [Thu, 26 May 2022 22:23:35 +0000 (22:23 +0000)] 
hwdb: Add Google Meet speakermic

It has the same issue as the Google Hangouts Meet speakermic but a
different VID/PID.

3 years agotest: fix a couple of pylint warnings 23536/head
Frantisek Sumsal [Fri, 27 May 2022 09:45:15 +0000 (11:45 +0200)] 
test: fix a couple of pylint warnings

3 years agotest: bump the post-reboot expect() timeout
Frantisek Sumsal [Fri, 27 May 2022 09:41:55 +0000 (11:41 +0200)] 
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
```

3 years agoMerge pull request #23517 from mrc0mmand/cryptsetup-switchroot-transition
Yu Watanabe [Thu, 26 May 2022 22:36:17 +0000 (07:36 +0900)] 
Merge pull request #23517 from mrc0mmand/cryptsetup-switchroot-transition

test: cover initrd->sysroot transition in TEST-24

3 years agoloader.conf: Clarify the default value of timeout.
Eduard Tolosa [Thu, 26 May 2022 20:53:24 +0000 (15:53 -0500)] 
loader.conf: Clarify the default value of timeout.

3 years agokernel-install: don't log each initrd on its own line in verbose mode 23529/head
наб [Thu, 26 May 2022 21:18:07 +0000 (23:18 +0200)] 
kernel-install: don't log each initrd on its own line in verbose mode

3 years agokernel-install: actually ignore the last two arguments
наб [Thu, 26 May 2022 21:16:13 +0000 (23:16 +0200)] 
kernel-install: actually ignore the last two arguments

3 years agoshared/find-esp: enhance logging 23527/head
Zbigniew Jędrzejewski-Szmek [Thu, 26 May 2022 19:36:59 +0000 (21:36 +0200)] 
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.

3 years agoshared/find-esp: fix inverted check for XBOOTLDR type
Zbigniew Jędrzejewski-Szmek [Thu, 26 May 2022 19:36:33 +0000 (21:36 +0200)] 
shared/find-esp: fix inverted check for XBOOTLDR type

3 years agokernel-install: if a plugin fails, return error immediately
Zbigniew Jędrzejewski-Szmek [Thu, 26 May 2022 18:56:12 +0000 (20:56 +0200)] 
kernel-install: if a plugin fails, return error immediately

Since the first version in 81516adcb71a47837544340f72eb8ee810274119,
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.

3 years agodocs/BLS: clear up the confusion about what $BOOT means 23504/head
Zbigniew Jędrzejewski-Szmek [Wed, 25 May 2022 11:41:29 +0000 (13:41 +0200)] 
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.

3 years agoMerge pull request #23523 from evverx/oss-fuzz-links
Zbigniew Jędrzejewski-Szmek [Thu, 26 May 2022 16:10:56 +0000 (18:10 +0200)] 
Merge pull request #23523 from evverx/oss-fuzz-links

docs: add a link to the OSS-Fuzz coverage report

3 years agodocs: be more specific about the OSS-Fuzz toolchain 23523/head
Evgeny Vereshchagin [Thu, 26 May 2022 15:22:50 +0000 (15:22 +0000)] 
docs: be more specific about the OSS-Fuzz toolchain

3 years agocore/device: do not downgrade device state if it is already enumerated 23517/head
Yu Watanabe [Fri, 20 May 2022 08:25:12 +0000 (10:25 +0200)] 
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]

3 years agodocs: update OSS-Fuzz links
Evgeny Vereshchagin [Thu, 26 May 2022 14:07:32 +0000 (14:07 +0000)] 
docs: update OSS-Fuzz links

3 years agocore/device: device_coldplug(): don't set DEVICE_DEAD
Martin Wilck [Wed, 25 May 2022 10:01:00 +0000 (12:01 +0200)] 
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.

3 years agotest: store the key on a separate device
Frantisek Sumsal [Thu, 26 May 2022 12:52:52 +0000 (14:52 +0200)] 
test: store the key on a separate device

3 years agotest: generate a custom initrd for TEST-24 if $INITRD is unset
Frantisek Sumsal [Thu, 26 May 2022 11:19:11 +0000 (13:19 +0200)] 
test: generate a custom initrd for TEST-24 if $INITRD is unset

Co-Authored-By: Yu Watanabe <watanabe.yu+github@gmail.com>
3 years agoman/homectl: adjust man page to match code 23521/head
Zbigniew Jędrzejewski-Szmek [Thu, 26 May 2022 12:23:27 +0000 (14:23 +0200)] 
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.

3 years agoman/sd-bus: discuss negative-return values and add example
Zbigniew Jędrzejewski-Szmek [Thu, 26 May 2022 12:04:52 +0000 (14:04 +0200)] 
man/sd-bus: discuss negative-return values and add example

Fixes #22816.

3 years agoman/shutdown: explain -h more
Zbigniew Jędrzejewski-Szmek [Thu, 26 May 2022 11:14:08 +0000 (13:14 +0200)] 
man/shutdown: explain -h more

Fixes #23401

3 years agoman/automount: say that automounts should not be nested
Zbigniew Jędrzejewski-Szmek [Thu, 26 May 2022 12:28:43 +0000 (14:28 +0200)] 
man/automount: say that automounts should not be nested

Fixes #21832.

3 years agoman/systemd.automount: move the main description up and clarify deps
Zbigniew Jędrzejewski-Szmek [Fri, 20 May 2022 15:35:17 +0000 (17:35 +0200)] 
man/systemd.automount: move the main description up and clarify deps

3 years agoTODO: drop entry
Zbigniew Jędrzejewski-Szmek [Wed, 25 May 2022 14:36:50 +0000 (16:36 +0200)] 
TODO: drop entry

Implemented in 14e6e444dd9eaa0db229548c31baecd75de4478e.

3 years agoman: do not say "additional symlinks" for mount/automount aliases
Zbigniew Jędrzejewski-Szmek [Fri, 20 May 2022 15:31:53 +0000 (17:31 +0200)] 
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".

3 years agosystemctl: make show/status honour --state and --type
Zbigniew Jędrzejewski-Szmek [Sun, 22 May 2022 12:32:55 +0000 (14:32 +0200)] 
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.

3 years agoMerge pull request #23513 from keszybz/bootctl-version-print
Yu Watanabe [Thu, 26 May 2022 01:30:16 +0000 (10:30 +0900)] 
Merge pull request #23513 from keszybz/bootctl-version-print

bootctl: print version comparison when updating

3 years agotest: cover initrd->sysroot transition in TEST-24
Frantisek Sumsal [Wed, 25 May 2022 15:39:14 +0000 (17:39 +0200)] 
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

3 years agobootctl: when comparing versions, show the result 23513/head
Zbigniew Jędrzejewski-Szmek [Wed, 25 May 2022 14:00:44 +0000 (16:00 +0200)] 
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.

3 years agobasic: add helper function to print </==/>
Zbigniew Jędrzejewski-Szmek [Wed, 25 May 2022 13:58:02 +0000 (15:58 +0200)] 
basic: add helper function to print </==/>

3 years agoanalyze: use '' instead of the empty string when showing versions
Zbigniew Jędrzejewski-Szmek [Wed, 25 May 2022 08:18:14 +0000 (10:18 +0200)] 
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.

3 years ago[sd-boot] improve documentation of beep
Rahil Bhimjiani [Wed, 25 May 2022 10:54:30 +0000 (16:24 +0530)] 
[sd-boot] improve documentation of beep

3 years agodocs/BLS: describe version comparisons
Zbigniew Jędrzejewski-Szmek [Tue, 24 May 2022 14:25:58 +0000 (16:25 +0200)] 
docs/BLS: describe version comparisons

Fixes #23346.

3 years agobasic/string-util: tweak strverscmp_improved() for some corner cases
Zbigniew Jędrzejewski-Szmek [Tue, 24 May 2022 19:20:36 +0000 (21:20 +0200)] 
basic/string-util: tweak strverscmp_improved() for some corner cases

So far we had the rule that '' == '', '0_' == '0', but '_' > ''. This means
that the general rule that strings are compared iteratively, and each
segment that compares equal can be dropped and the comparison resumes at
the following characters wasn't true in such cases. Similarly, '0~' < '0',
but after dropping the common segment, '~' > ''.

The special handling of empty strings is dropped, and '_' == '' and
'~' < ''.

3 years agotest-seccomp: check for CAP_IPC_OWNER before calling shmat()
Anita Zhang [Tue, 24 May 2022 17:51:27 +0000 (10:51 -0700)] 
test-seccomp: check for CAP_IPC_OWNER before calling shmat()

shmat() requires the CAP_IPC_OWNER capability. When running test-seccomp
in environments with root + CAP_SYS_ADMIN, but not CAP_IPC_OWNER,
memory_deny_write_execute_shmat would fail. This fixes it.

3 years agokernel-install: ignore extra args passed when invoked as installkernel
Zbigniew Jędrzejewski-Szmek [Tue, 24 May 2022 20:19:05 +0000 (22:19 +0200)] 
kernel-install: ignore extra args passed when invoked as installkernel

kernel's 'make install' invokes install.sh which calls /sbin/install-kernel.
Thus we are invoked as e.g.
  /sbin/installkernel 5.18.0 arch/x86/boot/bzImage System.map /boot
The last two arguments would be passed as "initrds".

Before , we would just quitely ignore
/boot, because it doesn't pass the 'test -f' test, and possibly try to do
something with System.map. 742561efbe938c45936f2e4f5d81b3ff6b352882 tightened
the check, so we now throw an error.

It seems that the correct thing is to ignore those two arguments, because
our plugin syntax has no notion of System.map. And the installation directory
we can figure out ourselves better. Effectively, this makes things behave
like before, but less by accident.

Fixes #23490.

3 years agoci: reenable validation of GH Actions files
Frantisek Sumsal [Tue, 24 May 2022 19:01:45 +0000 (21:01 +0200)] 
ci: reenable validation of GH Actions files

3 years agodocs/BLS: rework the description of directory layout
Zbigniew Jędrzejewski-Szmek [Mon, 23 May 2022 18:49:54 +0000 (20:49 +0200)] 
docs/BLS: rework the description of directory layout

We said "`$BOOT/loader/` is the directory containing all files needed
for Type #1 entries" which is blatantly wrong. And also saying that we
define two directories, /loader and /loader/entries, but only ever defining
the second one was not very consistent.

Instead, let's say that /loader/ is for "boot loader configuration", and
/loader/entries has the snippets. A new section about /<entry-token>/<version>/
is added. This is described as the "recommended layout for additional files".

Also, we said that ID= should be used in the file name, but in fact it
wasn't in the example that was given, and afaik, nobody ever did that. So
this part is reduced to say "kernel version (as returned by `uname -r`,
including the OS identifier)". AFAIK, all distros include some form of
OS identifier in the version, so this should be good enough.

Since we now don't depend on autodetection (e.g. with entry-token and layout
configured), the installed doesn't need to always create /loader/entries and
things will still work. So don't say that the installer needs to create it.

Part of the discussion is moved to the Discussion section.

Overall, this brings the specification more in line with actual practice.

3 years agodocs: /etc/os-release → os-release(3)
Zbigniew Jędrzejewski-Szmek [Mon, 23 May 2022 12:27:44 +0000 (14:27 +0200)] 
docs: /etc/os-release → os-release(3)

It's /usr/lib/os-release now mostly. But let's link to the man page.

3 years agodocs: reworder/rewrite BLS to read more like a specification
Zbigniew Jędrzejewski-Szmek [Mon, 23 May 2022 12:22:40 +0000 (14:22 +0200)] 
docs: reworder/rewrite BLS to read more like a specification

I tried not to introduce any semantic changes, but to reorder the whole
text to be more usable as a reference specification: more sections are
created and the discussion and justifications are moved to the end.
Also, "BIOS" is changed to "firmware" in various places, and other parts
of the text that made sense when this was originally written are now dated
are adjusted. I separated and extended the examples a bit.

The abstract at the top ("TL;DR: Currently there’s no common boot scheme…")
is dropped. It didn't seem to fit anywhere.

3 years agoMinor wording fixes
Zbigniew Jędrzejewski-Szmek [Tue, 24 May 2022 08:20:23 +0000 (10:20 +0200)] 
Minor wording fixes

Some NEWS entries are tweaked a bit to address complaints about readability
from users.

"udev" is pronounced as /ˈjuːdɛv/, like in "user", hence "a" not "an".

3 years agoboot: Fix bad CompareMem call
Jan Janssen [Tue, 24 May 2022 12:15:59 +0000 (14:15 +0200)] 
boot: Fix bad CompareMem call

3 years agoportable: Fix memory leak in maybe_enable_disable()
Daan De Meyer [Mon, 23 May 2022 13:32:42 +0000 (15:32 +0200)] 
portable: Fix memory leak in maybe_enable_disable()

Fixes #23481

3 years agoMerge pull request #23475 from nabijaczleweli/certified-lint.1-moment
Frantisek Sumsal [Mon, 23 May 2022 19:16:22 +0000 (19:16 +0000)] 
Merge pull request #23475 from nabijaczleweli/certified-lint.1-moment

Actually run shellcheck on CI

3 years agodissect-image: Explicitly remove partitions when done with image
Daan De Meyer [Wed, 18 May 2022 11:35:21 +0000 (13:35 +0200)] 
dissect-image: Explicitly remove partitions when done with image

When closing a loop device, the kernel will asynchronously remove
the probed partitions. This can lead to race conditions where we
try to reuse a partition device that still needs to be removed by
the kernel. To avoid such issues, let's explicitly try to remove
any partitions using BLKPG_DEL_PARTITION when we're done with an
image.

To make sure we don't try to remove partitions when we want them
to remain (e.g. systemd-dissect --mount), we add
dissected_image_relinquish() in a similar vein to loop_device_relinquish()
and decrypted_image_relinquish().

3 years agoci: bump gcc in the "build test" workflow
Evgeny Vereshchagin [Sat, 7 May 2022 12:40:56 +0000 (12:40 +0000)] 
ci: bump gcc in the "build test" workflow

gcc-12 has been released

3 years agoshellcheck-clean kernel-install again 23475/head
наб [Sun, 22 May 2022 20:09:23 +0000 (22:09 +0200)] 
shellcheck-clean kernel-install again

3 years agoFix which(1) in meson-build.sh
наб [Sun, 22 May 2022 15:13:44 +0000 (17:13 +0200)] 
Fix which(1) in meson-build.sh

3 years agoDon't ignore kernel-install for shellcheck
наб [Sun, 22 May 2022 14:20:56 +0000 (16:20 +0200)] 
Don't ignore kernel-install for shellcheck

3 years agoMerge pull request #23344 from medhefgo/boot-config-add
Zbigniew Jędrzejewski-Szmek [Mon, 23 May 2022 07:26:19 +0000 (09:26 +0200)] 
Merge pull request #23344 from medhefgo/boot-config-add

boot: Small config entry add changes

3 years agoMerge pull request #23414 from keszybz/analyze-vercmp
Zbigniew Jędrzejewski-Szmek [Mon, 23 May 2022 07:14:51 +0000 (09:14 +0200)] 
Merge pull request #23414 from keszybz/analyze-vercmp

systemd-analyze compare-versions

3 years agotest: Test STRLEN for C11 string literals
Jan Janssen [Sun, 22 May 2022 07:37:27 +0000 (09:37 +0200)] 
test: Test STRLEN for C11 string literals

3 years agoNEWS: Fix some minor mistakes
Phaedrus Leeds [Sun, 22 May 2022 16:08:37 +0000 (12:08 -0400)] 
NEWS: Fix some minor mistakes

3 years agocoredump: Fix format string type mismatch
Daan De Meyer [Sun, 22 May 2022 12:36:07 +0000 (14:36 +0200)] 
coredump: Fix format string type mismatch

Fixes #23471

3 years agoboot: Rename functions adding entries to match userspace 23344/head
Jan Janssen [Wed, 11 May 2022 11:00:00 +0000 (13:00 +0200)] 
boot: Rename functions adding entries to match userspace

3 years agoboot: Remove trivial config entry add helpers
Jan Janssen [Wed, 11 May 2022 10:52:24 +0000 (12:52 +0200)] 
boot: Remove trivial config entry add helpers

These two functions have very limited use and are just fancy wrappers
around structured initializers.

3 years agoDo not require a valid version when parsing sd-boot loader entries
Victor Westerhuis [Sun, 14 Nov 2021 15:26:03 +0000 (16:26 +0100)] 
Do not require a valid version when parsing sd-boot loader entries

This fixes #20820

3 years agoMerge pull request #23465 from mrc0mmand/bump-actions-to-ubuntu-2204
Luca Boccassi [Sun, 22 May 2022 01:29:59 +0000 (02:29 +0100)] 
Merge pull request #23465 from mrc0mmand/bump-actions-to-ubuntu-2204

ci: bump GH Actions to Ubuntu Jammy where applicable

3 years agodocs: improve table readability
Benjamin Franzke [Sat, 21 May 2022 14:28:32 +0000 (16:28 +0200)] 
docs: improve table readability

Let the table span more than the default content width,
if the table contains alot of data (controlled by width: auto)
(720px is very good for continuous text, but too narrow for tables).

The container class is therefore adapted to put the
width restriction on the elements itself, allowing for
exceptions for individual elements like <table> and
<h1> (which used an offset margin before and is now
streamlined to use a max-width as well).

Also add a striped background to ease reading rows
and allow for horizontal mobile scrolling without
overflowing the entire document, only the table itself.

3 years agoMerge pull request #22550 from medhefgo/boot-mixed
Luca Boccassi [Sat, 21 May 2022 21:38:56 +0000 (22:38 +0100)] 
Merge pull request #22550 from medhefgo/boot-mixed

boot: EFI mixed mode support

3 years agoci: temporarily disable validation of GH Action files 23465/head
Frantisek Sumsal [Sat, 21 May 2022 15:34:34 +0000 (17:34 +0200)] 
ci: temporarily disable validation of GH Action files

since the current version of super-linter doesn't recognize
ubuntu-22.04 as a valid runner specification. This should
be fixed once https://github.com/github/super-linter/pull/2897
is merged, which includes
https://github.com/rhysd/actionlint/commit/09a60b0f5761c2d066def294e541c25a89756eea

3 years agocryptsetup: fix build with -Db_ndebug=true
Frantisek Sumsal [Sat, 21 May 2022 15:30:51 +0000 (17:30 +0200)] 
cryptsetup: fix build with -Db_ndebug=true

```
 ...
 ../src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-fido2.c:33:13: error: variable 'r' set but not used [-Werror,-Wunused-but-set-variable]
         int r;
             ^
 1 error generated.
 ...
 ../src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-pkcs11.c:34:13: error: variable 'r' set but not used [-Werror,-Wunused-but-set-variable]
         int r;
             ^
 1 error generated.
 ninja: build stopped: subcommand failed.
 + fatal ''\''meson compile'\'' failed with -Db_ndebug=true'
```

3 years agoci: prefer the distro llvm version if available
Frantisek Sumsal [Sat, 21 May 2022 14:35:55 +0000 (16:35 +0200)] 
ci: prefer the distro llvm version if available

3 years agoci: bump GH Actions to Ubuntu Jammy where applicable
Frantisek Sumsal [Sat, 21 May 2022 14:03:14 +0000 (16:03 +0200)] 
ci: bump GH Actions to Ubuntu Jammy where applicable

3 years agoresolved: default to OpenSSL
Luca Boccassi [Tue, 17 May 2022 19:09:49 +0000 (20:09 +0100)] 
resolved: default to OpenSSL

If both gnutls and openssl are available, prefer openssl.
We are gradually moving toward supporting openssl only as the
crypto library, and the resolved gnutls backend will be dropped
at some point, so start nudging users toward the openssl one.

3 years agoMerge pull request #23460 from keszybz/docs-redirect
Zbigniew Jędrzejewski-Szmek [Sat, 21 May 2022 16:11:18 +0000 (18:11 +0200)] 
Merge pull request #23460 from keszybz/docs-redirect

docs: rename COREDUMP_PACKAGE_METADATA → ELF_PACKAGE_METADATA

3 years agodocs: adapt forward layout to systemd.io design 23460/head
Benjamin Franzke [Sat, 21 May 2022 11:08:19 +0000 (13:08 +0200)] 
docs: adapt forward layout to systemd.io design