From 593840e0758c97c7926c24362546344243590839 Mon Sep 17 00:00:00 2001 From: Narendra Patel Date: Mon, 15 May 2023 17:21:49 -0400 Subject: [PATCH] kata-ctl: Allow INSTALL_PATH= to be specified Update the kata-ctl install rule to allow it to be installed to a given directory The Makefile was updated to use an INSTALL_PATH variable to track where the kata-ctl binary should be installed. If the user doesn't specify anything, then it uses the default path that cargo uses. Otherwise, it will install it in the directory that the user specified. The README.md file was also updated to show how to use the new option. Fixes #5403 Co-authored-by: Cesar Tamayo Co-authored-by: Kevin Mora Jimenez Co-authored-by: Narendra Patel Co-authored-by: Ray Karrenbauer Co-authored-by: Srinath Duraisamy Signed-off-by: Narendra Patel --- src/tools/kata-ctl/Makefile | 3 ++- src/tools/kata-ctl/README.md | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tools/kata-ctl/Makefile b/src/tools/kata-ctl/Makefile index fbbd5c112a..23ae7ca1e7 100644 --- a/src/tools/kata-ctl/Makefile +++ b/src/tools/kata-ctl/Makefile @@ -10,6 +10,7 @@ PROJECT_URL = https://github.com/kata-containers PROJECT_COMPONENT = kata-ctl TARGET = $(PROJECT_COMPONENT) +INSTALL_PATH = $(HOME)/.cargo VERSION_FILE := ./VERSION export VERSION := $(shell grep -v ^\# $(VERSION_FILE)) @@ -55,7 +56,7 @@ test: @RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo test --target $(TRIPLE) $(if $(findstring release,$(BUILD_TYPE)),--release) $(EXTRA_RUSTFEATURES) -- --nocapture install: - @RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo install --locked --target $(TRIPLE) --path . + @RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo install --locked --target $(TRIPLE) --path . --root $(INSTALL_PATH) check: standard_rust_check diff --git a/src/tools/kata-ctl/README.md b/src/tools/kata-ctl/README.md index 181e66db74..c37ab9dcd7 100644 --- a/src/tools/kata-ctl/README.md +++ b/src/tools/kata-ctl/README.md @@ -27,6 +27,11 @@ $ make $ make install ``` +If you would like to install the tool to a specific directory, then you can provide it through the `INSTALL_PATH` variable. +```bash +$ make install INSTALL_PATH=/path/to/your/custom/install/directory +``` + ## Run the tool ```bash