From 75788c7a1dd59f94a2b9227db77ba466752f5f91 Mon Sep 17 00:00:00 2001
From: Harshavardhana <harsha@minio.io>
Date: Sun, 5 Jul 2015 18:12:58 -0700
Subject: [PATCH] Fix go installation check on amazon instance

---
 buildscripts/checkdeps.sh | 7 ++++++-
 pkg/utils/scsi/scsi.go    | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/buildscripts/checkdeps.sh b/buildscripts/checkdeps.sh
index 831183e3a..8f21655a9 100644
--- a/buildscripts/checkdeps.sh
+++ b/buildscripts/checkdeps.sh
@@ -104,7 +104,12 @@ check_golang_env() {
         exit -1
     fi
 
-    if [ "$(dirname ${go_binary_path})" != "${GOROOT%%*(/)}/bin" ] ; then
+    local new_go_binary_path=${go_binary_path}
+    if [ -h "${go_binary_path}" ]; then
+        new_go_binary_path=$(/bin/readlink -f ${go_binary_path})
+    fi
+
+    if [[ !"$(dirname ${new_go_binary_path})" =~ *"${GOROOT%%*(/)}"* ]] ; then
         echo "The go binary found in your PATH configuration does not belong to the Go installation pointed by your GOROOT environment," \
             "please refer to Go installation document"
         echo "https://github.com/minio/minio/blob/master/INSTALLGO.md#install-go-13"
diff --git a/pkg/utils/scsi/scsi.go b/pkg/utils/scsi/scsi.go
index b80d96428..8f5ba277f 100644
--- a/pkg/utils/scsi/scsi.go
+++ b/pkg/utils/scsi/scsi.go
@@ -52,7 +52,8 @@ func GetDisks() (Disks, error) {
 
 	sysFiles, err := ioutil.ReadDir(sysFSDEVICES)
 	if err != nil {
-		return Disks{}, iodine.New(err, nil)
+		// may be an amazon instance, ignore this
+		return Disks{}, nil
 	}
 
 	scsidevices = filterdisks(sysFiles)