Skip to content

Commit cfbec9b

Browse files
committed
test: skip UEFI vars wipe if TPM is enabled
This should fix SecureBoot tests. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 1e31ded commit cfbec9b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pkg/provision/providers/qemu/launch.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,17 @@ func launchVM(config *LaunchConfig) error {
277277
return err
278278
}
279279

280-
if !diskBootable {
280+
if !diskBootable && config.TPMConfig.NodeName == "" {
281281
// When the guest disk has been wiped externally we will re-attach
282282
// boot media (ISO/USB/UKI/kernel) below - but UEFI keeps the
283283
// previous Talos install's Boot#### entries in the variable store
284284
// (flash1.img), and they point at the now-erased ESP. Without a
285285
// reset, UEFI tries those entries first, fails, and never falls
286286
// through to the freshly-attached boot media. Convention: pflash
287287
// index 1 is the variable store, index 0 is the firmware code.
288+
//
289+
// Skip wiping if TPM is enabled - vars contain SecureBoot state,
290+
// so we can't wipe them without losing SecureBoot state.
288291
if len(config.PFlashSpec) >= 2 && len(config.PFlashImages) >= 2 {
289292
if err := writePFlashImage(config.PFlashImages[1], config.PFlashSpec[1]); err != nil {
290293
return fmt.Errorf("reset UEFI variable store: %w", err)

0 commit comments

Comments
 (0)