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>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2006-03-02 11:41:48 +01:00
1 parent e3045add08
commit 3244faf9d5
1 file changed
+15 -5
+15 -5
View File
@@ -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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.