From 3244faf9d5119d86007f47b6715d688bd8f95da0 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 2 Mar 2006 11:41:48 +0100 Subject: 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 Signed-off-by: Keir Fraser --- install.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'install.sh') 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 -- cgit v1.2.3