A method comprising: during a first boot phase of a boot procedure in a system, determining (202; 302) whether an updated first boot phase code is present, wherein determining whether the updated first boot phase code is present comprises determining whether an updated boot block code is present, the updated first boot phase code for updating a current version of a first boot phase code stored in a first memory region, the current version of the first boot phase code executing during the first boot phase, wherein the first boot phase code is a pre-extensible firmware interface, pre-EFI, initialization, PEI, code, a second memory region storing a second boot phase code which is a driver execution environment, DXE, phase code; in response to determining that the updated first boot phase code is present, validating (204; 308) the updated first boot phase code; in response to the validating indicating that the updated first boot phase code is valid, validating an updated second boot phase code; in case the validating of the updated second boot phase code indicates that the updated second boot phase code is valid, maintaining (212; 315) the first memory region unlocked while locking the second memory region; updating (214; 318) the current version of the first boot phase code in the unlocked first memory region using the updated first boot phase code; after the updating, locking (208, 322) the first memory region; after locking the first memory region, causing unlocking of the second memory region; updating the second boot phase code in the unlocked second memory region using the updated second boot phase code; and after updating the second boot phase code, locking the second memory region. during a first boot phase of a boot procedure in a system, determining (202; 302) whether an updated first boot phase code is present, wherein determining whether the updated first boot phase code is present comprises determining whether an updated boot block code is present, the updated first boot phase code for updating a current version of a first boot phase code stored in a first memory region, the current version of the first boot phase code executing during the first boot phase, wherein the first boot phase code is a pre-extensible firmware interface, pre-EFI, initialization, PEI, code, a second memory region storing a second boot phase code which is a driver execution environment, DXE, phase code; in response to determining that the updated first boot phase code is present, validating (204; 308) the updated first boot phase code; in response to the validating indicating that the updated first boot phase code is valid, validating an updated second boot phase code; in case the validating of the updated second boot phase code indicates that the updated second boot phase code is valid, maintaining (212; 315) the first memory region unlocked while locking the second memory region; updating (214; 318) the current version of the first boot phase code in the unlocked first memory region using the updated first boot phase code; after the updating, locking (208, 322) the first memory region; after locking the first memory region, causing unlocking of the second memory region; updating the second boot phase code in the unlocked second memory region using the updated second boot phase code; and after updating the second boot phase code, locking the second memory region.