Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
a5b21c59
Commit
a5b21c59
authored
Nov 27, 2014
by
Mikhail Zholobov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/parallels: Move setting the boot order to the separated step
parent
05affcea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
15 deletions
+44
-15
builder/parallels/iso/builder.go
builder/parallels/iso/builder.go
+1
-0
builder/parallels/iso/step_attach_iso.go
builder/parallels/iso/step_attach_iso.go
+1
-15
builder/parallels/iso/step_set_boot_order.go
builder/parallels/iso/step_set_boot_order.go
+42
-0
No files found.
builder/parallels/iso/builder.go
View file @
a5b21c59
...
...
@@ -256,6 +256,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
new
(
stepHTTPServer
),
new
(
stepCreateVM
),
new
(
stepCreateDisk
),
new
(
stepSetBootOrder
),
new
(
stepAttachISO
),
&
parallelscommon
.
StepAttachParallelsTools
{
ParallelsToolsMode
:
b
.
config
.
ParallelsToolsMode
,
...
...
builder/parallels/iso/step_attach_iso.go
View file @
a5b21c59
...
...
@@ -26,23 +26,9 @@ func (s *stepAttachISO) Run(state multistep.StateBag) multistep.StepAction {
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
// Set new boot order
ui
.
Say
(
"Setting the boot order..."
)
command
:=
[]
string
{
"set"
,
vmName
,
"--device-bootorder"
,
fmt
.
Sprintf
(
"hdd0 cdrom0 net0"
),
}
if
err
:=
driver
.
Prlctl
(
command
...
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error setting the boot order: %s"
,
err
)
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
}
// Attach the disk to the cdrom0 device. We couldn't use a separated device because it is failed to boot in PD9 [GH-1667]
ui
.
Say
(
"Attaching ISO to the default CD/DVD ROM device..."
)
command
=
[]
string
{
command
:
=
[]
string
{
"set"
,
vmName
,
"--device-set"
,
"cdrom0"
,
"--image"
,
isoPath
,
...
...
builder/parallels/iso/step_set_boot_order.go
0 → 100644
View file @
a5b21c59
package
iso
import
(
"fmt"
"github.com/mitchellh/multistep"
parallelscommon
"github.com/mitchellh/packer/builder/parallels/common"
"github.com/mitchellh/packer/packer"
)
// This step sets the device boot order for the virtual machine.
//
// Uses:
// driver Driver
// ui packer.Ui
// vmName string
//
// Produces:
type
stepSetBootOrder
struct
{}
func
(
s
*
stepSetBootOrder
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
driver
:=
state
.
Get
(
"driver"
)
.
(
parallelscommon
.
Driver
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
// Set new boot order
ui
.
Say
(
"Setting the boot order..."
)
command
:=
[]
string
{
"set"
,
vmName
,
"--device-bootorder"
,
fmt
.
Sprintf
(
"hdd0 cdrom0 net0"
),
}
if
err
:=
driver
.
Prlctl
(
command
...
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error setting the boot order: %s"
,
err
)
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
}
return
multistep
.
ActionContinue
}
func
(
s
*
stepSetBootOrder
)
Cleanup
(
state
multistep
.
StateBag
)
{}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment