From 76071eafc68885626662def20ae614e36c897301 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 29 Jul 2013 21:59:34 -0700 Subject: [PATCH] builder/amazon/chroot: only let it run on Linux --- builder/amazon/chroot/builder.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builder/amazon/chroot/builder.go b/builder/amazon/chroot/builder.go index 37c308a98..1711e58d1 100644 --- a/builder/amazon/chroot/builder.go +++ b/builder/amazon/chroot/builder.go @@ -5,12 +5,14 @@ package chroot import ( + "errors" "github.com/mitchellh/goamz/ec2" "github.com/mitchellh/multistep" awscommon "github.com/mitchellh/packer/builder/amazon/common" "github.com/mitchellh/packer/builder/common" "github.com/mitchellh/packer/packer" "log" + "runtime" ) // The unique ID for this builder @@ -51,6 +53,10 @@ func (b *Builder) Prepare(raws ...interface{}) error { } func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error) { + if runtime.GOOS != "linux" { + return nil, errors.New("The amazon-chroot builder only works on Linux environments.") + } + region, err := b.config.Region() if err != nil { return nil, err