James Hilliard [Mon, 1 Aug 2022 01:11:47 +0000 (01:11 +0000)]
bpf: fix is_allow_list section
The llvm bpf compiler appears to place const volatile variables in
a non-standard section which creates an incompatibility with the gcc
bpf compiler.
To fix this force GCC to also use the rodata section.
Note this does emit an assembler warning:
Generating src/core/bpf/restrict_ifaces/restrict-ifaces.bpf.unstripped.o with a custom command
/tmp/ccM2b7jP.s: Assembler messages:
/tmp/ccM2b7jP.s:87: Warning: setting incorrect section attributes for .rodata
See:
https://github.com/llvm/llvm-project/issues/56468
Fixes:
../src/core/restrict-ifaces.c:45:14: error: ‘struct
restrict_ifaces_bpf’ has no member named ‘rodata’; did you mean
‘data’?
45 | obj->rodata->is_allow_list = is_allow_list;
| ^~~~~~
| data
Loïc Collignon [Wed, 3 Aug 2022 09:42:28 +0000 (11:42 +0200)]
Fix 24172: __STDC_VERSION__ may be defined in C++
According to the C++ ISO standard, a conformant compiler is allowed to
define this macro to any value for any reason as it is implementation
defined: https://timsong-cpp.github.io/cppwp/cpp.predefined#2.3
This mean that it cannot be assumed that it is not defined in a C++.
Change the condition to reflect that.
Gio [Wed, 3 Aug 2022 08:26:03 +0000 (04:26 -0400)]
Added DERE DBook D10 (#24173)
* Added DERE DBook D10
Vincent Dagonneau [Mon, 9 May 2022 18:13:28 +0000 (14:13 -0400)]
This patch adds support for enrolling secure boot boot keys from sd-boot.
***DANGER*** NOTE ***DANGER***
This feature might result in your device becoming soft-brick as outlined
below, please use this feature carefully.
***DANGER*** NOTE ***DANGER***
If secure-boot-enrollment is set to no, then no action whatsoever is performed,
no matter the files on the ESP.
If secure boot keys are found under $ESP/loader/keys and secure-boot-enrollment
is set to either manual or force then sd-boot will generate enrollment entries
named after the directories they are in. The entries are shown at the very bottom
of the list and can be selected by the user from the menu. If the user selects it,
the user is shown a screen allowing for cancellation before a timeout. The enrollment
proceeds if the action is not cancelled after the timeout.
Additionally, if the secure-boot-enroll option is set to 'force' then the keys
located in the directory named 'auto' are going to be enrolled automatically. The user
is still going to be shown a screen allowing them to cancel the action if they want to,
however the enrollment will proceed automatically after a timeout without
user cancellation.
After keys are enrolled, the system reboots with secure boot enabled therefore, it is
***critical*** to ensure that everything needed for the system to boot is signed
properly (sd-boot itself, kernel, initramfs, PCI option ROMs).
This feature currently only allows loading the most simple set of variables: PK, KEK
and db.
The files need to be prepared with cert-to-efi-sig-list and then signed with
sign-efi-sig-list.
Here is a short example to generate your own keys and the right files for
auto-enrollement.
`
keys="PK KEK DB"
uuid="{$(systemd-id128 new -u)}"
for key in ${keys}; do
openssl req -new -x509 -subj "/CN=${key}/ -keyout "${key}.key" -out "${key}.crt"
openssl x509 -outform DER -in "${key}.crt" -out "${key}.cer"
cert-to-efi-sig-list -g "${uuid}" "${key}.crt" "${key}.esl.nosign"
done
sign-efi-sig-list -c PK.crt -k PK.key PK PK.esl.nosign PK.esl
sign-efi-sig-list -c PK.crt -k PK.key KEK KEK.esl.nosign KEK.esl
sign-efi-sig-list -c KEK.crt -k KEK.key db db.esl.nosign db.esl
`
Once these keys are enrolled, all the files needed for boot ***NEED*** to be signed in
order to run. You can sign the binaries with the sbsign tool, for example:
`
sbsign --key db.key --cert db.crt bzImage --output $ESP/bzImage
`
Example:
Assuming the system has been put in Setup Mode:
`
$ESP/loader/keys/auto/db.esl
$ESP/loader/keys/auto/KEK.esl
$ESP/loader/keys/auto/PK.esl
$ESP/loader/keys/Linux Only/db.esl
$ESP/loader/keys/Linux Only/KEK.esl
$ESP/loader/keys/Linux Only/PK.esl
$ESP/loader/keys/Linux and Windows/db.esl
$ESP/loader/keys/Linux and Windows/KEK.esl
$ESP/loader/keys/Linux and Windows/PK.esl
`
If auto-enroll is set, then the db, KEK and then PK are enrolled from the 'auto'
directory.
If not, three new boot entries are available to the user in order to enroll either the
'Linux Only', 'Linux And Windows' or 'auto' set of keys.
Einsler Lee [Tue, 2 Mar 2021 12:24:23 +0000 (20:24 +0800)]
"auto" is the default LogTarget of user service manager
"auto" (not console) is the default LogTarget of user service manager.
Einsler Lee [Tue, 2 Mar 2021 12:21:21 +0000 (20:21 +0800)]
main: reopen /dev/console for user service manager
Now the console_fd of user service manager is 2. Even if LogTarget=console is set in /etc/systemd/user.conf,there is no log in the console.
This reopen the /dev/console, so the log of user service can be output in the console.
Frantisek Sumsal [Wed, 3 Aug 2022 07:22:19 +0000 (07:22 +0000)]
Merge pull request #24178 from mrc0mmand/libgcc_s
test: install libgcc_s.so.1 explicitly if available
Lennart Poettering [Tue, 2 Aug 2022 15:27:29 +0000 (17:27 +0200)]
systemctl: clarify that "status" is about the most recent invocation of a service
And point people to "journalctl --unit=" for information of prior runs.
Inspired by: #24159
Lennart Poettering [Tue, 2 Aug 2022 16:16:21 +0000 (18:16 +0200)]
repart: when keeping ref to backing inode/devnode, use fd_reopen() rathern than F_DUPFD
Via the "backing_fd" variable we intend to pin the backing inode through
our entire code. So far we typically created the fd via F_DUPFD_CLOEXEC,
and thus any BSD lock taken one the original fd is shared with our
backing_fd reference. And if the origina fd is closed but our backing_fd
is not, we'll keep the BSD lock open, even if we then reopen the block
device through the backing_fd. If hit, this results in a deadlock.
Let's fix that by creating the backing_fd via fd_reopen(), so that the
locks are no longer shared, and if the original fd is closed all BSD
locks on it that are in effect are auto-released.
(Note the deadlock is only triggered if multiple operations on the same
backing inode are executed, i.e. factory reset, resize and applying of
partitions.)
Replaces: #24181
Daan De Meyer [Tue, 2 Aug 2022 18:15:02 +0000 (20:15 +0200)]
mkosi: Update to latest
Fixed centos stream 8 builds that were hitting a nonexisting mirror
url
Lennart Poettering [Tue, 2 Aug 2022 15:09:34 +0000 (17:09 +0200)]
update TODO
Lennart Poettering [Tue, 2 Aug 2022 11:58:09 +0000 (13:58 +0200)]
mountpoint-util: make fd_is_mountpoint() work reasonably with AT_EMPTYPATH
Inspired by: https://github.com/systemd/systemd/pull/24141
Calling fd_is_mountpoint() with AT_EMPTYPATH and an empty filename can
only work if we have new statx() available. If we do not, we can still
make things work for directories, but not for other inodes (since there
we cannot query information about the parent inode to compare things.)
Hence, let's handle and test this explicitly, to support this to the
level this is possible.
Jacek Migacz [Wed, 27 Jul 2022 16:38:12 +0000 (18:38 +0200)]
resolved: fix single-label resolution over DNS
Fixes: #23494 (when ResolveUnicastSingleLabel=yes)
Frantisek Sumsal [Tue, 2 Aug 2022 16:28:43 +0000 (18:28 +0200)]
test: be a bit more verbose about shared library symlinks
For example:
```
D: Installing /usr/lib64/libz.so.1.2.11
D: Creating symlink /usr/lib64/libz.so.1.2.11 -> /usr/lib64/libz.so.1
D: Creating extra symlink: /lib64/libz.so
D: Installing /usr/lib64/libgcc_s-12-
20220507.so.1
D: Creating symlink /usr/lib64/libgcc_s-12-
20220507.so.1 -> /usr/lib64/libgcc_s.so.1
```
Frantisek Sumsal [Tue, 2 Aug 2022 11:54:57 +0000 (13:54 +0200)]
test: install libgcc_s.so.1 explicitly if available
Since the library is dlopen()ed by libpthread and required during
pthread_exit()/pthread_cancel(), let's install it explicitly if available to
avoid unexpected fails in tests. This also consolidates all related
workarounds for this library across the test scripts.
Luca Boccassi [Tue, 2 Aug 2022 13:42:33 +0000 (14:42 +0100)]
Merge pull request #24146 from poettering/efi-stub-measure-payload
stub: measure kernel/initrd/parameters into clean PCRs 11/12/13, and add "systemd-measure" tool to be able to pre-calculate values
Lennart Poettering [Tue, 2 Aug 2022 12:01:29 +0000 (14:01 +0200)]
update TODO
Daan De Meyer [Tue, 2 Aug 2022 09:51:40 +0000 (11:51 +0200)]
mkosi: Update to latest commit
With this update, Arch Linux keyring updates will be automatically
pulled in instead of having to update to a new mkosi commit every
time the keyring gets outdated.
Lennart Poettering [Wed, 27 Jul 2022 13:46:42 +0000 (15:46 +0200)]
update TODO
Lennart Poettering [Fri, 29 Jul 2022 16:45:53 +0000 (18:45 +0200)]
test: add trivial test for systemd-measure
Lennart Poettering [Mon, 25 Jul 2022 22:13:16 +0000 (00:13 +0200)]
measure: add new tool to precalculate PCR values for a kernel image
For now, this simply outputs the PCR hash values expected for a kernel
image, if it's measured like sd-stub would do it.
(Later on, we can extend the tool, to optionally sign these
pre-calculated measurements, in order to implement signed PCR policies
for disk encryption.)
Lennart Poettering [Thu, 28 Jul 2022 08:48:16 +0000 (10:48 +0200)]
bootctl: suppress "Boot Loaders Listed in EFI Variables" section header if section empty
Some more cosmetics.
Lennart Poettering [Wed, 27 Jul 2022 15:23:25 +0000 (17:23 +0200)]
bootctl: prettify tree output of discovered boot loaders a bit
Previously, the tree output of discovered boot laoders in the ESP would
look like this:
Available Boot Loaders on ESP:
ESP: /efi (/dev/disk/by-partuuid/
0c6f41ed-2573-4723-8c84-
23681f9d1c28)
File: └─/EFI/systemd/systemd-bootx64.efi (systemd-boot v250.7-1.fc36)
File: └─/EFI/BOOT/BOOTX64.EFI (systemd-boot v250.7-1.fc36)
With this change the tree branches are corrected to look like this:
Available Boot Loaders on ESP:
ESP: /efi (/dev/disk/by-partuuid/
0c6f41ed-2573-4723-8c84-
23681f9d1c28)
File: ├─/EFI/systemd/systemd-bootx64.efi (systemd-boot v250.7-1.fc36)
└─/EFI/BOOT/BOOTX64.EFI (systemd-boot v250.7-1.fc36)
Ahhh! So much nicer. This incorrect tree drawing has been bugging me for
so long. Finally I can sleep at night again!
Lennart Poettering [Wed, 27 Jul 2022 15:07:12 +0000 (17:07 +0200)]
bootctl: underline sections in status output
Let's give the output a bit more structure, inspired by the way our
newer --help texts use underlining to separate out sections a bit.
Lennart Poettering [Thu, 28 Jul 2022 08:47:05 +0000 (10:47 +0200)]
boot: add hexdump helper call
This is not actually used (or even supposed to be used) in clean
codepaths, but is tremendously useful when verifying things work
correctly, as a debugging tool.
Lennart Poettering [Wed, 27 Jul 2022 14:39:13 +0000 (16:39 +0200)]
boot: add three new boot loader feature flags
Report whether the devicetree + sort-key boot loader spec type #1
fields are supported, and whether the "@saved" pseudo-entry is
supported.
Strictly speaking, thes features have been added in versions that are
already released (250+), so by adding this those version even though
they support the features will be considered not supporting them, but
that should be OK (the opposite would be a problem though, i.e. if we'd
assume a boot loader had a feature it actually does not).
These three features are features relevant to userspace, as it allows
userspace to tweak/genereate BLS entries or set EFI vars correctly.
Other features (i.e. that have no impliciations to userspace) are not
reported.
Lennart Poettering [Wed, 27 Jul 2022 13:28:55 +0000 (15:28 +0200)]
bootctl: show stub feature set in status output
Lennart Poettering [Thu, 28 Jul 2022 15:11:47 +0000 (17:11 +0200)]
stub: clean up kernel command line when converting to ASCII
Let's be a bit more careful when converting the UTF-16 cmdline to ASCII.
Let's convert all characters out of the printable ASCII range to spaces,
instead of blindly relying on C's downcasting behaviour.
Lennart Poettering [Wed, 27 Jul 2022 13:25:59 +0000 (15:25 +0200)]
stub: introduce StubFeatures, similar to LoaderFeatures
systemd-boot reports its features via the LoaderFeatures EFI variable.
Let's add something similar for stub features, given they have been
growing.
For starters only define four feature flags. One is a baseline feature
we pretty much always supported (see comment in code), two are features
added in one of the most recently released systemd version, and the
final one, is a feature we added a few commits ago.
This is useful for userspace to figure out what is supported and what
not.
Lennart Poettering [Wed, 27 Jul 2022 08:58:29 +0000 (10:58 +0200)]
boot: move unified kernel PE section definitions into 'fundamental' code
Le's share this code between userspace and uefispace. This is useful
later when pre-measuring expected PCRs from userspace.
Lennart Poettering [Wed, 27 Jul 2022 08:43:34 +0000 (10:43 +0200)]
boot: split out TPM PCR defines into header file we can share between userspace and kernel space
Lennart Poettering [Tue, 26 Jul 2022 09:35:57 +0000 (11:35 +0200)]
sd-stub: measure sysext images picked up by sd-stub into PCR 13
Let's grab another so far unused PCR, and measure all sysext images into
it that we load from the ESP. Note that this is possibly partly redundant,
since sysext images should have dm-verity enabled, and that is hooked up
to IMA. However, measuring this explicitly has the benefit that we can
measure filenames too, easily, and that all without need for IMA or
anything like that.
This means: when booting a unified sd-stub kernel through sd-boot we'll
now have:
1. PCR 11: unified kernel image payload (i.e. kernel, initrd, boot
splash, dtb, osrelease)
2. PCR 12: kernel command line (i.e. the one embedded in the image, plus
optionally an overriden one) + any credential files picked up by
sd-stub
3. PCR 13: sysext images picked up by sd-stub
And each of these three PCRs should carry just the above, and start from
zero, thus be pre-calculatable.
Thus, all components and parameters of the OS boot process (i.e.
everything after the boot loader) is now nicely pre-calculable.
NOTE: this actually replaces previous measuring of the syext images into
PCR 4. I added this back in
845707aae23b3129db635604edb95c4048a5922a,
following the train of thought, that sysext images for the initrd should
be measured like the initrd itself they are for, and according to my
thinking that would be a unified kernel which is measured by firmware
into PCR 4 like any other UEFI executables.
However, I think we should depart from that idea. First and foremost
that makes it harder to pre-calculate PCR 4 (since we actually measured
quite incompatible records to the TPM event log), but also I think
there's great value in being able to write policies that bind to the
used sysexts independently of the earlier boot chain (i.e. shim, boot
loader, unified kernel), hence a separate PCR makes more sense.
Strictly speaking, this is a compatibility break, but I think one we can
get away with, simply because the initrd sysext images are currently not
picked up by systemd-sysext yet in the initrd, and because of that we
can be reasonably sure noone uses this yet, and hence relies on the PCR
register used. Hence, let's clean this up before people actually do
start relying on this.
Lennart Poettering [Mon, 25 Jul 2022 22:13:06 +0000 (00:13 +0200)]
stub: measure PE sections in a defined order, and include all sections
Lennart Poettering [Mon, 25 Jul 2022 15:44:24 +0000 (17:44 +0200)]
efi: from the stub measure the ELF kernel + built-in initrd and so on into PCR 11
Here we grab a new – on Linux so far unused (by my Googling skills, that
is) – and measure all static components of the PE kernel image into.
This is useful since for the first time we'll have a PCR that contains
only a PCR of the booted kernel, nothing else. That allows putting
together TPM policies that bind to a specific kernel (+ builtin initrd),
without having to have booted that kernel first. PCRs can be
pre-calculated. Yay!
You might wonder, why we measure just the discovered PE sections we are
about to use, instead of the whole PE image. That's because of the next
step I have in mind: PE images should also be able to carry an
additional section that contains a signature for its own expected,
pre-calculated PCR values. This signature data should then be passed
into the booted kernel and can be used there in TPM policies. Benefit:
TPM policies can now be bound to *signatures* of PCRs, instead of the
raw hash values themselves. This makes update management a *lot* easier,
as policies don't need to be updated whenever a kernel is updated, as
long as the signature is available. Now, if the PCR signature is
embedded in the kernel PE image it cannot be of a PCR hash of the kernel
PE image itself, because that would be a chicken-and-egg problem. Hence,
by only measuring the relavent payload sections (and that means
excluding the future section that will contain the PCR hash signature)
we avoid this problem, naturally.
Lennart Poettering [Tue, 26 Jul 2022 16:32:21 +0000 (18:32 +0200)]
efi: tell userspace where the stub measured the kernel command line/credentials into
This is useful for userspace to know, so that policies can be put
together safely, matching what the stub actually measured.
Lennart Poettering [Mon, 25 Jul 2022 15:35:16 +0000 (17:35 +0200)]
efi: optionally report when measuring to TPM whether we actually did
the measurement calls can succeed either when they actually measured
something, or when they skipped measurement because the local system
didn't support TPMs.
Let's optionally return a boolean saying which case it is. This is later
useful to tell userspace how and if we measured something.
Lennart Poettering [Tue, 2 Aug 2022 08:28:15 +0000 (10:28 +0200)]
update TODO
Yu Watanabe [Tue, 2 Aug 2022 03:56:01 +0000 (12:56 +0900)]
Merge pull request #24174 from yuwata/network-link-local-address
network: fix link local address handling
Yu Watanabe [Mon, 1 Aug 2022 18:43:04 +0000 (03:43 +0900)]
test-network: add test case for #23197
Yu Watanabe [Mon, 1 Aug 2022 18:33:21 +0000 (03:33 +0900)]
network: make link_may_have_ipv6ll() optionally check Multicast= setting
Fixes the IPv6LL issue in #23197.
Yu Watanabe [Mon, 1 Aug 2022 18:32:55 +0000 (03:32 +0900)]
network: fix possible NULL-pointer dereference
Yu Watanabe [Mon, 1 Aug 2022 18:04:59 +0000 (03:04 +0900)]
network: do not try to start ipv4acd on non-supported interfaces
Fixes IPv4LL issue reported in #23197.
Yu Watanabe [Mon, 1 Aug 2022 18:01:49 +0000 (03:01 +0900)]
network: split link_ipv4ll_enabled() into two
And move it from networkd-link.[ch] to relevant files.
Yu Watanabe [Mon, 1 Aug 2022 17:44:37 +0000 (02:44 +0900)]
network: drop doubled semicolon
Yu Watanabe [Mon, 1 Aug 2022 17:43:38 +0000 (02:43 +0900)]
tree-wide: fix typo
dependabot[bot] [Mon, 1 Aug 2022 09:05:55 +0000 (09:05 +0000)]
build(deps): bump meson from 0.62.2 to 0.63.0 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 0.62.2 to 0.63.0.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/0.62.2...0.63.0)
---
updated-dependencies:
- dependency-name: meson
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
James Hilliard [Mon, 1 Aug 2022 01:34:11 +0000 (01:34 +0000)]
bpf: set gcc std and compile flags
This should make gcc bpf compilation more reliable.
dependabot[bot] [Mon, 1 Aug 2022 09:05:28 +0000 (09:05 +0000)]
build(deps): bump github/codeql-action from 2.1.15 to 2.1.17
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.15 to 2.1.17.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
3f62b754e23e0dd60f91b744033e1dc1654c0ec6...
0c670bbf0414f39666df6ce8e718ec5662c21e03)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Mon, 1 Aug 2022 09:05:35 +0000 (09:05 +0000)]
build(deps): bump github/super-linter from 4.9.4 to 4.9.5
Bumps [github/super-linter](https://github.com/github/super-linter) from 4.9.4 to 4.9.5.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/
a320804d310fdeb8d1a46c6c6c1e615d443b10c9...
2d64ac1c067c34beaf7d24cc12733cd46236f76e)
---
updated-dependencies:
- dependency-name: github/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Mon, 1 Aug 2022 09:05:24 +0000 (09:05 +0000)]
build(deps): bump actions/setup-node from 3.3.0 to 3.4.1
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.3.0 to 3.4.1.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/
eeb10cff27034e7acf239c5d29f62154018672fd...
2fddd8803e2f5c9604345a0b591c3020ee971a93)
---
updated-dependencies:
- dependency-name: actions/setup-node
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Cristian Rodríguez [Mon, 1 Aug 2022 05:04:27 +0000 (01:04 -0400)]
gcrypt: switch to system rng before gcry_check_version (#24162)
Current docs claim this must be done before gcry_check_version.
Joaquín Ignacio Aramendía [Sat, 30 Jul 2022 19:56:04 +0000 (16:56 -0300)]
Add ACCEL_MOUNT_MATRIX for OXP Mini
Frantisek Sumsal [Sat, 30 Jul 2022 20:11:50 +0000 (20:11 +0000)]
Merge pull request #24090 from yuwata/test-login
test: hopefully fixes race in TEST-35-LOGIN
Hugo Carvalho [Sat, 30 Jul 2022 18:12:09 +0000 (19:12 +0100)]
Update LINGUAS
Sort language codes in alphabetical order
Yu Watanabe [Sat, 30 Jul 2022 14:51:25 +0000 (23:51 +0900)]
test: restart logind before cleaning up sessions
Hopefully, fixes #24040.
Yu Watanabe [Sat, 30 Jul 2022 15:12:48 +0000 (00:12 +0900)]
test: do not restart getty@tty2 automatically
Yu Watanabe [Sat, 30 Jul 2022 15:11:59 +0000 (00:11 +0900)]
test: terminate session and user on cleanup
Max Gautier [Sat, 30 Jul 2022 06:46:27 +0000 (08:46 +0200)]
docs: Correct StandartOutput documentation
fix #2114
Luca Boccassi [Sat, 30 Jul 2022 12:48:09 +0000 (13:48 +0100)]
Merge pull request #24154 from yuwata/meson-fixups
meson: several fixlets
Eli Schwartz [Wed, 27 Jul 2022 01:49:48 +0000 (21:49 -0400)]
meson: fix broken boolean kwarg
Everywhere else that `conf.get('ENABLE_*')` is used as a boolean key for
something (for example in if statements) it always checks if == 1, but
in this one case it neglects to do so. This is important because
conf.get yields the same int that was stored, but if statements require
booleans.
So does executable's "install" kwarg, at least according to the
documentation. In actuality, it accepts all types without sanity
checking, then uses python "if bool(var)", so you can actually do
`install: 'do not'` and that's treated identical to `true`. This is a
type-checking bug which Meson will eventually fix.
muon fails on the same code, today.
Eli Schwartz [Wed, 27 Jul 2022 01:13:55 +0000 (21:13 -0400)]
meson: strip various strings before converting them to integers
"9\n" is not intrinsically a number, although some tools might
auto-strip strings before checking if they are a number. It's not
guaranteed, anyway.
Eli Schwartz [Wed, 27 Jul 2022 01:09:07 +0000 (21:09 -0400)]
meson: use files in run_command with relativized path
Passing a file as a command argument in string form assumes that
run_command has the current subdir as its cwd, but Meson's documentation
*explicitly* calls this out as undefined and wrong to use.
Indeed, muon has a different implementation that uses a different cwd,
and this argument cannot be found. Instead, passing a files() object
means that it's the job of meson itself to verify the file exists, then
pass it to the run_command in some format that guarantees it is a valid
path reference.
Eli Schwartz [Thu, 19 May 2022 10:54:40 +0000 (06:54 -0400)]
meson: move i18n module import to only when it is used
When translations are disabled, it's not necessary to `import('i18n')`
and do nothing with it. Also, importing it is (slightly) slow as Meson
needs to load another implementation file from disk, so why bother with
that work?
More particularly, muon does not yet implement this module and fails to
setup. Since there's already an option to disable using it, it makes
sense to let that option completely skip the not-implemented
functionality and actually succeed.
Eli Schwartz [Thu, 19 May 2022 10:50:35 +0000 (06:50 -0400)]
meson: fix type for many build options
Integers and booleans are supposed to be actual integers and booleans,
not strings describing their value, but Meson silently accepted either
one. It's still wrong to do it though, and other implementations of
Meson such as muon choke on it.
Yu Watanabe [Sat, 30 Jul 2022 04:44:11 +0000 (13:44 +0900)]
meson: use 0 for default uids, gids, and time epoch
0 UID and GID are special, and should not be acceptable for the settings.
Hence, we can handle 0 as unset.
Strictly speaking, time epoch with 0 is valid, but I guess no one use
0 as a valid value.
Cristian Rodríguez [Tue, 26 Jul 2022 18:24:12 +0000 (18:24 +0000)]
gcrypt: prefer the OS RNG
by default, gcrypt defaults to an userspace RNG, this is
the wrong thing (tm) to do on linux.
Switch to the SYSTEM rng instead.
Fei Li [Fri, 17 Jun 2022 11:26:28 +0000 (19:26 +0800)]
virt: detect KubeVirt instance
Kubevirt is currently technically based on KVM (but not xen yet[1]).
The systemd-detect-virt command, used to differentiate the current
virtualization environment, works fine on x86 relying on CPUID, while
fails to get the correct value (none instead of kvm) on aarch64.
Let's fix this by adding a new 'vendor[KubeVirt] = kvm' classification
considering the sys_vendor is always KubeVirt.
[1] https://groups.google.com/g/kubevirt-dev/c/C6cUgzTOsVg
Signed-off-by: Fei Li <lifei.shirley@bytedance.com>
James Hilliard [Wed, 27 Jul 2022 21:28:09 +0000 (15:28 -0600)]
journalctl: allow statically linked build
The journalctl tool may be needed on cross compilation hosts in order
to run --update-catalog against a target rootfs.
To avoid reliability issues caused by shared linking allow journalctl
to be linked statically.
Daan De Meyer [Tue, 19 Jul 2022 08:37:05 +0000 (10:37 +0200)]
units: Simplify container getty handling
Let's remove the baud settings for the container getty units since
they don't have any effect there anyway. On top of that, when we're
dealing with container TTYs, we can handle all the setup involved
ourselves so let's prevent agetty/login from touching the container
tty at all.
One example where this helps is that it actually makes disabling
TTYVHangup have an effect since before, login would unconditionally
call vhangup() on the tty.
Daan De Meyer [Thu, 28 Jul 2022 12:15:33 +0000 (14:15 +0200)]
Merge pull request #24080 from rdtscp/feature/machinectl/copy-force-flag
Add --force flag to machinectl copy-[to|from]
Lennart Poettering [Thu, 28 Jul 2022 09:25:26 +0000 (11:25 +0200)]
update TODO
Luca Boccassi [Wed, 27 Jul 2022 21:57:31 +0000 (22:57 +0100)]
Merge pull request #23875 from yuwata/resolve-mdns-fix-use-after-free
resolve: mdns: fix use-after-free
Janis Goldschmidt [Wed, 27 Jul 2022 09:23:20 +0000 (11:23 +0200)]
Use correct option name in error message
Alexander Wilson [Fri, 22 Jul 2022 11:08:11 +0000 (04:08 -0700)]
machinectl: Add plumbing for a `--force` flag for file copy
machine: Add APIs CopyTo[Machine]WithFlags + CopyFrom[Machine]WithFlags
- Same API to those without `WithFlags` (except this can take flags)
- Initially, only a flag to allow replacing a file if it already exists
Alexander Wilson [Fri, 22 Jul 2022 11:13:31 +0000 (04:13 -0700)]
copy: Respect COPY_REPLACE flag for copy_tree
- Add a test that asserts that copy_tree on an existing file will fail without COPY_REPLACE
- Add a test that asserts that copy_tree with COPY_MERGE and COPY_REPLACE on an existing directory will overwrite files that already exist.
Alexander Wilson [Fri, 22 Jul 2022 11:15:08 +0000 (04:15 -0700)]
copy.[ch]: Refactor
- Refactor: Move HardlinkContext to header file
- Refactor: Create `fd_copy_tree_generic` which isolates the functionality to check stat type and appropriately copy.
- Refactor: Create `fd_copy_leaf` which handles copying leaf nodes of a file tree.
Lennart Poettering [Mon, 25 Jul 2022 15:40:32 +0000 (17:40 +0200)]
stub: override StubInfo EFI variable unconditionally, since *we* own it
The other variables are owned by the boot menu (i.e. sd-boot), we only
fill those in if it didn't do so for us (to support cases where our stub
kernel is directly invoked by UEFI). But StubInfo is genuinely about the
stub, hence let's simplify things and unconditionally set it from the
stub.
Lennart Poettering [Tue, 26 Jul 2022 16:23:49 +0000 (18:23 +0200)]
boot: introduce common shortcut exit path in pack_cpio()
THis will be useful in a later commit, when we add more stuff to the
common exit path. But even without that, it's a nice simplification,
removing redundant lines.
Luca Boccassi [Tue, 26 Jul 2022 16:41:51 +0000 (17:41 +0100)]
portable: set PrivateTmp=yes in trusted profile too
When running on images you don't want to modify the /tmp
directory even if it's writable, and often it will just
be read-only. Set PrivateTmp=yes.
Fixes https://github.com/systemd/systemd/issues/23592
Luca Boccassi [Tue, 26 Jul 2022 22:17:23 +0000 (23:17 +0100)]
Merge pull request #24122 from yuwata/core-mount-bind-mount-on-nfs
core/mount: ignore -EACCES from mkdir_p_label() on NFS
Daan De Meyer [Tue, 26 Jul 2022 18:40:01 +0000 (20:40 +0200)]
mkosi: Update to latest commit
Fixes an issue with Arch builds failing by updating the archlinux
keyring package.
Lennart Poettering [Mon, 25 Jul 2022 15:42:54 +0000 (17:42 +0200)]
efi: update measure.h comments a bit
Lennart Poettering [Mon, 25 Jul 2022 15:33:53 +0000 (17:33 +0200)]
update TODO
(this basically just copies a coment from src/boot/efi/measure.h into
the TODO)
asavah [Tue, 26 Jul 2022 14:48:24 +0000 (17:48 +0300)]
meson: fix math flags check
Yu Watanabe [Tue, 26 Jul 2022 14:23:01 +0000 (23:23 +0900)]
core/mount: downgrade log level about several mkdir failures
Yu Watanabe [Tue, 26 Jul 2022 14:15:01 +0000 (23:15 +0900)]
Revert "core/mount: fail early if directory cannot be created"
This reverts commit
e4de58c8231e47509ffeb3aa47620ca42f22d7f6.
If mkdir() fails and the path does exist, then the later mount
command fails anyway. Hence, it is not necessary to fail here.
Fixes #24120.
Daan De Meyer [Tue, 26 Jul 2022 12:53:16 +0000 (14:53 +0200)]
mkosi: Build against Fedora rawhide as well
Yu Watanabe [Tue, 26 Jul 2022 11:03:12 +0000 (20:03 +0900)]
home: drop conflicted headers
Fixes #24117.
Yu Watanabe [Tue, 26 Jul 2022 10:31:31 +0000 (19:31 +0900)]
homed: fix dbus node enumerator
Fixes #24114.
Lennart Poettering [Tue, 26 Jul 2022 09:24:02 +0000 (11:24 +0200)]
Merge pull request #23702 from igo95862/fix-object-manager-interface-in-wrong-places
Fix ObjectManager interfaces for `GetManagedObjects`, `InerfacesAdded` and `InterfacesRemoved`
igo95862 [Sun, 3 Jul 2022 16:24:15 +0000 (19:24 +0300)]
Fix ObjectManager interface emitted for non-manager objects
igo95862 [Sun, 3 Jul 2022 15:40:10 +0000 (18:40 +0300)]
test-bus-objects: Test interfaces added/removed signal interfaces
`org.freedesktop.DBus.ObjectManager` should only be emitted if
object in question has ObjectManager attached.
igo95862 [Sun, 3 Jul 2022 14:11:46 +0000 (17:11 +0300)]
Fix GetManagedObjects returning ObjectManager interface for non-manager objects
igo95862 [Fri, 10 Jun 2022 17:51:04 +0000 (20:51 +0300)]
test-bus-objects: Test GetManagedObjects interfaces are correct
Objects without ObjectManager should not have
`org.freedesktop.DBus.ObjectManager` interface.
Object with ObjectManager should do.
Also added ASSERT_SE_NONNEG and ASSERT_NONNEG macros.
Luca Boccassi [Mon, 25 Jul 2022 20:28:11 +0000 (21:28 +0100)]
Merge pull request #24033 from dtardon/list-automounts
Add `systemctl list-automounts`
Lennart Poettering [Mon, 25 Jul 2022 09:31:05 +0000 (11:31 +0200)]
localed: don't fail if we cannot copy an xattr
We ignore xattr copy failures on all other cases, and we should do so
here too.
Fixes: #24106
Lennart Poettering [Mon, 25 Jul 2022 14:08:10 +0000 (16:08 +0200)]
update TODO
Lennart Poettering [Mon, 25 Jul 2022 13:01:37 +0000 (15:01 +0200)]
update TODO
Lennart Poettering [Mon, 25 Jul 2022 12:59:35 +0000 (14:59 +0200)]
update TODO
Lennart Poettering [Mon, 25 Jul 2022 12:55:48 +0000 (14:55 +0200)]
TODO: add new 'deprecations and removals' section