aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-02 11:41:48 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-02 11:41:48 +0100
commit3244faf9d5119d86007f47b6715d688bd8f95da0 (patch)
tree5dd0a3a2bb192c372437eda0181f9baa083627d0 /install.sh
parente3045add081fb0fcf1b2c9be65027fdfbdd92d9e (diff)
downloadxen-3244faf9d5119d86007f47b6715d688bd8f95da0.tar.gz
xen-3244faf9d5119d86007f47b6715d688bd8f95da0.tar.bz2
xen-3244faf9d5119d86007f47b6715d688bd8f95da0.zip
Make sure that installed files have sensible permissions and are owned by the
user running install. Also clean up the install script a little. Signed-off-by: Horms <horms@verge.net.au> Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/install.sh b/install.sh
index d51bc51eab..fab9472c86 100755
--- a/install.sh
+++ b/install.sh
@@ -22,20 +22,30 @@ if ! [ -d $dst ]; then
exit 1
fi
+tmp="`mktemp -d`"
+
echo "Installing Xen from '$src' to '$dst'..."
-(cd $src; tar -cf - --exclude etc/init.d --exclude etc/hotplug --exclude etc/udev * ) | tar -C $dst -xf -
-cp -fdRL $src/etc/init.d/* $dst/etc/init.d/
-echo "All done."
+(cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
[ -x "$(which udevinfo)" ] && \
UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
- cp -f $src/etc/udev/rules.d/*.rules $dst/etc/udev/rules.d/
+ echo " - installing for udev-based system"
+ rm -rf "$tmp/etc/hotplug"
else
- cp -f $src/etc/hotplug/*.agent $dst/etc/hotplug/
+ echo " - installing for hotplug-based system"
+ rm -rf "$tmp/etc/udev"
fi
+echo " - modifying permissions"
+chmod -R a+rX "$tmp"
+
+(cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf -
+rm -rf "$tmp"
+
+echo "All done."
+
echo "Checking to see whether prerequisite tools are installed..."
cd $src/../check
./chk install