@@ -24,6 +24,7 @@ import (
2424 "github.com/sirupsen/logrus"
2525
2626 "github.com/lima-vm/lima/v2/pkg/debugutil"
27+ "github.com/lima-vm/lima/v2/pkg/driver"
2728 "github.com/lima-vm/lima/v2/pkg/instance/hostname"
2829 "github.com/lima-vm/lima/v2/pkg/iso9660util"
2930 "github.com/lima-vm/lima/v2/pkg/limatype"
@@ -137,14 +138,19 @@ func templateArgs(ctx context.Context, bootScripts bool, instDir, name string, i
137138 Containerd : Containerd {System : * instConfig .Containerd .System , User : * instConfig .Containerd .User , Archive : archive },
138139 SlirpNICName : networks .SlirpNICName ,
139140
140- RosettaEnabled : * instConfig .Rosetta .Enabled ,
141- RosettaBinFmt : * instConfig .Rosetta .BinFmt ,
142- VMType : * instConfig .VMType ,
143- VSockPort : vsockPort ,
144- VirtioPort : virtioPort ,
145- Plain : * instConfig .Plain ,
146- TimeZone : * instConfig .TimeZone ,
147- Param : instConfig .Param ,
141+ VMType : * instConfig .VMType ,
142+ VSockPort : vsockPort ,
143+ VirtioPort : virtioPort ,
144+ Plain : * instConfig .Plain ,
145+ TimeZone : * instConfig .TimeZone ,
146+ Param : instConfig .Param ,
147+ }
148+
149+ if instConfig .VMOpts .VZ .Rosetta .Enabled != nil {
150+ args .RosettaEnabled = * instConfig .VMOpts .VZ .Rosetta .Enabled
151+ }
152+ if instConfig .VMOpts .VZ .Rosetta .BinFmt != nil {
153+ args .RosettaEnabled = * instConfig .VMOpts .VZ .Rosetta .BinFmt
148154 }
149155
150156 firstUsernetIndex := limayaml .FirstUsernetIndex (instConfig )
@@ -357,7 +363,7 @@ func GenerateCloudConfig(ctx context.Context, instDir, name string, instConfig *
357363 return os .WriteFile (filepath .Join (instDir , filenames .CloudConfig ), config , 0o444 )
358364}
359365
360- func GenerateISO9660 (ctx context.Context , instDir , name string , instConfig * limatype.LimaYAML , udpDNSLocalPort , tcpDNSLocalPort int , guestAgentBinary , nerdctlArchive string , vsockPort int , virtioPort string ) error {
366+ func GenerateISO9660 (ctx context.Context , drv driver. Driver , instDir , name string , instConfig * limatype.LimaYAML , udpDNSLocalPort , tcpDNSLocalPort int , guestAgentBinary , nerdctlArchive string , vsockPort int , virtioPort string ) error {
361367 args , err := templateArgs (ctx , true , instDir , name , instConfig , udpDNSLocalPort , tcpDNSLocalPort , vsockPort , virtioPort )
362368 if err != nil {
363369 return err
@@ -372,6 +378,18 @@ func GenerateISO9660(ctx context.Context, instDir, name string, instConfig *lima
372378 return err
373379 }
374380
381+ driverScripts , err := drv .BootScripts ()
382+ if err != nil {
383+ return fmt .Errorf ("failed to get boot scripts: %w" , err )
384+ }
385+
386+ for filename , content := range driverScripts {
387+ layout = append (layout , iso9660util.Entry {
388+ Path : fmt .Sprintf ("boot/%s" , filename ),
389+ Reader : strings .NewReader (string (content )),
390+ })
391+ }
392+
375393 for i , f := range instConfig .Provision {
376394 switch f .Mode {
377395 case limatype .ProvisionModeSystem , limatype .ProvisionModeUser , limatype .ProvisionModeDependency :
0 commit comments