Roger Pau Monne
2012-Feb-21 09:19 UTC
[PATCH 0 of 2] Linux/init: add udev and brctl checks to xencommons
Move udev and brctl checks previously in tools/check to xencommons.
Roger Pau Monne
2012-Feb-21 09:19 UTC
[PATCH 1 of 2] Linux/init: check for brctl at xencommons
# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1329811412 -3600
# Node ID 40f8487cacc807bb6f9d642b4fe75deaf1087833
# Parent c157f98ab8ff6e2e8b35cc6135f636896cb4f623
Linux/init: check for brctl at xencommons
Check for brctl at xencommons, since hotplug scripts use it.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
diff -r c157f98ab8ff -r 40f8487cacc8 tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons Tue Feb 21 08:46:04 2012 +0100
+++ b/tools/hotplug/Linux/init.d/xencommons Tue Feb 21 09:03:32 2012 +0100
@@ -50,6 +50,9 @@ if test -f /proc/xen/capabilities && \
exit 0
fi
+# Check if brctl is present
+hash brctl > /dev/null 2>&1 || echo "Warning: brctl not
found"
+
do_start () {
local time=0
local timeout=30
Roger Pau Monne
2012-Feb-21 09:19 UTC
[PATCH 2 of 2] Linux/init: check for udev >= 59 at xencommons
# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1329814249 -3600
# Node ID eea0d53efff1fa94266026088cd5498921598df6
# Parent 40f8487cacc807bb6f9d642b4fe75deaf1087833
Linux/init: check for udev >= 59 at xencommons
Check for udev at xencommons, since hotplug scripts use it.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
diff -r 40f8487cacc8 -r eea0d53efff1 tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons Tue Feb 21 09:03:32 2012 +0100
+++ b/tools/hotplug/Linux/init.d/xencommons Tue Feb 21 09:50:49 2012 +0100
@@ -53,6 +53,26 @@ fi
# Check if brctl is present
hash brctl > /dev/null 2>&1 || echo "Warning: brctl not
found"
+# Check for udev >= 59
+if ! hash udevadm > /dev/null 2>&1
+then
+ if ! hash udevinfo > /dev/null 2>&1
+ then
+ echo "Warning: unable to find udevadm or udevinfo"
+ else
+ udevver=`udevinfo -V | awk ''{print $NF}''`
+ fi
+else
+ udevver=`udevadm info -V | awk ''{print $NF}''`
+fi
+if test -z "${udevver}" || test "${udevver}" -lt 59
+then
+ if ! hash hotplug > /dev/null 2>&1
+ then
+ echo "Warning: udev is too old, upgrade to version 59 or later"
+ fi
+fi
+
do_start () {
local time=0
local timeout=30
Roger Pau Monné
2012-Feb-23 15:06 UTC
Re: [PATCH 0 of 2] Linux/init: add udev and brctl checks to xencommons
I''ve sent an updated version of this, so forget about this series. Thanks, Roger.
Ian Jackson
2012-Feb-24 12:06 UTC
Re: [PATCH 1 of 2] Linux/init: check for brctl at xencommons
Roger Pau Monne writes ("[PATCH 1 of 2] Linux/init: check for brctl at
xencommons"):> Linux/init: check for brctl at xencommons
...> +# Check if brctl is present
> +hash brctl > /dev/null 2>&1 || echo "Warning: brctl not
found"
I using think "type" would be more idomatic than "hash".
I think the warning message should go to stderr and mention
xencommons. I was going to suggest that you should use the lsb init
function "log_warning_msg" but I see that xencommons does not
currently source /lib/lsb/init-functions. But perhaps it should.
http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html
Ian.
Roger Pau Monné
2012-Feb-24 13:09 UTC
Re: [PATCH 1 of 2] Linux/init: check for brctl at xencommons
2012/2/24 Ian Jackson <Ian.Jackson@eu.citrix.com>:> Roger Pau Monne writes ("[PATCH 1 of 2] Linux/init: check for brctl at xencommons"): >> Linux/init: check for brctl at xencommons > ... >> +# Check if brctl is present >> +hash brctl > /dev/null 2>&1 || echo "Warning: brctl not found"(this is a previous version of the patch, see http://lists.xen.org/archives/html/xen-devel/2012-02/msg02108.html for the new series)> I using think "type" would be more idomatic than "hash".Ok, I will replace hash with type> I think the warning message should go to stderr and mention > xencommons. I was going to suggest that you should use the lsb init > function "log_warning_msg" but I see that xencommons does not > currently source /lib/lsb/init-functions. But perhaps it should.I usually use OpenRC under Linux, and since it doesn't like the stock xencommons file I use a custom one. If you think it is ok to include /lib/lsb/init-functions I can update the series to include that and make use of log_warning_msg.> http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html > > Ian._______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel