Commit Graph
61767 Commits
Author SHA1 Message Date
Jan Janssen f151abb0e5 Revert "boot: Use EFI_BOOT_MANAGER_POLICY_PROTOCOL to connect console devices"
This reverts commit b99bf58118.

It seems that using this protocol on some firmwares to forcibly
initialize console devices may break handles (already opened file
handles and the device handle itself) that we rely on to access the
boot filesystem, making it impossible to load the selected entry.

It might be possible to get a new handle by querying for the device
handle by using its device path after calling into this protocol, but
this is untested. The firmware might also be so buggy that accessing
devices after using this protocol is impossible.

It seems prudent to revert this for now until some reliable way is found
to initialize console devices without introducing huge boot delays. Any
users on firmware where console devices cannot be accessed would have to
rely on disabling fastboot.

Fixes: #25737, #25846
2023-01-03 17:12:33 +01:00
igo95862 8d41101a4a man: Fix systemd-boot man page wrong secure keys location
The keys should be placed at `/loader/keys/` not `/keys/`.

See `src/boot/efi/boot.c` file and
function `secure_boot_discover_keys`.
2023-01-03 10:16:40 +01:00
Lennart Poettering 4f06325ce9 fundamental: rework IN_SET() to require at least three arguments
If less than three parameters are passed a simple comparison is the
better choice.

Lo and behold this found two pretty bad typos.
2023-01-02 17:16:50 +01:00
Lennart Poettering efa75d7022 core: rework operation_to_signal() to rename return parameter ret_xyz 2023-01-02 16:34:42 +01:00
Daan De Meyer 35fdc097f4 Merge pull request #25912 from DaanDeMeyer/ukify
ukify fixes
2023-01-02 16:07:58 +01:00
Vito Caputo b22d392de6 manager: perform objective->shutdown_verb mapping locally
This is a small cleanup removing the need for the spurious
*ret_shutdown_verb argument on invoke_main_loop() while moving
the MANAGER_OBJECTIVE::shutdown_verb string mapping local to
where it actually gets added to the shutdown argv in
become_shutdown().

This also eliminates the need for the several clearings of
*ret_shutdown_argv, and the streq() branches of shutdown_verb in
favor of plain equality tests against the objective value.

Nothing functionally has been changed.
2023-01-02 16:00:22 +01:00
Jan Janssen 599c930e48 ukify: Fix section offset calculation
objcopy seems to expect that the offset passed to --change-section-vma
is absolute instead of relative to ImageBase. If this is not accounted
for an invalid image is created that cannot be loaded:

  0 .osrel        0000016b  0000000200016000  0000000200016000  00000400  2**2
  …
  6 .text         0000d242  0000000140001000  0000000140001000  00c6e800  2**4

This isn't an issue with gnu-efi based PE images, but natively created
ones will have a non-zero ImageBase.
2023-01-02 15:59:17 +01:00
Daan De Meyer 4f312ba07b ukify: Require specifying --tools for each tools directory
Instead of consuming N arguments as tools directories, let's always
only consume one argument per specification of --tools. This avoids
issues where the linux image and initrd are interpreted as tools
directories.
2023-01-02 14:53:47 +01:00
Daan De Meyer 737dab1a8d ukify: Handle directories in path_is_readable() 2023-01-02 14:52:49 +01:00
Gio 8d885b4477 Update 60-sensor.hwdb
Updated DBook D10 / Juno Tablet. Before the bvr (bios version) was hard coded to v1.05. This will read all versions
2023-01-01 16:36:15 +01:00
Ludwig Nussel d353fcceb5 machined: pass shell command line to polkit
Pass the joined arguments to polkit as command_line property like
pkexec does. Obviously not exactly perfect as it lacks quoting. Good
enough for polkit rules to check whether a program was called with
or without arguments though.
2022-12-29 13:29:25 +01:00
Luca Boccassi 7900968527 Merge pull request #25864 from yuwata/dissect-fix-mtree
dissect: fix mtree
2022-12-26 17:43:27 +01:00
Hannoskaj cb6f38b182 Prevents airplane mode toggle for HP Spectre 16 2022-12-26 21:08:24 +09:00
Jia Zhang 486cf22c35 boot: don't convert the trailing newline in mangle_stub_cmdline()
It is pretty convenient to add .cmdline using /proc/cmdline like
this:
  --add-section .cmdline=/proc/cmdline --change-section-vma .cmdline=0x25000

However, it always returns a trailing newline, and stub will
convert it to a whitespace by mangle_stub_cmdline() in next boot.
Thus the resulting /proc/cmdline would contain a trailing
whitespace. When /proc/cmdline is used to generate .cmdline again,
the resulting UKI is mangled.

To address this kind of inconvenience, mangle_stub_cmdline() should
skip converting the trailing newline, and try to chomp all the
trailing whitespaces.

Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
2022-12-26 19:12:23 +09:00
Yu Watanabe 01a33cf7e8 dissect: reduce indent in mtree_print_item() 2022-12-26 16:42:29 +09:00
Yu Watanabe 5ffa6a0af4 dissect: do not trigger assertion on error
recurse_dir() does not provide 'sx' on error.

Fixes #25862.
2022-12-26 16:42:29 +09:00
Yu Watanabe 167f2c1a2b dissect: use assert() when no side effect 2022-12-26 16:42:29 +09:00
Lennart Poettering 5c8e19cc1c Merge pull request #25850 from poettering/switch-root-tweaks-minor
pid1: minor tweaks to the SwitchRoot() logic
2022-12-24 11:20:02 +01:00
Yu Watanabe 20ada51464 Merge pull request #25828 from poettering/no-more-basename
convert a number of basename() invocations to path_extract_filename()
2022-12-24 08:13:00 +09:00
Lennart Poettering 8656f4a6ae prioq: make prioq_reshuffle() void
We never use the return value, and it's confusing and kinda pointless
what we return there.

Hence drop it.

Originally noticed by: tristone13th <tristone13th@outlook.com>

Alternative to: #25810
2022-12-23 23:26:26 +01:00
Lennart Poettering b892124bdc Merge pull request #25849 from poettering/repart-loop
pull in loop.ko from repart unit
2022-12-23 23:26:00 +01:00
Lennart Poettering 6ae5c39af1 docs: remove /dev/tty* confusion
The text said /dev/tty* as a whole was the VT subsystem and that VT is
not supported in containers.

But that's not accurate as /dev/tty* will match /dev/tty too and that
one device node is special and is not related to VT: it always points to
the current process own controlling tty, regardless what that is.

hence, rewrite /dev/tty* as /dev/tty[0-9]*.
2022-12-23 21:17:31 +01:00
Will Fancher 0941ccae3c sysroot: Order systemd-fsck-root after systemd-makefs 2022-12-23 18:34:09 +01:00
Lennart Poettering 457bbbce7b systemctl: rework how we detect if init is systemd 2022-12-23 18:29:35 +01:00
Lennart Poettering e10086ac01 core: use chase_symlinks_and_access() where appropriate 2022-12-23 18:09:02 +01:00
Lennart Poettering 5f4c9c27d8 core: tighten validation checks in SwitchRoot() dbus call 2022-12-23 18:09:02 +01:00
Lennart Poettering 937362e02c lock-file: various updates 2022-12-23 17:35:21 +01:00
Lennart Poettering 020b66d850 analyze: basename() → path_extract_filename() 2022-12-23 17:35:21 +01:00
Lennart Poettering d0242ac946 format-table: add field type TABLE_PATH_BASENAME
This is just like TABLE_PATH, but only shows the basename in regular
tabular output.

This is useful in systemd-repart for example
2022-12-23 17:35:21 +01:00
Lennart Poettering a67bacff34 tmpfiles: port basename() → path_extract_filename() 2022-12-23 17:35:21 +01:00
Lennart Poettering 1d8a8a7dee sysv-generator: port basename() → path_extract_filename() 2022-12-23 17:35:21 +01:00
Lennart Poettering 03469b770b shared: port various shared helpers basename() → path_extract_filename() 2022-12-23 17:35:21 +01:00
Lennart Poettering ce7dcfd6b0 units: pull in loop.ko and dm-mod.ko before repart
We want to make use of that when formatting file systems, hence let's
pull in these modules explicitly.

(This is necessary because we are an early boot service that might run
before systemd-tmpfiles-dev.service, which creates /dev/loop-control and
/dev/mapper/control.)

Alternatively we could just order ourselves after
systemd-tmpfiles-dev.service, but I think there's value in adding an
explicit minimal ordering here, since we know what we'll need.

Fixes: #25775
2022-12-23 17:26:57 +01:00
Lennart Poettering 143a1f1039 units: change modprobe@dm-mod.service → modprobe@dm_mod.service
Follow-up for 8f1359bf85
2022-12-23 17:26:48 +01:00
Lennart Poettering 7b2ffb593e repart/makefs: port over to path_extract_filename() 2022-12-23 15:04:19 +01:00
Lennart Poettering 7e763f9402 portable: port basename() → path_extract_filename() 2022-12-23 15:04:19 +01:00
Lennart Poettering b36e39d2eb nspawn: port over basename() → path_extract_filename() 2022-12-23 15:04:19 +01:00
Lennart Poettering 451f0dba60 mount-tool: port over basename() → path_extract_filename() 2022-12-23 15:04:19 +01:00
Lennart Poettering 72d95a18c1 journalctl: port COMM= matching to path_extract_filename() 2022-12-23 15:04:19 +01:00
Lennart Poettering 83802e9abd dissect: remove one more use of basename()
And while we are at it, make use of path_extract_filename() return value
that indicates whether the path was suffixed with a slash.
2022-12-23 15:04:19 +01:00
Lennart Poettering a99626c11a core: move some basename() use → path_extract_filename() 2022-12-23 15:04:19 +01:00
Lennart Poettering 0eb2f0a2fc tests: we don't actually use basename() anymore 2022-12-23 15:04:19 +01:00
Lennart Poettering c96c9fc78e homed: move away from basename() 2022-12-23 15:04:19 +01:00
Jia Zhang c2c38276cb measure: fix the failures of compare_reported_pcr_nr()
EFI_LOADER_VARIABLE() already applies to the stringify to construct the
path of EFI variable in efivars, so it is wrong to enclose the name of
EFI variable with the quotes. Otherwise, the following errors are
reported.

Reading EFI variable /sys/firmware/efi/efivars/StubFeatures-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f.
Reading EFI variable /sys/firmware/efi/efivars/"StubPcrKernelImage"-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f.
open("/sys/firmware/efi/efivars/"StubPcrKernelImage"-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f") failed: No such file or directory
Reading EFI variable /sys/firmware/efi/efivars/"StubPcrKernelParameters"-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f.
open("/sys/firmware/efi/efivars/"StubPcrKernelParameters"-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f") failed: No such file or directory
Reading EFI variable /sys/firmware/efi/efivars/"StubPcrInitRDSysExts"-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f.
open("/sys/firmware/efi/efivars/"StubPcrInitRDSysExts"-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f") failed: No such file or directory

Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
2022-12-23 14:41:33 +01:00
Yu Watanabe 2b22355075 Merge pull request #25823 from poettering/dissect-diskseq
gpt-auto: reference dissected partitions to mount via diskseq block device symlinks
2022-12-23 22:11:59 +09:00
Yu Watanabe 26c45a6c1d tree-wide: have_effective_cap() may return negative errno 2022-12-23 22:11:00 +09:00
Yu Watanabe d7301331e8 Merge pull request #25830 from yuwata/wait-online-unmanaged
wait-online: exit with success when all interfaces are ready or unmanaged
2022-12-23 22:10:38 +09:00
Lennart Poettering 71eaa9291d Merge pull request #25777 from PeterCxy/enroll-fido2
cryptenroll: Implement support for unlocking via FIDO2 tokens
2022-12-23 13:14:14 +01:00
Lennart Poettering 309bba96d6 update TODO 2022-12-23 12:44:57 +01:00
Lennart Poettering 8716a76ce2 gpt-auto-generator: enable referencing partitions via diskseq symlinks 2022-12-23 12:44:57 +01:00