Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
'floppy_files' and 'floppy_files' create two separate drives
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuzmin committed Feb 14, 2018
1 parent 47cccb4 commit bc3810f
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions iso/step_add_floppy.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ func (s *StepAddFloppy) runImpl(state multistep.StateBag) error {
d := state.Get("driver").(*driver.Driver)

tmpFloppy := state.Get("floppy_path")
if s.Config.FloppyIMGPath != "" && tmpFloppy != nil {
return fmt.Errorf("'floppy_img_path' cannot be used together with 'floppy_files' and 'floppy_dirs'")
}

var floppyIMGPath string
if tmpFloppy != nil {
ui.Say("Uploading created floppy image")

Expand All @@ -72,15 +67,21 @@ func (s *StepAddFloppy) runImpl(state multistep.StateBag) error {

// remember the path to the temporary floppy image to remove it after the build is finished
s.uploadedFloppyPath = uploadPath
floppyIMGPath = ds.ResolvePath(uploadPath)
} else {
floppyIMGPath = s.Config.FloppyIMGPath
floppyIMGPath := ds.ResolvePath(uploadPath)
ui.Say("Adding generated Floppy...")
err = vm.AddFloppy(floppyIMGPath)
if err != nil {
return err
}
}

ui.Say("Adding Floppy...")
err := vm.AddFloppy(floppyIMGPath)
if err != nil {
return err
if s.Config.FloppyIMGPath != "" {
floppyIMGPath := s.Config.FloppyIMGPath
ui.Say("Adding Floppy image...")
err := vm.AddFloppy(floppyIMGPath)
if err != nil {
return err
}
}

return nil
Expand Down

0 comments on commit bc3810f

Please sign in to comment.