Date: Wed, 26 Mar 2014 08:43:06 +0000 (UTC) From: Julio Merino <jmmv@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r263766 - user/jmmv/autotest/node Message-ID: <201403260843.s2Q8h6lP083555@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jmmv Date: Wed Mar 26 08:43:05 2014 New Revision: 263766 URL: http://svnweb.freebsd.org/changeset/base/263766 Log: Turn setup into an shtk-based script. This means that "pkg install shtk" must be run first on the host by hand, but that's easy enough to do. Added a check to the Makefile to ensure that shtk is present. The reason for doing this is that I want to add extra logic to this script, and that logic will be much easier to implement with shtk. Added: user/jmmv/autotest/node/setup.sh - copied, changed from r263762, user/jmmv/autotest/node/setup Deleted: user/jmmv/autotest/node/setup Modified: user/jmmv/autotest/node/Makefile Modified: user/jmmv/autotest/node/Makefile ============================================================================== --- user/jmmv/autotest/node/Makefile Wed Mar 26 07:42:43 2014 (r263765) +++ user/jmmv/autotest/node/Makefile Wed Mar 26 08:43:05 2014 (r263766) @@ -9,10 +9,14 @@ SHELL= /bin/sh CONFIGS_SUBDIR!= hostname -s SYSCONFDIR= ${.CURDIR}/configs/${CONFIGS_SUBDIR} -SCRIPTS= iterate loop +SCRIPTS= iterate loop setup .PHONY: all -all: ${SCRIPTS} rc.d/autotest_node +all: check-shtk .WAIT ${SCRIPTS} rc.d/autotest_node + +check-shtk: .PHONY + @"${SHTK}" version >/dev/null 2>&1 \ + || echo "shtk not available; run 'pkg install shtk'" .for script in ${SCRIPTS} ${script}: ${script}.sh Copied and modified: user/jmmv/autotest/node/setup.sh (from r263762, user/jmmv/autotest/node/setup) ============================================================================== --- user/jmmv/autotest/node/setup Wed Mar 26 06:26:53 2014 (r263762, copy source) +++ user/jmmv/autotest/node/setup.sh Wed Mar 26 08:43:05 2014 (r263766) @@ -1,4 +1,3 @@ -#! /bin/sh # $FreeBSD$ # # Copyright 2013 Google Inc. @@ -29,18 +28,16 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# \file setup +# \file setup.sh # Configures the current machine as an autotest node. -set -e -x - -PROGDIR="$(cd $(dirname ${0}) && pwd)" +shtk_import cli # Installs any required packages and ensures they are up-to-date. install_deps() { pkg update - pkg install -y qemu-devel kyua shtk + pkg install -y qemu-devel kyua pkg upgrade -y } @@ -50,20 +47,20 @@ install_deps() { # \param ... Arguments to make. Use to pass variable overrides for the host, # such as the location of shtk(1). build() { - make -C "${PROGDIR}" clean - make -C "${PROGDIR}" all "${@}" + make -C "$(shtk_cli_dirname)" clean + make -C "$(shtk_cli_dirname)" all "${@}" } # Sets up rc.conf to start autotest_node on boot. enable_daemon() { - grep "local_startup.*${PROGDIR}/rc.d" /etc/rc.conf \ - || echo "local_startup=\"\${local_startup} ${PROGDIR}/rc.d\"" \ + grep "local_startup.*$(shtk_cli_dirname)/rc.d" /etc/rc.conf \ + || echo "local_startup=\"\${local_startup} $(shtk_cli_dirname)/rc.d\"" \ >>/etc/rc.conf grep "autotest_node_enable=yes" /etc/rc.conf \ || echo "autotest_node_enable=yes" >>/etc/rc.conf - "${PROGDIR}/rc.d/autotest_node" start + "$(shtk_cli_dirname)/rc.d/autotest_node" start } @@ -73,6 +70,3 @@ main() { build "${@}" enable_daemon } - - -main "${@}"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403260843.s2Q8h6lP083555>