m/n/c/update: implement kexec-based activation
As we've had some issues with EFI-based slot activation and enterprise
server firmware is extremely slow, this implements kexec-based
activation. This just kexecs into the freshly-installed slot instead of
rebooting. It still updates the BootOrder on successful boot to allow
cold-boots if the server crashes or loses power, but no longer uses the
NextBoot mechanism to boot into the new slot once (this is taken care of
by kexec).
Change-Id: I6092c47d988634ba39fb6bdd7fd7ccd41ceb02ef
Reviewed-on: https://review.monogon.dev/c/monogon/+/2021
Reviewed-by: Serge Bazanski <serge@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/node/core/mgmt/mgmt.go b/metropolis/node/core/mgmt/mgmt.go
index a9f5973..0c7cb54 100644
--- a/metropolis/node/core/mgmt/mgmt.go
+++ b/metropolis/node/core/mgmt/mgmt.go
@@ -6,6 +6,7 @@
"context"
"fmt"
"net"
+ "sync"
"google.golang.org/grpc"
@@ -27,6 +28,8 @@
LogTree *logtree.LogTree
// Update service handle for performing updates via the API.
UpdateService *update.Service
+ // Serialized UpdateNode RPCs
+ updateMutex sync.Mutex
// Automatically populated on Run.
LogService