diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2015-04-06 12:39:04 +0100 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2015-04-06 12:39:04 +0100 |
commit | c7d526c1deeca057f3b4b0b4dd5b25979aa8fbe2 (patch) | |
tree | df19a801b768d7b3424e29347c44fbda8c40b3e6 /scripts | |
parent | d7e6e160f278891ff0a937a3012413db0c5a6f4b (diff) |
Enable uname substitution in schroot sessions
This is a handy trick when building native old-gen
toolchains on new-gen machines.
Change-Id: I6f97bfa8133b994dad641e3c497b4a5a7ee77d84
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/test-schroot.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/test-schroot.sh b/scripts/test-schroot.sh index 447df314..6f7bf685 100755 --- a/scripts/test-schroot.sh +++ b/scripts/test-schroot.sh @@ -17,8 +17,9 @@ target_ssh_opts="" host_ssh_opts="" profile="tcwg-test" multilib_path="lib" +uname="" -while getopts "a:bd:e:fh:l:mo:p:P:qv" OPTION; do +while getopts "a:bd:e:fh:l:mo:p:P:qu:v" OPTION; do case $OPTION in a) arch=$OPTARG ;; b) begin_session=true ;; @@ -32,6 +33,7 @@ while getopts "a:bd:e:fh:l:mo:p:P:qv" OPTION; do p) host_ssh_opts="$OPTARG" ;; P) profile="$OPTARG" ;; q) exec > /dev/null ;; + u) uname="$OPTARG" ;; v) set -x ;; esac done @@ -246,6 +248,18 @@ EOF echo $target:$port installed sysroot $sysroot fi +if [ x"$uname" != x"" ]; then + old_uname="$($rsh root@$target "uname -m")" + $rsh root@$target "mv /bin/uname /bin/uname.real" + $rsh root@$target "cat > /bin/uname" <<EOF +#!/bin/bash + +/bin/uname.real "\$@" | sed -e "s/$old_uname/$uname/g" +exit \${PIPESTATUS[0]} +EOF + $rsh root@$target "chmod a+x /bin/uname" +fi + if $ssh_master; then ssh $orig_target_ssh_opts -o Port=$port -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -fMN $target fi |