From 12acf93505cf5f678c615475063eca8db6ff5233 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Thu, 17 Nov 2016 17:56:42 +0000 Subject: [PATCH] integrate-distro.sh: Support for running without ytools-run installed Signed-off-by: Jan Lindemann --- scripts/integrate-distro.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/integrate-distro.sh b/scripts/integrate-distro.sh index 3681f664..da936e51 100644 --- a/scripts/integrate-distro.sh +++ b/scripts/integrate-distro.sh @@ -1,7 +1,5 @@ #!/bin/sh -. ini-tools.sh - # -- defaults # install_dev=/dev/sdb arch=`uname -m` @@ -450,7 +448,8 @@ usage() get_opts() { - eval set -- `getopt -o 'hd:n:a:p:k:u:w:s:r:fc:' -l config-file:,non-interactive -- "$@"` + local p + eval set -- `getopt -o 'hd:n:a:p:k:u:w:s:r:fc:P:' -l config-file:,non-interactive -- "$@"` while [ "$1" != -- ] ; do case "$1" in -h) @@ -503,6 +502,13 @@ get_opts() -f) o_force=1 ;; + -P) + export PATH="$2" + for p in /sbin /usr/sbin; do + echo $PATH | grep -q "\(^\|:\)$p\(:\|$\)" || PATH=$PATH:$p + done + shift + ;; *) usage 1 ;; @@ -1380,6 +1386,8 @@ host_files="" declare -A hooks get_opts "$@" +. ini-tools.sh + case $arch in i386|i586|i686) case `uname -m` in @@ -1433,7 +1441,7 @@ if [ `whoami` != root -o "$l32" ]; then opts="" [ "$config_file" ] && opts="$opts --config-file $config_file" #debug="/bin/bash -x" - ssh -l root localhost $l32 $debug $exe $@ -p $root_password_file -u $scm_user -w $cwd $opt_ssh_auth_sock $opts + ssh -l root localhost $l32 $debug $exe $@ -p $root_password_file -u $scm_user -w $cwd $opt_ssh_auth_sock -P "$PATH" $opts exit $? fi