summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* chase: make the result absolute when a symlink is absoluteYu Watanabe2023-04-182-1/+15
| | | | As the path may be outside of the specified dir_fd.
* chase: make chaseat() provides absolute path also when dir_fd points to the ↵Yu Watanabe2023-04-182-2/+31
| | | | | | | | | | root directory Usually, we pass the file descriptor of the root directory to chaseat() when `--root=` is not specified. Previously, even in such case, the result was relative, and we need to prefix the path with "/" when we want to pass the path to other functions that do not support dir_fd, or log or show the path. That's inconvenient.
* Merge pull request #27323 from keszybz/gpt-auto-generator-warning-cleanupMike Yuan2023-04-184-8/+11
|\ | | | | gpt-auto-generator: do not error out when no partitions are found
| * gpt-auto-generator: "translate" errno codes into proper messagesZbigniew Jędrzejewski-Szmek2023-04-183-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | E.g. in logs on jammy-ppc64el in https://github.com/systemd/systemd/pull/27294: Apr 16 17:42:50 H systemd-gpt-auto-generator[300]: Failed to dissect partition table of block device /dev/sda: No message of desired type Apr 16 17:42:50 H (sd-execu[295]: /usr/lib/systemd/system-generators/systemd-gpt-auto-generator failed with exit status 1. ee0e6e476e61d4baa2a18e241d212753e75003bf made this particular condition not an error. But for other errnos we want to print a better message too. dissect_loop_device_and_warn() already does this, but it always prints the error at error level. We want to suppress some of the errors, so let's make the print helper public and do the error suppression in the caller.
| * fstab-generator: add missing phrase in commentZbigniew Jędrzejewski-Szmek2023-04-181-1/+1
| |
* | test: prefix the transient unit with test- to make coverage runs happyFrantisek Sumsal2023-04-181-0/+1
| | | | | | | | | | | | See 9fd8226312 for more details. Follow-up to c9210b7470.
* | Merge pull request #27320 from poettering/kmod-setup-tweaksMike Yuan2023-04-181-4/+6
|\ \ | |/ |/| minor tweaks to kmod-setup.c
| * kmod-setup: bypass heavy virtio-rng check if we are not running in a VM anywayLennart Poettering2023-04-181-0/+4
| | | | | | | | | | detect_vm() is cheap, because cached, let's hence do that early before we get out the big guns and sweep through sysfs.
| * kmod-setup: use STARTSWITH_SET() where appropriateLennart Poettering2023-04-181-4/+2
| |
* | hwdb: Fix rotation for BMAX Y13Paolo Velati2023-04-181-0/+9
|/
* Revert "getty-generator: Use device hotplug to instantiate virtualizer consoles"Lennart Poettering2023-04-181-17/+13
| | | | This reverts commit e7e6ce5f8d467304731a98e8a140e69713f1bf07.
* Merge pull request #27256 from medhefgo/boot-rdtscLennart Poettering2023-04-181-28/+57
|\ | | | | boot: Improve timer frequency detection
| * boot: Use CPUID to detect TSC frequencyJan Janssen2023-04-131-1/+30
| | | | | | | | | | Aside from being more accurate on CPUs that report the information this is also orders of magnitude faster than sleeping for 1ms.
| * boot: Rework timer frquency readingJan Janssen2023-04-131-18/+31
| | | | | | | | This is in preparation for the next commit.
| * boot: Use compiler intrinsic for TSCJan Janssen2023-04-131-15/+2
| |
* | gpt-auto: do not fail when no suitable partitions foundYu Watanabe2023-04-181-1/+2
| | | | | | | | Follow-up for 598fd4da1cf9665834110583fd9133073cc12481.
* | getty-generator: Use device hotplug to instantiate virtualizer consolesDaan De Meyer2023-04-181-13/+17
| | | | | | | | | | | | | | If getty-generator runs in the initrd, the corresponding tty might not have been instantiated yet in /dev, which means a serial getty is not spawned on it. Instead, let's instantiate the serial-getty when the device appears so that it always gets instantiated.
* | lsm-util: move detection of support of LSMs into a new lsm-util.[ch] helperLennart Poettering2023-04-184-37/+40
| | | | | | | | | | | | | | This makes the bpf LSM check generic, so that we can use it elsewhere. it also drops the caching inside it, given that bpf-lsm code in PID1 will cache it a second time a stack frame further up when it checks for various other bpf functionality.
* | bpf-firewall: give a name to maps usedDominique Martinet2023-04-183-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running systemd with IP accounting enabled generates many bpf maps (two per unit for accounting, another two if IPAddressAllow/Deny are used). Systemd itself knows which maps belong to what unit and commands like `systemctl status <unit>` can be used to query what service has which map, but monitoring these values all the time costs 4 dbus requests (calling the .IP{E,I}gress{Bytes,Packets} method for each unit) and makes services like the prometheus systemd_exporter[1] somewhat slow when doing that for every units, while less precise information could quickly be obtained by looking directly at the maps. Unfortunately, bpf map names are rather limited: - only 15 characters in length (16, but last byte must be 0) - only allows isalnum(), _ and . characters If it wasn't for the length limit we could use the normal unit escape functions but I've opted to just make any forbidden character into underscores for maximum brievty -- the map prefix is also rather short: This isn't meant as a precise mapping, but as a hint for admins who want to look at these. (Note there is no problem if multiple maps have the same name) Link: https://github.com/povilasv/systemd_exporter [1]
* | process-util: be more careful with pidfd_get_pid() special casesLennart Poettering2023-04-171-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's be more careful with generating error codes for (expected) error causes. This does not introduce new error conditions, it just changes what we return under specific cases, to make things nicely recognizable in each case. Most importantly this detects if fdinfo reports a pid of "-1" for pidfds with processes that are already reaped (and thus have no PID anymore) None of our current users care about these error codes, but let's get this right for the future.
* | fsck: use execv_p_ and execl_p_Florian Klink2023-04-173-30/+5
| | | | | | | | | | Instead of invoking find_executable on our own, use the variants of exec provided by glibc which does this for us.
* | creds: make available to all ExecStartPre= and ExecStart= processesLuca Boccassi2023-04-172-1/+10
| | | | | | | | Fixes https://github.com/systemd/systemd/issues/27275
* | user-util:remove duplicate includesjcg2023-04-171-1/+0
| |
* | virt: Further improve detection of EC2 metal instancesBenjamin Herrenschmidt2023-04-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f90eea7d18d9ebe88e6a66cd7a86b618def8945d virt: Improve detection of EC2 metal instances Added support for detecting EC2 metal instances via the product name in DMI by testing for the ".metal" suffix. Unfortunately this doesn't cover all cases, as there are going to be instance types where ".metal" is not a suffix (ie, .metal-16xl, .metal-32xl, ...) This modifies the logic to also allow those new forms. Signed-off-by: Benjamin Herrenschmidt <benh@amazon.com>
* | mkosi: Use kernel-core for Fedora and CentOS imagesDaan De Meyer2023-04-172-3/+2
| | | | | | | | Let's reduce image size by using a smaller kernel package.
* | hwdb: add accelerometer mount matrix for Lenovo Yoga Tablet 2 851F/LHans de Goede2023-04-171-0/+4
| | | | | | | | | | Add an accelerometer mount matrix for Lenovo Yoga Tablet 2 851F/L, to fix screen rotation now that the kernel has support for the LSM303D IMU.
* | Merge pull request #27298 from mrc0mmand/test-async-tweaksLuca Boccassi2023-04-172-9/+8
|\ \ | | | | | | test: modernize test-async a bit
| * | docs: add a missing $ signFrantisek Sumsal2023-04-161-1/+1
| | | | | | | | | | | | | | | Addresses https://github.com/systemd/systemd/pull/27283#pullrequestreview-1386816102. Follow-up to 1a127aa02b.
| * | test: modernize test-async a bitFrantisek Sumsal2023-04-161-8/+7
| | | | | | | | | | | | | | | Mainly to give it some debug output to, hopefully, see why it sometimes gets stuck in CI when run with sanitizers.
* | | process-util: make safe_fork() unset $NOTIFY_SOCKETYu Watanabe2023-04-165-4/+9
|/ / | | | | | | | | | | | | | | Propagating $NOTIFY_SOCKET is typically dangerous. Let's unset it unless explicitly requested to keep it. Fixes #27288. Replaces #27291.
* | mkosi: default to Fedora 38Zbigniew Jędrzejewski-Szmek2023-04-162-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | It'll be out this week. We can't update the man pages before it is realeased, but we can use it for mkosi builds and do some very late testing. Also, use filepath specification for /bin/pkg-config. We need it for meson, and meson calls it directly by this path. pkgconfig is a virtual Provides on pkgconf-pkg-config, and the indirection here just obfuscates things with no benefit. Add it explicitly for centos too. (I think it is pulled in by packages which contain pkg-config modules anyway, but it's better to be explicit).
* | exec-util: make execute_strv() optionally take root directoryYu Watanabe2023-04-162-3/+6
| | | | | | | | Preparation for rewriting kernel-install in C.
* | Merge pull request #27283 from mrc0mmand/assorted-test-tweaksYu Watanabe2023-04-1612-4/+245
|\ \ | | | | | | test: a bunch of assorted tweaks, Saturday edition
| * | test: add a couple of tests with invalid UTF-8 charactersFrantisek Sumsal2023-04-161-1/+19
| | |
| * | test: add a simple test for getenv_path_list()Frantisek Sumsal2023-04-161-0/+35
| | |
| * | test: add a couple of basic sanity tests for the security verbFrantisek Sumsal2023-04-161-0/+5
| | |
| * | test: add a couple of basic sanity tests for timedatectlFrantisek Sumsal2023-04-161-0/+22
| | |
| * | test: add a simple test for secure-bits stuffFrantisek Sumsal2023-04-162-0/+85
| | |
| * | shared: add a missing includeFrantisek Sumsal2023-04-161-0/+2
| | |
| * | test: add tests for uuid/uint64 specifiersFrantisek Sumsal2023-04-161-0/+27
| | | | | | | | | | | | | | | They're used in repart, but are not part of the "common" specifier lists, so cover them explicitly.
| * | test: add a test case for table_dup_cell()Frantisek Sumsal2023-04-151-0/+43
| | | | | | | | | | | | Also, sneak in coverage for "less popular" cell types.
| * | docs: a couple of typo fixes & formatting tweaksFrantisek Sumsal2023-04-151-3/+3
| | |
| * | test: stop the test unit when it's not needed anymoreFrantisek Sumsal2023-04-141-0/+1
| | | | | | | | | | | | | | | Otherwise it keeps printing stuff to the journal/console, adding unnecessary noise.
| * | test: check the colored --version outputFrantisek Sumsal2023-04-141-0/+3
| | |
* | | Merge pull request #27253 from yuwata/cmsg-find-and-copy-dataYu Watanabe2023-04-1613-47/+59
|\ \ \ | | | | | | | | socket-util: introduce CMSG_FIND_AND_COPY_DATA()
| * | | tree-wide: also use CMSG_TYPED_DATA() on writing message headerYu Watanabe2023-04-163-4/+4
| | | |
| * | | sd-dhcp-server: use CMSG_FIND_DATA() at one more placeYu Watanabe2023-04-161-14/+4
| | | |
| * | | tree-wide: copy timestamp data from cmsgYu Watanabe2023-04-164-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On RISCV32, time_t is 64bit and size_t is 32bit, hence the timestamp data in message header may not be aligned. Fixes #27241.
| * | | socket-util: introduce CMSG_FIND_AND_COPY_DATA()Yu Watanabe2023-04-162-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cmd(3) man page says about CMSG_DATA(): > The pointer returned cannot be assumed to be suitably aligned for > accessing arbitrary payload data types. Applications should not cast > it to a pointer type matching the payload, but should instead use > memcpy(3) to copy data to or from a suitably declared object. Hence, if we want to use unaligned data in cmsg, we need to copy it before use. That's typically important for reading timestamps in RISCV32, as the time_t is 64bit and size_t is 32bit on the system.
| * | | tree-wide: replace __alignof__() with alignof()Yu Watanabe2023-04-145-13/+14
| | | | | | | | | | | | | | | | Addresses https://github.com/systemd/systemd/pull/27254#discussion_r1165267046.