@@ -339,14 +339,18 @@ func GenerateISO9660(instDir, name string, y *limayaml.LimaYAML, udpDNSLocalPort
339
339
}
340
340
}
341
341
342
- guestAgentBinary , err := GuestAgentBinary (* y .OS , * y .Arch )
342
+ guestAgentBinary , err := usrlocalsharelima . GuestAgentBinary (* y .OS , * y .Arch )
343
343
if err != nil {
344
344
return err
345
345
}
346
- defer guestAgentBinary .Close ()
346
+ guestAgent , err := os .Open (guestAgentBinary )
347
+ if err != nil {
348
+ return err
349
+ }
350
+ defer guestAgent .Close ()
347
351
layout = append (layout , iso9660util.Entry {
348
352
Path : "lima-guestagent" ,
349
- Reader : guestAgentBinary ,
353
+ Reader : guestAgent ,
350
354
})
351
355
352
356
if nerdctlArchive != "" {
@@ -373,21 +377,6 @@ func GenerateISO9660(instDir, name string, y *limayaml.LimaYAML, udpDNSLocalPort
373
377
return iso9660util .Write (filepath .Join (instDir , filenames .CIDataISO ), "cidata" , layout )
374
378
}
375
379
376
- func GuestAgentBinary (ostype limayaml.OS , arch limayaml.Arch ) (io.ReadCloser , error ) {
377
- if ostype == "" {
378
- return nil , errors .New ("os must be set" )
379
- }
380
- if arch == "" {
381
- return nil , errors .New ("arch must be set" )
382
- }
383
- dir , err := usrlocalsharelima .Dir ()
384
- if err != nil {
385
- return nil , err
386
- }
387
- gaPath := filepath .Join (dir , "lima-guestagent." + ostype + "-" + arch )
388
- return os .Open (gaPath )
389
- }
390
-
391
380
func getCert (content string ) Cert {
392
381
lines := []string {}
393
382
for _ , line := range strings .Split (content , "\n " ) {
0 commit comments