@@ -127,15 +127,23 @@ generate-grpc:
127127 @echo " Generating gRPC code from proto..."
128128 protoc --go_out=. --go_opt=paths=source_relative \
129129 --go-grpc_out=. --go-grpc_opt=paths=source_relative \
130- lib/exec/exec .proto
130+ lib/guest/guest .proto
131131
132132# Generate all code
133133generate-all : oapi-generate generate-vmm-client generate-wire generate-grpc
134134
135135# Check if CH binaries exist, download if missing
136136.PHONY : ensure-ch-binaries
137137ensure-ch-binaries :
138- @if [ ! -f lib/vmm/binaries/cloud-hypervisor/v48.0/x86_64/cloud-hypervisor ]; then \
138+ @ARCH=$$(uname -m ) ; \
139+ if [ " $$ ARCH" = " x86_64" ]; then \
140+ CH_ARCH=x86_64; \
141+ elif [ " $$ ARCH" = " aarch64" ] || [ " $$ ARCH" = " arm64" ]; then \
142+ CH_ARCH=aarch64; \
143+ else \
144+ echo " Unsupported architecture: $$ ARCH" ; exit 1; \
145+ fi ; \
146+ if [ ! -f lib/vmm/binaries/cloud-hypervisor/v48.0/$$ CH_ARCH/cloud-hypervisor ]; then \
139147 echo " Cloud Hypervisor binaries not found, downloading..." ; \
140148 $(MAKE ) download-ch-binaries; \
141149 fi
@@ -156,27 +164,27 @@ ensure-caddy-binaries:
156164 $(MAKE ) build-caddy; \
157165 fi
158166
159- # Build exec -agent (guest binary) into its own directory for embedding
160- lib/system/exec_agent/exec -agent : lib/system/exec_agent /main.go
161- @echo " Building exec -agent..."
162- cd lib/system/exec_agent && CGO_ENABLED=0 go build -ldflags=" -s -w" -o exec -agent .
167+ # Build guest -agent (guest binary) into its own directory for embedding
168+ lib/system/guest_agent/guest -agent : lib/system/guest_agent /main.go
169+ @echo " Building guest -agent..."
170+ cd lib/system/guest_agent && CGO_ENABLED=0 go build -ldflags=" -s -w" -o guest -agent .
163171
164172# Build the binary
165- build : ensure-ch-binaries ensure-caddy-binaries lib/system/exec_agent/exec -agent | $(BIN_DIR )
173+ build : ensure-ch-binaries ensure-caddy-binaries lib/system/guest_agent/guest -agent | $(BIN_DIR )
166174 go build -tags containers_image_openpgp -o $(BIN_DIR ) /hypeman ./cmd/api
167175
168176# Build all binaries
169177build-all : build
170178
171179# Run in development mode with hot reload
172- dev : ensure-ch-binaries ensure-caddy-binaries lib/system/exec_agent/exec -agent $(AIR )
180+ dev : ensure-ch-binaries ensure-caddy-binaries lib/system/guest_agent/guest -agent $(AIR )
173181 @rm -f ./tmp/main
174182 $(AIR ) -c .air.toml
175183
176184# Run tests (as root for network capabilities, enables caching and parallelism)
177185# Usage: make test - runs all tests
178186# make test TEST=TestCreateInstanceWithNetwork - runs specific test
179- test : ensure-ch-binaries ensure-caddy-binaries lib/system/exec_agent/exec -agent
187+ test : ensure-ch-binaries ensure-caddy-binaries lib/system/guest_agent/guest -agent
180188 @if [ -n " $( TEST) " ]; then \
181189 echo " Running specific test: $( TEST) " ; \
182190 sudo env " PATH=$$ PATH" " DOCKER_CONFIG=$$ {DOCKER_CONFIG:-$$ HOME/.docker}" go test -tags containers_image_openpgp -run=$(TEST ) -v -timeout=180s ./...; \
@@ -194,9 +202,9 @@ clean:
194202 rm -rf $(BIN_DIR )
195203 rm -rf lib/vmm/binaries/cloud-hypervisor/
196204 rm -rf lib/ingress/binaries/
197- rm -f lib/system/exec_agent/exec -agent
205+ rm -f lib/system/guest_agent/guest -agent
198206
199207# Prepare for release build (called by GoReleaser)
200208# Downloads all embedded binaries and builds embedded components
201- release-prep : download-ch-binaries build-caddy-binaries lib/system/exec_agent/exec -agent
209+ release-prep : download-ch-binaries build-caddy-binaries lib/system/guest_agent/guest -agent
202210 go mod tidy
0 commit comments