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
cc13e669
Commit
cc13e669
authored
Nov 19, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazon/chroot: don't choose partition mount point if taken
[GH-635]
parent
d9c3aed4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
CHANGELOG.md
CHANGELOG.md
+2
-0
builder/amazon/chroot/device.go
builder/amazon/chroot/device.go
+8
-0
No files found.
CHANGELOG.md
View file @
cc13e669
...
...
@@ -25,6 +25,8 @@ BUG FIXES:
*
builder/amazon/chroot: Copying empty directories works. [GH-588]
*
builder/amazon/chroot: Chroot commands work with shell provisioners. [GH-581]
*
builder/amazon/chroot: Don't choose a mount point that is a partition of
an already mounted device. [GH-635]
*
builder/virtualbox: Ctrl-C interrupts during waiting for boot. [GH-618]
*
builder/vmware: VMX modifications are now case-insensitive. [GH-608]
*
builder/vmware: VMware Fusion won't ask for VM upgrade.
...
...
builder/amazon/chroot/device.go
View file @
cc13e669
...
...
@@ -19,6 +19,14 @@ func AvailableDevice() (string, error) {
letters
:=
"fghijklmnop"
for
_
,
letter
:=
range
letters
{
device
:=
fmt
.
Sprintf
(
"/dev/%s%c"
,
prefix
,
letter
)
// If the block device itself, i.e. /dev/sf, exists, then we
// can't use any of the numbers either.
if
_
,
err
:=
os
.
Stat
(
device
);
err
==
nil
{
continue
}
for
i
:=
1
;
i
<
16
;
i
++
{
device
:=
fmt
.
Sprintf
(
"/dev/%s%c%d"
,
prefix
,
letter
,
i
)
if
_
,
err
:=
os
.
Stat
(
device
);
err
!=
nil
{
...
...
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