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
Unknown Object (File)
Fri, Jan 23, 6:25 PM
Unknown Object (File)
Sat, Jan 17, 4:40 PM
Unknown Object (File)
Wed, Jan 14, 9:23 AM
Unknown Object (File)
Tue, Jan 13, 5:44 PM
Unknown Object (File)
Jan 8 2026, 3:47 PM
Unknown Object (File)
Dec 27 2025, 1:36 AM
Unknown Object (File)
Nov 25 2025, 10:31 PM
Unknown Object (File)
Nov 23 2025, 6:33 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.