Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions internal/tools/uvmboot/lcow.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const (
shareFilesArgName = "share"
securityPolicyArgName = "security-policy"
securityHardwareFlag = "security-hardware"
noVerityBoot = "no-verity-boot"
securityPolicyEnforcerArgName = "security-policy-enforcer"
)

Expand Down Expand Up @@ -105,6 +106,10 @@ var lcowCommand = cli.Command{
Name: securityHardwareFlag,
Usage: "Use VMGS file to run on secure hardware. ('root-fs-type' must be set to 'none')",
},
cli.BoolFlag{
Name: noVerityBoot,
Usage: "Do not use verity boot. (IMPORTANT: can only be used together with --security-hardware flag)",
},
cli.StringFlag{
Name: execCommandLineArgName,
Usage: "Command to execute in the UVM.",
Expand Down Expand Up @@ -276,8 +281,16 @@ func createLCOWOptions(ctx context.Context, c *cli.Context, id string) (*uvm.Opt
}
if c.IsSet(securityHardwareFlag) {
options.GuestStateFilePath = vmutils.DefaultGuestStateFile
hclEnabled := false
options.HclEnabled = &hclEnabled
options.SecurityPolicyEnabled = true
options.BundleDirectory = os.TempDir()
options.AllowOvercommit = false

if !c.IsSet(noVerityBoot) {
options.DmVerityRootFsVhd = vmutils.DefaultDmVerityRootfsVhd
options.DmVerityMode = true
}
}

return options, nil
Expand Down
Loading