aboutsummaryrefslogtreecommitdiffstats
path: root/lava-slave
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2017-10-25 13:45:56 +0200
committerCorentin LABBE <clabbe@baylibre.com>2017-10-25 14:11:58 +0200
commit905a723528e499e9eae193b4d72388076d561f6c (patch)
tree71286e054b5dc8ff32ebd72a3bd2f4d392a27cae /lava-slave
parent626402f90d0f8435e9268268180d46fe3b58f040 (diff)
Add support for conmux
Diffstat (limited to 'lava-slave')
-rw-r--r--lava-slave/Dockerfile5
-rwxr-xr-xlava-slave/scripts/cu-loop11
-rwxr-xr-xlava-slave/scripts/start.sh9
3 files changed, 25 insertions, 0 deletions
diff --git a/lava-slave/Dockerfile b/lava-slave/Dockerfile
index 6aece71..e87ac63 100644
--- a/lava-slave/Dockerfile
+++ b/lava-slave/Dockerfile
@@ -17,6 +17,8 @@ RUN \
git \
vim \
sudo \
+ cu \
+ conmux \
python-setproctitle \
tftpd-hpa \
u-boot-tools \
@@ -50,6 +52,9 @@ COPY configs/lava-slave /etc/lava-dispatcher/lava-slave
COPY configs/tftpd-hpa /etc/default/tftpd-hpa
+COPY scripts/cu-loop /usr/local/bin/
+COPY conmux/* /etc/conmux/
+
#TODO made this customizable, 1000 ports by default is too much
RUN sed -i 's,XNBD_PORT_RANGE_MIN.*,XNBD_PORT_RANGE_MIN=55950,' /usr/lib/python2.7/dist-packages/lava_dispatcher/pipeline/utils/constants.py
diff --git a/lava-slave/scripts/cu-loop b/lava-slave/scripts/cu-loop
new file mode 100755
index 0000000..fbe5777
--- /dev/null
+++ b/lava-slave/scripts/cu-loop
@@ -0,0 +1,11 @@
+#!/bin/sh
+DEV=$1
+BAUD=${2:-115200}
+
+while true; do
+ # NOTE: needs cu >= 1.07-24
+ # c.f. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=336996
+ test -e $DEV && cu -l $DEV -s $BAUD --parity=none --nostop --nortscts dir
+ sleep 0.2
+done
+
diff --git a/lava-slave/scripts/start.sh b/lava-slave/scripts/start.sh
index f442e8d..dcbbcd7 100755
--- a/lava-slave/scripts/start.sh
+++ b/lava-slave/scripts/start.sh
@@ -10,5 +10,14 @@ service tftpd-hpa start || exit 4
rm -f /var/run/lava-slave.pid
service lava-slave start || exit 5
+touch /var/run/conmux-registry
+/usr/sbin/conmux-registry 63000 /var/run/conmux-registry&
+sleep 2
+for item in $(ls /etc/conmux/*cf)
+do
+ echo "Add $item"
+ /usr/sbin/conmux $item &
+done
+
# start an http file server for boot/transfer_overlay support
(cd /var/lib/lava/dispatcher; python -m SimpleHTTPServer 80)
span class="c1"># # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ########################################################################### # Configurable variables [ -z "$SYNCTHING_VERSION" ] && SYNCTHING_VERSION=0.14.28 [ -z "$SYNCTHING_INOTIFY_VERSION" ] && SYNCTHING_INOTIFY_VERSION=0.8.6 # XXX - may be cleanup # Used as temporary HACK while waiting merge of #165 #[ -z "$SYNCTHING_INOTIFY_VERSION" ] && { SYNCTHING_INOTIFY_VERSION=master; SYNCTHING_INOTIFY_CMID=af6fbf9d63f95a0; } [ -z "$DESTDIR" ] && DESTDIR=/opt/AGL/xds/agent [ -z "$TMPDIR" ] && TMPDIR=/tmp [ -z "$GOOS" ] && GOOS=$(go env GOOS) [ -z "$GOARCH" ] && GOARCH=$(go env GOARCH) [ -z "$CLEANUP" ] && CLEANUP=false TEMPDIR=$TMPDIR/.get-syncthing.tmp mkdir -p ${TEMPDIR} && cd ${TEMPDIR} || exit 1 trap "cleanExit" 0 1 2 15 cleanExit () { if [ "$CLEANUP" = "true" ]; then rm -rf ${TEMPDIR} fi } TB_EXT="tar.gz" EXT="" [[ "$GOOS" = "windows" ]] && { TB_EXT="zip"; EXT=".exe"; } GOOS_ST=${GOOS} GOOS_STI=${GOOS} [[ "$GOOS" = "darwin" ]] && GOOS_ST="macosx" echo "Get Syncthing..." ## Install Syncthing + Syncthing-inotify ## gpg: key 00654A3E: public key "Syncthing Release Management <release@syncthing.net>" imported GPG=$(which gpg) if [ "$?" != 0 ]; then echo "You must install first gpg ( eg.: sudo apt install gpg )" exit 1 fi # Workaround about issue with the particular GPG keyserver: # trying several explicit keyservers until the command succeeds # (see https://github.com/jacobalberty/unifi-docker/issues/64) for server in $(shuf -e pool.sks-keyservers.net \ ha.pool.sks-keyservers.net \ hkp://p80.pool.sks-keyservers.net:80 \ keyserver.ubuntu.com \ hkp://keyserver.ubuntu.com:80 \ pgp.mit.edu) ; do ${GPG} -q --keyserver "$server" --recv-keys 37C84554E7E0A261E4F76E1ED26E6ED000654A3E && break || : done tarball="syncthing-${GOOS_ST}-${GOARCH}-v${SYNCTHING_VERSION}.${TB_EXT}" \ && curl --connect-timeout 60 --retry 3 -sfSL "https://github.com/syncthing/syncthing/releases/download/v${SYNCTHING_VERSION}/${tarball}" -O \ && curl --connect-timeout 60 --retry 3 -sfSL "https://github.com/syncthing/syncthing/releases/download/v${SYNCTHING_VERSION}/sha1sum.txt.asc" -O \ && gpg -q --verify sha1sum.txt.asc \ && grep -E " ${tarball}\$" sha1sum.txt.asc | sha1sum -c - \ && rm -rf sha1sum.txt.asc syncthing-${GOOS_ST}-${GOARCH}-v${SYNCTHING_VERSION} if [ "${TB_EXT}" = "tar.gz" ]; then tar -xvf "$tarball" --strip-components=1 "$(basename "$tarball" .tar.gz)"/syncthing \ && mv syncthing ${DESTDIR}/syncthing || exit 1 else unzip "$tarball" && mv syncthing-windows-*/syncthing.exe ${DESTDIR}/syncthing.exe || exit 1 fi echo "Get Syncthing-inotify..." if [ "$SYNCTHING_INOTIFY_VERSION" = "master" ]; then mkdir -p ${TEMPDIR}/syncthing-inotify-build/src/github.com/syncthing || exit 1 cd ${TEMPDIR}/syncthing-inotify-build/src/github.com/syncthing [[ ! -d ./syncthing ]] && (git clone https://github.com/syncthing/syncthing || exit 1; ) [[ ! -d ./syncthing-inotify ]] && (git clone https://github.com/syncthing/syncthing-inotify || exit 1; ) cd syncthing-inotify git status version=$(git describe --tags --always | sed 's/^v//')__patch_165 if [ "$SYNCTHING_INOTIFY_CMID" != "" ]; then git checkout -q $SYNCTHING_INOTIFY_CMID || exit 1 version=${version}__patch_165 fi # Workaround about "cannot find package "golang.org/x/sys/unix" go get -u golang.org/x/sys/unix # Workaround about "undefined: stream" error when cross-building MacOS # https://github.com/rjeczalik/notify/issues/108 OPTS="" [[ "$GOOS_STI" = "darwin" ]] && OPTS="-tags kqueue" export GOPATH=$(cd ../../../.. && pwd) go build ${OPTS} -v -i -ldflags "-w -X main.Version=$version" -o ${DESTDIR}/syncthing-inotify${EXT} || exit 1 else tarball="syncthing-inotify-${GOOS_STI}-${GOARCH}-v${SYNCTHING_INOTIFY_VERSION}.${TB_EXT}" curl --connect-timeout 60 --retry 3 -sfSL "https://github.com/syncthing/syncthing-inotify/releases/download/v${SYNCTHING_INOTIFY_VERSION}/${tarball}" -O || exit 1 rm -rf syncthing-inotify-${GOOS_STI}-${GOARCH}-v${SYNCTHING_INOTIFY_VERSION} if [ "${TB_EXT}" = "tar.gz" ]; then tar -xvf "${tarball}" syncthing-inotify && mv syncthing-inotify ${DESTDIR}/syncthing-inotify || exit 1 else unzip "$tarball" && mv syncthing-inotify.exe ${DESTDIR}/syncthing-inotify.exe || exit 1 fi fi echo "DONE: syncthing and syncthing-inotify successfuly installed in ${DESTDIR}"