diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2021-02-21 22:33:27 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2021-02-21 22:48:15 +0000 |
commit | 2ca586ae8bb62ac888c352bf540220dcf9bf72e7 (patch) | |
tree | b26a37e2b7795264c061e110748742234bc4eb8b /tcwg-benchmark-bare.sh | |
parent | fbd70c84737a90f4c819848780293bfd44350f1c (diff) |
tcwg-benchmark-bare.sh: Add $USER user in container only if not tcwg-benchmark
Re-adding tcwg-benchmark causes an error, so create $USER in the
container only if it is not tcwg-benchmark.
Another option would be to change new-user.sh (in dockerfiles repo) to
automatically switch to update mode when it detects that the new user
is already defined, but that seems to be in contradiction with
new-user.sh --update flag.
Change-Id: Ib1cccd931cbae3889bb96dec16b65cf1f9314416
Diffstat (limited to 'tcwg-benchmark-bare.sh')
-rwxr-xr-x | tcwg-benchmark-bare.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tcwg-benchmark-bare.sh b/tcwg-benchmark-bare.sh index 75e9f753..9cfb80b8 100755 --- a/tcwg-benchmark-bare.sh +++ b/tcwg-benchmark-bare.sh @@ -175,8 +175,13 @@ esac # Start a container to run the benchmarks in. # The board is connected to the slave via USB, the container needs # special rights to access it. + +# tcwg-benchmark user already exists, re-creating it causes an error. +newuser= +[ "x$USER" != "xtcwg-benchmark" ] && newuser="--newuser $USER" + ./start-container-docker.sh \ - --newuser $USER \ + $newuser \ --distro "$bench_container_tag" \ --task bench \ --docker_opts "--privileged -v /dev/bus/usb:/dev/bus/usb" \ |