Skip to content

Commit f2686ea

Browse files
committed
preinstall_sb: restore using ignore action for VM
We relaxed in snapd 2.72 the preinstall check to allow installation in VMs. Now that we have the action API, an ignore action will be available to the rest of the system and users. Restore this. However, keep the current behaviour for nested tests as muinstaller does not support interactions to ignore errors.
1 parent 8360eee commit f2686ea

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

secboot/preinstall_sb.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232

3333
"github.com/snapcore/snapd/logger"
3434
"github.com/snapcore/snapd/osutil"
35+
"github.com/snapcore/snapd/snapdenv"
3536
"github.com/snapcore/snapd/systemd"
3637
)
3738

@@ -80,10 +81,9 @@ func PreinstallCheck(ctx context.Context, bootImagePaths []string) (*PreinstallC
8081
// - listed as Driver#### load options
8182
// - referenced in the DriverOrder UEFI variable
8283
// - loaded from PCI device option ROMs (e.g. network card PXE ROMs)
83-
//TODO:FDEM: remove once secboot provides an action to apply this configuration
8484
checkFlags := sb_preinstall.PermitAddonDrivers
85-
if systemd.IsVirtualMachine() {
86-
// when running in Virtual Machine, allow it
85+
// For nested tests: muinstaller does not support interactions to ignore errors.
86+
if systemd.IsVirtualMachine() && snapdenv.Testing() {
8787
checkFlags |= sb_preinstall.PermitVirtualMachine
8888
}
8989

0 commit comments

Comments
 (0)