Since Linux v6.0 the vfat filesystem has support for renameat2(..., RENAME_EXCHANGE):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=da87e1725ae2
So bootupd could instead of applying the diff files one by one to the destination dir, it could create a temporary dir that is a copy of the existing ESP, apply the diff to that temp dir and finally do an atomic rename exchange of the two directories.
That way, the update mechanism will be safer since it would only require a single renameat2() system call.
Since Linux v6.0 the vfat filesystem has support for
renameat2(..., RENAME_EXCHANGE):https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=da87e1725ae2
So
bootupdcould instead of applying the diff files one by one to the destination dir, it could create a temporary dir that is a copy of the existing ESP, apply the diff to that temp dir and finally do an atomic rename exchange of the two directories.That way, the update mechanism will be safer since it would only require a single
renameat2()system call.