From: Yu Watanabe Date: Wed, 21 Jan 2026 12:39:46 +0000 (+0900) Subject: bootctl: do not use the EFI path as XBOOTLDR path X-Git-Tag: v260-rc1~7^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=07f147d544e53ddadf7b53ba48ea9700ad7e2a03;p=thirdparty%2Fsystemd.git bootctl: do not use the EFI path as XBOOTLDR path When running in a container, EFI and XBOOTLDR partition check is relaxed, hence /boot may be recognized as both EFI and XBOOTLDR partition. Before: ``` $ run0 systemd-nspawn -xD / --private-network --bind=/sys/firmware/efi/efivars --bind=/boot -E SYSTEMD_LOG_LEVEL=debug -- build/bootctl --variables=yes --no-pager -x Failed to check file system type of "/efi": No such file or directory Using EFI System Partition at /boot. Using XBOOTLDR partition at /boot as $BOOT. /boot ``` After: ``` $ run0 systemd-nspawn -xD / --private-network --bind=/sys/firmware/efi/efivars --bind=/boot -E SYSTEMD_LOG_LEVEL=debug -- build/bootctl --variables=yes -x Failed to check file system type of "/efi": No such file or directory Using EFI System Partition at /boot. Didn't find an XBOOTLDR partition, using the ESP as $BOOT. /boot ``` --- diff --git a/src/bootctl/bootctl.c b/src/bootctl/bootctl.c index b0c1fb29341..a74a131c247 100644 --- a/src/bootctl/bootctl.c +++ b/src/bootctl/bootctl.c @@ -145,8 +145,8 @@ int acquire_xbootldr( int r; r = find_xbootldr_and_warn(arg_root, arg_xbootldr_path, unprivileged_mode, &np, ret_uuid, ret_devid); - if (r == -ENOKEY) { - log_debug_errno(r, "Didn't find an XBOOTLDR partition, using the ESP as $BOOT."); + if (r == -ENOKEY || path_equal(np, arg_esp_path)) { + log_debug("Didn't find an XBOOTLDR partition, using the ESP as $BOOT."); arg_xbootldr_path = mfree(arg_xbootldr_path); if (ret_uuid)