Commit Graph
74804 Commits
Author SHA1 Message Date
Lennart Poettering ea22cbc327 ukify: suffix switches that take parameters with = in log output 2024-07-03 16:15:04 +02:00
Lennart Poettering c8bcf7ecf7 measure: drop incomplete support for PCRs != 11
At this point we have a clearer model:

* systemd-measure should be used for measuring UKIs on vendor build
  systems, i.e. only cover stuff predictable by the OS vendor, and
  identical on all systems. And that is pretty much only PCR 11.

* systemd-pcrlock should cover the other PCRs, which carry inherently
  local information, and can only be predicted locally and not already
  on vendor build systems.

Because of that, let's not bother with any PCRs except for 11 in
systemd-measure. This was added at a time where systemd-pcrlock didn't
exist yet, and hence it wasn't clear how this will play out in the end.
2024-07-03 16:15:04 +02:00
Lennart Poettering 759cf7e10a boot: compare auto- prefix case-insensitively 2024-07-03 16:15:04 +02:00
Lennart Poettering 76c8c0b264 boot: split out inner part of config_load_type2_entries()
Let's simplify the code a bit, and parse Type 2 entries in a function of
its own, separate from the directory enumeration.

This closely follows a similar split we did a long time ago for Type 1.

This is just refactoring, no real code change.
2024-07-03 16:15:04 +02:00
Lennart Poettering b8ed6e22f0 boot: indent error code path, but leave main code path unindented 2024-07-03 16:15:04 +02:00
Lennart Poettering 6c741d8f50 efi: don't non-chalantly drop const from memory buffer 2024-07-03 16:15:04 +02:00
Lennart Poettering 1beaaeab2f efi: drop "ret_" prefix from "ret_sections[]" parameter
While we write data to this parameter, it's not really a return
parameter, we after all do not fully set it, we just fill in some
fields. Hence it must be initialized beforehand.

According to our coding style only parameters that are purely used for
returning something should be named "ret_xyz", hence this one should not
be.

(We'll later rely on the current behaviour that it leaves array entries
for which we find no sections untouched, hence leave behaviour as is,
just rename the parameters to something more appropriate).

(Since we are dropping the "ret_" prefix of "ret_sections", let's rename
the old "section" parameter at the same time to "section_names", to make
clearer what it is about).
2024-07-03 16:15:04 +02:00
Lennart Poettering d30b89c7fc efi: fix mangle_stub_cmdline() for empty strings 2024-07-03 16:15:04 +02:00
Lennart Poettering 596731db99 efi: add limit on how large files can be we load into memory at once 2024-07-03 16:15:04 +02:00
Daan De Meyer 90a255779d repart: Allow overriding fstype per partition designator
$SYSTEMD_REPART_OVERRIDE_FSTYPE is too invasive. Often you want to
override the fstype only for a specific designator, so let's support
that as well.
2024-07-03 15:45:51 +02:00
Daan De Meyer 690a85b1d4 mkosi: Copy packages to the build directory as well
With the latest mkosi, mkosi -t none can be used to rerun the build
script without messing with a previously built image. This allows
one to run "mkosi -t disk -f qemu" in one terminal to build and boot
an image in qemu and then run "mkosi -t none" in another terminal to
rebuild the packages. If one then has "RuntimeBuildSources=yes" set
in their mkosi configuration, the build directory is mounted into the
virtual machine, which means that one can then run "dnf upgrade
/work/build/*.rpm" from within the VM to install the new packages.

This allows for quickly iterating on changes without having to rebuild
the image all the time.

We'll probably want to document this at some point, but let's start
with making it possible by copying the built packages to the build directory.
2024-07-03 15:44:27 +02:00
Daan De Meyer 2fe6ad5a64 mkosi: Make sure we don't hide errors from git merge-base
Currently if git merge-base fails we'll hide the error and exit with
exit status 0. Let's make we only exit early if git merge-base exits
with 1 which indicates the current commit is not on the target branch.
Any other error is considered fatal.
2024-07-03 15:42:12 +02:00
Anton Golubev 4ee0ac1ae4 hwdb: Add some HP IR cameras
Two very similar devices, with two functions - a regular camera and IR.
The peculiarity of their infrared camera is that it uses a color image
format (YUYV), although it is essentially black and white.

The IR camera interface differs from the regular camera interface by name:

"HP Wide Vision FHD Camera: HP W" for the regular camera and
"HP Wide Vision FHD Camera: HP I" for an infrared camera

Therefore, glob *I is used to separate the IR camera
2024-07-03 13:51:52 +02:00
Luca Boccassi 0f20f7d6fe Merge pull request #33575 from YHNdnzj/soft-reboot-system-manager-only
core/dbus-manager: several cleanups, refuse SoftReboot() for user manager
2024-07-03 13:40:06 +02:00
Lennart Poettering 9545512f3e update TODO 2024-07-03 10:55:18 +02:00
Daan De Meyer 6bd14bf4b3 mkosi: update fedora commit reference
* f9fe17dbde Use vmlinux.h from kernel-devel
* 9cbad936a6 Pull in openssl-devel-engine
* 8ae009f929 Only add Requires on python3-zstd on Fedora
* 750e910c7c Drop BuildRequires on python3-zstd
2024-07-03 10:39:58 +02:00
Mike Yuan 33a06bbc74 core/main: add an assertion to ensure user managers won't initiate destructive/system-wide operation 2024-07-03 10:12:53 +02:00
Mike Yuan 6851abe403 core/manager: invoke special targets on signal only for system manager 2024-07-03 10:11:25 +02:00
Mike Yuan 236cd48546 core/dbus-manager: refuse SoftReboot() for user managers
Otherwise, busctl --user call ... SoftReboot results in
user manager broadcasting signal and initiating soft-reboot...
2024-07-03 10:11:24 +02:00
Mike Yuan 541aadff97 core/dbus-manager: check for runtime scope first for system-wide operations
It's pointless to do selinux or /run/ space checks
for user managers.
2024-07-03 10:11:24 +02:00
Mike Yuan a85fe612d7 core/dbus-manager: use sd_bus_error_set() rather than _setf() where appropriate
Also, there can only be one system manager.
2024-07-03 10:11:24 +02:00
Mike Yuan b80ae4bcfd core/dbus-manager: use path_simplify_alloc() for root and init paths 2024-07-03 10:11:24 +02:00
Mike Yuan ff21827fee core/dbus-manager: use PidRef for log_caller()
This is only for logging, but since we lookup for the unit
here, let's try to be accurate.
2024-07-03 10:11:21 +02:00
Daan De Meyer 88e9230643 mkosi: Don't touch the packaging checkout if work is being done
If work is being done in a separate branch, don't touch the packaging
checkout.
2024-07-03 01:17:35 +02:00
Daan De Meyer 48d6dad100 meson: Define __TARGET_ARCH macros required by bpf
These are required by the bpf_tracing.h header in libbpf, see
https://github.com/libbpf/libbpf/blob/master/src/bpf_tracing.h.

bpf_tracing.h does have a few fallbacks in case __TARGET_ARCH_XXX
is not defined but recommends using the __TARGET_ARCH macros instead
so let's do that.
2024-07-03 01:16:35 +02:00
Luca Boccassi e6b2508275 coredump: correctly take tmpfs size into account for compression
We calculate the amount of uncompressed data we can write by taking the limits
into account and halving it to ensure there's room for switching to compression
on the fly when storing cores on a tmpfs (eg: due read-only rootfs).

But the logic is flawed, as taking into account the size of the tmpfs storage
was applied after the halving, so in practice when an uncompressed core file
was larger than the tmpfs, we fill it and then fail.

Rearrange the logic so that the halving is done after taking into account
the tmpfs size.
2024-07-03 01:15:03 +02:00
Mike Yuan 4b7249111a docs/CODING_STYLE: document that we nowadays prefer (const char*) for func ret type
Addresses https://github.com/systemd/systemd/pull/33567#discussion_r1662818225
2024-07-02 23:35:58 +02:00
Luca Boccassi 467c501667 Merge pull request #33577 from fbuihuu/testsuite-tweaks-for-v256-on-SUSE
Testsuite tweaks for v256 on suse
2024-07-02 23:35:33 +02:00
Lennart Poettering 6f5c8f44f1 Merge pull request #33574 from poettering/get-efi-var-raw
efi: efi variable refactoring
2024-07-02 21:16:37 +02:00
Franck Bui 252542ffc3 test: fix TEST-74-AUX-UTILS.ssh.sh on SUSE 2024-07-02 19:07:03 +02:00
Franck Bui 855bad331e test: preserve symlink in inst_recursive()
On SUSE this function is used to copy symlinks installed in *.wants/
directories.
2024-07-02 19:06:21 +02:00
Franck Bui 56a894e888 test: fix TEST-24-CRYPTSETUP on SUSE
/etc/systemd/journald.conf.d drop-in dir already exists on SUSE.
2024-07-02 19:05:07 +02:00
Franck Bui a09825ce9f test: install /etc/hosts
Needed for resolving the "localhost" hostname.
2024-07-02 19:03:49 +02:00
Lennart Poettering 31e1edf570 efivars: rename efivar_get_uint_string() → efivar_get_uint64_str16()
Be explicit with the type, and more inline with our other code, that
likes to indicate the string char width in the name.

Also, switch to a fixed size type, since EFI variables should really be
binary exact the same on all archs.
2024-07-02 18:15:35 +02:00
Lennart Poettering 50e8b11e16 efi: rename efivar_(set|get)() → efivar_(set|get)_str16()
These functions after all write EFI UTF-16 strings, i.e. are relatively
high-level, hence give them a specific name indicating the type, to
match our other helpers that have similar type suffixes.
2024-07-02 18:15:32 +02:00
Lennart Poettering 70871dd0a3 efivars: use appropropriate uint8_t type when dealing with "raw" bytes
We don't actually want chars here, but rather raw bytes, in particular
to avoid signedness issues. Hence, let's use uint8_t here.
2024-07-02 18:15:30 +02:00
Lennart Poettering 1d22e23edb efivars: change return parameter of efivar_get_raw() to be void**
This is the "raw", untyped version after all, hence we should return a
void pointer, and let the client cast, if they know more.

Replaces: #30812
2024-07-02 18:15:27 +02:00
Lennart Poettering f84b512290 efi: split out efivars.[ch] from util.[ch]
These are quite a bunch of functions, let's give them their own file.

No code changes, just some trivial refactoring.
2024-07-02 18:15:16 +02:00
Daan De Meyer cca8c15599 mkosi: Install perf
It's already installed on ubuntu via linux-tools-common.
2024-07-02 18:14:19 +02:00
Lennart Poettering ead6c49ee1 update TODO 2024-07-02 16:59:14 +02:00
Daniel Rusek a9d472d6e4 test: split the resolved test suite into separate test cases
Although being far from ideal and the first two test cases have to be run
before the setup phase otherwise they will fail, it still makes the test
suite look much better and easier to read
2024-07-02 10:08:53 +02:00
Luca Boccassi 5dfce2296c Merge pull request #33496 from YHNdnzj/fd-is-mount-symlink
mountpoint-util: do not assume symlinks are not mountpoints
2024-07-02 10:07:20 +02:00
Luca Boccassi 1b3dc17624 Merge pull request #33560 from YHNdnzj/trivial-cleanup-2
2 trivial follow-ups for recent PRs
2024-07-02 10:05:49 +02:00
Luca Boccassi aedc4f77d1 Merge pull request #33523 from neighbourhoodie/fix/dns-opt-extended-rcode
Fix DNS OPT extended rcode parsing
2024-07-02 01:48:40 +02:00
dependabot[bot] ba490e2281 build(deps): bump github/codeql-action from 3.24.7 to 3.25.11
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.7 to 3.25.11.
- [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/3ab4101902695724f9365a384f86c1074d94e18c...b611370bb5703a7efb587f9d136a52ea24c5c38c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 22:08:28 +02:00
Luca Boccassi 4739539a78 mkosi: update debian commit reference
* abf24e775c Add recommends on linux-sysctl-defaults
* 76cb4138d2 autopkgtest: skip qemu tests on arm64
* 0935d73526 Install new systemd-import generator
2024-07-01 21:42:11 +02:00
Mike Yuan 0ee63608bc shared/condition: add missing space after 'if'
Follow-up for 98b1ecc917
2024-07-01 19:14:22 +02:00
Mike Yuan 71c404f9cf shared/mount-util: return early if param is NULL
To make things more readable and consistent.
2024-07-01 18:59:28 +02:00
Lennart Poettering 1c30bf35bc Merge pull request #33475 from poettering/name-to-handle-at-fid
teach inode_same() the concept of name_to_handle_at() FIDs to properly detect inode identities
2024-07-01 18:53:14 +02:00
Daan De Meyer 9fc4388ae4 mkfs-util: Simplify logic 2024-07-01 18:52:57 +02:00