mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-10-25 13:17:11 +00:00
The state directory is used to store: - the disk image, if not specified via '-disk' - the ISO for metadata, if '-data' is used - the Unix domain socket for virtio sockets - the PID of the hyperkit process - a JSON file with the hyperkit configuration This patch also enables the virtio socket device for the VM. While at it, also fix .gitignore to ignore kernel images again. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
78 lines
2.2 KiB
Makefile
78 lines
2.2 KiB
Makefile
.PHONY: default all
|
|
default: bin/moby bin/linuxkit bin/rtf
|
|
all: default
|
|
|
|
VERSION="0.0" # dummy for now
|
|
GIT_COMMIT=$(shell git rev-list -1 HEAD)
|
|
|
|
GO_COMPILE=linuxkit/go-compile:5bf17af781df44f07906099402680b9a661f999b
|
|
|
|
MOBY?=bin/moby
|
|
LINUXKIT?=bin/linuxkit
|
|
GOOS=$(shell uname -s | tr '[:upper:]' '[:lower:]')
|
|
GOARCH=amd64
|
|
ifneq ($(GOOS),linux)
|
|
CROSS=-e GOOS=$(GOOS) -e GOARCH=$(GOARCH)
|
|
endif
|
|
|
|
PREFIX?=/usr/local/
|
|
|
|
MOBY_COMMIT=a9a00fae6204a89baeed6903c7e2901412c1ede0
|
|
bin/moby: | bin
|
|
docker run --rm --log-driver=none $(CROSS) $(GO_COMPILE) --clone-path github.com/moby/tool --clone https://github.com/moby/tool.git --commit $(MOBY_COMMIT) --package github.com/moby/tool/cmd/moby --ldflags "-X main.GitCommit=$(GIT_COMMIT) -X main.Version=$(VERSION)" -o $@ > tmp_moby_bin.tar
|
|
tar xf tmp_moby_bin.tar > $@
|
|
rm tmp_moby_bin.tar
|
|
touch $@
|
|
|
|
RTF_COMMIT=3ced00340aacfc1932e8c03281bf3bfc586c147c
|
|
RTF_CMD=github.com/linuxkit/rtf/cmd
|
|
bin/rtf: | bin
|
|
docker run --rm --log-driver=none $(CROSS) $(GO_COMPILE) --clone-path github.com/linuxkit/rtf --clone https://github.com/linuxkit/rtf.git --commit $(RTF_COMMIT) --package github.com/linuxkit/rtf --ldflags "-X $(RTF_CMD).GitCommit=$(RTF_COMMIT) -X $(RTF_CMD).Version=$(VERSION)" -o $@ > tmp_rtf_bin.tar
|
|
tar xf tmp_rtf_bin.tar > $@
|
|
rm tmp_rtf_bin.tar
|
|
touch $@
|
|
|
|
|
|
LINUXKIT_DEPS=$(wildcard src/cmd/linuxkit/*.go) Makefile vendor.conf
|
|
bin/linuxkit: $(LINUXKIT_DEPS) | bin
|
|
tar cf - vendor -C src/cmd/linuxkit . | docker run --rm --net=none --log-driver=none -i $(CROSS) $(GO_COMPILE) --package github.com/linuxkit/linuxkit --ldflags "-X main.GitCommit=$(GIT_COMMIT) -X main.Version=$(VERSION)" -o $@ > tmp_linuxkit_bin.tar
|
|
tar xf tmp_linuxkit_bin.tar > $@
|
|
rm tmp_linuxkit_bin.tar
|
|
touch $@
|
|
|
|
bin:
|
|
mkdir -p $@
|
|
|
|
install:
|
|
cp -R ./bin/* $(PREFIX)/bin
|
|
|
|
.PHONY: test
|
|
test:
|
|
$(MAKE) -C test
|
|
|
|
.PHONY: collect-artifacts
|
|
collect-artifacts: artifacts/test.img.tar.gz artifacts/test-ltp.img.tar.gz
|
|
|
|
.PHONY: ci ci-tag ci-pr
|
|
ci:
|
|
$(MAKE) clean
|
|
$(MAKE)
|
|
$(MAKE) install
|
|
$(MAKE) -C test all
|
|
|
|
ci-tag:
|
|
$(MAKE) clean
|
|
$(MAKE)
|
|
$(MAKE) install
|
|
$(MAKE) -C test all
|
|
|
|
ci-pr:
|
|
$(MAKE) clean
|
|
$(MAKE)
|
|
$(MAKE) install
|
|
$(MAKE) -C test pr
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf bin *.log *-kernel *-cmdline *-state *.img *.iso *.gz *.qcow2 *.vhd *.vmx *.vmdk *.tar
|