summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* boot: Fix alignment of long long inside structs on x86Jan Janssen2023-04-112-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | On x86 EFI follows the windows ABI, which expects 8-byte aligned long long. The x86 sysv ELF ABI expects them to be 8-byte aligned when used alone, but 4-byte aligned when they appear inside of structs: struct S { int i; long long ll; }; // _Static_assert(sizeof(struct S) == 12, "x86 sysv ABI"); _Static_assert(sizeof(struct S) == 16, "EFI/MS ABI"); To get the behavior we need when building with sysv ELF ABI we need to pass '-malign-double' to the compiler as done by EDK2. This in turn will make ubsan unhappy as the stack may not be properly aligned on entry, so we have to tell the compiler explicitly to re-align the stack on entry to efi_main. This fixes loading EFI drivers on x86 that were previously always rejected as the EFI_LOADED_IMAGE_PROTOCOL had a wrong memory layout. See also: https://github.com/rhboot/shim/pull/516
* Merge pull request #27186 from yuwata/os-releaseDaan De Meyer2023-04-113-158/+213
|\ | | | | os-util: several cleanups and introduce _at() variants of os-release parsers
| * os-util: introduce several _at() variants of os-release parsersYu Watanabe2023-04-112-14/+120
| |
| * os-util: make $SYSTEMD_OS_RELEASE prefixed with the root directoryYu Watanabe2023-04-111-1/+1
| | | | | | | | | | | | | | | | To make it consistent with other env vars, e.g. $SYSTEMD_ESP_PATH or $SYSTEMD_XBOOTLDR_PATH. This is useful when the root is specified by a file descriptor, instead of a path.
| * os-util: merge parse_{extension,os}_release()Yu Watanabe2023-04-112-28/+14
| |
| * os-util: invert order of arguments in extension release parserYu Watanabe2023-04-112-5/+5
| | | | | | | | | | | | | | For consistency with other functions. Unfortunately, va_start() requires that the previous argument is a pointer, hence the order of the arguments in the internal function cannot be changed.
| * os-util: shorten temporal variable namesYu Watanabe2023-04-111-40/+28
| | | | | | | | No functional change, just refactoring.
| * os-util: log one more error causeYu Watanabe2023-04-111-2/+3
| |
| * os-util: do not use 'r' for storing loop statusYu Watanabe2023-04-111-8/+6
| | | | | | | | | | | | | | The variable 'r' is usually used for storing return value of functional call. Let's introduce another boolean to store the current loop status. No functional change, just refactoring.
| * os-util: return earlier when unsupported image class is specifiedYu Watanabe2023-04-111-0/+3
| |
| * os-util: return earlier when extension release file is foundYu Watanabe2023-04-111-64/+65
| | | | | | | | No functional change, just refactoring.
| * os-util: split-out open_os_release() from open_extension_release()Yu Watanabe2023-04-112-92/+102
| | | | | | | | | | | | The logics of opening os-release and extension-release are completely different. No functional change, just refactoring.
| * os-util: fix fd leak on failureYu Watanabe2023-04-111-1/+2
| |
| * os-util: make open_extension_release() return O_PATH fdYu Watanabe2023-04-111-12/+2
| |
| * os-util: drop fopen_extension_release()Yu Watanabe2023-04-112-35/+6
| |
* | Merge pull request #27169 from yuwata/udev-rule-refuse-unsafe-pathZbigniew Jędrzejewski-Szmek2023-04-114-39/+68
|\ \ | |/ |/| sd-device,udev: refuse unsafe path in SYMLINK= and TAG=
| * sd-device: manage cached sysattr values with path_hash_opsYu Watanabe2023-04-081-1/+1
| | | | | | | | As here keys are relative paths to sysattrs.
| * sd-device,udev: tag must be a valid filenameYu Watanabe2023-04-083-6/+6
| | | | | | | | | | | | | | | | | | | | | | All tags are managed under /run/udev/tags, and the directories there are named with tags. Hence, each tag must be a valid filename. This also makes all validity check moved to sd-device side, and makes failure caused by setting invalid tags non-critical. With this change, an empty string cannot be assigned to TAG=, hence the test cases are adjusted.
| * sd-device,udev: refuse invalid devlink and store in normalized formYu Watanabe2023-04-083-18/+45
| | | | | | | | | | | | | | | | This is especially for the case that the path contains "..". Prompted by https://github.com/systemd/systemd/pull/27164#issuecomment-1498863858. This also makes SYMLINK= gracefully handle paths prefixed with "/dev/", and manage devlink paths with path_hash_ops.
| * udev-rules: replace ingrowing word extractor with extract_first_word()Yu Watanabe2023-04-081-13/+14
| | | | | | | | No functional change, just refactoring.
| * udev-rules: rename variable "filename" -> "path"Yu Watanabe2023-04-081-7/+7
| |
| * udev-rules: add/update commentsYu Watanabe2023-04-081-4/+5
| |
| * udev-rules: add missing parenYu Watanabe2023-04-081-1/+1
| |
* | compress: replace compress_blob() with compress_blob_explicit()Yu Watanabe2023-04-116-53/+39
| | | | | | | | | | | | | | And make compress_xyz() return 0 on success, as we know which compression algorithm is used when calling compress_blob(). Follow-up for 2360352ef02548723ac0c8eaf5ff6905eb9eeca5.
* | Merge pull request #27206 from yuwata/udev-renameDaan De Meyer2023-04-113-7/+9
|\ \ | | | | | | udev: rename arguments and options, update comments
| * | udev/scsi_id: rename positional argumentsYu Watanabe2023-04-112-5/+7
| | |
| * | device-nodes: rename argumentYu Watanabe2023-04-111-2/+2
| | |
* | | chase: drop redundant call of delete_trailing_chars()Yu Watanabe2023-04-111-8/+6
| | | | | | | | | | | | | | | | | | | | | In that branch, 'root' is a non-root and absolute path. Hence, delete_trailing_chars() does not make the path empty. And, if the path contains redundant slashes at the end, that will be dropped by path_simplify().
* | | Merge pull request #27207 from masatake/busctl--help-msgYu Watanabe2023-04-111-0/+1
|\ \ \ | | | | | | | | busctl: add --xml-interface to the help message
| * | | busctl: add --xml-interface to the help messageMasatake YAMATO2023-04-111-0/+1
| |/ / | | | | | | | | | Signed-off-by: Masatake YAMATO <yamato@redhat.com>
* | | Merge pull request #27201 from yuwata/o-path-supportYu Watanabe2023-04-113-4/+12
|\ \ \ | | | | | | | | Support O_PATH more
| * | | portable: always reopen fd of release fileYu Watanabe2023-04-111-3/+3
| | | | | | | | | | | | | | | | To make it support the case that the fd is O_PATH.
| * | | copy: make copy_bytes() support O_PATH fdsYu Watanabe2023-04-112-1/+9
| |/ /
* | | tree-wide: A few more uses of "unmet" for conditionsColin Walters2023-04-112-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a followup to 413e8650b71d4404a7453403797f93d73d88c466 > tree-wide: Use "unmet" for condition checks, not "failed" Since I noticed when running `systemctl status` on a recent systemd still seeing `Condition: start condition failed` To recap the original rationale here for "unmet" is that it's normal for some units to be conditional, so the term "failure" here is too strong.
* | | Merge pull request #27199 from yuwata/find-espYu Watanabe2023-04-114-10/+74
|\ \ \ | | | | | | | | path-util: introduce path_prefix_root_cwd(), and use it in find_esp() and friends
| * | | find-esp: use path_prefix_root_cwd()Yu Watanabe2023-04-111-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlikely, but even if find_esp() or friends called with unnormalized or relative 'root', let's make the result path normalized and absolute. Note, before 63105f33edad423691e2d53bf7071f99c83799ba, these functions returned an absolute and normalized path. But the commit made the result path simply concatenated with root. Follow-up for 63105f33edad423691e2d53bf7071f99c83799ba.
| * | | path-util: introduce path_prefix_root_cwd()Yu Watanabe2023-04-113-0/+68
| |/ /
* | | Merge pull request #27202 from yuwata/os-release-tiny-cleanupsYu Watanabe2023-04-113-31/+18
|\ \ \ | | | | | | | | os-util: tiny cleanups
| * | | os-util: drop redundant declaration of load_os_release_pairs()Yu Watanabe2023-04-112-16/+3
| | | |
| * | | os-util: use _IMAGE_CLASS_INVALIDYu Watanabe2023-04-112-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | When extension is not specified, image class is not necessary to be specified. Let's use _IMAGE_CLASS_INVALID as an indicator that no extension is specified.
| * | | os-util: move declaration of string table lookup for image classYu Watanabe2023-04-113-9/+11
| |/ /
* | | env-file: introduce parse_env_file_fdv()Yu Watanabe2023-04-112-6/+19
|/ /
* | Merge pull request #27184 from yuwata/xfopenat-fullDaan De Meyer2023-04-102-96/+126
|\ \ | | | | | | fileio: introduce xfopenat_full()
| * | fileio: introduce xfopenat_full()Yu Watanabe2023-04-082-70/+109
| | | | | | | | | | | | | | | This unifies call of various xfopenat() variants. No functional change, just refactoring.
| * | fileio: use take_fdopen() and friendsYu Watanabe2023-04-081-29/+20
| | |
* | | Merge pull request #27193 from yuwata/analyze-blameMike Yuan2023-04-105-25/+36
|\ \ \ | | | | | | | | analyze: make 'blame' work even the default target not reached
| * | | analyze: make blame command work even the default target not reachedYu Watanabe2023-04-105-25/+36
| | | |
* | | | fd-util: slightly optimize dir_fd_is_root()Yu Watanabe2023-04-101-8/+12
| | | | | | | | | | | | | | | | | | | | When STATX_MNT_ID is not supported, we need to manually obtain mount id. Let's compare inodes earlier.
* | | | chase: use dir_fd_is_root() to check if fd points to the root directoryYu Watanabe2023-04-101-3/+9
| | | | | | | | | | | | | | | | | | | | As commented in dir_fd_is_root(), comparing inode is not enough to determine if we are at the root directory.
* | | | chase: use stat_inode_same() at one more placeYu Watanabe2023-04-101-1/+1
| | | |