summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpt-auto-generator: port to partition_pick_mount_options() tooLennart Poettering2023-03-091-24/+59
| | | | | | | | This way we'll have the same mount options in place if we boot via the gpt generator, or if we mount a DDI locally. Note that this will also enable MS_NOSYMFOLLOW on ESP and XBOOTLDR now, if booted via gpt-auto-generator.
* dissect-image: set MS_NOSYMFOLLOW for ESP/XBOOTLDRLennart Poettering2023-03-092-40/+111
| | | | | | | | | | | | | | When we mount a DDI, let's set MS_NOSYMFOLLOW for ESP/XBOOTLDR. They are generally untrusted territory, (i.e. outside of encryption/authentication via dm-crypt/dm-verity). Moreover they are generally FAT, where symlinks don't exist anyway. Let's hence disable symlinks for them. This slightly refactors how we put together mount options for mounts, splitting this out into a new helper call dissected_partition_pick_options(), which we should be able to reuse later in gpt-auto-generator, to ensure mounts via loopback as DDI and those on bare metal get the same options.
* dissect: add new helper dissected_partition_fstype()Lennart Poettering2023-03-092-1/+7
| | | | Initially we only have one user, but following patches will add more.
* mountpoint-util: add helper that checks if MS_NOSYMFOLLOW is supportedLennart Poettering2023-03-093-0/+68
|
* missing: add more defines to fsopen() definitionsLennart Poettering2023-03-091-0/+12
|
* missing: add fsmount() syscall fallback definitionLennart Poettering2023-03-091-0/+20
|
* manager: in dump, show controllers in "Delegate:"Zbigniew Jędrzejewski-Szmek2023-03-091-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After Delegate= was converted from boolean to a controller list, the dump output was changed to have a separate line about the delegated controllers: ... DevicePolicy: auto DisableControllers: Delegate: yes ManagedOOMSwap: auto ManagedOOMMemoryPressure: auto ManagedOOMMemoryPressureLimit: 0.00% ManagedOOMPreference: none DelegateControllers: cpu memory pids ... The line with "Delegate:" is redundant, it effectively shows if "DelegateControllers:" is non-empty. It is nicer to keep the lines about controllers adjacent. And to avoid duplicate output, Delegate: will now show which controllers are enabled. This makes the output for that line again match the configuration stanza Delegate=: DisableControllers: Delegate: cpu io memory pids ManagedOOMSwap: auto ManagedOOMMemoryPressure: auto ManagedOOMMemoryPressureLimit: 0.00% ManagedOOMPreference: none MemoryPressureWatch: auto MemoryPressureThresholdSec: 100ms Dump output is for debugging, we don't need to maintain strict backwards-compat.
* journalctl: fix when --since, --until and --lines are used altogetherMike Yuan2023-03-091-1/+6
| | | | | | | | | | | | | | | This is a follow-up for #26669 (81fb5375b3b3bfc22d023d7908ad9eee4b3c1ffb). After the mentioned commit, we stopped checking if the entry is within the range of --until if --lines is used. However, when --since, --until and --lines=N are used altogether, and the number of lines between --since and --until is smaller than N, we would seek to --since later (f58269510727964cb5c10e7d2f9849c442ea1f80). This breaks the assumption that if --lines is set, the boundary is never exceeded because the counter of outputs gets us covered.
* tests: merge test-tmpfiles.c into test-tmpfile-util.cZbigniew Jędrzejewski-Szmek2023-03-093-81/+66
| | | | | | | The former was added in 65b3903ff576488eaabb51d3c4fbf9c73d867d7c, but the name is confusing: the test has nothing to do with systemd-tmpfiles. It had one function that mostly tested functions from tmpfile-util.c, so just move it into the latter.
* Merge pull request #26038 from ↵Zbigniew Jędrzejewski-Szmek2023-03-091-16/+59
|\ | | | | | | | | lilyinstarlight/fix/fstab-generator-sysroot-without-cmdline fstab-generator: use correct targets when /sysroot is specificied in fstab only
| * fstab-generator: add SYSTEMD_SYSFS_CHECK env varLily Foster2023-01-261-2/+10
| | | | | | | | | | This forces processing of /dev entries in fstab when running in a container is detected (checked as the existence of read-only /sys).
| * fstab-generator: use correct targets when /sysroot is specificied in fstab onlyLily Foster2023-01-261-14/+49
| |
* | macro: support the case that the number of elements has const qualifierYu Watanabe2023-03-091-4/+6
| | | | | | | | | | | | Follow-up for 5716c27e1f52d2aba9dd02916c01d6271d9d0b16. Addresses https://github.com/systemd/systemd/pull/26303#issuecomment-1460712007.
* | Merge pull request #26698 from ldv-alt/udevadm-verifyYu Watanabe2023-03-096-8/+213
|\ \ | | | | | | | | | | | | | | | | | | | | | Implement a udev rules syntax checker in the form of `udevadm verify [OPTIONS] FILE...` command that is based on `udev_rules_parse_file` interface and would apply further checks on top of it in the future. Resolves: #26606
| * | udev_rules_parse_file: issue diagnostics about line continuation at EOFDmitry V. Levin2023-03-081-0/+5
| | | | | | | | | | | | | | | | | | | | | When udev rules file ends with a line continuation, the parser used to silently ignore the line without any diagnostics at all. It's time to break the vow of silence and let the parser issue some error diagnostics.
| * | udevadm-verify: check for unused labelsDmitry V. Levin2023-03-081-2/+16
| | | | | | | | | | | | | | | | | | Check for unused labels in the specified udev rules files, report such labels and exit with a non-zero exit code if any unused labels are found.
| * | udevadm: introduce new 'verify' commandDmitry V. Levin2023-03-086-0/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We seem to have no tool to verify udev rule files. There is a simple udev rules syntax checker in the tree, test/rule-syntax-check.py, but it is too simple to detect less trivial issues not detected by udev, e.g. redundant comparisons (#26593) or labels without references. Such a tool would be beneficial not only for maintaining udev rules distributed along with udev, but also and even more so for maintaining third party udev rules that are more likely to have issues with syntax and semantic correctness. Implement a udev rules syntax and semantics checker in the form of 'udevadm verify [OPTIONS] FILE...' command that is based on udev_rules_parse_file() interface and would apply further checks on top of it in subsequent commits. Resolves: #26606
| * | udev_rules_parse_file: mark logged issuesDmitry V. Levin2023-03-081-6/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally, all issues found in udev rules by udev_rules_parse_file() are logged and ignored, so there was no mechanism to propagate the information about these issues back to the caller. Introduce such a mechanism by adding a new member to UdevRuleFile. This new member is a bitmask describing which log levels were used in messages logged with regards to the rule file. This mechanism is going to be used by udevadm verify in subsequent commits.
* | | localed: print a custom message if libxkbcommon.so is unvailableZbigniew Jędrzejewski-Szmek2023-03-091-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up for 82c2095a5e407bcf041dc7bde84791deec95ff9c. > I feel like the logging here may be a bit confusing on the new path. > Previously you did get a message that explained what was going on. Now you get > an info message that the layout could not be compiled, and … that's all. I can > imagine this being a confusing red herring if someone was trying to debug a > problem and saw this message. Perhaps we should log something else instead/as > well, on the case where libxkbcommon isn't present, to say that's what we're > logging about and it just means we can't validate the configuration, not that > it's definitely invalid?
* | | Merge pull request #26119 from kraxel/uki.installLuca Boccassi2023-03-083-6/+19
|\ \ \ | | | | | | | | kernel-install: improve uki handling
| * | | kernel-install: handle uki installs automaticallyGerd Hoffmann2023-03-071-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detect image type using "bootctl kernel-identify $kernel", store result in KERNEL_INSTALL_IMAGE_TYPE. Extend layout autodetection to check the kernel image type and pick layout=uki for UKIs. Resolves: #25822
| * | | 90-uki-copy.install: create $BOOT/EFI/Linux directory if neededGerd Hoffmann2023-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | Do not consider a missing 'Linux' subdirectory an error. Just create it instead.
| * | | bootctl: tweak DOS header magic checkGerd Hoffmann2023-03-071-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Read the magic first, try reading the full DOS exe header only in case the magic check succeeds. This avoids throwing an header read error on small dummy files as used by test-kernel-install.
* | | | Merge pull request #26656 from yuwata/mkdir-error-codeLuca Boccassi2023-03-082-1/+24
|\ \ \ \ | | | | | | | | | | mkdir: fix error code
| * | | | test: add tests for error code propagation from mkdir_xyz()Yu Watanabe2023-03-031-0/+20
| | | | |
| * | | | mkdir: fix error code on failureYu Watanabe2023-03-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ==== $ systemctl edit network.target Failed to create directories for "/etc/systemd/system/network.target.d/override.conf": No such file or directory ==== After: ==== $ systemctl edit network.target Failed to create directories for "/etc/systemd/system/network.target.d/override.conf": Permission denied ==== Fixes #26652.
* | | | | Merge pull request #26711 from keszybz/man-page-stuffLuca Boccassi2023-03-081-1/+1
|\ \ \ \ \ | |_|_|/ / |/| | | | Man page tweaks
| * | | | man: adjust description of CPUAccounting=Zbigniew Jędrzejewski-Szmek2023-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For any user on a semi-recent kernel, effectively this setting is pointless. We should deprecate it once not needed anymore for the v1 hierarchy. For now, adjust the description.
* | | | | Merge pull request #26716 from mrc0mmand/more-testsLuca Boccassi2023-03-081-1/+1
|\ \ \ \ \ | | | | | | | | | | | | test: add a couple of tests for systemd-escape and systemd-id128
| * | | | | random-seed: drop extraneous "we"Frantisek Sumsal2023-03-081-1/+1
| | | | | |
* | | | | | Merge pull request #26678 from yuwata/foreach_arrayZbigniew Jędrzejewski-Szmek2023-03-083-13/+70
|\ \ \ \ \ \ | | | | | | | | | | | | | | macro: introduce FOREACH_ARRAY() macro
| * | | | | | systemctl: port FOREACH_ARRAY() to systemctl-list-units.cYu Watanabe2023-03-071-13/+13
| | | | | | |
| * | | | | | macro: introduce FOREACH_ARRAY() macroYu Watanabe2023-03-072-0/+57
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | The pattern that runs all array element is quite common. But, sometimes, the number of element may be in a signed integer, or the array may be NULL.
* | | | | | core: log message when reloading finishesLuca Boccassi2023-03-081-1/+4
| |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | Reloading might be slow, especially when under memory pressure, and watchdogs might be triggered. It is useful to have timestamped telemetry in the journal to see how long a reload takes.
* | | | | timesync: stop re-sync on network configuration change when no link servers ↵Chitoku2023-03-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are configured (#26708) This commit fixes an issue where systemd-timesyncd re-synchronizes the system clock every time the network configuration is updated, no matter whether link servers are actually changed. Fixes a bug introduced by e05dd7718d0b32e039c9e0f7bf3875079d1a359d.
* | | | | localed: skip verification when libxkbcommon is not installedZbigniew Jędrzejewski-Szmek2023-03-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compliled without libxkbcommon, we do no verification and accept the arguments as given. When compliled against with, if dlopen() works, we do the verification. But if dlopen() fails, we would refuse the call and return SD_BUS_ERROR_INVALID_ARGS. 5de344704df64d8f31448f1222432bc87ddcfbef added things this way when converting to dlopen(), but it seems not very useful: it can be expected that when the library is supported but missing at runtime, we degrade softly, and that the behaviour is something inbetween the cases of hard disable at compilation time and full support. But right now we behave more strictly then if disabled at compilation. Change the code to just warn if dlopen fails, but accept the arguments. (There are various minimization scenarios where forcing the installation of libxkbcommon is not useful. E.g. a small installation where we want to set the keymap via logind, but the configuration is managed by a configuration management system and is known to be valid. Verification via libxkbcommon is just overhead in this case.) 800f65f827c9828d4c872d44b19ca8a008505690 moved the check earlier, so now even a noop case of setting the values that were already in place can fail. C.f. https://bugzilla.redhat.com/show_bug.cgi?id=2175244.
* | | | | Merge pull request #26706 from jengelh/masterLuca Boccassi2023-03-077-9/+9
|\ \ \ \ \ | | | | | | | | | | | | doc: various orthographic fixes
| * | | | | doc: correct wrong use "'s" contractionsJan Engelhardt2023-03-075-5/+5
| | | | | |
| * | | | | doc: replace wrong idiom in homed commentJan Engelhardt2023-03-071-2/+2
| | | | | |
| * | | | | doc: replace wrong á preposition by àJan Engelhardt2023-03-071-2/+2
| | | | | |
* | | | | | Merge pull request #26695 from poettering/dissect-mount-helperLuca Boccassi2023-03-071-1/+78
|\ \ \ \ \ \ | |/ / / / / |/| | | | | make "systemd-dissect --mount" available as /sbin/mount.ddi
| * | | | | dissect: implement external helper plugin interface for /bin/mountLennart Poettering2023-03-061-1/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change we'll install a symlink /sbin/mount.ddi → systemd-dissect. If invoked that way we'll do the equivalent of systemd-dissect --mount. This makes DDIs mountable directly via the "mount" command, by specifying the "-t ddi" pseudo file system type. Moreover you can now mount DDIs directly via /etc/fstab, by specifying "ddi" in the file system column (3rd column).
* | | | | | Merge pull request #26648 from bluca/kernel_install_guidLuca Boccassi2023-03-071-7/+24
|\ \ \ \ \ \ | | | | | | | | | | | | | | kernel-install: also try to find $BOOT by partition GUID
| * | | | | | kernel-install: also try to find $BOOT by partition GUIDLuca Boccassi2023-03-031-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there is nothing set up on /boot, /boot/efi or /efi, try to find the $BOOT partition checking for the XBOOTLDR or ESP partition GUIDs. Prefer XBOOTLDR as per BLS. Fixes https://github.com/systemd/systemd/issues/26644
| * | | | | | kernel-install: use log_verbose everywhereLuca Boccassi2023-03-031-7/+4
| | | | | | |
* | | | | | | conf-files: fix potential memleak in conf_files_list_strv_internal() on failureYu Watanabe2023-03-071-39/+31
| |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | This also changes the used hash_ops from path_hash_ops to string_hash_ops, as the key is not a path, but a filename.
* | | | | | Merge pull request #26669 from YHNdnzj/journalctl-lines-since-untilYu Watanabe2023-03-071-13/+42
|\ \ \ \ \ \ | | | | | | | | | | | | | | journalctl: fix output when --lines is used with --since or --until
| * | | | | | journalctl: fix output when --since is used with --linesMike Yuan2023-03-051-11/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, if --since is used with --lines=N, we seek to the place of --since and search afterwards there, resulting in outputing the first N lines. After this commit, we only do the above if --since is used without --reverse and --lines. Otherwise we seek to the tail first and check if the entry is within the range of --since later.
| * | | | | | journalctl: fix output when --until is used with --linesMike Yuan2023-03-051-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, when --lines is specified, we jump to the tail and search afterwards from there, thus breaking --until if used together. After this commit: If both --until and any of --reverse and --lines is specified, things get a little tricky. We seek to the place of --until first. If only --reverse or --reverse and --lines is specified, we search backwards and let the output counter handle --lines for us. If only --lines is used, we just jump backwards arg_lines and search afterwards from there.
* | | | | | | udev: Don't mark as tablet if device has relative coordinatesJoshua Goins2023-03-071-1/+1
| |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tablets don't typically have relative coordinates (they are separated on the kernel device layer). However, some Logitech mice report similar supported events, so use the existence of EV_REL to determiner whether or not the device is really a tablet. Fixes bug introduced by 0855ce67726f87a5a67b4fb536d58e0e4428a248. Fixes: #26600