Lets try this again. The first patch adjusts the initscripts to use explicit paths, this follows the NetBSD method of using hotplugpath.sh (I resisted renaming since its all a bit entwined). This time I have more carefully cleaned all vestiges of Xen out from /usr and installed into /usr/local and tested PV and HVM guests. Ian.
Use xen-hotplugpath.sh (as NEtBSD does) which allows PREFIX etc to change. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> --- tools/hotplug/Linux/init.d/xen-watchdog | 4 +++- tools/hotplug/Linux/init.d/xencommons | 24 ++++++++++++------------ tools/hotplug/Linux/init.d/xend | 16 +++++++++------- tools/hotplug/Linux/init.d/xendomains | 6 ++++-- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/tools/hotplug/Linux/init.d/xen-watchdog b/tools/hotplug/Linux/init.d/xen-watchdog index 55dd091..3592fda 100644 --- a/tools/hotplug/Linux/init.d/xen-watchdog +++ b/tools/hotplug/Linux/init.d/xen-watchdog @@ -17,7 +17,9 @@ ### END INIT INFO # -DAEMON=/usr/sbin/xenwatchdogd +. /etc/xen/scripts/hotplugpath.sh + +DAEMON=${SBINDIR}/xenwatchdogd base=$(basename $DAEMON) # Source function library. diff --git a/tools/hotplug/Linux/init.d/xencommons b/tools/hotplug/Linux/init.d/xencommons index 20afcc0..a2e633b 100644 --- a/tools/hotplug/Linux/init.d/xencommons +++ b/tools/hotplug/Linux/init.d/xencommons @@ -18,6 +18,8 @@ # Description: Starts and stops the daemons neeeded for xl/xend ### END INIT INFO +. /etc/xen/scripts/hotplugpath.sh + if [ -d /etc/sysconfig ]; then xencommons_config=/etc/sysconfig else @@ -72,7 +74,7 @@ do_start () { modprobe blktap2 2>/dev/null || modprobe blktap 2>/dev/null mkdir -p /var/run/xen - if ! `xenstore-read -s / >/dev/null 2>&1` + if ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` then test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored" rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null @@ -81,19 +83,19 @@ do_start () { if [ -n "$XENSTORED" ] ; then echo -n Starting $XENSTORED... $XENSTORED --pid-file /var/run/xenstored.pid $XENSTORED_ARGS - elif [ -x /usr/sbin/oxenstored ] ; then + elif [ -x ${SBINDIR}/oxenstored ] ; then echo -n Starting oxenstored... - /usr/sbin/oxenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS - elif [ -x /usr/sbin/xenstored ] ; then + ${SBINDIR}/oxenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS + elif [ -x ${SBINDIR}/xenstored ] ; then echo -n Starting C xenstored... - /usr/sbin/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS + ${SBINDIR}/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS else echo "No xenstored found" exit 1 fi # Wait for xenstored to actually come up, timing out after 30 seconds - while [ $time -lt $timeout ] && ! `xenstore-read -s / >/dev/null 2>&1` ; do + while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do echo -n . time=$(($time+1)) sleep 1 @@ -107,16 +109,14 @@ do_start () { fi echo Setting domain 0 name... - xenstore-write "/local/domain/0/name" "Domain-0" + ${BINDIR}/xenstore-write "/local/domain/0/name" "Domain-0" fi echo Starting xenconsoled... test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE" - xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS - test -z "$XENBACKENDD_DEBUG" || XENBACKENDD_ARGS="-d" - test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS + ${SBINDIR}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS echo Starting QEMU as disk backend for dom0 - test -z "$QEMU_XEN" && QEMU_XEN=/usr/lib/xen/bin/qemu-system-i386 + test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC}/qemu-system-i386" $QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \ -monitor /dev/null -serial /dev/null -parallel /dev/null \ -pidfile $QEMU_PIDFILE @@ -144,7 +144,7 @@ case "$1" in do_start ;; status) - xenstore-read -s / + ${BINDIR}/xenstore-read -s / ;; stop) do_stop diff --git a/tools/hotplug/Linux/init.d/xend b/tools/hotplug/Linux/init.d/xend index 0fd7b16..5f92cdc 100755 --- a/tools/hotplug/Linux/init.d/xend +++ b/tools/hotplug/Linux/init.d/xend @@ -18,6 +18,8 @@ # Description: Starts and stops the Xen control daemon. ### END INIT INFO +. /etc/xen/scripts/hotplugpath.sh + shopt -s extglob # Wait for Xend to be up @@ -25,12 +27,12 @@ function await_daemons_up { i=1 rets=10 - xend status + ${SBINDIR}/xend status while [ $? -ne 0 -a $i -lt $rets ]; do sleep 1 echo -n . i=$(($i + 1)) - xend status + ${SBINDIR}/xend status done } @@ -48,21 +50,21 @@ case "$1" in else touch /var/lock/xend fi - xend start + ${SBINDIR}/xend start await_daemons_up ;; stop) - xend stop + ${SBINDIR}/xend stop rm -f /var/lock/subsys/xend /var/lock/xend ;; status) - xend status + ${SBINDIR}/xend status ;; reload) - xend reload + ${SBINDIR}/xend reload ;; restart|force-reload) - xend restart + ${SBINDIR}/xend restart await_daemons_up ;; *) diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains index 00e5944..2a1999a 100644 --- a/tools/hotplug/Linux/init.d/xendomains +++ b/tools/hotplug/Linux/init.d/xendomains @@ -27,11 +27,13 @@ # boots / shuts down. ### END INIT INFO -CMD=xm +. /etc/xen/scripts/hotplugpath.sh + +CMD=${SBINDIR}/xm $CMD list &> /dev/null if test $? -ne 0 then - CMD=xl + CMD=${SBINDIR}/xl fi $CMD list &> /dev/null -- 1.7.2.5
Ian Campbell
2013-Feb-05 16:19 UTC
[PATCH 2/2] tools+stubdom: install under /usr/local by default.
Now that the hotplug scripts have been fixed to remove hardcoded paths lets try this again. From 26470:acaf29203cf9: This is the defacto (or FHS mandated?) standard location for software built from source, in order to avoid clashing with packaged software which is installed under /usr/bin etc. I think there is benefit in having Xen's install behave more like the majority of other OSS software out there. The major downside here is in the transition from 4.2 to 4.3 where people who have built from source will innevitably discover breakage because 4.3 no longer overwrites stuff in /usr like it used to so they pickup old stale bits from /usr instead of new stuff from /usr/local. Packages will use ./configure --prefix=/usr or whatever helper macro their package manager gives them. I have confirmed that doing this results in the same list of installed files as before this patch was applied. The hypervisor remains in /boot/ and there is no intention to move it. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Roger Pau Monné <roger.pau@citrix.com> Cc: Matt Wilson <msw@amazon.com> --- configure | 2 -- configure.ac | 1 - docs/configure | 2 -- docs/configure.ac | 1 - stubdom/configure | 2 -- stubdom/configure.ac | 1 - tools/configure | 2 -- tools/configure.ac | 1 - 8 files changed, 0 insertions(+), 12 deletions(-) diff --git a/configure b/configure index c2ec87d..cbc38ba 100755 --- a/configure +++ b/configure @@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org' PACKAGE_URL='http://www.xen.org/' ac_unique_file="./xen/common/kernel.c" -ac_default_prefix=/usr enable_option_checking=no ac_subst_vars='LTLIBOBJS LIBOBJS @@ -1686,7 +1685,6 @@ ac_config_files="$ac_config_files ./config/Toplevel.mk" - ac_aux_dir for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then diff --git a/configure.ac b/configure.ac index df1d5da..b17e671 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor], m4_esyscmd([./version.sh ./xen/Makefile]), [xen-devel@lists.xen.org], [xen], [http://www.xen.org/]) AC_CONFIG_SRCDIR([./xen/common/kernel.c]) AC_CONFIG_FILES([./config/Toplevel.mk]) -AC_PREFIX_DEFAULT([/usr]) m4_include([m4/features.m4]) m4_include([m4/subsystem.m4]) diff --git a/docs/configure b/docs/configure index be4934d..d623d19 100755 --- a/docs/configure +++ b/docs/configure @@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org' PACKAGE_URL='http://www.xen.org/' ac_unique_file="misc/xen-command-line.markdown" -ac_default_prefix=/usr ac_subst_vars='LTLIBOBJS LIBOBJS MARKDOWN @@ -1664,7 +1663,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_files="$ac_config_files ../config/Docs.mk" - ac_aux_dir for ac_dir in ../ "$srcdir"/../; do if test -f "$ac_dir/install-sh"; then diff --git a/docs/configure.ac b/docs/configure.ac index 5c3f5e8..ea0552e 100644 --- a/docs/configure.ac +++ b/docs/configure.ac @@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor Documentation], m4_esyscmd([../version.sh ../xen/Makefil [xen-devel@lists.xen.org], [xen], [http://www.xen.org/]) AC_CONFIG_SRCDIR([misc/xen-command-line.markdown]) AC_CONFIG_FILES([../config/Docs.mk]) -AC_PREFIX_DEFAULT([/usr]) AC_CONFIG_AUX_DIR([../]) # M4 Macro includes diff --git a/stubdom/configure b/stubdom/configure index ab9219a..51ca676 100755 --- a/stubdom/configure +++ b/stubdom/configure @@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org' PACKAGE_URL='http://www.xen.org/' ac_unique_file="../extras/mini-os/kernel.c" -ac_default_prefix=/usr ac_subst_vars='LTLIBOBJS LIBOBJS STUBDOM_INSTALL @@ -1792,7 +1791,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_files="$ac_config_files ../config/Stubdom.mk" - ac_aux_dir for ac_dir in ../ "$srcdir"/../; do if test -f "$ac_dir/install-sh"; then diff --git a/stubdom/configure.ac b/stubdom/configure.ac index 2b7b275..de29fb5 100644 --- a/stubdom/configure.ac +++ b/stubdom/configure.ac @@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor Stub Domains], m4_esyscmd([../version.sh ../xen/Makefile [xen-devel@lists.xen.org], [xen], [http://www.xen.org/]) AC_CONFIG_SRCDIR([../extras/mini-os/kernel.c]) AC_CONFIG_FILES([../config/Stubdom.mk]) -AC_PREFIX_DEFAULT([/usr]) AC_CONFIG_AUX_DIR([../]) # M4 Macro includes diff --git a/tools/configure b/tools/configure index 66d588a..9218fdf 100755 --- a/tools/configure +++ b/tools/configure @@ -558,7 +558,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org' PACKAGE_URL='http://www.xen.org/' ac_unique_file="libxl/libxl.c" -ac_default_prefix=/usr # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> @@ -2146,7 +2145,6 @@ ac_config_files="$ac_config_files ../config/Tools.mk" ac_config_headers="$ac_config_headers config.h" - ac_aux_dir for ac_dir in ../ "$srcdir"/../; do if test -f "$ac_dir/install-sh"; then diff --git a/tools/configure.ac b/tools/configure.ac index de5d085..6c712a1 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -7,7 +7,6 @@ AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]), AC_CONFIG_SRCDIR([libxl/libxl.c]) AC_CONFIG_FILES([../config/Tools.mk]) AC_CONFIG_HEADERS([config.h]) -AC_PREFIX_DEFAULT([/usr]) AC_CONFIG_AUX_DIR([../]) # Check if CFLAGS, LDFLAGS, LIBS, CPPFLAGS or CPP is set and print a warning -- 1.7.2.5 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Roger Pau Monné
2013-Apr-10 08:49 UTC
Re: [PATCH 1/2] hotplug/Linux: Remove hardcoded paths
On 05/02/13 17:19, Ian Campbell wrote:> Use xen-hotplugpath.sh (as NEtBSD does) which allows PREFIX etc to change.Just a typo, "NEtBSD" -> "NetBSD"> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Roger Pau Monné
2013-Apr-10 08:56 UTC
Re: [PATCH 2/2] tools+stubdom: install under /usr/local by default.
On 05/02/13 17:19, Ian Campbell wrote:> Now that the hotplug scripts have been fixed to remove hardcoded paths lets > try this again. From 26470:acaf29203cf9: > > This is the defacto (or FHS mandated?) standard location for software > built from source, in order to avoid clashing with packaged software > which is installed under /usr/bin etc. > > I think there is benefit in having Xen's install behave more like the > majority of other OSS software out there. > > The major downside here is in the transition from 4.2 to 4.3 where > people who have built from source will innevitably discover breakage > because 4.3 no longer overwrites stuff in /usr like it used to so they > pickup old stale bits from /usr instead of new stuff from /usr/local. > > Packages will use ./configure --prefix=/usr or whatever helper macro > their package manager gives them. I have confirmed that doing this > results in the same list of installed files as before this patch was > applied. > > The hypervisor remains in /boot/ and there is no intention to move it. > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com> > Cc: Roger Pau Monné <roger.pau@citrix.com> > Cc: Matt Wilson <msw@amazon.com>Acked-by: Roger Pau Monné <roger.pau@citrix.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Roger Pau Monne writes ("Re: [PATCH 1/2] hotplug/Linux: Remove hardcoded paths"):> On 05/02/13 17:19, Ian Campbell wrote: > > Use xen-hotplugpath.sh (as NEtBSD does) which allows PREFIX etc to change. > > Just a typo, "NEtBSD" -> "NetBSD" > > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com> > Acked-by: Roger Pau Monné <roger.pau@citrix.com>Applied, thanks. Ian.
Ian Campbell
2013-Apr-12 09:21 UTC
Re: [PATCH 2/2] tools+stubdom: install under /usr/local by default.
On Wed, 2013-04-10 at 09:56 +0100, Roger Pau Monne wrote:> On 05/02/13 17:19, Ian Campbell wrote: > > Now that the hotplug scripts have been fixed to remove hardcoded paths lets > > try this again. From 26470:acaf29203cf9: > > > > This is the defacto (or FHS mandated?) standard location for software > > built from source, in order to avoid clashing with packaged software > > which is installed under /usr/bin etc. > > > > I think there is benefit in having Xen's install behave more like the > > majority of other OSS software out there. > > > > The major downside here is in the transition from 4.2 to 4.3 where > > people who have built from source will innevitably discover breakage > > because 4.3 no longer overwrites stuff in /usr like it used to so they > > pickup old stale bits from /usr instead of new stuff from /usr/local. > > > > Packages will use ./configure --prefix=/usr or whatever helper macro > > their package manager gives them. I have confirmed that doing this > > results in the same list of installed files as before this patch was > > applied. > > > > The hypervisor remains in /boot/ and there is no intention to move it. > > > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com> > > Cc: Roger Pau Monné <roger.pau@citrix.com> > > Cc: Matt Wilson <msw@amazon.com> > Acked-by: Roger Pau Monné <roger.pau@citrix.com>Thanks. Since Ian J applied the precursor patch yesterday I have now applied this. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Ian Campbell
2013-Apr-12 14:08 UTC
Xen unstable now installs in /usr/local by default (Was: Re: [Xen-devel] [PATCH 2/2] tools+stubdom: install under /usr/local by default.)
On Fri, 2013-04-12 at 10:21 +0100, Ian Campbell wrote:> I have now applied this.I think it''s probably worth highlighting this a bit further to both the -devel@ and -users@ lists. As of xen staging changeset: commit 13d68fab40051e82a40c01e968ca6167ecb92dbd Author: Ian Campbell <ian.campbell@citrix.com> Date: Tue Feb 5 16:19:53 2013 +0000 tools+stubdom: install under /usr/local by default. Xen will install its tools and libraries under /usr/local and not /usr. This commit is currently in the staging tree and will be pushed to master whenever the tests pushed. If you are building from source and installing without package management (i.e. you are using "make install" or "make dist" etc) then you will want to clear out any previous remnants from /usr before updating so you don''t end up with a stale copy of the libraries etc confusing things. You may also need to run ldconfig. You can revert to the old behaviour with "./configure --prefix=/usr" Nothing changes in the stable branches due to this change, although obviously Xen 4.3 will include this change when it is released. Ian.
Ian Campbell
2013-Apr-12 14:08 UTC
Xen unstable now installs in /usr/local by default (Was: Re: [PATCH 2/2] tools+stubdom: install under /usr/local by default.)
On Fri, 2013-04-12 at 10:21 +0100, Ian Campbell wrote:> I have now applied this.I think it''s probably worth highlighting this a bit further to both the -devel@ and -users@ lists. As of xen staging changeset: commit 13d68fab40051e82a40c01e968ca6167ecb92dbd Author: Ian Campbell <ian.campbell@citrix.com> Date: Tue Feb 5 16:19:53 2013 +0000 tools+stubdom: install under /usr/local by default. Xen will install its tools and libraries under /usr/local and not /usr. This commit is currently in the staging tree and will be pushed to master whenever the tests pushed. If you are building from source and installing without package management (i.e. you are using "make install" or "make dist" etc) then you will want to clear out any previous remnants from /usr before updating so you don''t end up with a stale copy of the libraries etc confusing things. You may also need to run ldconfig. You can revert to the old behaviour with "./configure --prefix=/usr" Nothing changes in the stable branches due to this change, although obviously Xen 4.3 will include this change when it is released. Ian.