From 2aba4168f86eea6f15b1ed40e7aa8dcda7875c7d Mon Sep 17 00:00:00 2001 From: William Douglas Date: Thu, 3 May 2018 23:18:25 +0000 Subject: [PATCH] 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. --- src/bootman/update.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bootman/update.c b/src/bootman/update.c index 64ada63..6c300cc 100644 --- a/src/bootman/update.c +++ b/src/bootman/update.c @@ -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;