Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace boot command parser with PEG parser. #6129

Merged
merged 40 commits into from
Apr 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
673245a
Replace boot command parser with PEG parser.
mwhooker Apr 11, 2018
4e2f141
Rely on context to cancel typing boot command.
mwhooker Apr 12, 2018
1c0af28
Some cleanup and comments.
mwhooker Apr 12, 2018
e4af718
Implement new parser for Virtualbox boot command
mwhooker Apr 12, 2018
99d6192
Abstract vbox driver into PC-AT driver.
mwhooker Apr 12, 2018
9b7704c
Implement new parser for Parallels boot command
mwhooker Apr 12, 2018
5937629
Maximize scancode throughput.
mwhooker Apr 13, 2018
81d1277
Add key press interval to virtualbox.
mwhooker Apr 13, 2018
f9ad264
Comments
mwhooker Apr 13, 2018
bdb1eee
Implement new parser for HyperV boot command
mwhooker Apr 13, 2018
bf0a320
Implement new parser for qemu boot command
mwhooker Apr 13, 2018
cba4d32
cleanup
mwhooker Apr 13, 2018
e2e7bc6
Make special keys case insensitive.
mwhooker Apr 13, 2018
a46a7af
Remove old tests.
mwhooker Apr 13, 2018
36aeaf2
Use a partial for the boot command docs.
mwhooker Apr 13, 2018
4454e4f
Use erb to add support for partials.
mwhooker Apr 13, 2018
f5b09c8
set vim pandoc modeline
mwhooker Apr 14, 2018
c753391
fill out and reformat the boot command docs
mwhooker Apr 14, 2018
94129b7
we're using PC-XT (set1) not PC-AT
mwhooker Apr 14, 2018
9a839c4
fix formatting
mwhooker Apr 14, 2018
add7e8a
Stop sending boot commands when context canceled.
mwhooker Apr 16, 2018
9a8acbb
negative wait WIP
mwhooker Apr 16, 2018
84894ca
remove nonsensical negative waits.
mwhooker Apr 16, 2018
408eba8
flatten boot command config and implement for vmware
mwhooker Apr 18, 2018
e662927
Implement boot config struct for parallels
mwhooker Apr 16, 2018
7990966
fix boot command config struct name
mwhooker Apr 18, 2018
c629997
s/boot_command/bootcommand/
mwhooker Apr 18, 2018
c8e76ce
implement config struct for qemu
mwhooker Apr 18, 2018
a0c9ddb
implement boot config struct for virtualbox
mwhooker Apr 18, 2018
1d36ef0
implement boot config struct for hyperv
mwhooker Apr 18, 2018
e9e2794
sort keycode lists
mwhooker Apr 18, 2018
7d43324
add menu key.
mwhooker Apr 18, 2018
aa69bdf
Perform validation of boot command.
mwhooker Apr 19, 2018
df6224d
fix vnc config
mwhooker Apr 19, 2018
31d04f1
remove outdated comment
mwhooker Apr 19, 2018
374d8f0
better log message
mwhooker Apr 19, 2018
11de2b9
remove unnecessary log line.
mwhooker Apr 19, 2018
675eae1
flush scancodes when we wait
mwhooker Apr 19, 2018
7e9af82
fix 2 byte scancodes for pc-xt VMs.
mwhooker Apr 20, 2018
b5a97e4
fix test
mwhooker Apr 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ package:

deps:
@go get golang.org/x/tools/cmd/stringer
@go get -u github.com/mna/pigeon
@go get github.com/kardianos/govendor
@govendor sync

Expand Down Expand Up @@ -73,6 +74,8 @@ fmt-examples:
# source files.
generate: deps ## Generate dynamically generated code
go generate .
gofmt -w common/bootcommand/boot_command.go
goimports -w common/bootcommand/boot_command.go
gofmt -w command/plugin.go

test: deps fmt-check ## Run unit tests
Expand Down
33 changes: 0 additions & 33 deletions builder/hyperv/common/run_config.go

This file was deleted.

37 changes: 0 additions & 37 deletions builder/hyperv/common/run_config_test.go

This file was deleted.

19 changes: 0 additions & 19 deletions builder/hyperv/common/step_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ package common
import (
"context"
"fmt"
"time"

"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
)

type StepRun struct {
BootWait time.Duration

vmName string
}

Expand All @@ -32,22 +29,6 @@ func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.Ste

s.vmName = vmName

if int64(s.BootWait) > 0 {
ui.Say(fmt.Sprintf("Waiting %s for boot...", s.BootWait))
wait := time.After(s.BootWait)
WAITLOOP:
for {
select {
case <-wait:
break WAITLOOP
case <-time.After(1 * time.Second):
if _, ok := state.GetOk(multistep.StateCancelled); ok {
return multistep.ActionHalt
}
}
}
}

return multistep.ActionContinue
}

Expand Down
Loading