@@ -24,6 +24,7 @@ import (
24
24
"github.com/sirupsen/logrus"
25
25
26
26
"github.com/lima-vm/lima/v2/pkg/debugutil"
27
+ "github.com/lima-vm/lima/v2/pkg/driver"
27
28
"github.com/lima-vm/lima/v2/pkg/instance/hostname"
28
29
"github.com/lima-vm/lima/v2/pkg/iso9660util"
29
30
"github.com/lima-vm/lima/v2/pkg/limatype"
@@ -137,14 +138,19 @@ func templateArgs(ctx context.Context, bootScripts bool, instDir, name string, i
137
138
Containerd : Containerd {System : * instConfig .Containerd .System , User : * instConfig .Containerd .User , Archive : archive },
138
139
SlirpNICName : networks .SlirpNICName ,
139
140
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
148
154
}
149
155
150
156
firstUsernetIndex := limayaml .FirstUsernetIndex (instConfig )
@@ -357,7 +363,7 @@ func GenerateCloudConfig(ctx context.Context, instDir, name string, instConfig *
357
363
return os .WriteFile (filepath .Join (instDir , filenames .CloudConfig ), config , 0o444 )
358
364
}
359
365
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 {
361
367
args , err := templateArgs (ctx , true , instDir , name , instConfig , udpDNSLocalPort , tcpDNSLocalPort , vsockPort , virtioPort )
362
368
if err != nil {
363
369
return err
@@ -372,6 +378,18 @@ func GenerateISO9660(ctx context.Context, instDir, name string, instConfig *lima
372
378
return err
373
379
}
374
380
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
+
375
393
for i , f := range instConfig .Provision {
376
394
switch f .Mode {
377
395
case limatype .ProvisionModeSystem , limatype .ProvisionModeUser , limatype .ProvisionModeDependency :
0 commit comments