From: Murillo Fernandes Bernardes Subject: Re: Change check for udev on install.sh and check_hotplug Date: Fri, 18 Nov 2005 11:54:33 -0200 Message-ID: <200511181154.33360.mfb@br.ibm.com> References: <200511180030.49761.mfb@br.ibm.com> <20051118125600.GG8215@leeni.uk.xensource.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_Z0dfDPZd1u9NvoY" Return-path: In-Reply-To: <20051118125600.GG8215@leeni.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ewan Mellor Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_Z0dfDPZd1u9NvoY Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Friday 18 November 2005 10:56, Ewan Mellor wrote: > On Fri, Nov 18, 2005 at 12:30:49AM -0200, Murillo Fernandes Bernardes wrote: > > Changes check for "udev", so that it works on debian sid (that does not > > have /sbin/udev anymore). > > > > Signed-off-by: Murillo F. Bernardes > Isn't this going to issue a "udevinfo: command not found" message if udev > isn't installed? > It would be better if you checked for the existence of > udevinfo before trying to run it. fixed in this patch. Signed-off-by: Murillo F. Bernardes -- Murillo Fernandes Bernardes --Boundary-00=_Z0dfDPZd1u9NvoY Content-Type: text/x-diff; charset="iso-8859-1"; name="install-udev-check.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="install-udev-check.patch" diff -r f6fdb6e0d3c9 install.sh --- a/install.sh Thu Nov 17 13:56:50 2005 +++ b/install.sh Fri Nov 18 13:52:08 2005 @@ -27,7 +27,10 @@ cp -fdRL $src/etc/init.d/* $dst/etc/init.d/ echo "All done." -if [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 ]; then +[ -x "$(which udevinfo)" ] && \ + UDEV_VERSION=$(udevinfo -V | sed -e 's/^.*\s\([0-9]\+\)[^0-9]*/\1/') + +if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then cp -f $src/etc/udev/rules.d/*.rules $dst/etc/udev/rules.d/ else cp -f $src/etc/hotplug/*.agent $dst/etc/hotplug/ diff -r f6fdb6e0d3c9 tools/check/check_hotplug --- a/tools/check/check_hotplug Thu Nov 17 13:56:50 2005 +++ b/tools/check/check_hotplug Fri Nov 18 13:52:08 2005 @@ -6,8 +6,10 @@ echo ' *** Check for the hotplug scripts (hotplug) FAILED' exit 1 } +[ -x "$(which udevinfo)" ] && \ + UDEV_VERSION=$(udevinfo -V | sed -e 's/^.*\s\([0-9]\+\)[^0-9]*/\1/') -if [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 ]; then +if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then exit 0 fi --Boundary-00=_Z0dfDPZd1u9NvoY Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_Z0dfDPZd1u9NvoY--