Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
build: Add TRACE_DEV_MODE option to redirect the guest journal
Browse files Browse the repository at this point in the history
Add a `TRACE_DEV_MODE=yes` build option. This will install a new systemd
service and snippet to allow the guest OS journal to be redirected back
to the host using VSOCK.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
  • Loading branch information
jodh-intel committed Nov 26, 2018
1 parent 72cb4bf commit 8524e85
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,17 @@ ifeq ($(TRACE),yes)
endif
endif

# If "yes", install additional services to redirect guest OS journal messages
# to the host using VSOCK.
TRACE_DEV_MODE := no

# Path to systemd unit directory if installed as not init.
UNIT_DIR := /usr/lib/systemd/system

# Path to systemd drop-in snippet directory used to override the agent's
# service without having to modify the pristine agent service file.
SNIPPET_DIR := /etc/systemd/system/$(AGENT_SERVICE).d/

GENERATED_FILES :=
# Define if agent will be built by seccomp tag
SECCOMP := no
Expand All @@ -53,6 +61,11 @@ ifeq ($(TRACE),yes)
UNIT_FILES += jaeger-client-socat-redirector.service
endif

ifeq ($(TRACE_DEV_MODE),yes)
UNIT_FILES += kata-journald-host-redirect.service
SNIPPET_FILES += kata-redirect-agent-output-to-journal.conf
endif

VERSION_FILE := ./VERSION
VERSION := $(shell grep -v ^\# $(VERSION_FILE))
COMMIT_NO := $(shell git rev-parse HEAD 2> /dev/null || true)
Expand Down Expand Up @@ -83,6 +96,11 @@ ifeq ($(INIT),no)
@echo "Installing systemd unit files..."
$(foreach f,$(UNIT_FILES),$(call INSTALL_FILE,$f,$(UNIT_DIR)))
endif
ifeq ($(TRACE_DEV_MODE),yes)
@echo "Installing systemd snippet files..."
@mkdir -p $(SNIPPET_DIR)
$(foreach f,$(SNIPPET_FILES),$(call INSTALL_FILE,$f,$(SNIPPET_DIR)))
endif

build-image:
# build an docker image for development
Expand Down

0 comments on commit 8524e85

Please sign in to comment.