Skip to content
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.

Commit

Permalink
Merge pull request #289 from boot2docker/revert-283-boot2docker.iso
Browse files Browse the repository at this point in the history
Revert "Update default ISO path to prefer an ISO that's next to the boot...
  • Loading branch information
tianon committed Oct 16, 2014
2 parents b9082bc + a8ca6ec commit 8aedb4a
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"net"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
Expand Down Expand Up @@ -62,36 +61,6 @@ func cfgFilename(dir string) string {
return filename
}

func defaultIsoPath(dir string) string {
var err error

iso := filepath.Join(dir, "boot2docker.iso")

exe := os.Args[0]
if filepath.Base(exe) == exe {
// this logic borrowed from reexec/reexec.go in Docker itself :)
if lp, err := exec.LookPath(exe); err == nil {
exe = lp
}
}

if exe, err = filepath.Abs(exe); err != nil {
return iso
}

if exe, err = filepath.EvalSymlinks(exe); err != nil {
return iso
}

// if there's a "boot2docker.iso" next to our boot2docker-cli executable, let's prefer that one by default
exeIso := filepath.Join(filepath.Dir(exe), "boot2docker.iso")
if _, err = os.Stat(exeIso); err == nil {
return exeIso
}

return iso
}

// Write configuration set by the combination of profile and flags
// Should result in a format that can be piped into a profile file
func printConfig() string {
Expand Down Expand Up @@ -123,7 +92,7 @@ func config() (*flag.FlagSet, error) {
//flags.StringVarP(&B2D.Dir, "dir", "d", dir, "boot2docker config directory.")
B2D.Dir = dir
flags.StringVar(&B2D.ISOURL, "iso-url", "https://api.github.com/repos/boot2docker/boot2docker/releases", "source URL to provision the boot2docker ISO image.")
flags.StringVar(&B2D.ISO, "iso", defaultIsoPath(dir), "path to boot2docker ISO image.")
flags.StringVar(&B2D.ISO, "iso", filepath.Join(dir, "boot2docker.iso"), "path to boot2docker ISO image.")

// Sven disabled this, as it is broken - if I user with a fresh computer downloads
// just the boot2docker-cli, and then runs `boot2docker --init ip`, we create a vm
Expand Down

0 comments on commit 8aedb4a

Please sign in to comment.