debuggers.hg

view install.sh @ 22848:6341fe0f4e5a

Added tag 4.1.0-rc2 for changeset 9dca60d88c63
author Keir Fraser <keir@xen.org>
date Tue Jan 25 14:06:55 2011 +0000 (2011-01-25)
parents c964dd391c7d
children
line source
1 #!/bin/sh
3 src='./install'
4 if [ -d ./dist ]; then
5 src='./dist/install'
6 fi
8 if ! [ -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
12 fi
14 dst='/'
15 if [ $# -ne 0 ]; then
16 dst=$1
17 fi
19 if ! [ -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
23 fi
25 tmp="`mktemp -d`"
27 echo "Installing Xen from '$src' to '$dst'..."
28 (cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
30 [ -x "$(which udevinfo)" ] && \
31 UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
33 [ -z "$UDEV_VERSION" -a -x /sbin/udevadm ] && \
34 UDEV_VERSION=$(/sbin/udevadm info -V | awk '{print $NF}')
36 if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
37 echo " - installing for udev-based system"
38 rm -rf "$tmp/etc/hotplug"
39 else
40 echo " - installing for hotplug-based system"
41 rm -rf "$tmp/etc/udev"
42 fi
44 echo " - modifying permissions"
45 chmod -R a+rX "$tmp"
47 (cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf -
48 rm -rf "$tmp"
50 echo "All done."
52 echo "Checking to see whether prerequisite tools are installed..."
53 cd $src/../check
54 ./chk install
55 echo "All done."
57 exit 0