summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md10
-rwxr-xr-xbackup.sh18
-rwxr-xr-xlava-master/entrypoint.d/01_setup.sh4
3 files changed, 24 insertions, 8 deletions
diff --git a/README.md b/README.md
index 954d90d..3848bef 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@ You will see it in the "All Jobs" list: http://localhost:10080/scheduler/alljobs
To add a board you need to find its device-type, standard naming is to use the same as the official kernel DT name.
(But a very few DUT differ from that)
-You could check in https://github.com/Linaro/lava-server/tree/release/lava_scheduler_app/tests/device-types if you find yours.
+You could check in https://github.com/Linaro/lava/tree/master/etc/dispatcher-config/device-types if you find yours.
Example:
For a beagleboneblack, the device-type is beaglebone-black (Even if official DT name is am335x-boneblack)
@@ -332,7 +332,7 @@ boards:
interfacenum: (optional) The interfacenumber of the serial. (Used with two serial in one device)
use_conmux: True/False (Use conmux-console instead of ser2net)
use_ser2net: True/False (Deprecated, ser2net is the default uart handler)
- ser2net_options (optional) A list of ser2net options to add
+ ser2net_options: (optional) A list of ser2net options to add
- option1
- option2
use_screen: True/False (Use screen via ssh instead of ser2net)
@@ -355,6 +355,12 @@ Example:
Bus 001 Device 054: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
```
This device must use "0403" for idvendor and 6001 for idproduct.
+* Some boards reset serial on power on. This can cause ser2net/telnet to disconnect resulting in the LAVA Worker being unable to program the board. This may be mitigated by passing LOCAL as an option to ser2net in the boards.yaml.
+Example:
+```
+ ser2net_options:
+ - LOCAL
+```
Note on connection_command: connection_command is for people which want to use other custom way than ser2net to handle the console.
diff --git a/backup.sh b/backup.sh
index f4cf1de..3edd133 100755
--- a/backup.sh
+++ b/backup.sh
@@ -1,6 +1,11 @@
#!/bin/sh
BACKUP_DIR="backup-$(date +%Y%m%d_%H%M)"
+# use /tmp by default on host (this is used by tar)
+TMPDIR=${TMPDIR:-/tmp}
+export TMPDIR
+
+mkdir -p $TMPDIR
mkdir $BACKUP_DIR
cp boards.yaml $BACKUP_DIR
@@ -10,18 +15,19 @@ if [ -z "$DOCKERID" ];then
exit 1
fi
-docker exec -ti $DOCKERID tar czf /root/devices.tar.gz /etc/lava-server/dispatcher-config/devices/ || exit $?
+docker exec -t $DOCKERID tar czf /root/devices.tar.gz /etc/lava-server/dispatcher-config/devices/ || exit $?
docker cp $DOCKERID:/root/devices.tar.gz $BACKUP_DIR/ || exit $?
# for an unknown reason pg_dump > file doesnt work
-docker exec -ti $DOCKERID sudo -u postgres pg_dump --create --clean lavaserver --file /tmp/db_lavaserver || exit $?
-docker exec -ti $DOCKERID gzip /tmp/db_lavaserver || exit $?
+docker exec -t $DOCKERID sudo -u postgres pg_dump --create --clean lavaserver --file /tmp/db_lavaserver || exit $?
+docker exec -t $DOCKERID gzip /tmp/db_lavaserver || exit $?
docker cp $DOCKERID:/tmp/db_lavaserver.gz $BACKUP_DIR/ || exit $?
-docker exec -ti $DOCKERID rm /tmp/db_lavaserver.gz || exit $?
+docker exec -t $DOCKERID rm /tmp/db_lavaserver.gz || exit $?
-docker exec -ti $DOCKERID tar czf /root/joboutput.tar.gz /var/lib/lava-server/default/media/job-output/ || exit $?
+# tar outputs warnings when file changes on disk while creating tar file. So do not "exit on error"
+docker exec -t $DOCKERID tar czf /root/joboutput.tar.gz /var/lib/lava-server/default/media/job-output/ || echo "WARNING: tar operation returned $?"
docker cp $DOCKERID:/root/joboutput.tar.gz $BACKUP_DIR/ || exit $?
-docker exec -ti $DOCKERID rm /root/joboutput.tar.gz || exit $?
+docker exec -t $DOCKERID rm /root/joboutput.tar.gz || exit $?
echo "Backup done in $BACKUP_DIR"
rm -f backup-latest
diff --git a/lava-master/entrypoint.d/01_setup.sh b/lava-master/entrypoint.d/01_setup.sh
index eb5c8ef..5e437ef 100755
--- a/lava-master/entrypoint.d/01_setup.sh
+++ b/lava-master/entrypoint.d/01_setup.sh
@@ -17,6 +17,10 @@ if [ -e /root/backup/db_lavaserver ];then
yes yes | lava-server manage migrate || exit $?
echo "Restore jobs output from backup"
rm -r /var/lib/lava-server/default/media/job-output/*
+
+ # allow using different folder for tar operations (/tmp by default)
+ TMPDIR=${TMPDIR:-/tmp}
+
tar xzf /root/backup/joboutput.tar.gz || exit $?
fi
lava-server manage makemigrations