An automated VM template builder for the CSC cloud
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
cloudbuild/Makefile

46 lines
1.4 KiB

DEPS_DIR = guestfs/deps
LIBRARY_PATH = $(DEPS_DIR)/usr/lib/x86_64-linux-gnu:$(DEPS_DIR)/lib/x86_64-linux-gnu
LIBGUESTFS_PATH = guestfs/appliance
LIBGUESTFS_HV = scripts/qemu.sh
APPLIANCE_VERSION = 1.46.0
# Export LIBGUESTFS_DEBUG=1 to debug
all:
LIBRARY_PATH=$(LIBRARY_PATH) CGO_LDFLAGS='-l:libvirt.so.0 -l:libyajl.so.2' go build
run:
LD_LIBRARY_PATH=$(LIBRARY_PATH) LIBGUESTFS_PATH=$(LIBGUESTFS_PATH) LIBGUESTFS_HV=$(LIBGUESTFS_HV) LIBGUESTFS_BACKEND_SETTINGS=force_tcg ./cloudbuild
guestfish:
LD_LIBRARY_PATH=$(LIBRARY_PATH) LIBGUESTFS_PATH=$(LIBGUESTFS_PATH) LIBGUESTFS_HV=$(LIBGUESTFS_HV) LIBGUESTFS_BACKEND_SETTINGS=force_tcg scripts/guestfish.sh
deps:
scripts/download-deps.sh
scripts/create-libguestfs-module.sh
guestfish-deps:
scripts/download-guestfish-deps.sh
appliance-download:
mkdir -p guestfs
cd guestfs && \
rm -rf appliance && \
wget https://download.libguestfs.org/binaries/appliance/appliance-$(APPLIANCE_VERSION).tar.xz && \
tar Jxvf appliance-$(APPLIANCE_VERSION).tar.xz && \
rm appliance-$(APPLIANCE_VERSION).tar.xz
appliance:
scripts/create-appliance.sh
supermin-download:
mkdir -p guestfs
[ -e /usr/bin/supermin ] || cd guestfs && apt download supermin && dpkg -x supermin_*.deb deps && rm supermin_*.deb
prune-deps:
rm -rf $(DEPS_DIR)/usr/share $(DEPS_DIR)/usr/include $(DEPS_DIR)/etc
clean:
rm -rf cloudbuild guestfs
.PHONY: all run guestfish deps guestfish-deps appliance-download appliance supermin-download clean