diff --git a/installer/Makefile b/installer/Makefile index fcc19c605d..eb12b03c20 100644 --- a/installer/Makefile +++ b/installer/Makefile @@ -36,17 +36,15 @@ ovfenv := $(BIN)/ovfenv vic-ova-ui := $(BIN)/vic-ova-ui ova-webserver := $(BIN)/ova-webserver ova-landing-server := $(BIN)/ova-landing-server -toolbox := $(BIN)/toolbox rpctool := $(BIN)/rpctool gas: $(GAS) ovfenv: $(ovfenv) vic-ova-ui: $(vic-ova-ui) ova-webserver: $(ova-webserver) ova-landing-server: $(ova-landing-server) -toolbox: $(toolbox) rpctool: $(rpctool) tools: $(DEP) $(GOLINT) $(GAS) -all: golint gofmt govet gas $(ovfenv) $(vic-ova-ui) $(ova-webserver) $(ova-landing-server) $(toolbox) $(rpctool) +all: golint gofmt govet gas $(ovfenv) $(vic-ova-ui) $(ova-webserver) $(ova-landing-server) $(rpctool) vendor: $(DEP) @echo restoring vendor @@ -54,7 +52,7 @@ vendor: $(DEP) gas: $(GAS) @echo running go AST tool - @$(GAS) -quiet fileserver/... landing_server/... lib/... ovatools/... pkg/... toolbox/... 2> /dev/null + @$(GAS) -quiet fileserver/... landing_server/... lib/... ovatools/... pkg/... 2> /dev/null golint: $(GOLINT) @echo checking go lint... @@ -63,7 +61,6 @@ golint: $(GOLINT) @$(call golintf,github.com/vmware/vic-product/installer/lib/...) @$(call golintf,github.com/vmware/vic-product/installer/ovatools/...) @$(call golintf,github.com/vmware/vic-product/installer/pkg/...) - @$(call golintf,github.com/vmware/vic-product/installer/toolbox/...) gofmt: @echo checking gofmt... @@ -111,10 +108,6 @@ $(ova-landing-server): $(call godeps,landing_server/*.go) @echo building ova-landing-server @GOARCH=amd64 GOOS=linux $(TIME) $(GO) build $(RACE) -ldflags "$(LDFLAGS)" -o ./$@ ./$(dir $<) -$(toolbox): $(call godeps,toolbox/*.go) - @echo building toolbox - @GOARCH=amd64 GOOS=linux $(TIME) $(GO) build $(RACE) -ldflags "$(LDFLAGS)" -o ./$@ ./$(dir $<) - $(rpctool): $(call godeps,ovatools/rpctool/*.go) @echo building rpctool @GOARCH=amd64 GOOS=linux $(TIME) $(GO) build $(RACE) -ldflags "$(LDFLAGS)" -o ./$@ ./$(dir $<) diff --git a/installer/build/bootable/build-base.sh b/installer/build/bootable/build-base.sh index 8643fe17cc..b99366a407 100755 --- a/installer/build/bootable/build-base.sh +++ b/installer/build/bootable/build-base.sh @@ -77,7 +77,8 @@ function set_base() { cdrkit xfsprogs sudo \ lvm2 parted gptfdisk \ e2fsprogs docker-17.12.1-1.ph1 gzip \ - net-tools logrotate sshpass + net-tools logrotate sshpass \ + open-vm-tools log3 "installing package dependencies" tdnf install --installroot "${rt}/" --refresh -y \ diff --git a/installer/build/ova-manifest.json b/installer/build/ova-manifest.json index 1871ec2a31..795e3fdfbd 100644 --- a/installer/build/ova-manifest.json +++ b/installer/build/ova-manifest.json @@ -31,11 +31,6 @@ "source": "../bin/ova-landing-server", "destination": "/usr/local/bin/ova-landing-server" }, - { - "type": "file", - "source": "../bin/toolbox", - "destination": "/usr/bin/toolbox" - }, { "type": "file", "source": "../bin/rpctool", diff --git a/installer/toolbox/main.go b/installer/toolbox/main.go deleted file mode 100644 index 70bac16f0f..0000000000 --- a/installer/toolbox/main.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2017 VMware, Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build linux,amd64 - -package main - -import ( - "errors" - "os" - "os/signal" - "syscall" - - "github.com/Sirupsen/logrus" - "github.com/coreos/go-systemd/daemon" - "github.com/spf13/pflag" - - "github.com/vmware/govmomi/toolbox" - "github.com/vmware/govmomi/toolbox/vix" - "github.com/vmware/vic-product/installer/pkg/version" -) - -const ( - keepEnvVars = false - sdReady = "READY=1" -) - -// This example can be run on a VM hosted by ESX, Fusion or Workstation -func main() { - - log := logrus.New().WithField("app", "toolbox") - - var ver = false - pflag.BoolVar(&ver, "version", ver, "Show version information") - - pflag.Parse() - - if ver { - v := version.GetBuild() - log.Println("version:", v.Version) - log.Println("commit:", v.GitCommit) - log.Println("build date:", v.BuildDate) - os.Exit(0) - } - - in := toolbox.NewBackdoorChannelIn() - out := toolbox.NewBackdoorChannelOut() - - service := toolbox.NewService(in, out) - - if os.Getuid() == 0 { - service.Power.Halt.Handler = toolbox.Halt - service.Power.Reboot.Handler = toolbox.Reboot - } - - // Disable all guest operations - service.Command.Authenticate = func(_ vix.CommandRequestHeader, _ []byte) error { - return errors.New("not authorized") - } - - err := service.Start() - if err != nil { - log.Fatal(err) - } - - daemon.SdNotify(keepEnvVars, sdReady) - - // handle the signals and gracefully shutdown the service - sig := make(chan os.Signal, 1) - signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM) - - go func() { - log.Printf("signal %s received", <-sig) - service.Stop() - }() - - service.Wait() -}