Do freestanding initrd update before kernel update

To align with image mode update (and for the same reasons) move the
freestanding initrd update to before the kernel update. This prevents
creating an invalid kernel bootloader entry if there was a problem
with installing a freestanding initrd.
This commit is contained in:
William Douglas
2018-05-15 09:55:02 -07:00
committed by William Douglas
parent 3a8a7ee243
commit 2aba4168f8
+5 -5
View File
@@ -293,6 +293,11 @@ static bool boot_manager_update_native(BootManager *self)
LOG_SUCCESS("update_native: Bootloader updated");
if (!boot_manager_copy_initrd_freestanding(self)) {
LOG_ERROR("Failed to copying freestanding initrd");
return false;
}
/* This is mostly to allow a repair-situation */
if (running) {
/* Not necessarily fatal. */
@@ -304,11 +309,6 @@ static bool boot_manager_update_native(BootManager *self)
}
}
if (!boot_manager_copy_initrd_freestanding(self)) {
LOG_ERROR("Failed to copying freestanding initrd");
return false;
}
nc_hashmap_iter_init(mapped_kernels, &map_iter);
while (nc_hashmap_iter_next(&map_iter, (void **)&kernel_type, (void **)&typed_kernels)) {
Kernel *tip = NULL;