Page MenuHomeFreeBSD

boot: Check current loader file before overwriting
Changes PlannedPublic

Authored by jlduran_gmail.com on Sep 14 2024, 10:09 PM.
Tags
None
Referenced Files
F100617948: D46677.id143352.diff
Thu, Oct 17, 11:29 AM
Unknown Object (File)
Wed, Oct 2, 11:50 PM
Unknown Object (File)
Thu, Sep 26, 8:43 PM
Unknown Object (File)
Mon, Sep 23, 11:08 PM
Unknown Object (File)
Wed, Sep 18, 6:59 PM
Unknown Object (File)
Sep 18 2024, 9:50 AM
Unknown Object (File)
Sep 17 2024, 8:52 PM
Unknown Object (File)
Sep 15 2024, 8:21 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_gmail.com 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.