@@ -608,17 +608,15 @@ func (d *Driver) extractKernelImages() (err error) {
608608 err = hdiutil ("detach" , volumeRootDir )
609609 }()
610610
611- vmlinuz := filepath .Join (volumeRootDir , "boot" , d .Vmlinuz )
612- initrd := filepath .Join (volumeRootDir , "boot" , d .Initrd )
613-
614- log .Debugf ("Extracting %s into %s" , d .Vmlinuz , d .ResolveStorePath (d .Vmlinuz ))
615- if err := mcnutils .CopyFile (vmlinuz , d .ResolveStorePath (d .Vmlinuz )); err != nil {
616- return err
617- }
618-
619- log .Debugf ("Extracting %s into %s" , d .Initrd , d .ResolveStorePath (d .Initrd ))
620- if err := mcnutils .CopyFile (initrd , d .ResolveStorePath (d .Initrd )); err != nil {
621- return err
611+ for _ , f := range []string {"vmlinux" , "vmlinuz64" , "vmlinuz" , "bzImage" , "initrd" , "initrd.gz" , "initrd.img" } {
612+ p := filepath .Join (volumeRootDir , "boot" , f )
613+ dest := d .ResolveStorePath (f )
614+ if vmnet .IsExist (p ) {
615+ log .Debugf ("Extracting %s into %s" , p , dest )
616+ if err := mcnutils .CopyFile (p , dest ); err != nil {
617+ return err
618+ }
619+ }
622620 }
623621
624622 return nil
@@ -917,13 +915,20 @@ func (d *Driver) xhyveArgs() []string {
917915 diskImage = fmt .Sprintf ("4:0,ahci-hd,%s" , imgPath )
918916 }
919917
920- // assume the boot2docker.iso if empty
921- if d . Vmlinuz == "" {
918+ switch {
919+ case vmnet . IsExist ( d . ResolveStorePath ( "vmlinuz64" )):
922920 d .Vmlinuz = "vmlinuz64"
921+ case vmnet .IsExist (d .ResolveStorePath ("bzImage" )):
922+ d .Vmlinuz = "bzImage"
923923 }
924- if d .Initrd == "" {
924+
925+ switch {
926+ case vmnet .IsExist (d .ResolveStorePath ("initrd.img" )):
925927 d .Initrd = "initrd.img"
928+ case vmnet .IsExist (d .ResolveStorePath ("initrd" )):
929+ d .Initrd = "initrd"
926930 }
931+
927932 vmlinuz := d .ResolveStorePath (d .Vmlinuz )
928933 initrd := d .ResolveStorePath (d .Initrd )
929934
0 commit comments