debuggers.hg

view install.sh @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 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