| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
/run/systemd/mount-rootfs/ too
Let's use the same common directory as the unit logic uses.
This means we have less to clean up, and opens the door to eventually
allow unprivileged operation of the
mount_image_privately_interactively() logic.
|
|
|
|
| |
Without this, build would fail if the stub is not available in /usr/lib/.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were using the wrong memory type when allocating pool memory. This
does not seem to cause a problem on x86, but the kernel will fail to
boot at least on ARM in QEMU.
This is caused by mixing different allocation types which ended up
breaking the kernel or EDK2 during boot services exit. Commit
2f3c3b0bee5534f2338439f04b0aa517479f8b76 appears to fix this boot
failure because it was replacing the gnu-efi xpool_print with xasprintf
thereby unifying the allocation type.
But this same issue can also happen without this fix somehow when the
random-seed logic is in use.
Fixes: #27371
|
|
|
|
|
|
|
| |
Old kernels can fail to boot when they are located above the 4G
boundary even if they claim to support it.
Fixes: #27472
|
| |
|
|\
| |
| | |
Rework serialization of command lines in pid1 and make run not expand variables
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
__builtin_popcount() is a bit of a mouthful, so let's provide a helper.
Using _Generic has the advantage that if a type other then the ones on
the list is given, compilation will fail. This is nice, because if by any
change we pass a wider type, it is rejected immediately instead of being
truncated.
log.h is also needed. It is included transitively, but let's include it
directly.
macro.h is *not* needed.
|
| | |
|
|\ \
| | |
| | | |
boot: Improve timer frequency detection
|
| | |
| | |
| | |
| | |
| | | |
Aside from being more accurate on CPUs that report the information this
is also orders of magnitude faster than sleeping for 1ms.
|
| | |
| | |
| | |
| | | |
This is in preparation for the next commit.
|
| | | |
|
|/ /
| |
| |
| | |
Addresses https://github.com/systemd/systemd/pull/27254#discussion_r1165267046.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Addresses
https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1060130312,
https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1067927293, and
https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1067926416.
Follow-up for 84be0c710d9d562f6d2cf986cc2a8ff4c98a138b.
|
|\ \
| | |
| | | |
boot-entry: introduce _at() variant
|
| | |
| | |
| | |
| | |
| | | |
Preparation for later commits. The parameter will be used in
kernel-install later.
|
|\ \ \
| |/ /
|/| | |
dissect: add dissection policies
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
|
|/ /
| |
| |
| |
| | |
When --graceful is specified, let's gracefully deal with a missing
bootloader directory.
|
|/
|
|
|
| |
parse_boolean_argument() returns the same information via both the output
argument and normal return.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
get_file_version() would return:
- various negative errors if the file could not be accessed or if it was not a
regular file
- 0/NULL if the file was too small
- -ESRCH or -EINVAL if the file did not contain the marker
- -ENOMEM or permissions errors
- 1 if the marker was found
bootctl status iterates over /EFI/{systemd,BOOT}/*.efi and checks if the files
contain a systemd-boot version tag. Resource or permission errors should be
fatal, but lack of version information should be silently ignored.
OTOH, when updating or installing bootloader files, the version is expected
to be present.
get_file_version() is changed to return -ESRCH if the version is unavailable,
and other errnos for permission or resource errors.
The logging is reworked to always display an error if encountered, but also
to log the status at debug level what the result of the version inquiry is.
This makes it figure out what is going on:
/efi/EFI/systemd/systemd-bootx64.efi: EFI binary LoaderInfo marker: "systemd-boot 253-6.fc38"
/efi/EFI/BOOT/BOOTfbx64.efi: EFI binary has no LoaderInfo marker.
/efi/EFI/BOOT/BOOTIA32.EFI: EFI binary has no LoaderInfo marker.
/efi/EFI/BOOT/BOOTX64.EFI: EFI binary LoaderInfo marker: "systemd-boot 253-6.fc38"
Replaces #27034.
Fixes https://github.com/NixOS/nixpkgs/issues/223579.
|
|
|
|
|
|
|
|
|
|
| |
No functional change, just preparation for later commits.
These can be used in kernel-install later.
Note, unlike the our usual coding style, the arguments for
boot_entry_token_ensure() and parse_boot_entry_token_type() are
referenced, updated, and may freed, hence, always pass initialized
values. That's why they are not named as 'ret_xyz'.
|
| |
|
|
|
|
|
|
|
|
|
| |
Chasing symlinks is a core function that's used in a lot of places
so it deservers a less verbose names so let's rename it to chase()
and chaseat().
We also slightly change the pattern used for the chaseat() helpers
so we get chase_and_openat() and similar.
|
|
|
|
|
|
|
| |
Suppress errors when creating/writing EFI variables during 'bootctl update' if
'--graceful' mode is active (as the documentation indicates).
Closes #26773.
|
|
|
|
| |
As the file contains functions not only for UKI.
|
|
|
|
|
| |
The name KernelType is slightly ambiguous. The type is about kernel
image. Let's rename the enum to clarify that.
|
| |
|
|\
| |
| | |
boot: Add support for stack protector/trapping math/ubsan
|
| |
| |
| |
| | |
Sadly, no stack traces, but this is better than nothing.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Then, now verb_kernel_identify() and verb_kernel_inspect() can share
most of the code.
|
| |
| |
| |
| | |
No functional change, just prepration for later commits.
|
| |
| |
| |
| | |
No functional change, just refactoring.
|
| | |
|
|/
|
|
| |
No functional change, just for making beautify later diffs.
|
|\
| |
| | |
Allow creating files and directories with chase_symlinks_open() and further improvements
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
| |
Now that we always create PE images with a non-zero image base we cannot
run into this issue anymore. Any tool that still uses the old hard-coded
section offsets will end up creating bad images with sections below the
image base. objcopy will warn about this and any PE loader will simply
refuse to load such an image. Meanwhile updated tools do not use
hard-coded offsets anymore.
|
|
|
|
|
|
|
|
|
|
| |
Fixes the following build error:
```
../src/boot/efi/vmm.c: In function ‘get_smbios_table’:
../src/boot/efi/vmm.c:217:24: error: incompatible types when returning type ‘_Bool’ but ‘const SmbiosHeader *’ was expected
217 | return false;
| ^~~~~
```
|
|\
| |
| | |
boot: Drop gnu-efi / Add elf2efi.py
|
| |
| |
| |
| | |
This also moves them so that fuzz builds do not need pyelftools around.
|
| | |
|