Commit Graph

19 Commits

Author SHA1 Message Date
Lennart Poettering
fd2a114061 bootctl: fix potential uninitialized memory access (#36329) 2025-02-10 15:34:38 +01:00
Lennart Poettering
37252381d2 bootctl,kernel-install: suffix some paths referring to dirs in log messages with / 2025-02-10 01:15:52 +01:00
Lennart Poettering
af5b961ad8 bootctl: minor reordering of fields in output
Let's move the currently used/default/oneshot entry output after the
basic info about the boot loader itself, since conceptually these are
objects kinda "one level down" from the boot loader perspective. Hence,
let's *first* show all info about the boot loader itself before we
display the objects it manages.

This is just a trivial change in output, just swaps th elines for these
fields with the ones showing where the boot loader is installed.
2025-02-09 23:34:29 +01:00
Lennart Poettering
df418fa234 bootctl: suppress output of empty partition info if we also have no idea about EFI binary path
So far we'd output both the partition and the binary path always, even
if we didn't know either (but in that case show empty information).
Let's address this, and show partition info only if we know it, or if we
know the EFI binary path, but suppress both if we know neither.

Note that we'll show the partition info if we don't know it still if we
know the EFI binary path used for boot, since it is relative to the
partition of course, and hence it's really strange to know one but not
the other, hence it deserves some mentioning in the output.
2025-02-09 23:23:38 +01:00
Lennart Poettering
26bfd97216 bootctl: also shown whether stub loader partition data was passed
Let's make the stub and loader output sections more alike, and say in
both cases whether we recieved that data from the boot phase or not the
same way.
2025-02-09 23:21:14 +01:00
Lennart Poettering
df28afe9b2 bootctl: fix potential uninitialized memory access
And while we are at it, let' get rid of have_xyz_partition_uuid
variables, to simplify things.
2025-02-09 23:19:46 +01:00
Lennart Poettering
f90efd2d13 bootctl: improve output regarding random seed if we cannot access ESP 2025-02-09 09:14:21 +01:00
Lennart Poettering
7249651bff bootctl: move print block device path calls to command section of its own 2025-01-28 16:25:15 +00:00
Yu Watanabe
c1bfee0bdb bootctl: use hash ops with destructor
This also makes the hashmap allocated when necessary.
2025-01-23 18:19:28 +09:00
Yu Watanabe
901bfcd8c1 tree-wide: rely on sd_varlink_dispatch() for validating zero-argument method calls, too
Follow-ups for a7cc7038ac.
2025-01-20 00:21:31 +09:00
Lennart Poettering
d66894a7a5 ask-password-api: add new "hup_fd" field to AskPasswordReq
This new field allows specification of an fd on which the password
prompt logic will look for POLLHUP events for, and if seen will abort
the query.

The usecase for this is that when we query for a pw on behalf of a
Varlink client we can abort the query automatically if the client dies.
2025-01-02 16:38:44 +01:00
Lennart Poettering
c4a02a526d ask-password-api: move timeout into AskPasswordRequest structure too 2025-01-02 16:38:25 +01:00
Lennart Poettering
72068d9d25 ask-password-api: move tty_fd into AskPasswordRequest structure, too 2025-01-02 16:38:12 +01:00
Zbigniew Jędrzejewski-Szmek
fd409ff0e0 various: set info on varlink server object
The values that were previously hardcoded in sd-varlink.c are now defined
in new varlink_set_info_systemd() and that function is called everywhere
where we create a server.
2024-12-10 10:51:56 +01:00
Adrian Vovk
f2751d757f bootspec: Look at /loader/addons in XBOOTLDR
The bootspec util-lib's handling of global addons didn't previously
match the behavior of sd-stub, and this commit corrects that.

First, bootspec didn't load global addons from the XBOOTLDR dir, but the
stub does. So, bootspec now enumerates addons in XBOOTLDR, not just ESP

Second, the stub only loads resources (including addons) from the
partition that it was found on. Thus, we must keep track of which
partition the global addons come from, and which partition each boot
entry comes from. In other words: global addons found on the ESP will
NOT apply to UKIs found in XBOOTLDR, and bootspec now reflects that.
2024-11-26 22:25:29 -05:00
Daan De Meyer
f2ac4458f0 bootctl: Only create loader/keys/auto if required
systemd-boot uses the existance of loader/keys/auto to determine
whether to auto-enroll secure boot or not so only create the directory
if we're actually going to put auto-enroll signature lists in it.
2024-11-15 18:36:53 +00:00
Daan De Meyer
a1d46e3078 tree-wide: Introduce --certificate-source= option
This allows loading the X.509 certificate from an OpenSSL provider
instead of a file system path. This allows loading certficates directly
from hardware tokens instead of having to export them to a file on
disk first.
2024-11-07 20:30:47 +01:00
Daan De Meyer
4047b99c00 bootctl: Validate private key path 2024-11-07 20:24:59 +01:00
Zbigniew Jędrzejewski-Szmek
0b676aab33 Move bootctl to its own source subdirectory
It's been split into a bunch of files and deserves its own subdirectory
similarly to systemctl.
2024-11-07 14:15:00 +01:00