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
f374edc2
Commit
f374edc2
authored
Jun 22, 2015
by
Clint Shryock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazon-chroot: Fixes for amazon-chroot builder
These are needed for chroot builder to work
parent
42000dda
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
builder/amazon/chroot/step_create_volume.go
builder/amazon/chroot/step_create_volume.go
+1
-1
builder/amazon/chroot/step_instance_info.go
builder/amazon/chroot/step_instance_info.go
+1
-1
builder/amazon/chroot/step_register_ami.go
builder/amazon/chroot/step_register_ami.go
+13
-4
No files found.
builder/amazon/chroot/step_create_volume.go
View file @
f374edc2
...
@@ -29,7 +29,7 @@ func (s *StepCreateVolume) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -29,7 +29,7 @@ func (s *StepCreateVolume) Run(state multistep.StateBag) multistep.StepAction {
log
.
Printf
(
"Searching for root device of the image (%s)"
,
*
image
.
RootDeviceName
)
log
.
Printf
(
"Searching for root device of the image (%s)"
,
*
image
.
RootDeviceName
)
var
rootDevice
*
ec2
.
BlockDeviceMapping
var
rootDevice
*
ec2
.
BlockDeviceMapping
for
_
,
device
:=
range
image
.
BlockDeviceMappings
{
for
_
,
device
:=
range
image
.
BlockDeviceMappings
{
if
device
.
DeviceName
==
image
.
RootDeviceName
{
if
*
device
.
DeviceName
==
*
image
.
RootDeviceName
{
rootDevice
=
device
rootDevice
=
device
break
break
}
}
...
...
builder/amazon/chroot/step_instance_info.go
View file @
f374edc2
...
@@ -49,7 +49,7 @@ func (s *StepInstanceInfo) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -49,7 +49,7 @@ func (s *StepInstanceInfo) Run(state multistep.StateBag) multistep.StepAction {
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
instance
:=
&
instancesResp
.
Reservations
[
0
]
.
Instances
[
0
]
instance
:=
instancesResp
.
Reservations
[
0
]
.
Instances
[
0
]
state
.
Put
(
"instance"
,
instance
)
state
.
Put
(
"instance"
,
instance
)
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
...
...
builder/amazon/chroot/step_register_ami.go
View file @
f374edc2
...
@@ -24,14 +24,20 @@ func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -24,14 +24,20 @@ func (s *StepRegisterAMI) Run(state multistep.StateBag) multistep.StepAction {
blockDevices
:=
make
([]
*
ec2
.
BlockDeviceMapping
,
len
(
image
.
BlockDeviceMappings
))
blockDevices
:=
make
([]
*
ec2
.
BlockDeviceMapping
,
len
(
image
.
BlockDeviceMappings
))
for
i
,
device
:=
range
image
.
BlockDeviceMappings
{
for
i
,
device
:=
range
image
.
BlockDeviceMappings
{
newDevice
:=
device
newDevice
:=
device
if
newDevice
.
DeviceName
==
image
.
RootDeviceName
{
if
*
newDevice
.
DeviceName
==
*
image
.
RootDeviceName
{
if
newDevice
.
EBS
!=
nil
{
if
newDevice
.
EBS
!=
nil
{
newDevice
.
EBS
.
SnapshotID
=
&
snapshotId
newDevice
.
EBS
.
SnapshotID
=
aws
.
String
(
snapshotId
)
}
else
{
}
else
{
newDevice
.
EBS
=
&
ec2
.
EBSBlockDevice
{
SnapshotID
:
&
snapshotId
}
newDevice
.
EBS
=
&
ec2
.
EBSBlockDevice
{
SnapshotID
:
aws
.
String
(
snapshotId
)
}
}
}
}
}
// assume working from a snapshot, so we unset the Encrypted field if set,
// otherwise AWS API will return InvalidParameter
if
newDevice
.
EBS
.
Encrypted
!=
nil
{
newDevice
.
EBS
.
Encrypted
=
nil
}
blockDevices
[
i
]
=
newDevice
blockDevices
[
i
]
=
newDevice
}
}
...
@@ -82,7 +88,10 @@ func buildRegisterOpts(config *Config, image *ec2.Image, blockDevices []*ec2.Blo
...
@@ -82,7 +88,10 @@ func buildRegisterOpts(config *Config, image *ec2.Image, blockDevices []*ec2.Blo
Architecture
:
image
.
Architecture
,
Architecture
:
image
.
Architecture
,
RootDeviceName
:
image
.
RootDeviceName
,
RootDeviceName
:
image
.
RootDeviceName
,
BlockDeviceMappings
:
blockDevices
,
BlockDeviceMappings
:
blockDevices
,
VirtualizationType
:
&
config
.
AMIVirtType
,
}
if
config
.
AMIVirtType
!=
""
{
registerOpts
.
VirtualizationType
=
aws
.
String
(
config
.
AMIVirtType
)
}
}
if
config
.
AMIVirtType
!=
"hvm"
{
if
config
.
AMIVirtType
!=
"hvm"
{
...
...
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