scripts: net: Add overlay file to sample script
Add an '--overlay' command line option in order to use an overlay file when compiling Zephyr. Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
This commit is contained in:
parent
81cfb08f52
commit
8f451b7338
1 changed files with 23 additions and 2 deletions
|
@ -10,6 +10,7 @@ docker_pid=0
|
||||||
configuration=""
|
configuration=""
|
||||||
result=0
|
result=0
|
||||||
sample=""
|
sample=""
|
||||||
|
zephyr_overlay=""
|
||||||
|
|
||||||
check_dirs ()
|
check_dirs ()
|
||||||
{
|
{
|
||||||
|
@ -261,11 +262,17 @@ wait_docker ()
|
||||||
docker_exec ()
|
docker_exec ()
|
||||||
{
|
{
|
||||||
local result=0
|
local result=0
|
||||||
|
local overlay=""
|
||||||
|
|
||||||
|
if [ -n "$zephyr_overlay" ]
|
||||||
|
then
|
||||||
|
overlay="-DOVERLAY_CONFIG=$zephyr_overlay"
|
||||||
|
fi
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
echo_server)
|
echo_server)
|
||||||
start_configuration
|
start_configuration
|
||||||
start_zephyr
|
start_zephyr "$overlay"
|
||||||
|
|
||||||
start_docker \
|
start_docker \
|
||||||
"/net-tools/echo-client -i eth0 192.0.2.1" \
|
"/net-tools/echo-client -i eth0 192.0.2.1" \
|
||||||
|
@ -282,7 +289,8 @@ docker_exec ()
|
||||||
start_docker \
|
start_docker \
|
||||||
"/net-tools/echo-server -i eth0"
|
"/net-tools/echo-server -i eth0"
|
||||||
|
|
||||||
start_zephyr "-DCONFIG_NET_SAMPLE_SEND_ITERATIONS=10"
|
start_zephyr "$overlay" \
|
||||||
|
"-DCONFIG_NET_SAMPLE_SEND_ITERATIONS=10"
|
||||||
|
|
||||||
wait_zephyr
|
wait_zephyr
|
||||||
result=$?
|
result=$?
|
||||||
|
@ -343,6 +351,8 @@ usage ()
|
||||||
echo "-N|--net-tools-dir <dir>\tset net-tools directory"
|
echo "-N|--net-tools-dir <dir>\tset net-tools directory"
|
||||||
echo "--start\t\t\t\tonly start Docker container and network and exit"
|
echo "--start\t\t\t\tonly start Docker container and network and exit"
|
||||||
echo "--stop\t\t\t\tonly stop Docker container and network"
|
echo "--stop\t\t\t\tonly stop Docker container and network"
|
||||||
|
echo -n "--overlay <config files>\tadditional configuration/overlay "
|
||||||
|
echo "files for the\n\t\t\t\tZephyr build process"
|
||||||
echo "<test script>\t\t\tsample script to run instead of test based on"
|
echo "<test script>\t\t\tsample script to run instead of test based on"
|
||||||
echo "\t\t\t\tcurrent directory"
|
echo "\t\t\t\tcurrent directory"
|
||||||
echo "The automatically detected directories are:"
|
echo "The automatically detected directories are:"
|
||||||
|
@ -394,6 +404,17 @@ do
|
||||||
fi
|
fi
|
||||||
configuration=stop_only
|
configuration=stop_only
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
--overlay)
|
||||||
|
shift
|
||||||
|
if [ -n "$zephyr_overlay" ]
|
||||||
|
then
|
||||||
|
zephyr_overlay="$zephyr_overlay $1"
|
||||||
|
else
|
||||||
|
zephyr_overlay="$1"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
-*)
|
-*)
|
||||||
echo "Argument '$1' not recognised" >&2
|
echo "Argument '$1' not recognised" >&2
|
||||||
usage
|
usage
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue