summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #25558 from poettering/fdisk-id128Lennart Poettering2022-11-294-36/+46
|\ | | | | add generic uuid/id128 helpers for libfdisk too
| * fdisk-util: add fdisk_partition_get_type_as_id128() helperLennart Poettering2022-11-294-24/+25
| | | | | | | | Let's also add an easy accessor for the other per-partition UUID.
| * fdisk-util: add fdisk_partition_get_uuid_as_id128() helperLennart Poettering2022-11-294-14/+23
| | | | | | | | Inspired by: #25534
* | blkid: add helpers that get gpt partition uuid as sd_id128_tLennart Poettering2022-11-295-53/+68
| | | | | | | | just some refactoring to make things simpler.
* | Merge pull request #25385 from drvink/mainLennart Poettering2022-11-295-3/+33
|\ \ | |/ |/| systemd: Support OOMPolicy in scope units
| * systemd: Default to OOMPolicy=continue for login session scopesMark Laws2022-11-241-0/+6
| | | | | | | | | | If the kernel OOM kills a process under a login session scope, we don't want to kill the user's other processes for no good reason.
| * systemd: Support OOMPolicy in scope unitsMark Laws2022-11-244-3/+27
| | | | | | | | Closes #25376.
* | kernel-install: Add uki layoutJoerg Behrmann2022-11-292-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the kernel-install man page only documents the bls layout for use with the boot loader spec type #1. 90-loaderentry.install uses this layout to generate loader entries and copy the kernel image and initrd to $BOOT. This commit documents a second layout "uki" and adds 90-uki-copy.install, which copies a UKI "uki.efi" from the staging area or any file with the .efi extension given on the command line to $BOOT/EFI/Linux/$ENTRY_TOKEN-$KERNEl_VERSION(+$TRIES).efi This allows for both locally generated and distro-provided UKIs to be handled by kernel-install.
* | Merge pull request #25132 from ↵Daan De Meyer2022-11-292-15/+44
|\ \ | | | | | | | | | | | | yuwata/core-device-inactivate-removed-device-on-switching-root core/device: inactivate removed device on switching root
| * | core/device: verify device syspath on switching rootYu Watanabe2022-10-271-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise, if a device is removed while switching root, then the corresponding .device unit will never go to inactive state. This replaces the code dropped by cf1ac0cfe44997747b0f857a1d0b67cea1298272. Fixes #25106.
| * | core/device: also serialize/deserialize device syspathYu Watanabe2022-10-262-2/+13
| | | | | | | | | | | | The field will be used in later commits.
| * | core/device: update commentYu Watanabe2022-10-261-13/+18
| | |
* | | Merge pull request #25536 from yuwata/sd-netlink-several-fixesYu Watanabe2022-11-294-194/+231
|\ \ \ | | | | | | | | sd-netlink: several fixes
| * | | sd-netlink: append instead of prepend multipart messageYu Watanabe2022-11-261-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, e.g., networkd enumerated network interfaces with ifindex in a decreasing order, as sd-netlink inverses the order of the received multipart messages. Let's keep the order of the multipart messages. Hopefully this changes no behavior, as our code do not depend on the order of the received multipart messages. Before: === Nov 26 09:35:10 systemd[1]: Starting Network Configuration... Nov 26 09:35:11 systemd-networkd[36185]: wlp59s0: Saved new link: ifindex=3, iftype=ETHER(1), kind=n/a Nov 26 09:35:12 systemd-networkd[36185]: enp0s31f6: Saved new link: ifindex=2, iftype=ETHER(1), kind=n/a Nov 26 09:35:12 systemd-networkd[36185]: lo: Saved new link: ifindex=1, iftype=LOOPBACK(772), kind=n/a After: === Nov 26 09:45:18 systemd[1]: Starting Network Configuration... Nov 26 09:45:19 systemd-networkd[38372]: lo: Saved new link: ifindex=1, iftype=LOOPBACK(772), kind=n/a Nov 26 09:45:19 systemd-networkd[38372]: enp0s31f6: Saved new link: ifindex=2, iftype=ETHER(1), kind=n/a Nov 26 09:45:19 systemd-networkd[38372]: wlp59s0: Saved new link: ifindex=3, iftype=ETHER(1), kind=n/a
| * | | sd-netlink: do not link non-multipart messagesYu Watanabe2022-11-261-33/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if a single packet contains multiple non-multipart messages, then the messages were linked and saved as a single entry, especially even if the messages has different serial numbers. Though, not sure if the kernel sends such packet. But at least for safety, let's link only multipart messages.
| * | | sd-netlink: split out parse_message_one() from socket_read_message()Yu Watanabe2022-11-261-39/+60
| | | | | | | | | | | | | | | | | | | | No functional change, just refactoring and preparation for later commits.
| * | | sd-netlink: do not use serials currently queuedYu Watanabe2022-11-261-1/+10
| | | |
| * | | sd-netlink: also manage received messages by serialYu Watanabe2022-11-263-13/+41
| | | | | | | | | | | | | | | | | | | | Then, we can easily find the received message matching with requested serial.
| * | | sd-netlink: reimplement received message queueYu Watanabe2022-11-263-68/+46
| | | | | | | | | | | | | | | | | | | | By using OrderedSet and Hashmap, we can drop all memmove() calls. No functional changes, just refactoring.
| * | | sd-netlink: introduce netlink_queue_received_message() and friendYu Watanabe2022-11-263-44/+41
| | | | | | | | | | | | | | | | No functional change, just refactoring.
| * | | sd-netlink: fix segfaultYu Watanabe2022-11-261-1/+2
| | | |
| * | | sd-netlink: fix possible use-after-freeYu Watanabe2022-11-261-27/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When we receive a multi-part message and fail to parse it, then the prviously received message is freed with the _cleanup_ attribute, but still referenced by sd_netlink.rqueue_partial. That causes use-after-free when we receive another multi-part message.
| * | | sd-netlink: return earlier when received invalid messageYu Watanabe2022-11-261-2/+7
| | | |
| * | | sd-netlink: allocate read buffer when necessaryYu Watanabe2022-11-262-5/+0
| | | |
| * | | sd-netlink: check received size in socket_recv_message()Yu Watanabe2022-11-261-14/+10
| | | | | | | | | | | | | | | | | | | | No functional change, just refactoring and slightly shorten socket_read_message().
| * | | sd-netlink: drop redundant 'else'Yu Watanabe2022-11-261-4/+2
| | | |
| * | | sd-netlink: always initialize return variable on successYu Watanabe2022-11-261-2/+7
| | | |
* | | | Merge pull request #25552 from yuwata/network-ndisc-trivial-fixesYu Watanabe2022-11-291-2/+1
|\ \ \ \ | | | | | | | | | | network: NDisc: trivial fixes
| * | | | network: drop invalid and unused flagYu Watanabe2022-11-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Route.flags can only take RTNH_F_ONLINK, and other flags are silently dropped.
| * | | | network: fix indentationYu Watanabe2022-11-291-1/+1
| | | | |
* | | | | Merge pull request #25532 from Werkov/fix-cgtop-argsLuca Boccassi2022-11-281-6/+10
|\ \ \ \ \ | |/ / / / |/| | | | cgtop: Do not rewrite -P or -k options
| * | | | cgtop: Do not rewrite -P or -k optionsMichal Koutný2022-11-281-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --recursive=no will overwrite possible -P or -k option hence making the recursive disabling impossible. Check what counting types the system supports (encoded in the ordering of our enum) of and pick whatever user requests but is also supported. Fixes: #25248
* | | | | Merge pull request #25496 from DaanDeMeyer/repart-optimizeLuca Boccassi2022-11-281-95/+127
|\ \ \ \ \ | | | | | | | | | | | | repart: Prefer using loop devices to populate filesystems when available
| * | | | | repart: Prefer using loop devices to populate filesystems when availableDaan De Meyer2022-11-281-82/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's make sure we use loop devices if we have access to them and only fall back to regular files if we can't use loop devices. We prefer loop devices because when using mkfs --root options, we have to populate a temporary staging tree which means we're copying every file twice instead of once when using loop devices.
| * | | | | repart: Make sure all files in the image are owned by rootDaan De Meyer2022-11-281-9/+17
| | | | | |
| * | | | | repart: Move commentDaan De Meyer2022-11-281-4/+4
| | | | | |
* | | | | | Merge pull request #25222 from medhefgo/stub-cmdlineLuca Boccassi2022-11-2813-204/+261
|\ \ \ \ \ \ | |/ / / / / |/| | | | | stub: Fix cmdline handling
| * | | | | stub: Detect empty LoadOptions when run from EFI shellJan Janssen2022-11-272-11/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EFI shell will pass the entire command line to the application it starts, which includes the file path of the stub binary. This prevents us from using the built-in cmdline if the command line is otherwise empty. Fortunately, the EFI shell registers a protocol on any images it starts this way. The protocol even lets us access the args individually, making it easy to strip the stub path off. Fixes: #25201
| * | | | | stub: Fix cmdline handlingJan Janssen2022-11-227-46/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes some bugs that could lead to garbage getting appended to the command line passed to the kernel: 1. The .cmdline section is not guaranteed to be NUL-terminated, but it was used as if it was. 2. The conversion of the command line to ASCII that was passed to the stub ate the NUL at the end. 3. LoadOptions is not guaranteed to be a NUL-terminated EFI string (it really should be and generally always is, though). This also fixes the inconsistent mangling of the command line. If the .cmdline section was used ASCII controls chars (new lines in particular) would not be converted to spaces. As part of this commit, we optimize conversion for the generic code instead of the (deprecated) EFI handover protocol. Previously we would convert to ASCII/UTF-8 and then back to EFI string for the (now) default generic code path. Instead we now convert to EFI string and mangle that back to ASCII in the EFI handover protocol path.
| * | | | | boot: Use xstr8_to_16 for path conversionJan Janssen2022-11-224-108/+24
| | | | | |
| * | | | | boot: Use xstr8_to_16Jan Janssen2022-11-225-48/+17
| | | | | |
| * | | | | boot: Add xstrn8_to_16Jan Janssen2022-11-223-1/+109
| | | | | |
* | | | | | systemctl: deprecate passing positional argument to reboot completelyMike Yuan2022-11-272-14/+3
| |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (follow-up of #15958) In #15958 we deprecated passing positional argument to reboot by generate a warning. It's been two years now and I believe it can be dropped completely, as per requested in #15773.
* | | | | fdisk: introduce common fdisk_new_context_fd() helperLennart Poettering2022-11-265-40/+60
| | | | | | | | | | | | | | | | | | | | | | | | | We do the same thing over and over again and it's a bit ugly, hence let's unify the code for it at one common place.
* | | | | dissect: don't pre-open swap devices, we are not going to use themLennart Poettering2022-11-261-1/+2
| | | | |
* | | | | repart: Remove bogus checkDaan De Meyer2022-11-261-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --empty option applies to the partition table of the block device, not the number of definition files we've read. Also, even if we don't find any definition files, let's not shortcut execution so we can run repart on a device/loopback file to get information on the partition table.
* | | | | logind: Properly unescape names of lingering usersMichal Koutný2022-11-261-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Filenames to store user linger requests are created with C-escaping. When we enumerate the files to acquire ligering users, we use the filenames verbatim. In the case C-escaping is not an identity map (such as "DOMAIN\User"), we won't be able to start user instances of such mangled users. Unescape filenames when we treat them as usernames again. Fixes: #25448
* | | | | Merge pull request #25530 from poettering/resolved-stub-nameYu Watanabe2022-11-267-42/+145
|\ \ \ \ \ | | | | | | | | | | | | resolved: make _localdnsstub and _localdnsproxy resolve to 127.0.0.{53,54}
| * | | | | resolved: introduce common macro for 127.0.0.2 IP addressLennart Poettering2022-11-253-3/+7
| | | | | |
| * | | | | resolved: introduce the _localdnsstub and _localdnsproxy special hostnames ↵Lennart Poettering2022-11-254-7/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for 127.0.0.54 + 127.0.0.53 Let's give these special IP addresses names. After all name resolution is our job here. Fixes: #23623