xref: /spdk/docker/spdk-app/init (revision cc6920a4763d4b9a43aa40583c8397d8f14fa100)
1#!/usr/bin/env bash
2
3app=spdk_tgt args=() limit_args=()
4
5# Override default app
6if [[ -n $SPDK_APP ]]; then
7	app=$SPDK_APP
8fi
9
10# Define extra arguments to the app
11if [[ -n $SPDK_ARGS ]]; then
12	args=($SPDK_ARGS)
13fi
14
15# Limit the app with to following options,
16# to allow for minimal impact on the host.
17limit_args+=("--no-pci")
18limit_args+=("--num-trace-entries" 0)
19
20# if set, don't include limit_args[] on the cmdline
21if [[ ! -v SPDK_NO_LIMIT ]]; then
22	args+=("${limit_args[@]}")
23fi
24
25if [[ -e /config ]]; then
26	args+=("--json" "/config")
27fi
28
29# Wait a bit to make sure ip is in place
30sleep 2s
31
32exec "$app" "${args[@]}"
33