1#!/bin/sh
2
3src='./install'
4if [ -d ./dist ]; then
5  src='./dist/install'
6fi
7
8if ! [ -d $src ]; then
9  echo "ERROR: Could not find a valid distribution directory."
10  echo "       If this is a source-only release, try 'make dist'."
11  exit 1
12fi
13
14dst='/'
15if [ $# -ne 0 ]; then
16  dst=$1
17fi
18
19if ! [ -d $dst ]; then
20  echo "ERROR: You must specify a valid install directory."
21  echo "       The specified directory '$dst' is not valid."
22  exit 1
23fi
24
25tmp="`mktemp -d`"
26
27echo "Installing Xen from '$src' to '$dst'..."
28(cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
29
30(cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf -
31rm -rf "$tmp"
32
33echo "All done."
34
35exit 0
36