Skip to content

Commit

Permalink
kata-ctl: Allow INSTALL_PATH= to be specified
Browse files Browse the repository at this point in the history
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 <cesar.tamayo@intel.com>
Co-authored-by: Kevin Mora Jimenez <kevin.mora.jimenez@intel.com>
Co-authored-by: Narendra Patel <narendra.g.patel@intel.com>
Co-authored-by: Ray Karrenbauer <ray.karrenbauer@intel.com>
Co-authored-by: Srinath Duraisamy <srinath.duraisamy@intel.com>
Signed-off-by: Narendra Patel <narendra.g.patel@intel.com>
  • Loading branch information
5 people committed May 15, 2023
1 parent da877a6 commit 593840e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tools/kata-ctl/Makefile
Expand Up @@ -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))
Expand Down Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/tools/kata-ctl/README.md
Expand Up @@ -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
Expand Down

0 comments on commit 593840e

Please sign in to comment.