|
|
|
|
@ -21,6 +21,7 @@ import (
|
|
|
|
|
type StepCreateFloppy struct {
|
|
|
|
|
Files []string
|
|
|
|
|
Directories []string
|
|
|
|
|
Label string
|
|
|
|
|
|
|
|
|
|
floppyPath string
|
|
|
|
|
|
|
|
|
|
@ -33,6 +34,12 @@ func (s *StepCreateFloppy) Run(ctx context.Context, state multistep.StateBag) mu
|
|
|
|
|
return multistep.ActionContinue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if s.Label == "" {
|
|
|
|
|
s.Label = "packer"
|
|
|
|
|
} else {
|
|
|
|
|
log.Println("Floppy label is set to %s", s.Label)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s.FilesAdded = make(map[string]bool)
|
|
|
|
|
|
|
|
|
|
ui := state.Get("ui").(packer.Ui)
|
|
|
|
|
@ -70,8 +77,8 @@ func (s *StepCreateFloppy) Run(ctx context.Context, state multistep.StateBag) mu
|
|
|
|
|
log.Println("Formatting the block device with a FAT filesystem...")
|
|
|
|
|
formatConfig := &fat.SuperFloppyConfig{
|
|
|
|
|
FATType: fat.FAT12,
|
|
|
|
|
Label: "packer",
|
|
|
|
|
OEMName: "packer",
|
|
|
|
|
Label: s.Label,
|
|
|
|
|
OEMName: s.Label,
|
|
|
|
|
}
|
|
|
|
|
if err := fat.FormatSuperFloppy(device, formatConfig); err != nil {
|
|
|
|
|
state.Put("error", fmt.Errorf("Error creating floppy: %s", err))
|
|
|
|
|
|