ia64/xen-unstable

changeset 9102:e639d53330ba

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>
author kaf24@firebug.cl.cam.ac.uk
date Thu Mar 02 11:41:48 2006 +0100 (2006-03-02)
parents d9f980fabc18
children 4dd325c1d87d
files install.sh
line diff
     1.1 --- a/install.sh	Thu Mar 02 11:03:34 2006 +0100
     1.2 +++ b/install.sh	Thu Mar 02 11:41:48 2006 +0100
     1.3 @@ -22,20 +22,30 @@ if ! [ -d $dst ]; then
     1.4    exit 1
     1.5  fi
     1.6  
     1.7 +tmp="`mktemp -d`"
     1.8 +
     1.9  echo "Installing Xen from '$src' to '$dst'..."
    1.10 -(cd $src; tar -cf - --exclude etc/init.d --exclude etc/hotplug --exclude etc/udev * ) | tar -C $dst -xf -
    1.11 -cp -fdRL $src/etc/init.d/* $dst/etc/init.d/
    1.12 -echo "All done."
    1.13 +(cd $src; tar -cf - * ) | tar -C "$tmp" -xf -
    1.14  
    1.15  [ -x "$(which udevinfo)" ] && \
    1.16    UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
    1.17  
    1.18  if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
    1.19 -  cp -f $src/etc/udev/rules.d/*.rules $dst/etc/udev/rules.d/
    1.20 +  echo " - installing for udev-based system"
    1.21 +  rm -rf "$tmp/etc/hotplug"
    1.22  else
    1.23 -  cp -f $src/etc/hotplug/*.agent $dst/etc/hotplug/
    1.24 +  echo " - installing for hotplug-based system"
    1.25 +  rm -rf "$tmp/etc/udev"
    1.26  fi
    1.27  
    1.28 +echo " - modifying permissions"
    1.29 +chmod -R a+rX "$tmp"
    1.30 +
    1.31 +(cd $tmp; tar -cf - *) | tar --no-same-owner -C "$dst" -xf -
    1.32 +rm -rf "$tmp"
    1.33 +
    1.34 +echo "All done."
    1.35 +
    1.36  echo "Checking to see whether prerequisite tools are installed..."
    1.37  cd $src/../check
    1.38  ./chk install