Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Make GVPROXY_PATH to locate gvproxy #11480

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ETCDIR ?= ${PREFIX}/etc
TMPFILESDIR ?= ${PREFIX}/lib/tmpfiles.d
SYSTEMDDIR ?= ${PREFIX}/lib/systemd/system
USERSYSTEMDDIR ?= ${PREFIX}/lib/systemd/user
GVPROXY_PATH ?= /usr/libexec/gvproxy
REMOTETAGS ?= remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp
BUILDTAGS ?= \
$(shell hack/apparmor_tag.sh) \
Expand Down Expand Up @@ -90,11 +91,13 @@ else
BUILD_INFO ?= $(shell date "+$(DATE_FMT)")
ISODATE ?= $(shell date --iso-8601)
endif
LIBPOD := ${PROJECT}/v3/libpod
MODULE ?= $(shell grep -m1 ^module go.mod | cut -d\ -f2)
LIBPOD := ${MODULE}/libpod
GOFLAGS ?= -trimpath
LDFLAGS_PODMAN ?= \
-X $(LIBPOD)/define.gitCommit=$(GIT_COMMIT) \
-X $(LIBPOD)/define.buildInfo=$(BUILD_INFO) \
-X $(MODULE)/pkg/machine.ForwarderBinaryPath=$(GVPROXY_PATH) \
-X $(LIBPOD)/config._installPrefix=$(PREFIX) \
-X $(LIBPOD)/config._etcDir=$(ETCDIR) \
$(EXTRA_LDFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (
ErrVMAlreadyExists = errors.New("VM already exists")
ErrVMAlreadyRunning = errors.New("VM already running")
ErrMultipleActiveVM = errors.New("only one VM can be active at a time")
ForwarderBinaryName = "gvproxy"
ForwarderBinaryPath string // Populated by Makefile
)

type Download struct {
Expand Down
5 changes: 3 additions & 2 deletions pkg/machine/qemu/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,10 @@ func CheckActiveVM() (bool, string, error) {
// startHostNetworking runs a binary on the host system that allows users
// to setup port forwarding to the podman virtual machine
func (v *MachineVM) startHostNetworking() error {
// TODO we may wish to configure the directory in containers common
binary := filepath.Join("/usr/libexec/podman/", machine.ForwarderBinaryName)

binary := machine.ForwarderBinaryPath
if _, err := os.Stat(binary); err != nil {
fmt.Println("Failed to find " + binary + ". Perhaps build using `make GVPROXY+PATH=...`")
return err
}

Expand Down