Do not skip ESP mirroring for a bind-mounted /boot

This commit is contained in:
Pavel Isaev 2026-11-11 12:27:13 +03:00
parent ca77f6e3d6
commit b5215ca0a5

View file

@ -4,8 +4,10 @@ if [[ $1 == boot-sync ]]; then
[[ ${SERVICE_RESULT:-success} == success ]] || { echo 'OSTree finalization failed; ESP unchanged' >&2; exit 1; }
[[ -e /run/ostree-booted ]]
mountpoint -q /efi || { echo '/efi is not mounted; ESP unchanged' >&2; exit 1; }
# D-103: an XBOOTLDR /boot mount is written by OSTree directly; nothing to mirror.
mountpoint -q /boot && exit 0
# The two-partition layout bind-mounts /boot from the root filesystem, so a
# mountpoint alone must NOT skip mirroring. Skip only when /boot is a truly
# separate filesystem (XBOOTLDR) that OSTree writes directly.
if mountpoint -q /boot && [[ "$(stat -c %d /boot)" != "$(stat -c %d /)" ]]; then exit 0; fi
src=/sysroot/boot/ostree
dst=/efi/ostree
esrc=/sysroot/boot/loader/entries