Page MenuHomeFreeBSD

boot: Check current loader file before overwriting
Changes PlannedPublic

Authored by jlduran on Sep 14 2024, 10:09 PM.
Tags
None
Referenced Files
F136789376: D46677.id143353.diff
Wed, Nov 19, 1:45 PM
Unknown Object (File)
Wed, Oct 29, 2:13 PM
Unknown Object (File)
Oct 19 2025, 12:48 PM
Unknown Object (File)
Oct 19 2025, 12:47 PM
Unknown Object (File)
Oct 19 2025, 12:47 PM
Unknown Object (File)
Oct 18 2025, 10:16 PM
Unknown Object (File)
Oct 1 2025, 3:00 PM
Unknown Object (File)
Sep 11 2025, 10:25 AM
Subscribers

Details

Reviewers
imp
emaste
Summary

Check if the current bootloader file is the same as the new one before
replacing it. If it is, there is no point in doing so.

While here, make sure the copies retain all the attributes of the
original file.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This is not the right. Sorry.

My main goal is to achieve idempotence when running install-boot.sh on a running system.
There is an area of ​​the code that I don't understand/I'm afraid of, marked with XXX.

jlduran added inline comments.
tools/boot/install-boot.sh
115

I have made a few tests.
If the ESP is small enough to just fit an old boot1.efi, but not the loader.efi, we would remove the only boot loader. Whether such a scenario is realistic is another story.
I'll clean up.