From a5483ae3716f35a7d438843dd259448011ea14c4 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 18 Nov 2019 15:26:51 +0800 Subject: [PATCH] DEVELOPER_NOTES: update board lockfile info --- DEVELOPER_NOTES.rst | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/DEVELOPER_NOTES.rst b/DEVELOPER_NOTES.rst index 634ee2471..8c141fbf9 100644 --- a/DEVELOPER_NOTES.rst +++ b/DEVELOPER_NOTES.rst @@ -1,39 +1,17 @@ Sharing development boards ========================== -To avoid conflicts for development boards on the server, while using a board you must hold the corresponding lock file present in ``/var/lib/artiq/boards``. Holding the lock file grants you exclusive access to the board. +To avoid conflicts for development boards on the server, while using a board you must hold the corresponding lock file present in the ``/tmp`` folder of the machine to which the board is connected. Holding the lock file grants you exclusive access to the board. -To lock the KC705 for 30 minutes or until Ctrl-C is pressed: +For example, to lock the KC705 until ENTER is pressed: :: - flock --verbose /var/lib/artiq/boards/kc705-1 sleep 1800 - -Check that the command acquires the lock, i.e. prints something such as: -:: - flock: getting lock took 0.000003 seconds - flock: executing sleep - -To lock the KC705 for the duration of the execution of a shell: -:: - flock /var/lib/artiq/boards/kc705-1 bash - -You may also use this script: -:: - #!/bin/bash - exec flock /var/lib/artiq/boards/$1 bash --rcfile <(cat ~/.bashrc; echo PS1=\"[$1\ lock]\ \$PS1\") + ssh rpi-1.m-labs.hk "flock /tmp/board_lock-kc705-1 -c 'echo locked; read; echo unlocked'" If the board is already locked by another user, the ``flock`` commands above will wait for the lock to be released. -To determine which user is locking a board, use: +To determine which user is locking a board, use a command such as: :: - fuser -v /var/lib/artiq/boards/kc705-1 - - -Selecting a development board with artiq_flash -============================================== - -The board lock file also contains the openocd commands for selecting the corresponding developer board: -:: - artiq_flash -I "$(cat /var/lib/artiq/boards/sayma-1)" + ssh rpi-1.m-labs.hk "fuser -v /tmp/board_lock-kc705-1" Deleting git branches