3 fail () { printf >&2 "%s: %s\n" "$0" "$*"; exit 127; }
5 if test -f /etc/lsb-release; then . /etc/lsb-release; fi
7 d="${USERV_U_distro:-$DISTRIB_CODENAME}"
8 n="${USERV_U_nominum:-adt}"
13 */*|.*|*.*|*_*_*) fail 'dangerous format in distro or nominum' ;;
15 *) fail 'userv adtxenlvm only supports nominums starting with adt' ;;
18 nddir=/var/lib/autopkgtest/xenlvm/"$nd"
19 test -d "$nddir" || fail 'unknown distro or nominum'
23 exec "$base" --adt-distro="$d" --adt-nominum="$n" "$@"
27 with) run adt-xenlvm-with-testbed sh -c 'echo y && exec cat' ;;
28 pon0) run adt-xenlvm-on-testbed -- --print0-command ;;
29 *) fail 'unknown mode'