]> git.ipfire.org Git - thirdparty/grub.git/commit
util/grub-install: Delay copying files to {grubdir,platdir} after install_device...
authorMate Kukri <mate.kukri@canonical.com>
Fri, 24 Nov 2023 08:32:57 +0000 (08:32 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 5 Dec 2023 14:32:30 +0000 (15:32 +0100)
commit3f9eace2d39d94103d8961ccf1b4d8fff10f132b
treea23ae0af48936a06ee099a7b3e83fdd87e5a732b
parente60015f574024584e43d1b3b245551e864aa8c4d
util/grub-install: Delay copying files to {grubdir,platdir} after install_device was validated

Previously grub-install copied modules to grubdir before doing any
validation on the install_device.

When grub-install was called with an invalid install_device, modules
were already copied to /boot before it found out and was forced to rely
on atexit() rollback.

This patch delays copying the modules after at least some install_device
validation was done, and thus reduces reliance on successful rollback.

Signed-off-by: Mate Kukri <mate.kukri@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-install.c