Skip to content

Commit

Permalink
makefile: Add make install
Browse files Browse the repository at this point in the history
allow install osbuilder scripts.

Example:
make install DESTDIR=/tmp/t

export DISTRO_REPO=1                                                                                                                                         export GOPATH=~/go
export AGENT_SOURCE_BIN=/tmp/usr/bin/kata-agent

/tmp/t/usr/libexec/kata-containers/osbuilder/rootfs-builder/rootfs.sh fedora
pushd /tmp/t/usr/libexec/kata-containers/osbuilder/rootfs-builder
/tmp/t/usr/libexec/kata-containers/osbuilder/image-builder/image_builder.sh $(pwd)/rootfs-Fedora

Fixes: kata-containers#206

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
  • Loading branch information
jcvenegas committed Nov 26, 2018
1 parent 39e6aa4 commit 06c8d88
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,40 @@ test-initrd-only:
list-distros:
@ $(ROOTFS_BUILDER) -l

DESTDIR := /
KATADIR := /usr/libexec/kata-containers
OSBUILDER_DIR := $(KATADIR)/osbuilder
INSTALL_DIR :=$(DESTDIR)/$(OSBUILDER_DIR)
DIST_CONFIGS:= $(wildcard rootfs-builder/*/config.sh)

SCRIPTS :=
SCRIPTS += rootfs-builder/rootfs.sh
SCRIPTS += image-builder/image_builder.sh
SCRIPTS += initrd-builder/initrd_builder.sh

FILES :=
FILES += rootfs-builder/versions.txt
FILES += scripts/lib.sh

define INSTALL_FILE
echo "Installing $(abspath $2/$1)";
install -m 644 -D $1 $2/$1;
endef

define INSTALL_SCRIPT
echo "Installing $(abspath $2/$1)";
install -m 755 -D $1 $(abspath $2/$1);
endef

.PHONY: install-scripts
install-scripts:
@echo "Installing scripts"
@$(foreach f,$(SCRIPTS),$(call INSTALL_SCRIPT,$f,$(INSTALL_DIR)))
@echo "Installing helper files"
@$(foreach f,$(FILES),$(call INSTALL_FILE,$f,$(INSTALL_DIR)))
@echo "Installing installing config files"
@$(foreach f,$(DIST_CONFIGS),$(call INSTALL_FILE,$f,$(INSTALL_DIR)))

.PHONY: clean
clean:
rm -rf $(DISTRO_ROOTFS_MARKER) $(DISTRO_ROOTFS) $(DISTRO_IMAGE) $(DISTRO_INITRD)

0 comments on commit 06c8d88

Please sign in to comment.