Skip to content

Commit 736c148

Browse files
committed
fix: change the UEFI firmware search path order
Ensure that SecureBoot enabled images come before regular ones. With Ubuntu 24.04 `ovmf` package, due to the ordering of the search paths `talosctl` might pick up a wrong image and disable SecureBoot. Signed-off-by: Andrey Smirnov <[email protected]>
1 parent a727a1d commit 736c148

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

Diff for: internal/app/machined/internal/server/v1alpha1/v1alpha1_server.go

+4
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,10 @@ func getContainerInspector(ctx context.Context, namespace string, driver common.
12851285
func (s *Server) Read(in *machine.ReadRequest, srv machine.MachineService_ReadServer) (err error) {
12861286
stat, err := os.Stat(in.Path)
12871287
if err != nil {
1288+
if os.IsNotExist(err) {
1289+
return status.Error(codes.NotFound, err.Error())
1290+
}
1291+
12881292
return err
12891293
}
12901294

Diff for: internal/integration/base/api.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,9 @@ func (apiSuite *APISuite) HashKubeletCert(ctx context.Context, node string) (str
448448

449449
_, err = io.Copy(hash, reader)
450450
if err != nil {
451-
return "", err
451+
if client.StatusCode(err) != codes.NotFound { // not found, swallow it
452+
return "", err
453+
}
452454
}
453455

454456
return hex.EncodeToString(hash.Sum(nil)), reader.Close()

Diff for: pkg/provision/providers/qemu/arch.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ func (arch Arch) PFlash(uefiEnabled bool, extraUEFISearchPaths []string) []PFlas
124124
"ovmf-x86_64-4m-vars.bin",
125125
}
126126

127-
uefiSourceFiles = append(uefiSourceFiles, uefiSourceFilesInsecure...)
128-
129127
// Append extra search paths
130128
uefiSourcePathPrefixes = append(uefiSourcePathPrefixes, extraUEFISearchPaths...)
131129

@@ -143,6 +141,12 @@ func (arch Arch) PFlash(uefiEnabled bool, extraUEFISearchPaths []string) []PFlas
143141
}
144142
}
145143

144+
for _, p := range uefiSourcePathPrefixes {
145+
for _, f := range uefiSourceFilesInsecure {
146+
uefiSourcePaths = append(uefiSourcePaths, filepath.Join(p, f))
147+
}
148+
}
149+
146150
return []PFlash{
147151
{
148152
Size: 0,

0 commit comments

Comments
 (0)