aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2015-04-06 12:13:44 +0100
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2015-04-06 12:20:44 +0100
commit66493069b76af5584ada926409b8d919f2fc97d8 (patch)
tree7091de17d1e9245856cebb952feb379e24768b58 /scripts
parent4500e7d2457564af3ea6b4a0f3f509f319e13683 (diff)
Remove schroot generation and copy logic
This is now moved to schroot-master.git/admin-schroot.sh script in another repo. Change-Id: I1f64dd6958f904bb5761579507b823a7b1267566
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/test-schroot.sh127
1 files changed, 1 insertions, 126 deletions
diff --git a/scripts/test-schroot.sh b/scripts/test-schroot.sh
index 52ef9d72..447df314 100755
--- a/scripts/test-schroot.sh
+++ b/scripts/test-schroot.sh
@@ -8,11 +8,9 @@ set -e
arch="native"
begin_session=false
-schroot_master=""
shared_dir=""
board_exp=""
finish_session=false
-gen_schroot=false
sysroot=""
ssh_master=false
target_ssh_opts=""
@@ -20,15 +18,13 @@ host_ssh_opts=""
profile="tcwg-test"
multilib_path="lib"
-while getopts "a:bc:d:e:fgh:l:mo:p:P:qv" OPTION; do
+while getopts "a:bd:e:fh:l:mo:p:P:qv" OPTION; do
case $OPTION in
a) arch=$OPTARG ;;
b) begin_session=true ;;
- c) schroot_master="$OPTARG" ;;
d) shared_dir=$OPTARG ;;
e) board_exp="$OPTARG" ;;
f) finish_session=true ;;
- g) gen_schroot=true ;;
h) multilib_path="$OPTARG" ;;
l) sysroot=$OPTARG ;;
m) ssh_master=true ;;
@@ -144,127 +140,6 @@ rsh="ssh $rsh_opts"
user="$(ssh $target_ssh_opts $target echo \$USER)"
home="$(ssh $target_ssh_opts $target pwd)"
-if $gen_schroot; then
- chroot=/tmp/$schroot_id.$$
-
- # Make sure machine in the lab agree on what time it is.
- ssh $target_ssh_opts $target \
- sudo ntpdate pool.ntp.org >/dev/null 2>&1 || true
-
- ssh $target_ssh_opts $target \
- sudo rm -rf $chroot
- ssh $target_ssh_opts $target \
- sudo debootstrap \
- --arch=$deb_arch \
- --variant=minbase \
- --include=iptables,openssh-server,rsync,sshfs \
- --foreign \
- $deb_dist $chroot
- # Copy qemu binaries to handle foreign schroots.
- ssh $target_ssh_opts $target \
- sudo cp /usr/bin/qemu-\*-static $chroot/usr/bin/ || true
- ssh $target_ssh_opts $target \
- sudo chroot $chroot ./debootstrap/debootstrap --second-stage &
- pid=$!
- while sleep 10; do
- if ! ssh $target_ssh_opts $target ps -e -o cmd= | grep -v "grep\|ssh" | grep "./debootstrap/debootstrap --second-stage" >/dev/null; then
- kill $pid || true
- break
- fi
- done
-
- # Configure APT sources.
- case "$deb_arch" in
- amd64|i386) deb_mirror="http://archive.ubuntu.com/ubuntu/" ;;
- *) deb_mirror="http://ports.ubuntu.com/ubuntu-ports/" ;;
- esac
- ssh $target_ssh_opts $target \
- sudo chroot $chroot bash -c "\"for i in '' -updates -security -backports; do for j in '' -src; do echo deb\\\$j $deb_mirror $deb_dist\\\$i main restricted universe multiverse >> /etc/apt/sources.list; done; done\""
-
- case "$deb_arch" in
- amd64) extra_packages="qemu-user-static gdb gdbserver" ;;
- *) extra_packages="gdb gdbserver" ;;
- esac
-
- case "$profile" in
- "tcwg-build") extra_packages="autoconf autogen automake bash bison build-essential ccrypt dejagnu flex gawk git g++ gcc libncurses5-dev libtool make texinfo wget xz-utils" ;;
- esac
-
- if ! [ -z "$extra_packages" ]; then
- ssh $target_ssh_opts $target \
- sudo chroot $chroot apt-get update
- ssh $target_ssh_opts $target \
- sudo chroot $chroot apt-get install -y "$extra_packages"
- fi
-
- if [ "$(echo "$extra_packages" | grep -c qemu-user-static)" = "0" ]; then
- ssh $target_ssh_opts $target \
- sudo rm -f $chroot/usr/bin/qemu-\*-static
- fi
-
- # Install foundation model in x86_64 chroots for bare-metal testing
- if [ x"$deb_arch" = x"amd64" ]; then
- ssh $target_ssh_opts $target \
- sudo mkdir -p $chroot/linaro/foundation-model/Foundation_v8pkg
- ssh $target_ssh_opts $target \
- sudo rsync -a /linaro/foundation-model/Foundation_v8pkg/ $chroot/linaro/foundation-model/Foundation_v8pkg/
- fi
-
- if echo "$extra_packages" | grep -q "git"; then
- ssh $target_ssh_opts $target \
- sudo ln -s /usr/share/doc/git/contrib/workdir/git-new-workdir $chroot/usr/local/bin/
- ssh $target_ssh_opts $target \
- sudo chmod a+x $chroot/usr/share/doc/git/contrib/workdir/git-new-workdir
- fi
-
- ssh $target_ssh_opts $target \
- sudo mkdir -p /var/chroots/
- ssh $target_ssh_opts $target \
- sudo bash -c "\"cd $chroot && tar --one-file-system -czf /var/chroots/$schroot_id.tgz .\""
-
- ssh $target_ssh_opts $target \
- sudo rm -rf $chroot
-
- case "$deb_arch" in
- armhf|i386) personality="personality=linux32" ;;
- *) personality="" ;;
- esac
-
- ssh $target_ssh_opts $target \
- sudo bash -c "\"cat > /etc/schroot/chroot.d/$schroot_id\"" <<EOF
-[$schroot_id]
-type=file
-file=/var/chroots/$schroot_id.tgz
-groups=users
-root-groups=users
-profile=$profile
-$personality
-EOF
-
- if ! [ -z "$schroot_master" ]; then
- scp $target_ssh_opts $target:/var/chroots/$schroot_id.tgz $schroot_master/
- mkdir -p $schroot_master/chroot.d/
- scp $target_ssh_opts $target:/etc/schroot/chroot.d/$schroot_id $schroot_master/chroot.d/
- fi
-fi
-
-if ! [ -z "$schroot_master" ]; then
- # Make sure machine in the lab agree on what time it is.
- ssh $target_ssh_opts $target \
- sudo ntpdate pool.ntp.org >/dev/null 2>&1 || true
-
- ssh $target_ssh_opts $target \
- sudo mkdir -p /var/chroots/
-
- cat $schroot_master/$schroot_id.tgz | ssh $target_ssh_opts $target \
- sudo bash -c "\"cat > /var/chroots/$schroot_id.tgz\""
- cat $schroot_master/chroot.d/$schroot_id | ssh $target_ssh_opts $target \
- sudo bash -c "\"cat > /etc/schroot/chroot.d/$schroot_id\""
-
- (cd $schroot_master && tar -c $profile/ | ssh $target_ssh_opts $target \
- sudo bash -c "\"cd /etc/schroot && rm -rf $profile && tar -x && chown -R root:root $profile/\"")
-fi
-
if $begin_session; then
ssh $target_ssh_opts $target schroot -b -c chroot:$schroot_id -n $profile-$port -d /
$schroot sh -c "\"echo $user - data $((1024*1024)) >> /etc/security/limits.conf\""