Install in /usr/local by default.
cover Install in /usr/local by default.
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.
PATCH 1/2 hotplug/Linux: Remove hardcoded paths
Use xen-hotplugpath.sh (as NEtBSD does) which allows PREFIX etc to change.
--- 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(-)
tools/hotplug/Linux/init.d/xen-watchdog +3 -1
@@ -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.
tools/hotplug/Linux/init.d/xencommons +12 -12
@@ -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
tools/hotplug/Linux/init.d/xend +9 -7
@@ -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 ;; *)
tools/hotplug/Linux/init.d/xendomains +4 -2
@@ -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
Signature · 1 line
1.7.2.5
Re: [PATCH 1/2] hotplug/Linux: Remove hardcoded paths
Quoted 1 line · Ian Campbell
Use
xen-hotplugpath.sh(as NEtBSD does) which allows PREFIX etc to change.
Just a typo, "NEtBSD" -> "NetBSD"
Quoted 1 line
Signed-off-by Ian Campbell <[email protected]>
Ian Jackson
AppliedRe: [PATCH 1/2] hotplug/Linux: Remove hardcoded paths
Roger Pau Monne writes ("Re: [PATCH 1/2] hotplug/Linux: Remove hardcoded paths"):
Quoted 7 lines · Ian Campbell
Quoted 1 line
Use
xen-hotplugpath.sh(as NEtBSD does) which allows PREFIX etc to change.Just a typo, "NEtBSD" -> "NetBSD"
Quoted 1 line
Signed-off-by Ian Campbell <[email protected]>Acked-by Roger Pau Monné <[email protected]>
Applied, thanks.
Ian.
PATCH 2/2 tools+stubdom: install under /usr/local by default.
In reply to Ian CampbellNow 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.
--- 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(-)
configure +0 -2
@@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='[email protected]' 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
configure.ac +0 -1
@@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor], m4_esyscmd([./version.sh ./xen/Makefile]), [[email protected]], [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])
docs/configure +0 -2
@@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='[email protected]' 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
docs/configure.ac +0 -1
@@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor Documentation], m4_esyscmd([../version.sh ../xen/Makefil [[email protected]], [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
stubdom/configure +0 -2
@@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='[email protected]' 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
stubdom/configure.ac +0 -1
@@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor Stub Domains], m4_esyscmd([../version.sh ../xen/Makefile [[email protected]], [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
tools/configure +0 -2
@@ -558,7 +558,6 @@ PACKAGE_BUGREPORT='[email protected]' 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
tools/configure.ac +0 -1
@@ -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
Signature · 7 lines
1.7.2.5 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Re: [PATCH 2/2] tools+stubdom: install under /usr/local by default.
Quoted 20 lines · Ian Campbell
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/binetc.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.
Quoted 5 lines
The hypervisor remains in
/boot/and there is no intention to move it.Signed-off-by Ian Campbell <[email protected]>Cc Roger Pau Monné <[email protected]>Cc Matt Wilson <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH 2/2] tools+stubdom: install under /usr/local by default.
Quoted 21 lines · Roger Pau Monne
Quoted 20 lines · Ian Campbell
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/binetc.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.
Quoted 6 lines
Quoted 5 lines
The hypervisor remains in
/boot/and there is no intention to move it.Signed-off-by Ian Campbell <[email protected]>Cc Roger Pau Monné <[email protected]>Cc Matt Wilson <[email protected]>Acked-by Roger Pau Monné <[email protected]>
Thanks. Since Ian J applied the precursor patch yesterday I have now applied this.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Xen unstable now installs in /usr/local by default (Was: Re: [PATCH 2/2] tools+stubdom: install under /usr/local by default.)
Quoted 1 line · Ian Campbell
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 <[email protected]>
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.