Bruce Edge
2010-Jul-07 00:07 UTC
[Xen-devel] Xen build - Debian vs Redhat layout patch options
What''s the right way to address these sort RedHat vs. Debian things in the Xen build? - rm -f $(D)$(CONFIG_DIR)/sysconfig/xendomains + rm -f $(D)$(CONFIG_DIR)/default/xendomains - mkdir -p /var/lock/subsys - touch /var/lock/subsys/xend + mkdir -p /var/lock + touch /var/lock/xend Can I submit a patch that uses a config var to switch on which path use ? Or, where should such a build time switch go? Env, or? ...assuming that it''s even an option. There''s a couple of different downstream patches that others are maintaining to handle this kind of stuff, but that lag behind the xen-unstable tree and it seems like an upstream patch to handle this distro variation in the Xen build itself would be a better long term solution. -Bruce _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2010-Jul-07 11:19 UTC
Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options
On Wed, 7 Jul 2010, Bruce Edge wrote:> What''s the right way to address these sort RedHat vs. Debian things in the Xen build? > > - rm -f $(D)$(CONFIG_DIR)/sysconfig/xendomains > + rm -f $(D)$(CONFIG_DIR)/default/xendomains > > - mkdir -p /var/lock/subsys > - touch /var/lock/subsys/xend > + mkdir -p /var/lock > + touch /var/lock/xend > > Can I submit a patch that uses a config var to switch on which path use ? > > Or, where should such a build time switch go? Env, or? > ...assuming that it''s even an option. > > There''s a couple of different downstream patches that others are maintaining to handle this kind of stuff, but that lag > behind the xen-unstable tree and it seems like an upstream patch to handle this distro variation in the Xen build itself > would be a better long term solution. >A way to switch between the two would be nice, I would accept a patch that accomplish that using a config var (something in Config.mk ?. The default value of this config variable might be detected looking at the existence of /etc/sysconfig or /etc/default. Keep in mind that besides sysconfig vs. default there are other subtle differences, like the chkconfig line in the init scripts (tools/hotplug/Linux/init.d/xencommons for example). _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bruce Edge
2010-Sep-13 23:53 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Wed, Jul 7, 2010 at 4:19 AM, Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:> On Wed, 7 Jul 2010, Bruce Edge wrote: >> What''s the right way to address these sort RedHat vs. Debian things in the Xen build? >> >> - rm -f $(D)$(CONFIG_DIR)/sysconfig/xendomains >> + rm -f $(D)$(CONFIG_DIR)/default/xendomains >> >> - mkdir -p /var/lock/subsys >> - touch /var/lock/subsys/xend >> + mkdir -p /var/lock >> + touch /var/lock/xend >> >> Can I submit a patch that uses a config var to switch on which path use ? >> >> Or, where should such a build time switch go? Env, or? >> ...assuming that it''s even an option. >> >> There''s a couple of different downstream patches that others are maintaining to handle this kind of stuff, but that lag >> behind the xen-unstable tree and it seems like an upstream patch to handle this distro variation in the Xen build itself >> would be a better long term solution. >> > > A way to switch between the two would be nice, I would accept a patch > that accomplish that using a config var (something in Config.mk ?. > The default value of this config variable might be detected looking at > the existence of /etc/sysconfig or /etc/default. > > Keep in mind that besides sysconfig vs. default there are other subtle > differences, like the chkconfig line in the init scripts > (tools/hotplug/Linux/init.d/xencommons for example). >Here''s my attempt at the above. It defaults to the current behavior with the debian option being an env setting. ========================== cut ====================There are 2 locations that are not optimal for Debian based distributions. These are /etc/sysconfig, and /var/subsys. Debian uses /etc/default and /var for these respectively. This patch provides a new make config variable, XEN_CONFIG_ARCH, which changes the location of these 2 elements if set. If unset it defaults to the current behavior, but if set to the string "default", it uses the Debian locations. For the runtime scripts it checks whether the Red Hat sysconfig files exist first, then looks in the Debian location. This lets the config files reside in the desired location and does not require any additional runtime config file to point to their location. This patch also adds a sysconfig.txt file describing the build time usage. Author: Bruce Edge <bruce.edge@gmail.com> Signed-off-by: Bruce Edge <bruce.edge@gmail.com> Index: xen-unstable.hg/Config.mk ==================================================================--- xen-unstable.hg.orig/Config.mk 2010-09-13 10:44:48.000000000 -0700 +++ xen-unstable.hg/Config.mk 2010-09-13 10:45:11.000000000 -0700 @@ -8,6 +8,9 @@ XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) XEN_OS ?= $(shell uname -s) +# Override for debian based systems that use /etc instead of /etc/sysconfig +XEN_CONFIG_ARCH ?= /sysconfig + CONFIG_$(XEN_OS) := y SHELL ?= /bin/sh Index: xen-unstable.hg/config/StdGNU.mk ==================================================================--- xen-unstable.hg.orig/config/StdGNU.mk 2010-09-13 10:44:48.000000000 -0700 +++ xen-unstable.hg/config/StdGNU.mk 2010-09-13 10:45:11.000000000 -0700 @@ -49,7 +49,7 @@ CONFIG_DIR = $(PREFIX)/etc endif -SYSCONFIG_DIR = $(CONFIG_DIR)/sysconfig +SYSCONFIG_DIR = $(CONFIG_DIR)/$(XEN_CONFIG_ARCH) XEN_CONFIG_DIR = $(CONFIG_DIR)/xen XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts Index: xen-unstable.hg/Makefile ==================================================================--- xen-unstable.hg.orig/Makefile 2010-09-13 10:44:48.000000000 -0700 +++ xen-unstable.hg/Makefile 2010-09-13 10:45:11.000000000 -0700 @@ -203,7 +203,7 @@ rm -f $(D)$(CONFIG_DIR)/udev/xen-backend.rules rm -f $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules rm -f $(D)$(CONFIG_DIR)/udev/xend.rules - rm -f $(D)$(CONFIG_DIR)/sysconfig/xendomains + rm -f $(D)$(SYSCONFIG_DIR)/xendomains rm -rf $(D)/var/run/xen* $(D)/var/lib/xen* rm -rf $(D)/boot/*xen* rm -rf $(D)/lib/modules/*xen* Index: xen-unstable.hg/docs/misc/network_setup.txt ==================================================================--- xen-unstable.hg.orig/docs/misc/network_setup.txt 2010-09-13 10:44:48.000000000 -0700 +++ xen-unstable.hg/docs/misc/network_setup.txt 2010-09-13 10:45:11.000000000 -0700 @@ -44,7 +44,7 @@ Creating network initscripts ---------------------------- -In the /etc/sysconfig/network-scripts directory it is necccessary to create +In the <SYSCONFIG>/network-scripts directory it is necccessary to create 2 config files. The first (ifcfg-eth0) defines your physical network interface, and says that it will be part of a bridge: @@ -79,8 +79,8 @@ The final step is to configure iptables to allow all traffic to be forwarded across the bridge -# echo "-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT" > /etc/sysconfig/iptables-forward-bridged -# lokkit --custom-rules=ipv4:filter:/etc/sysconfig/iptables-forward-bridged +# echo "-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT" > <SYSCONFIG>/iptables-forward-bridged +# lokkit --custom-rules=ipv4:filter:<SYSCONFIG>/iptables-forward-bridged # service libvirtd reload Alternatively, you can prevent bridged traffic getting pushed through Index: xen-unstable.hg/docs/misc/sysconfig.txt ==================================================================--- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ xen-unstable.hg/docs/misc/sysconfig.txt 2010-09-13 10:45:11.000000000 -0700 @@ -0,0 +1,14 @@ +This describes the use of the <SYSCONFIG> and <SUBSYS> variables. + +Red hat and most other RPM based distros use /etc/sysconfig for configuration data. + +Debian and other derivative distros use /etc/default for this same data. + +The same applies to /var/subsys and /var. Red Hat uses the former and Debian the latter. + +These differences are handled by the XEN_CONFIG_ARCH build time variable. The default is for the Red Hat configuration. Debian and other derivatives need to set this variable to "default" in the build shell''s environment. + +eg: + +XEN_CONFIG_ARCH="" make dist + Index: xen-unstable.hg/tools/vnet/doc/vnet-xend.txt ==================================================================--- xen-unstable.hg.orig/tools/vnet/doc/vnet-xend.txt 2010-09-13 10:44:49.000000000 -0700 +++ xen-unstable.hg/tools/vnet/doc/vnet-xend.txt 2010-09-13 10:45:11.000000000 -0700 @@ -79,8 +79,8 @@ MTU=1400 -in /etc/sysconfig/network-scripts/ifcfg-eth0. You may also have to change or remove -cached config files for eth0 under /etc/sysconfig/networking. +in <SYSCONFIG>/network-scripts/ifcfg-eth0. You may also have to change or remove +cached config files for eth0 under <SYSCONFIG>/networking. Once configured, vnets are persistent in the xend database. To remove a vnet use Index: xen-unstable.hg/tools/xenballoon/xenballoond.init ==================================================================--- xen-unstable.hg.orig/tools/xenballoon/xenballoond.init 2010-09-13 10:44:49.000000000 -0700 +++ xen-unstable.hg/tools/xenballoon/xenballoond.init 2010-09-13 10:45:11.000000000 -0700 @@ -29,6 +29,10 @@ if [ -f /etc/sysconfig/xenballoon.conf ]; then . /etc/sysconfig/xenballoon.conf +else + if [ -f /etc/default/xenballoon.conf ]; then + . /etc/default/xenballoon.conf + fi fi # Check that balloon driver is present Index: xen-unstable.hg/tools/xenballoon/xenballoond ==================================================================--- xen-unstable.hg.orig/tools/xenballoon/xenballoond 2010-09-13 10:44:49.000000000 -0700 +++ xen-unstable.hg/tools/xenballoon/xenballoond 2010-09-13 10:45:11.000000000 -0700 @@ -21,7 +21,7 @@ # If xenbus is running and the /usr/bin/xenstore-* tools are installed, # "xenbus is enabled". # -# Parameters are documented in /etc/sysconfig/xenballoon.conf. Although +# Parameters are documented in <SYSCONFIG>/xenballoon.conf. Although # some are not used with directed ballooning, all must be set properly. # If xenbus is enabled, some of these parameters may be overridden by values # set by domain0 via xenbus. @@ -237,7 +237,13 @@ fi preswapnow=0 -. /etc/sysconfig/xenballoon.conf +if [ -f /etc/sysconfig/xenballoon.conf ]; then + . /etc/sysconfigxenballoon.conf +else + if [ -f /etc/default/xenballoon.conf ]; then + . /etc/default/xenballoon.conf + fi +fi while true; do Index: xen-unstable.hg/tools/xenballoon/xenballoond.README ==================================================================--- xen-unstable.hg.orig/tools/xenballoon/xenballoond.README 2010-09-13 10:44:49.000000000 -0700 +++ xen-unstable.hg/tools/xenballoon/xenballoond.README 2010-09-13 10:45:11.000000000 -0700 @@ -59,10 +59,10 @@ Instructions to install/deploy xenballoond (in Redhat-based system): - in each guest: - ensure pre-requisites are met (see above) - - place xenballoon.conf in /etc/sysconfig + - place xenballoon.conf in <SYSCONFIG> - place xenballoond in /usr/sbin - copy xenballoond.init to /etc/rc.d/init.d/xenballoond (note file rename) - - edit /etc/sysconfig/xenballoond.conf as desired (especially note that + - edit <SYSCONFIG>/xenballoond.conf as desired (especially note that selfballooning defaults as off) - start xenballoond with "service xenballoond start", and/or configure xenballoond to start at init (e.g. "chkconfig xenballoond on") Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains ==================================================================--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xendomains 2010-09-13 10:44:48.000000000 -0700 +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains 2010-09-13 10:45:11.000000000 -0700 @@ -46,9 +46,13 @@ exit 0 fi -LOCKFILE=/var/lock/subsys/xendomains -XENDOM_CONFIG=/etc/sysconfig/xendomains - +if [ -d /etc/sysconfig ]; then + LOCKFILE=/var/lock/subsys/xendomains + XENDOM_CONFIG=/etc/sysconfig/xendomains +else + LOCKFILE=/var/lock/xendomains + XENDOM_CONFIG=/etc/default/xendomains +fi test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing"; if [ "$1" = "stop" ]; then exit 0; else exit 6; fi; } Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xend ==================================================================--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xend 2010-09-13 13:53:19.000000000 -0700 +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xend 2010-09-13 13:56:52.000000000 -0700 @@ -40,14 +40,20 @@ echo "xencommons should be started first." exit 1 fi - mkdir -p /var/lock/subsys - touch /var/lock/subsys/xend + # mkdir shouldn''t be needed as most distros have this already created. Default to using subsys. + # This makes it Red Had/Debian agnostic + mkdir -p /var/lock + if [ -d /var/lock/subsys ] ; then + touch /var/lock/subsys/xend + else + touch /var/lock/xend + fi xend start await_daemons_up ;; stop) xend stop - rm -f /var/lock/subsys/xend + rm -f /var/lock/subsys/xend /var/lock/xend ;; status) xend status _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mike Viau
2010-Sep-14 00:23 UTC
RE: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
I have been wondering about the lack of Xen''s conformance around the support of the Debian based OS file hierarchical structure. Xen 4.1 is looking to be more attractive for Debian based OS users with the patch submitted on by behalf of Bruce Edge :) -M _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Sander Eikelenboom
2010-Sep-14 06:45 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
Hello Bruce, I think it would be wise to call the string "debian" instead of "default". Since unset is "THE default", and with the string "default" you can specify two kinds of default with complete other behavior which could cause confusion. -- Sander Tuesday, September 14, 2010, 1:53:39 AM, you wrote:> On Wed, Jul 7, 2010 at 4:19 AM, Stefano Stabellini > <stefano.stabellini@eu.citrix.com> wrote: >> On Wed, 7 Jul 2010, Bruce Edge wrote: >>> What''s the right way to address these sort RedHat vs. Debian things in the Xen build? >>> >>> - rm -f $(D)$(CONFIG_DIR)/sysconfig/xendomains >>> + rm -f $(D)$(CONFIG_DIR)/default/xendomains >>> >>> - mkdir -p /var/lock/subsys >>> - touch /var/lock/subsys/xend >>> + mkdir -p /var/lock >>> + touch /var/lock/xend >>> >>> Can I submit a patch that uses a config var to switch on which path use ? >>> >>> Or, where should such a build time switch go? Env, or? >>> ...assuming that it''s even an option. >>> >>> There''s a couple of different downstream patches that others are maintaining to handle this kind of stuff, but that lag >>> behind the xen-unstable tree and it seems like an upstream patch to handle this distro variation in the Xen build itself >>> would be a better long term solution. >>> >> >> A way to switch between the two would be nice, I would accept a patch >> that accomplish that using a config var (something in Config.mk ?. >> The default value of this config variable might be detected looking at >> the existence of /etc/sysconfig or /etc/default. >> >> Keep in mind that besides sysconfig vs. default there are other subtle >> differences, like the chkconfig line in the init scripts >> (tools/hotplug/Linux/init.d/xencommons for example). >>> Here''s my attempt at the above. It defaults to the current behavior > with the debian option being an env setting.> ========================== cut ====================> There are 2 locations that are not optimal for Debian based distributions. > These are /etc/sysconfig, and /var/subsys. > Debian uses /etc/default and /var for these respectively. > This patch provides a new make config variable, XEN_CONFIG_ARCH, which > changes the location of these 2 elements if set. > If unset it defaults to the current behavior, but if set to the string > "default", it uses the Debian locations. > For the runtime scripts it checks whether the Red Hat sysconfig files > exist first, then looks in the Debian location. > This lets the config files reside in the desired location and does not > require any additional runtime config file > to point to their location. > This patch also adds a sysconfig.txt file describing the build time usage. > Author: Bruce Edge <bruce.edge@gmail.com>> Signed-off-by: Bruce Edge <bruce.edge@gmail.com>> Index: xen-unstable.hg/Config.mk > ==================================================================> --- xen-unstable.hg.orig/Config.mk 2010-09-13 10:44:48.000000000 -0700 > +++ xen-unstable.hg/Config.mk 2010-09-13 10:45:11.000000000 -0700 > @@ -8,6 +8,9 @@ > XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) > XEN_OS ?= $(shell uname -s)> +# Override for debian based systems that use /etc instead of /etc/sysconfig > +XEN_CONFIG_ARCH ?= /sysconfig > + > CONFIG_$(XEN_OS) := y> SHELL ?= /bin/sh > Index: xen-unstable.hg/config/StdGNU.mk > ==================================================================> --- xen-unstable.hg.orig/config/StdGNU.mk 2010-09-13 > 10:44:48.000000000 -0700 > +++ xen-unstable.hg/config/StdGNU.mk 2010-09-13 10:45:11.000000000 -0700 > @@ -49,7 +49,7 @@ > CONFIG_DIR = $(PREFIX)/etc > endif> -SYSCONFIG_DIR = $(CONFIG_DIR)/sysconfig > +SYSCONFIG_DIR = $(CONFIG_DIR)/$(XEN_CONFIG_ARCH)> XEN_CONFIG_DIR = $(CONFIG_DIR)/xen > XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts > Index: xen-unstable.hg/Makefile > ==================================================================> --- xen-unstable.hg.orig/Makefile 2010-09-13 10:44:48.000000000 -0700 > +++ xen-unstable.hg/Makefile 2010-09-13 10:45:11.000000000 -0700 > @@ -203,7 +203,7 @@ > rm -f $(D)$(CONFIG_DIR)/udev/xen-backend.rules > rm -f $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules > rm -f $(D)$(CONFIG_DIR)/udev/xend.rules > - rm -f $(D)$(CONFIG_DIR)/sysconfig/xendomains > + rm -f $(D)$(SYSCONFIG_DIR)/xendomains > rm -rf $(D)/var/run/xen* $(D)/var/lib/xen* > rm -rf $(D)/boot/*xen* > rm -rf $(D)/lib/modules/*xen* > Index: xen-unstable.hg/docs/misc/network_setup.txt > ==================================================================> --- xen-unstable.hg.orig/docs/misc/network_setup.txt 2010-09-13 > 10:44:48.000000000 -0700 > +++ xen-unstable.hg/docs/misc/network_setup.txt 2010-09-13 > 10:45:11.000000000 -0700 > @@ -44,7 +44,7 @@ > Creating network initscripts > ----------------------------> -In the /etc/sysconfig/network-scripts directory it is necccessary to create > +In the <SYSCONFIG>/network-scripts directory it is necccessary to create > 2 config files. The first (ifcfg-eth0) defines your physical network interface, > and says that it will be part of a bridge:> @@ -79,8 +79,8 @@ > The final step is to configure iptables to allow all traffic to be > forwarded across the bridge> -# echo "-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT" > > /etc/sysconfig/iptables-forward-bridged > -# lokkit --custom-rules=ipv4:filter:/etc/sysconfig/iptables-forward-bridged > +# echo "-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT" > > <SYSCONFIG>/iptables-forward-bridged > +# lokkit --custom-rules=ipv4:filter:<SYSCONFIG>/iptables-forward-bridged > # service libvirtd reload> Alternatively, you can prevent bridged traffic getting pushed through > Index: xen-unstable.hg/docs/misc/sysconfig.txt > ==================================================================> --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > +++ xen-unstable.hg/docs/misc/sysconfig.txt 2010-09-13 > 10:45:11.000000000 -0700 > @@ -0,0 +1,14 @@ > +This describes the use of the <SYSCONFIG> and <SUBSYS> variables. > + > +Red hat and most other RPM based distros use /etc/sysconfig for > configuration data. > + > +Debian and other derivative distros use /etc/default for this same data. > + > +The same applies to /var/subsys and /var. Red Hat uses the former and > Debian the latter. > + > +These differences are handled by the XEN_CONFIG_ARCH build time > variable. The default is for the Red Hat configuration. Debian and > other derivatives need to set this variable to "default" in the build > shell''s environment. > + > +eg: > + > +XEN_CONFIG_ARCH="" make dist > + > Index: xen-unstable.hg/tools/vnet/doc/vnet-xend.txt > ==================================================================> --- xen-unstable.hg.orig/tools/vnet/doc/vnet-xend.txt 2010-09-13 > 10:44:49.000000000 -0700 > +++ xen-unstable.hg/tools/vnet/doc/vnet-xend.txt 2010-09-13 > 10:45:11.000000000 -0700 > @@ -79,8 +79,8 @@> MTU=1400> -in /etc/sysconfig/network-scripts/ifcfg-eth0. You may also have to > change or remove > -cached config files for eth0 under /etc/sysconfig/networking. > +in <SYSCONFIG>/network-scripts/ifcfg-eth0. You may also have to > change or remove > +cached config files for eth0 under <SYSCONFIG>/networking.> Once configured, vnets are persistent in the xend database. > To remove a vnet use > Index: xen-unstable.hg/tools/xenballoon/xenballoond.init > ==================================================================> --- xen-unstable.hg.orig/tools/xenballoon/xenballoond.init > 2010-09-13 10:44:49.000000000 -0700 > +++ xen-unstable.hg/tools/xenballoon/xenballoond.init 2010-09-13 > 10:45:11.000000000 -0700 > @@ -29,6 +29,10 @@> if [ -f /etc/sysconfig/xenballoon.conf ]; then > . /etc/sysconfig/xenballoon.conf > +else > + if [ -f /etc/default/xenballoon.conf ]; then > + . /etc/default/xenballoon.conf > + fi > fi> # Check that balloon driver is present > Index: xen-unstable.hg/tools/xenballoon/xenballoond > ==================================================================> --- xen-unstable.hg.orig/tools/xenballoon/xenballoond 2010-09-13 > 10:44:49.000000000 -0700 > +++ xen-unstable.hg/tools/xenballoon/xenballoond 2010-09-13 > 10:45:11.000000000 -0700 > @@ -21,7 +21,7 @@ > # If xenbus is running and the /usr/bin/xenstore-* tools are installed, > # "xenbus is enabled". > # > -# Parameters are documented in /etc/sysconfig/xenballoon.conf. Although > +# Parameters are documented in <SYSCONFIG>/xenballoon.conf. Although > # some are not used with directed ballooning, all must be set properly. > # If xenbus is enabled, some of these parameters may be overridden by values > # set by domain0 via xenbus. > @@ -237,7 +237,13 @@ > fi > preswapnow=0> -. /etc/sysconfig/xenballoon.conf > +if [ -f /etc/sysconfig/xenballoon.conf ]; then > + . /etc/sysconfigxenballoon.conf > +else > + if [ -f /etc/default/xenballoon.conf ]; then > + . /etc/default/xenballoon.conf > + fi > +fi> while true; > do > Index: xen-unstable.hg/tools/xenballoon/xenballoond.README > ==================================================================> --- xen-unstable.hg.orig/tools/xenballoon/xenballoond.README > 2010-09-13 10:44:49.000000000 -0700 > +++ xen-unstable.hg/tools/xenballoon/xenballoond.README 2010-09-13 > 10:45:11.000000000 -0700 > @@ -59,10 +59,10 @@ > Instructions to install/deploy xenballoond (in Redhat-based system): > - in each guest: > - ensure pre-requisites are met (see above) > - - place xenballoon.conf in /etc/sysconfig > + - place xenballoon.conf in <SYSCONFIG> > - place xenballoond in /usr/sbin > - copy xenballoond.init to /etc/rc.d/init.d/xenballoond (note file rename) > - - edit /etc/sysconfig/xenballoond.conf as desired (especially note that > + - edit <SYSCONFIG>/xenballoond.conf as desired (especially note that > selfballooning defaults as off) > - start xenballoond with "service xenballoond start", and/or configure > xenballoond to start at init (e.g. "chkconfig xenballoond on") > Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains > ==================================================================> --- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xendomains > 2010-09-13 10:44:48.000000000 -0700 > +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains > 2010-09-13 10:45:11.000000000 -0700 > @@ -46,9 +46,13 @@ > exit 0 > fi> -LOCKFILE=/var/lock/subsys/xendomains > -XENDOM_CONFIG=/etc/sysconfig/xendomains > - > +if [ -d /etc/sysconfig ]; then > + LOCKFILE=/var/lock/subsys/xendomains > + XENDOM_CONFIG=/etc/sysconfig/xendomains > +else > + LOCKFILE=/var/lock/xendomains > + XENDOM_CONFIG=/etc/default/xendomains > +fi > test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing"; > if [ "$1" = "stop" ]; then exit 0; > else exit 6; fi; } > Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xend > ==================================================================> --- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xend > 2010-09-13 13:53:19.000000000 -0700 > +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xend 2010-09-13 > 13:56:52.000000000 -0700 > @@ -40,14 +40,20 @@ > echo "xencommons should be started first." > exit 1 > fi > - mkdir -p /var/lock/subsys > - touch /var/lock/subsys/xend > + # mkdir shouldn''t be needed as most distros have this already > created. Default to using subsys. > + # This makes it Red Had/Debian agnostic > + mkdir -p /var/lock > + if [ -d /var/lock/subsys ] ; then > + touch /var/lock/subsys/xend > + else > + touch /var/lock/xend > + fi > xend start > await_daemons_up > ;; > stop) > xend stop > - rm -f /var/lock/subsys/xend > + rm -f /var/lock/subsys/xend /var/lock/xend > ;; > status) > xend status-- Best regards, Sander mailto:linux@eikelenboom.it _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bruce Edge
2010-Sep-14 14:18 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Mon, Sep 13, 2010 at 11:45 PM, Sander Eikelenboom <linux@eikelenboom.it> wrote:> Hello Bruce, > > I think it would be wise to call the string "debian" instead of "default". > Since unset is "THE default", and with the string "default" you can specify two kinds of default with complete other behavior which could cause confusion. > > -- > > SanderMakes sense. I went with "default" as that''s the string that replaces sysconfig, but you''re reasoning is sound. I''ll replace the option with debian. -Bruce> > Tuesday, September 14, 2010, 1:53:39 AM, you wrote: > >> On Wed, Jul 7, 2010 at 4:19 AM, Stefano Stabellini >> <stefano.stabellini@eu.citrix.com> wrote: >>> On Wed, 7 Jul 2010, Bruce Edge wrote: >>>> What''s the right way to address these sort RedHat vs. Debian things in the Xen build? >>>> >>>> - rm -f $(D)$(CONFIG_DIR)/sysconfig/xendomains >>>> + rm -f $(D)$(CONFIG_DIR)/default/xendomains >>>> >>>> - mkdir -p /var/lock/subsys >>>> - touch /var/lock/subsys/xend >>>> + mkdir -p /var/lock >>>> + touch /var/lock/xend >>>> >>>> Can I submit a patch that uses a config var to switch on which path use ? >>>> >>>> Or, where should such a build time switch go? Env, or? >>>> ...assuming that it''s even an option. >>>> >>>> There''s a couple of different downstream patches that others are maintaining to handle this kind of stuff, but that lag >>>> behind the xen-unstable tree and it seems like an upstream patch to handle this distro variation in the Xen build itself >>>> would be a better long term solution. >>>> >>> >>> A way to switch between the two would be nice, I would accept a patch >>> that accomplish that using a config var (something in Config.mk ?. >>> The default value of this config variable might be detected looking at >>> the existence of /etc/sysconfig or /etc/default. >>> >>> Keep in mind that besides sysconfig vs. default there are other subtle >>> differences, like the chkconfig line in the init scripts >>> (tools/hotplug/Linux/init.d/xencommons for example). >>> > >> Here''s my attempt at the above. It defaults to the current behavior >> with the debian option being an env setting. > >> ========================== cut ====================>> There are 2 locations that are not optimal for Debian based distributions. >> These are /etc/sysconfig, and /var/subsys. >> Debian uses /etc/default and /var for these respectively. >> This patch provides a new make config variable, XEN_CONFIG_ARCH, which >> changes the location of these 2 elements if set. >> If unset it defaults to the current behavior, but if set to the string >> "default", it uses the Debian locations. >> For the runtime scripts it checks whether the Red Hat sysconfig files >> exist first, then looks in the Debian location. >> This lets the config files reside in the desired location and does not >> require any additional runtime config file >> to point to their location. >> This patch also adds a sysconfig.txt file describing the build time usage. >> Author: Bruce Edge <bruce.edge@gmail.com> > >> Signed-off-by: Bruce Edge <bruce.edge@gmail.com> > >> Index: xen-unstable.hg/Config.mk >> ==================================================================>> --- xen-unstable.hg.orig/Config.mk 2010-09-13 10:44:48.000000000 -0700 >> +++ xen-unstable.hg/Config.mk 2010-09-13 10:45:11.000000000 -0700 >> @@ -8,6 +8,9 @@ >> XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) >> XEN_OS ?= $(shell uname -s) > >> +# Override for debian based systems that use /etc instead of /etc/sysconfig >> +XEN_CONFIG_ARCH ?= /sysconfig >> + >> CONFIG_$(XEN_OS) := y > >> SHELL ?= /bin/sh >> Index: xen-unstable.hg/config/StdGNU.mk >> ==================================================================>> --- xen-unstable.hg.orig/config/StdGNU.mk 2010-09-13 >> 10:44:48.000000000 -0700 >> +++ xen-unstable.hg/config/StdGNU.mk 2010-09-13 10:45:11.000000000 -0700 >> @@ -49,7 +49,7 @@ >> CONFIG_DIR = $(PREFIX)/etc >> endif > >> -SYSCONFIG_DIR = $(CONFIG_DIR)/sysconfig >> +SYSCONFIG_DIR = $(CONFIG_DIR)/$(XEN_CONFIG_ARCH) > >> XEN_CONFIG_DIR = $(CONFIG_DIR)/xen >> XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts >> Index: xen-unstable.hg/Makefile >> ==================================================================>> --- xen-unstable.hg.orig/Makefile 2010-09-13 10:44:48.000000000 -0700 >> +++ xen-unstable.hg/Makefile 2010-09-13 10:45:11.000000000 -0700 >> @@ -203,7 +203,7 @@ >> rm -f $(D)$(CONFIG_DIR)/udev/xen-backend.rules >> rm -f $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules >> rm -f $(D)$(CONFIG_DIR)/udev/xend.rules >> - rm -f $(D)$(CONFIG_DIR)/sysconfig/xendomains >> + rm -f $(D)$(SYSCONFIG_DIR)/xendomains >> rm -rf $(D)/var/run/xen* $(D)/var/lib/xen* >> rm -rf $(D)/boot/*xen* >> rm -rf $(D)/lib/modules/*xen* >> Index: xen-unstable.hg/docs/misc/network_setup.txt >> ==================================================================>> --- xen-unstable.hg.orig/docs/misc/network_setup.txt 2010-09-13 >> 10:44:48.000000000 -0700 >> +++ xen-unstable.hg/docs/misc/network_setup.txt 2010-09-13 >> 10:45:11.000000000 -0700 >> @@ -44,7 +44,7 @@ >> Creating network initscripts >> ---------------------------- > >> -In the /etc/sysconfig/network-scripts directory it is necccessary to create >> +In the <SYSCONFIG>/network-scripts directory it is necccessary to create >> 2 config files. The first (ifcfg-eth0) defines your physical network interface, >> and says that it will be part of a bridge: > >> @@ -79,8 +79,8 @@ >> The final step is to configure iptables to allow all traffic to be >> forwarded across the bridge > >> -# echo "-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT" > >> /etc/sysconfig/iptables-forward-bridged >> -# lokkit --custom-rules=ipv4:filter:/etc/sysconfig/iptables-forward-bridged >> +# echo "-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT" > >> <SYSCONFIG>/iptables-forward-bridged >> +# lokkit --custom-rules=ipv4:filter:<SYSCONFIG>/iptables-forward-bridged >> # service libvirtd reload > >> Alternatively, you can prevent bridged traffic getting pushed through >> Index: xen-unstable.hg/docs/misc/sysconfig.txt >> ==================================================================>> --- /dev/null 1970-01-01 00:00:00.000000000 +0000 >> +++ xen-unstable.hg/docs/misc/sysconfig.txt 2010-09-13 >> 10:45:11.000000000 -0700 >> @@ -0,0 +1,14 @@ >> +This describes the use of the <SYSCONFIG> and <SUBSYS> variables. >> + >> +Red hat and most other RPM based distros use /etc/sysconfig for >> configuration data. >> + >> +Debian and other derivative distros use /etc/default for this same data. >> + >> +The same applies to /var/subsys and /var. Red Hat uses the former and >> Debian the latter. >> + >> +These differences are handled by the XEN_CONFIG_ARCH build time >> variable. The default is for the Red Hat configuration. Debian and >> other derivatives need to set this variable to "default" in the build >> shell''s environment. >> + >> +eg: >> + >> +XEN_CONFIG_ARCH="" make dist >> + >> Index: xen-unstable.hg/tools/vnet/doc/vnet-xend.txt >> ==================================================================>> --- xen-unstable.hg.orig/tools/vnet/doc/vnet-xend.txt 2010-09-13 >> 10:44:49.000000000 -0700 >> +++ xen-unstable.hg/tools/vnet/doc/vnet-xend.txt 2010-09-13 >> 10:45:11.000000000 -0700 >> @@ -79,8 +79,8 @@ > >> MTU=1400 > >> -in /etc/sysconfig/network-scripts/ifcfg-eth0. You may also have to >> change or remove >> -cached config files for eth0 under /etc/sysconfig/networking. >> +in <SYSCONFIG>/network-scripts/ifcfg-eth0. You may also have to >> change or remove >> +cached config files for eth0 under <SYSCONFIG>/networking. > >> Once configured, vnets are persistent in the xend database. >> To remove a vnet use >> Index: xen-unstable.hg/tools/xenballoon/xenballoond.init >> ==================================================================>> --- xen-unstable.hg.orig/tools/xenballoon/xenballoond.init >> 2010-09-13 10:44:49.000000000 -0700 >> +++ xen-unstable.hg/tools/xenballoon/xenballoond.init 2010-09-13 >> 10:45:11.000000000 -0700 >> @@ -29,6 +29,10 @@ > >> if [ -f /etc/sysconfig/xenballoon.conf ]; then >> . /etc/sysconfig/xenballoon.conf >> +else >> + if [ -f /etc/default/xenballoon.conf ]; then >> + . /etc/default/xenballoon.conf >> + fi >> fi > >> # Check that balloon driver is present >> Index: xen-unstable.hg/tools/xenballoon/xenballoond >> ==================================================================>> --- xen-unstable.hg.orig/tools/xenballoon/xenballoond 2010-09-13 >> 10:44:49.000000000 -0700 >> +++ xen-unstable.hg/tools/xenballoon/xenballoond 2010-09-13 >> 10:45:11.000000000 -0700 >> @@ -21,7 +21,7 @@ >> # If xenbus is running and the /usr/bin/xenstore-* tools are installed, >> # "xenbus is enabled". >> # >> -# Parameters are documented in /etc/sysconfig/xenballoon.conf. Although >> +# Parameters are documented in <SYSCONFIG>/xenballoon.conf. Although >> # some are not used with directed ballooning, all must be set properly. >> # If xenbus is enabled, some of these parameters may be overridden by values >> # set by domain0 via xenbus. >> @@ -237,7 +237,13 @@ >> fi >> preswapnow=0 > >> -. /etc/sysconfig/xenballoon.conf >> +if [ -f /etc/sysconfig/xenballoon.conf ]; then >> + . /etc/sysconfigxenballoon.conf >> +else >> + if [ -f /etc/default/xenballoon.conf ]; then >> + . /etc/default/xenballoon.conf >> + fi >> +fi > >> while true; >> do >> Index: xen-unstable.hg/tools/xenballoon/xenballoond.README >> ==================================================================>> --- xen-unstable.hg.orig/tools/xenballoon/xenballoond.README >> 2010-09-13 10:44:49.000000000 -0700 >> +++ xen-unstable.hg/tools/xenballoon/xenballoond.README 2010-09-13 >> 10:45:11.000000000 -0700 >> @@ -59,10 +59,10 @@ >> Instructions to install/deploy xenballoond (in Redhat-based system): >> - in each guest: >> - ensure pre-requisites are met (see above) >> - - place xenballoon.conf in /etc/sysconfig >> + - place xenballoon.conf in <SYSCONFIG> >> - place xenballoond in /usr/sbin >> - copy xenballoond.init to /etc/rc.d/init.d/xenballoond (note file rename) >> - - edit /etc/sysconfig/xenballoond.conf as desired (especially note that >> + - edit <SYSCONFIG>/xenballoond.conf as desired (especially note that >> selfballooning defaults as off) >> - start xenballoond with "service xenballoond start", and/or configure >> xenballoond to start at init (e.g. "chkconfig xenballoond on") >> Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains >> ==================================================================>> --- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xendomains >> 2010-09-13 10:44:48.000000000 -0700 >> +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains >> 2010-09-13 10:45:11.000000000 -0700 >> @@ -46,9 +46,13 @@ >> exit 0 >> fi > >> -LOCKFILE=/var/lock/subsys/xendomains >> -XENDOM_CONFIG=/etc/sysconfig/xendomains >> - >> +if [ -d /etc/sysconfig ]; then >> + LOCKFILE=/var/lock/subsys/xendomains >> + XENDOM_CONFIG=/etc/sysconfig/xendomains >> +else >> + LOCKFILE=/var/lock/xendomains >> + XENDOM_CONFIG=/etc/default/xendomains >> +fi >> test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing"; >> if [ "$1" = "stop" ]; then exit 0; >> else exit 6; fi; } >> Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xend >> ==================================================================>> --- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xend >> 2010-09-13 13:53:19.000000000 -0700 >> +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xend 2010-09-13 >> 13:56:52.000000000 -0700 >> @@ -40,14 +40,20 @@ >> echo "xencommons should be started first." >> exit 1 >> fi >> - mkdir -p /var/lock/subsys >> - touch /var/lock/subsys/xend >> + # mkdir shouldn''t be needed as most distros have this already >> created. Default to using subsys. >> + # This makes it Red Had/Debian agnostic >> + mkdir -p /var/lock >> + if [ -d /var/lock/subsys ] ; then >> + touch /var/lock/subsys/xend >> + else >> + touch /var/lock/xend >> + fi >> xend start >> await_daemons_up >> ;; >> stop) >> xend stop >> - rm -f /var/lock/subsys/xend >> + rm -f /var/lock/subsys/xend /var/lock/xend >> ;; >> status) >> xend status > > > > -- > Best regards, > Sander mailto:linux@eikelenboom.it > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Olaf Hering
2010-Sep-14 14:31 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Mon, Sep 13, Bruce Edge wrote:> -SYSCONFIG_DIR = $(CONFIG_DIR)/sysconfig > +SYSCONFIG_DIR = $(CONFIG_DIR)/$(XEN_CONFIG_ARCH)Unless I miss something: Thats your hook: SYSCONFIG_DIR Set it to something other than /etc/sysconfig during build. Olaf _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2010-Sep-14 17:05 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"):> There are 2 locations that are not optimal for Debian based distributions. > These are /etc/sysconfig, and /var/subsys. > Debian uses /etc/default and /var for these respectively.Thanks for this contribution. I have some comments:> This patch provides a new make config variable, XEN_CONFIG_ARCH, which > changes the location of these 2 elements if set.I''m not sure that "XEN_CONFIG_ARCH" is the right answer. What''s wrong with simply setting SYSCONFIG_DIR ? Perhaps SYSCONFIG_DIR needs to be defined with "?=" rather than "=" ? If we do need a special variable for the leaf dir it should be called something else. ARCH is for CPU architectures.> For the runtime scripts it checks whether the Red Hat sysconfig files > exist first, then looks in the Debian location. > This lets the config files reside in the desired location and does not > require any additional runtime config file > to point to their location.This is good.> Creating network initscripts > ---------------------------- > > -In the /etc/sysconfig/network-scripts directory it is necccessary to create > +In the <SYSCONFIG>/network-scripts directory it is necccessary to create > 2 config files. The first (ifcfg-eth0) defines your physical network interface, > and says that it will be part of a bridge:This, and all the stuff that implicitly refers to files in /etc/default for host network configuration, is entirely wrong. Debian-derived distros have a different way of setting up networking and the files have a different syntax and semantics, as well as a different location. It''s only the files which are invented by the Xen distribution which might be found in /etc/sysconfig _or_ /etc/default.> if [ -f /etc/sysconfig/xenballoon.conf ]; then > . /etc/sysconfig/xenballoon.conf > +else > + if [ -f /etc/default/xenballoon.conf ]; thenUse elif ?> +if [ -d /etc/sysconfig ]; then > + LOCKFILE=/var/lock/subsys/xendomains > + XENDOM_CONFIG=/etc/sysconfig/xendomains > +else > + LOCKFILE=/var/lock/xendomains > + XENDOM_CONFIG=/etc/default/xendomains > +fiI don''t think this is correct. You should test for /etc/sysconfig and /var/lock/subsys separately, in case someone makes a mutant distro that has one but not the other. Would you care to revise your patch and resubmit it ? Thanks, Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bruce Edge
2010-Sep-14 17:13 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Tue, Sep 14, 2010 at 10:05 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:> Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"): >> There are 2 locations that are not optimal for Debian based distributions. >> These are /etc/sysconfig, and /var/subsys. >> Debian uses /etc/default and /var for these respectively. > > Thanks for this contribution. I have some comments: > >> This patch provides a new make config variable, XEN_CONFIG_ARCH, which >> changes the location of these 2 elements if set. > > I''m not sure that "XEN_CONFIG_ARCH" is the right answer. What''s wrong > with simply setting SYSCONFIG_DIR ? Perhaps SYSCONFIG_DIR needs to be > defined with "?=" rather than "=" ? > > If we do need a special variable for the leaf dir it should be called > something else. ARCH is for CPU architectures. > >> For the runtime scripts it checks whether the Red Hat sysconfig files >> exist first, then looks in the Debian location. >> This lets the config files reside in the desired location and does not >> require any additional runtime config file >> to point to their location. > > This is good. > >> Creating network initscripts >> ---------------------------- >> >> -In the /etc/sysconfig/network-scripts directory it is necccessary to create >> +In the <SYSCONFIG>/network-scripts directory it is necccessary to create >> 2 config files. The first (ifcfg-eth0) defines your physical network interface, >> and says that it will be part of a bridge: > > This, and all the stuff that implicitly refers to files in > /etc/default for host network configuration, is entirely wrong. > Debian-derived distros have a different way of setting up networking > and the files have a different syntax and semantics, as well as a > different location. > > It''s only the files which are invented by the Xen distribution which > might be found in /etc/sysconfig _or_ /etc/default. > >> if [ -f /etc/sysconfig/xenballoon.conf ]; then >> . /etc/sysconfig/xenballoon.conf >> +else >> + if [ -f /etc/default/xenballoon.conf ]; then > > Use elif ? > >> +if [ -d /etc/sysconfig ]; then >> + LOCKFILE=/var/lock/subsys/xendomains >> + XENDOM_CONFIG=/etc/sysconfig/xendomains >> +else >> + LOCKFILE=/var/lock/xendomains >> + XENDOM_CONFIG=/etc/default/xendomains >> +fi > > I don''t think this is correct. You should test for /etc/sysconfig and > /var/lock/subsys separately, in case someone makes a mutant distro > that has one but not the other. > > Would you care to revise your patch and resubmit it ? > > Thanks, > Ian. >Yes, I''ll revise & resubmit. Thanks for the comments. -Bruce _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bruce Edge
2010-Sep-14 18:56 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Tue, Sep 14, 2010 at 10:05 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:> Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"): >> There are 2 locations that are not optimal for Debian based distributions. >> These are /etc/sysconfig, and /var/subsys. >> Debian uses /etc/default and /var for these respectively. > > Thanks for this contribution. I have some comments:Thanks for the hints Ian. I have some questions on your comments.> >> This patch provides a new make config variable, XEN_CONFIG_ARCH, which >> changes the location of these 2 elements if set. > > I''m not sure that "XEN_CONFIG_ARCH" is the right answer. What''s wrong > with simply setting SYSCONFIG_DIR ? Perhaps SYSCONFIG_DIR needs to be > defined with "?=" rather than "=" ?In order to honor the $PREFIX setting, $SYSCONFIG_DIR has to depend on $PREFIX: ifeq ($(PREFIX),/usr) CONFIG_DIR = /etc else CONFIG_DIR = $(PREFIX)/etc endif SYSCONFIG_DIR = $(CONFIG_DIR)/$(XEN_CONFIG_ARCH) So using ?= for the above would require that one manually add the $PREFIX to whatever SYSCONFIG_DIR they wanted to use.> > If we do need a special variable for the leaf dir it should be called > something else. ARCH is for CPU architectures.What''s a good word to differentiate bewteen debian/red hat distros? DISTRO_TYPE=<debian | redhat> That would allow the addition of other distro types as neeeded.> >> For the runtime scripts it checks whether the Red Hat sysconfig files >> exist first, then looks in the Debian location. >> This lets the config files reside in the desired location and does not >> require any additional runtime config file >> to point to their location. > > This is good. > >> Creating network initscripts >> ---------------------------- >> >> -In the /etc/sysconfig/network-scripts directory it is necccessary to create >> +In the <SYSCONFIG>/network-scripts directory it is necccessary to create >> 2 config files. The first (ifcfg-eth0) defines your physical network interface, >> and says that it will be part of a bridge: > > This, and all the stuff that implicitly refers to files in > /etc/default for host network configuration, is entirely wrong. > Debian-derived distros have a different way of setting up networking > and the files have a different syntax and semantics, as well as a > different location.I''ll need to research this further. If anyone has any heuristics to suggest....> > It''s only the files which are invented by the Xen distribution which > might be found in /etc/sysconfig _or_ /etc/default. > >> if [ -f /etc/sysconfig/xenballoon.conf ]; then >> . /etc/sysconfig/xenballoon.conf >> +else >> + if [ -f /etc/default/xenballoon.conf ]; then > > Use elif ?:-)> >> +if [ -d /etc/sysconfig ]; then >> + LOCKFILE=/var/lock/subsys/xendomains >> + XENDOM_CONFIG=/etc/sysconfig/xendomains >> +else >> + LOCKFILE=/var/lock/xendomains >> + XENDOM_CONFIG=/etc/default/xendomains >> +fi > > I don''t think this is correct. You should test for /etc/sysconfig and > /var/lock/subsys separately, in case someone makes a mutant distro > that has one but not the other.Again, if I go with DISTRO_TYPE I could define a set of default locations for each DISTRO_TYPE. That would allow std distros to work with a master toggle and others to be customized as needed. -Bruce> > Would you care to revise your patch and resubmit it ? > > Thanks, > Ian. >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2010-Sep-15 10:03 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"):> So using ?= for the above would require that one manually add the > $PREFIX to whatever SYSCONFIG_DIR they wanted to use.Yes, you''re right. That''s a good reason for using a variable just for the directory leafname.> > If we do need a special variable for the leaf dir it should be called > > something else. ARCH is for CPU architectures. > > What''s a good word to differentiate bewteen debian/red hat distros? > > DISTRO_TYPE=<debian | redhat>No, that''s not the correct answer. We should have one variable for each thing that is controlled. So for the /etc dir for Xen settings files in sh syntax, SYSCONFIG_DIR_LEAF set to "default" or "sysconfig", perhaps.> That would allow the addition of other distro types as neeeded.It is better to provide hooks to allow distros we don''t know about to do what they want.> > This, and all the stuff that implicitly refers to files in > > /etc/default for host network configuration, is entirely wrong. > > Debian-derived distros have a different way of setting up networking > > and the files have a different syntax and semantics, as well as a > > different location. > > I''ll need to research this further. If anyone has any heuristics to > suggest....Since this is a document, rather than a script, you can simply refer people to the Debian version. Debian derivatives use /etc/network/interfaces. Documentation can be found in the manpages interfaces(5) and bridge-utils-interfaces(5). A typical /etc/network/interfaces for Xen looks something like this: # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto xenbr0 iface xenbr0 inet static address 192.0.2.145 netmask 255.255.255.0 gateway 192.0.2.254 bridge_ports eth0 bridge_fd 0 bridge_stp off> Again, if I go with DISTRO_TYPE I could define a set of default > Locations for each DISTRO_TYPE. That would allow std distros to work > with a master toggle and others to be customized as needed.A "master toggle" as you call it is generally a bad idea. Portability features should be switched individually. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bruce Edge
2010-Sep-15 16:06 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Wed, Sep 15, 2010 at 3:03 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:> Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"): >> So using ?= for the above would require that one manually add the >> $PREFIX to whatever SYSCONFIG_DIR they wanted to use. > > Yes, you''re right. That''s a good reason for using a variable just for > the directory leafname. > >> > If we do need a special variable for the leaf dir it should be called >> > something else. ARCH is for CPU architectures. >> >> What''s a good word to differentiate bewteen debian/red hat distros? >> >> DISTRO_TYPE=<debian | redhat> > > No, that''s not the correct answer. We should have one variable for > each thing that is controlled. So for the /etc dir for Xen settings > files in sh syntax, SYSCONFIG_DIR_LEAF set to "default" or > "sysconfig", perhaps. > >> That would allow the addition of other distro types as neeeded. > > It is better to provide hooks to allow distros we don''t know about to > do what they want.You don''t think there''s any advantage to grouping all the distro directory dependencies in one place? Something like this: ifeq ($(DISTRO_TYPE),redhat) SYSCONFIG_DIR = $(CONFIG_DIR)/sysconfig SUBSYS_DIR = /var/run/subsys INITD_DIR = /etc/rc.d/init.d endif ifeq ($(DISTRO_TYPE),debian) SYSCONFIG_DIR = $(CONFIG_DIR)/default SUBSYS_DIR = /var/run INITD_DIR = /etc/init.d endif I thought that would make it easy to see where new distro layouts should be added. If not, then I''ll just use these variables that can be tuned individually: SYSCONFIG_DIR_LEAF SUBSYS_DIR_LEAF INITD_DIR and put them all in Config.mk. -Bruce> >> > This, and all the stuff that implicitly refers to files in >> > /etc/default for host network configuration, is entirely wrong. >> > Debian-derived distros have a different way of setting up networking >> > and the files have a different syntax and semantics, as well as a >> > different location. >> >> I''ll need to research this further. If anyone has any heuristics to >> suggest.... > > Since this is a document, rather than a script, you can simply refer > people to the Debian version. > > Debian derivatives use /etc/network/interfaces. Documentation can be > found in the manpages interfaces(5) and bridge-utils-interfaces(5). > A typical /etc/network/interfaces for Xen looks something like this: > > # This file describes the network interfaces available on your system > # and how to activate them. For more information, see interfaces(5). > > # The loopback network interface > auto lo > iface lo inet loopback > > # The primary network interface > auto xenbr0 > iface xenbr0 inet static > address 192.0.2.145 > netmask 255.255.255.0 > gateway 192.0.2.254 > bridge_ports eth0 > bridge_fd 0 > bridge_stp off > >> Again, if I go with DISTRO_TYPE I could define a set of default >> Locations for each DISTRO_TYPE. That would allow std distros to work >> with a master toggle and others to be customized as needed. > > A "master toggle" as you call it is generally a bad idea. Portability > features should be switched individually. > > Ian. >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Olaf Hering
2010-Sep-15 16:16 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Wed, Sep 15, Bruce Edge wrote:> Something like this: > > ifeq ($(DISTRO_TYPE),redhat) > SYSCONFIG_DIR = $(CONFIG_DIR)/sysconfig > SUBSYS_DIR = /var/run/subsys > INITD_DIR = /etc/rc.d/init.d > endif > > ifeq ($(DISTRO_TYPE),debian) > SYSCONFIG_DIR = $(CONFIG_DIR)/default > SUBSYS_DIR = /var/run > INITD_DIR = /etc/init.d > endifSuSE has /etc/sysconfig, /var/run and /etc/init.d Olaf _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2010-Sep-16 16:29 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"):> On Wed, Sep 15, 2010 at 3:03 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote: > > It is better to provide hooks to allow distros we don''t know about to > > do what they want. > > You don''t think there''s any advantage to grouping all the distro > directory dependencies in one place?No. I think there is a disadvantage to grouping these kind of configuration parameter settings by our idea of what distros there are and how they work.> I thought that would make it easy to see where new distro layouts > should be added.A distro we haven''t heard of doesn''t want to patch our makefiles to add themselves to a huge list, and we don''t want a list of all the distros in the universe in our code. They just want to set the settings available to the values for their setup.> If not, then I''ll just use these variables that can be tuned individually: > > SYSCONFIG_DIR_LEAF > SUBSYS_DIR_LEAF > INITD_DIR > > and put them all in Config.mk.That would be great, thanks. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bruce Edge
2010-Sep-16 18:52 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Thu, Sep 16, 2010 at 9:29 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:> Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"): >> On Wed, Sep 15, 2010 at 3:03 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote: >> > It is better to provide hooks to allow distros we don''t know about to >> > do what they want. >> >> You don''t think there''s any advantage to grouping all the distro >> directory dependencies in one place? > > No. I think there is a disadvantage to grouping these kind of > configuration parameter settings by our idea of what distros there > are and how they work. > >> I thought that would make it easy to see where new distro layouts >> should be added. > > A distro we haven''t heard of doesn''t want to patch our makefiles to > add themselves to a huge list, and we don''t want a list of all the > distros in the universe in our code. They just want to set the > settings available to the values for their setup. > >> If not, then I''ll just use these variables that can be tuned individually: >> >> SYSCONFIG_DIR_LEAF >> SUBSYS_DIR_LEAF >> INITD_DIR >> >> and put them all in Config.mk. > > That would be great, thanks. > > Ian. >Here''s the next attempt. This addresses the issues raised above and addresses a few more things I found. This one fixes udev and xen-watchdog startup as well. =============== cut =============== See docs/misc/distro_mapping.txt for more details. Author: Bruce Edge <bruce.edge@gmail.com> Signed-off-by: Bruce Edge <bruce.edge@gmail.com> Index: xen-unstable.hg/config/StdGNU.mk ==================================================================--- xen-unstable.hg.orig/config/StdGNU.mk 2010-09-15 10:14:31.000000000 -0700 +++ xen-unstable.hg/config/StdGNU.mk 2010-09-16 09:48:43.000000000 -0700 @@ -49,7 +49,7 @@ CONFIG_DIR = $(PREFIX)/etc endif -SYSCONFIG_DIR = $(CONFIG_DIR)/sysconfig +SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR) XEN_CONFIG_DIR = $(CONFIG_DIR)/xen XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts Index: xen-unstable.hg/Makefile ==================================================================--- xen-unstable.hg.orig/Makefile 2010-09-15 10:14:31.000000000 -0700 +++ xen-unstable.hg/Makefile 2010-09-16 09:35:49.000000000 -0700 @@ -203,7 +203,7 @@ rm -f $(D)$(CONFIG_DIR)/udev/xen-backend.rules rm -f $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules rm -f $(D)$(CONFIG_DIR)/udev/xend.rules - rm -f $(D)$(CONFIG_DIR)/sysconfig/xendomains + rm -f $(D)$(SYSCONFIG_DIR)/xendomains rm -rf $(D)/var/run/xen* $(D)/var/lib/xen* rm -rf $(D)/boot/*xen* rm -rf $(D)/lib/modules/*xen* Index: xen-unstable.hg/docs/misc/distro_mapping.txt ==================================================================--- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ xen-unstable.hg/docs/misc/distro_mapping.txt 2010-09-16 09:50:30.000000000 -0700 @@ -0,0 +1,20 @@ +With directory layout differences between Red Hat, Debian, Suse and +other distros one needs to set the variables for the elements below + +-----------------+------------------+---------------+----------------+ + | RedHat (default) | Debian | Suse | +-----------------+------------------+---------------+----------------+ +CONFIG_LEAF_DIR | /sysconfig | /default | /sysconfig | +SUBSYS_DIR | /var/run/subsys | /var/run | /var/run | +INITD_DIR | /etc/rc.d/init.d | /etc/init.d | /etc/init.d | +-----------------+------------------+---------------+----------------+ + +The build currently defaults to the elements used by Red Hat. +For others, these env variables must be set in the shell env +or modified in Config.mk before running make. + +This mechanism sets the location that files are installed to, but does +not change the code itself. Scripts that refer to files affected by these +directories must check each possible location at run time. +To add support for new distributions that don''t use the above locations, +one must grep for the above elements and add appropriate checks. Index: xen-unstable.hg/tools/xenballoon/xenballoond.init ==================================================================--- xen-unstable.hg.orig/tools/xenballoon/xenballoond.init 2010-09-15 10:14:32.000000000 -0700 +++ xen-unstable.hg/tools/xenballoon/xenballoond.init 2010-09-16 09:53:19.000000000 -0700 @@ -29,6 +29,8 @@ if [ -f /etc/sysconfig/xenballoon.conf ]; then . /etc/sysconfig/xenballoon.conf +elif [ -f /etc/default/xenballoon.conf ]; then + . /etc/default/xenballoon.conf fi # Check that balloon driver is present Index: xen-unstable.hg/tools/xenballoon/xenballoond ==================================================================--- xen-unstable.hg.orig/tools/xenballoon/xenballoond 2010-09-15 10:14:32.000000000 -0700 +++ xen-unstable.hg/tools/xenballoon/xenballoond 2010-09-16 09:35:49.000000000 -0700 @@ -21,7 +21,7 @@ # If xenbus is running and the /usr/bin/xenstore-* tools are installed, # "xenbus is enabled". # -# Parameters are documented in /etc/sysconfig/xenballoon.conf. Although +# Parameters are documented in <SYSCONFIG>/xenballoon.conf. Although # some are not used with directed ballooning, all must be set properly. # If xenbus is enabled, some of these parameters may be overridden by values # set by domain0 via xenbus. @@ -237,7 +237,12 @@ fi preswapnow=0 -. /etc/sysconfig/xenballoon.conf +# See DISTRO_TYPE in the docs +if [ -f /etc/sysconfig/xenballoon.conf ]; then + . /etc/sysconfig/xenballoon.conf +elif [ -f /etc/default/xenballoon.conf ]; then + . /etc/default/xenballoon.conf +fi while true; do Index: xen-unstable.hg/tools/xenballoon/xenballoond.README ==================================================================--- xen-unstable.hg.orig/tools/xenballoon/xenballoond.README 2010-09-15 10:14:32.000000000 -0700 +++ xen-unstable.hg/tools/xenballoon/xenballoond.README 2010-09-16 09:56:42.000000000 -0700 @@ -56,16 +56,19 @@ be installed. Binaries can be obtained, for example, by building xen-vvv.gz/tools in a guest-binary-compatible development tree -Instructions to install/deploy xenballoond (in Redhat-based system): +Instructions to install/deploy xenballoond: + (see docs/misc/distro_mapping.txt for SYSCONFIG and INITD_DIR definitions) - in each guest: - ensure pre-requisites are met (see above) - - place xenballoon.conf in /etc/sysconfig + - place xenballoon.conf in <SYSCONFIG> - place xenballoond in /usr/sbin - - copy xenballoond.init to /etc/rc.d/init.d/xenballoond (note file rename) - - edit /etc/sysconfig/xenballoond.conf as desired (especially note that + - copy xenballoond.init to <INITD_DIR>/xenballoond (note file rename) + - edit <SYSCONFIG>/xenballoond.conf as desired (especially note that selfballooning defaults as off) - start xenballoond with "service xenballoond start", and/or configure - xenballoond to start at init (e.g. "chkconfig xenballoond on") + xenballoond to start at init + (Red Hat e.g. "chkconfig xenballoond on") + (Debian e.g. " update-rc.d xenballoond defaults") - in domain0: - if monitoring is desired, xenballoon-monitor may be installed in /usr/sbin - note that certain xenballoond.conf variables may be overridden by domain0 @@ -73,7 +76,7 @@ xenballoond.conf TODO: -080630 modifications to support SUSE-based and debian-based guests +080630 modifications to support SUSE-based 080630 domain0 ballooning policy module 080630 experiment with more aggressive (optionally) memory minimum targets 080630 BUG: xenballoond doesn''t properly record the fact that it''s running; Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains ==================================================================--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xendomains 2010-09-15 10:14:31.000000000 -0700 +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains 2010-09-16 09:35:49.000000000 -0700 @@ -46,8 +46,18 @@ exit 0 fi -LOCKFILE=/var/lock/subsys/xendomains -XENDOM_CONFIG=/etc/sysconfig/xendomains +# See DISTRO_TYPE in the docs +if [ -d /var/lock/subsys ]; then + LOCKFILE=/var/lock/subsys/xendomains +else + LOCKFILE=/var/lock/xendomains +fi + +if [ -d /etc/sysconfig ]; then + XENDOM_CONFIG=/etc/sysconfig/xendomains +else + XENDOM_CONFIG=/etc/default/xendomains +fi test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing"; if [ "$1" = "stop" ]; then exit 0; Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xend ==================================================================--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xend 2010-09-15 10:14:31.000000000 -0700 +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xend 2010-09-16 09:35:49.000000000 -0700 @@ -40,14 +40,20 @@ echo "xencommons should be started first." exit 1 fi - mkdir -p /var/lock/subsys - touch /var/lock/subsys/xend + # mkdir shouldn''t be needed as most distros have this already created. Default to using subsys. + # See DISTRO_TYPE in the docs + mkdir -p /var/lock + if [ -d /var/lock/subsys ] ; then + touch /var/lock/subsys/xend + else + touch /var/lock/xend + fi xend start await_daemons_up ;; stop) xend stop - rm -f /var/lock/subsys/xend + rm -f /var/lock/subsys/xend /var/lock/xend ;; status) xend status Index: xen-unstable.hg/tools/hotplug/Linux/Makefile ==================================================================--- xen-unstable.hg.orig/tools/hotplug/Linux/Makefile 2010-09-15 10:14:31.000000000 -0700 +++ xen-unstable.hg/tools/hotplug/Linux/Makefile 2010-09-16 09:35:49.000000000 -0700 @@ -62,16 +62,17 @@ .PHONY: install install: all install-initd install-scripts $(HOTPLUGS) +# See DISTRO_TYPE in the docs for INITD_DIR location .PHONY: install-initd install-initd: - [ -d $(DESTDIR)$(CONFIG_DIR)/init.d ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/init.d + [ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR) [ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR) - $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d - $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d + $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(INITD_DIR) + $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR) $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains - $(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d + $(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR) $(INSTALL_PROG) $(XENCOMMONS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xencommons - $(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(CONFIG_DIR)/init.d + $(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR) .PHONY: install-scripts install-scripts: Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xen-watchdog ==================================================================--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xen-watchdog 2010-09-15 10:14:31.000000000 -0700 +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xen-watchdog 2010-09-16 09:35:49.000000000 -0700 @@ -18,7 +18,24 @@ # # Source function library. -. /etc/init.d/functions +if [ -e /etc/init.d/functions ] ; then + . /etc/init.d/functions +elif [ -e /lib/lsb/init-functions ] ; then + . /lib/lsb/init-functions + success () { + log_success_msg $* + } + failure () { + log_failure_msg $* + } +else + success () { + echo $* + } + failure () { + echo $* + } +fi start() { local r Index: xen-unstable.hg/Config.mk ==================================================================--- xen-unstable.hg.orig/Config.mk 2010-09-16 09:47:02.000000000 -0700 +++ xen-unstable.hg/Config.mk 2010-09-16 09:48:58.000000000 -0700 @@ -31,6 +31,12 @@ MANDIR ?= $(SHAREDIR)/man BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d +# These are the Red Hat settings. +# See distro_mapping.txt for other options +CONFIG_LEAF_DIR ?= sysconfig +SUBSYS_DIR ?= /var/run/subsys +INITD_DIR ?= /etc/rc.d/init.d + ifneq ($(EXTRA_PREFIX),) EXTRA_INCLUDES += $(EXTRA_PREFIX)/include EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBLEAFDIR) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dan Magenheimer
2010-Sep-16 20:24 UTC
RE: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
> Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs > Redhat layout patch options"): > > On Wed, Sep 15, 2010 at 3:03 AM, Ian Jackson > <Ian.Jackson@eu.citrix.com> wrote: > > > It is better to provide hooks to allow distros we don''t know about > to > > > do what they want. > > > > You don''t think there''s any advantage to grouping all the distro > > directory dependencies in one place? > > No. I think there is a disadvantage to grouping these kind of > configuration parameter settings by our idea of what distros there > are and how they work.Um, OK, then what is the default going to be? Or are you going to require everyone who uses ANY distro to edit a list of Config.mk parameters before the build does anything useful? Seems to me if we group them as Bruce suggests and only require a single edit (or even do it automagically based on presence/contents of certain files), the vast majority of Xen developers will be better off. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dan Magenheimer
2010-Sep-16 20:34 UTC
RE: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
> Um, OK, then what is the default going to be? Or are you > going to require everyone who uses ANY distro to edit a > list of Config.mk parameters before the build does anything > useful? Seems to me if we group them as Bruce suggests and > only require a single edit (or even do it automagically based > on presence/contents of certain files), the vast majority > of Xen developers will be better off.Never mind, objection withdrawn. With a reasonable default and Bruce''s distro_mapping.txt file that explains it (along with a pointer to that file in Config.mk, I''m OK with it.> -----Original Message----- > From: Dan Magenheimer > Sent: Thursday, September 16, 2010 2:24 PM > To: Ian Jackson; Bruce Edge > Cc: xen-devel@lists.xensource.com > Subject: RE: [Xen-devel] [patch] Xen build - Debian vs Redhat layout > patch options > > > Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs > > Redhat layout patch options"): > > > On Wed, Sep 15, 2010 at 3:03 AM, Ian Jackson > > <Ian.Jackson@eu.citrix.com> wrote: > > > > It is better to provide hooks to allow distros we don''t know > about > > to > > > > do what they want. > > > > > > You don''t think there''s any advantage to grouping all the distro > > > directory dependencies in one place? > > > > No. I think there is a disadvantage to grouping these kind of > > configuration parameter settings by our idea of what distros there > > are and how they work. > > Um, OK, then what is the default going to be? Or are you > going to require everyone who uses ANY distro to edit a > list of Config.mk parameters before the build does anything > useful? Seems to me if we group them as Bruce suggests and > only require a single edit (or even do it automagically based > on presence/contents of certain files), the vast majority > of Xen developers will be better off. > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Olaf Hering
2010-Sep-16 20:45 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Thu, Sep 16, Bruce Edge wrote:> +++ xen-unstable.hg/tools/xenballoon/xenballoond.README 2010-09-16 09:56:42.000000000 -0700> + xenballoond to start at init > + (Red Hat e.g. "chkconfig xenballoond on") > + (Debian e.g. " update-rc.d xenballoond defaults")> +080630 modifications to support SUSE-basedThat would be ''insserv xenballoond'', it is part of LSB. Olaf _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bruce Edge
2010-Sep-16 20:56 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Thu, Sep 16, 2010 at 1:45 PM, Olaf Hering <olaf@aepfle.de> wrote:> On Thu, Sep 16, Bruce Edge wrote: > >> +++ xen-unstable.hg/tools/xenballoon/xenballoond.README 2010-09-16 09:56:42.000000000 -0700 > >> + xenballoond to start at init >> + (Red Hat e.g. "chkconfig xenballoond on") >> + (Debian e.g. " update-rc.d xenballoond defaults") > >> +080630 modifications to support SUSE-based > > That would be ''insserv xenballoond'', it is part of LSB.Are you suggesting the following change? + xenballoond to start at init + (Red Hat e.g. "chkconfig xenballoond on") + (Debian e.g. " update-rc.d xenballoond defaults") + (Suse e.g. " insserv xenballoond") -Bruce -Bruce> > Olaf > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Olaf Hering
2010-Sep-16 20:59 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Thu, Sep 16, Bruce Edge wrote:> Are you suggesting the following change? > > + xenballoond to start at init > + (Red Hat e.g. "chkconfig xenballoond on") > + (Debian e.g. " update-rc.d xenballoond defaults") > + (Suse e.g. " insserv xenballoond")Yes, looks good. Olaf _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bruce Edge
2010-Sep-16 21:02 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Thu, Sep 16, 2010 at 1:59 PM, Olaf Hering <olaf@aepfle.de> wrote:> On Thu, Sep 16, Bruce Edge wrote: > >> Are you suggesting the following change? >> >> + xenballoond to start at init >> + (Red Hat e.g. "chkconfig xenballoond on") >> + (Debian e.g. " update-rc.d xenballoond defaults") >> + (Suse e.g. " insserv xenballoond") > > Yes, looks good. > > Olaf > >OK, resubmit #3 with Olaf''s suggestion. No other changes. -Bruce _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2010-Sep-17 15:01 UTC
RE: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options [and 1 more messages]
Dan Magenheimer writes ("RE: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"):> Um, OK, then what is the default going to be?I don''t mind very much, but it would make sense for it to be similar to the historical Xen defaults so probably vaguely Fedora-like.> Seems to me if we group them as Bruce suggests and only require a > single edit (or even do it automagically based on presence/contents > of certain files), the vast majority of Xen developers will be > better off.The problem with these kind of arrangements is that they inevitably breed further settings, not properly individually configurable, hanging off the "what OS do you have" switch. Dan Magenheimer writes ("RE: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"):> Never mind, objection withdrawn. With a reasonable default > and Bruce''s distro_mapping.txt file that explains it (along > with a pointer to that file in Config.mk, I''m OK with it.Good, thanks. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2010-Sep-17 16:11 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"):> OK, resubmit #3 with Olaf''s suggestion. > No other changes.Thanks. Nearly there I think... There are still a couple of occurrences of this:> +# See DISTRO_TYPE in the docswhich should presumably refer to docs/misc/distro_mapping.txt.> +CONFIG_LEAF_DIR | /sysconfig | /default | /sysconfig |^ ^ ^ Not hugely important, but these slashes should be omitted I think ? Since CONFIG_LEAF_DIR is used and defined like this:> +SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)...> +CONFIG_LEAF_DIR ?= sysconfig> +To add support for new distributions that don''t use the above locations, > +one must grep for the above elements and add appropriate checks.Surely this should simply say that for a new distro one must change the settings for the appropriate values, in Config.mk, and/or set them in a local ".config" file. There shouldn''t be any need to grep for them, should there ?> -080630 modifications to support SUSE-based and debian-based guests > +080630 modifications to support SUSE-basedThis can be removed now ? Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bruce Edge
2010-Sep-17 17:05 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Fri, Sep 17, 2010 at 9:11 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:> Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"): >> OK, resubmit #3 with Olaf''s suggestion. >> No other changes. > > Thanks. Nearly there I think... > > There are still a couple of occurrences of this: > >> +# See DISTRO_TYPE in the docsOK, will fix. It changed so many times I forgot about them...> > which should presumably refer to docs/misc/distro_mapping.txt. > > >> +CONFIG_LEAF_DIR | /sysconfig | /default | /sysconfig | > ^ ^ ^ > > Not hugely important, but these slashes should be omitted I think ?Yes, they can and will in the next round.> Since CONFIG_LEAF_DIR is used and defined like this: > >> +SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR) > ... >> +CONFIG_LEAF_DIR ?= sysconfig > > >> +To add support for new distributions that don''t use the above locations, >> +one must grep for the above elements and add appropriate checks. > > Surely this should simply say that for a new distro one must change > the settings for the appropriate values, in Config.mk, and/or set them > in a local ".config" file. There shouldn''t be any need to grep for > them, should there ?Yes and no. For building one only needs to add these in the env or Config.mk, but for runtime, xen checks each location in turn and for non-standard locations checks need to be added. eg: If someone adds CONFIG_LEAF_DIR=blah, then they will need to modify the if statement below as well. if [ -f /etc/sysconfig/xenballoon.conf ]; then + . /etc/sysconfig/xenballoon.conf +elif [ -f /etc/default/xenballoon.conf ]; then + . /etc/default/xenballoon.conf +fi I felt that if I left a tag in all these places, like "distro_mapping" or something similar it would give people something to search for to find all the places they needed to add new code.> > >> -080630 modifications to support SUSE-based and debian-based guests >> +080630 modifications to support SUSE-based > > This can be removed now ?Oh, right, I guess this does handle the SUSE case too. - will do. Thanks for all the hints. -Bruce> > Ian. >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2010-Sep-17 17:52 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"):> Yes and no. For building one only needs to add these in the env or > Config.mk, but for runtime, xen checks each location in turn and for > non-standard locations checks need to be added. eg:Ah, I see what you mean. But I think your grep cannot be reliable anyway because we cannot anticipate all the ways a distro may be weird. If for some distro /etc/default needs to be changed to a third possibility then yes they''ll have to grep for /etc/default; but if /etc is renamed /flibble then they''ll have to grep for /flibble. I expect most distro packages and admins will know about these idiosyncracies. But write what you like; it''s only a doc comment :-). Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bruce Edge
2010-Sep-17 18:13 UTC
Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options
On Fri, Sep 17, 2010 at 10:52 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:> Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"): >> Yes and no. For building one only needs to add these in the env or >> Config.mk, but for runtime, xen checks each location in turn and for >> non-standard locations checks need to be added. eg: > > Ah, I see what you mean. But I think your grep cannot be reliable > anyway because we cannot anticipate all the ways a distro may be > weird. > > If for some distro /etc/default needs to be changed to a third > possibility then yes they''ll have to grep for /etc/default; but if > /etc is renamed /flibble then they''ll have to grep for /flibble. I > expect most distro packages and admins will know about these > idiosyncracies. > > But write what you like; it''s only a doc comment :-). > > Ian. >All comments addressed and fixed. -Bruce =============== cut ============== See docs/misc/distro_mapping.txt for more details. Author: Bruce Edge <bruce.edge@gmail.com> Signed-off-by: Bruce Edge <bruce.edge@gmail.com> Index: xen-unstable.hg/config/StdGNU.mk ==================================================================--- xen-unstable.hg.orig/config/StdGNU.mk 2010-09-17 10:40:05.000000000 -0700 +++ xen-unstable.hg/config/StdGNU.mk 2010-09-17 10:54:29.000000000 -0700 @@ -49,7 +49,7 @@ CONFIG_DIR = $(PREFIX)/etc endif -SYSCONFIG_DIR = $(CONFIG_DIR)/sysconfig +SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR) XEN_CONFIG_DIR = $(CONFIG_DIR)/xen XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts Index: xen-unstable.hg/Makefile ==================================================================--- xen-unstable.hg.orig/Makefile 2010-09-17 10:40:05.000000000 -0700 +++ xen-unstable.hg/Makefile 2010-09-17 10:54:29.000000000 -0700 @@ -203,7 +203,7 @@ rm -f $(D)$(CONFIG_DIR)/udev/xen-backend.rules rm -f $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules rm -f $(D)$(CONFIG_DIR)/udev/xend.rules - rm -f $(D)$(CONFIG_DIR)/sysconfig/xendomains + rm -f $(D)$(SYSCONFIG_DIR)/xendomains rm -rf $(D)/var/run/xen* $(D)/var/lib/xen* rm -rf $(D)/boot/*xen* rm -rf $(D)/lib/modules/*xen* Index: xen-unstable.hg/docs/misc/distro_mapping.txt ==================================================================--- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ xen-unstable.hg/docs/misc/distro_mapping.txt 2010-09-17 11:03:23.000000000 -0700 @@ -0,0 +1,27 @@ +With directory layout differences between Red Hat, Debian, Suse and +other distros one needs to set the variables for the elements below + +-----------------+------------------+---------------+----------------+ + | RedHat (default) | Debian | Suse | +-----------------+------------------+---------------+----------------+ +CONFIG_LEAF_DIR | sysconfig | default | sysconfig | +SUBSYS_DIR | /var/run/subsys | /var/run | /var/run | +INITD_DIR | /etc/rc.d/init.d | /etc/init.d | /etc/init.d | +-----------------+------------------+---------------+----------------+ + +The build currently defaults to the elements used by Red Hat. +For others, these env variables must be set in the shell env +or modified in Config.mk before running make. + +This mechanism sets the location that files are installed to, but does +not change the code itself. Scripts that refer to files affected by these +directories must check each possible location at run time. + +To add support for new distributions that don''t use the above locations, +one must grep for the above elements and add appropriate checks. + +For example if a new distro uses /etc/bork as it''s config dir, It''s not +sufficient to set CONFIG_LEAF_DIR=bork, one must also add tests for the +existance of the bork dir in every context where config files are read. + + Index: xen-unstable.hg/tools/xenballoon/xenballoond.init ==================================================================--- xen-unstable.hg.orig/tools/xenballoon/xenballoond.init 2010-09-17 10:40:05.000000000 -0700 +++ xen-unstable.hg/tools/xenballoon/xenballoond.init 2010-09-17 10:54:29.000000000 -0700 @@ -29,6 +29,8 @@ if [ -f /etc/sysconfig/xenballoon.conf ]; then . /etc/sysconfig/xenballoon.conf +elif [ -f /etc/default/xenballoon.conf ]; then + . /etc/default/xenballoon.conf fi # Check that balloon driver is present Index: xen-unstable.hg/tools/xenballoon/xenballoond ==================================================================--- xen-unstable.hg.orig/tools/xenballoon/xenballoond 2010-09-17 10:40:05.000000000 -0700 +++ xen-unstable.hg/tools/xenballoon/xenballoond 2010-09-17 10:54:29.000000000 -0700 @@ -21,7 +21,7 @@ # If xenbus is running and the /usr/bin/xenstore-* tools are installed, # "xenbus is enabled". # -# Parameters are documented in /etc/sysconfig/xenballoon.conf. Although +# Parameters are documented in <SYSCONFIG>/xenballoon.conf. Although # some are not used with directed ballooning, all must be set properly. # If xenbus is enabled, some of these parameters may be overridden by values # set by domain0 via xenbus. @@ -237,7 +237,12 @@ fi preswapnow=0 -. /etc/sysconfig/xenballoon.conf +# See docs/misc/distro_mapping.txt +if [ -f /etc/sysconfig/xenballoon.conf ]; then + . /etc/sysconfig/xenballoon.conf +elif [ -f /etc/default/xenballoon.conf ]; then + . /etc/default/xenballoon.conf +fi while true; do Index: xen-unstable.hg/tools/xenballoon/xenballoond.README ==================================================================--- xen-unstable.hg.orig/tools/xenballoon/xenballoond.README 2010-09-17 10:40:05.000000000 -0700 +++ xen-unstable.hg/tools/xenballoon/xenballoond.README 2010-09-17 11:04:19.000000000 -0700 @@ -56,16 +56,20 @@ be installed. Binaries can be obtained, for example, by building xen-vvv.gz/tools in a guest-binary-compatible development tree -Instructions to install/deploy xenballoond (in Redhat-based system): +Instructions to install/deploy xenballoond: + (see docs/misc/distro_mapping.txt for SYSCONFIG and INITD_DIR definitions) - in each guest: - ensure pre-requisites are met (see above) - - place xenballoon.conf in /etc/sysconfig + - place xenballoon.conf in <SYSCONFIG> - place xenballoond in /usr/sbin - - copy xenballoond.init to /etc/rc.d/init.d/xenballoond (note file rename) - - edit /etc/sysconfig/xenballoond.conf as desired (especially note that + - copy xenballoond.init to <INITD_DIR>/xenballoond (note file rename) + - edit <SYSCONFIG>/xenballoond.conf as desired (especially note that selfballooning defaults as off) - start xenballoond with "service xenballoond start", and/or configure - xenballoond to start at init (e.g. "chkconfig xenballoond on") + xenballoond to start at init + (Red Hat e.g. "chkconfig xenballoond on") + (Debian e.g. " update-rc.d xenballoond defaults") + (Suse e.g. " insserv xenballoond") - in domain0: - if monitoring is desired, xenballoon-monitor may be installed in /usr/sbin - note that certain xenballoond.conf variables may be overridden by domain0 @@ -73,7 +77,6 @@ xenballoond.conf TODO: -080630 modifications to support SUSE-based and debian-based guests 080630 domain0 ballooning policy module 080630 experiment with more aggressive (optionally) memory minimum targets 080630 BUG: xenballoond doesn''t properly record the fact that it''s running; Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains ==================================================================--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xendomains 2010-09-17 10:40:05.000000000 -0700 +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains 2010-09-17 10:54:29.000000000 -0700 @@ -46,8 +46,18 @@ exit 0 fi -LOCKFILE=/var/lock/subsys/xendomains -XENDOM_CONFIG=/etc/sysconfig/xendomains +# See docs/misc/distro_mapping.txt +if [ -d /var/lock/subsys ]; then + LOCKFILE=/var/lock/subsys/xendomains +else + LOCKFILE=/var/lock/xendomains +fi + +if [ -d /etc/sysconfig ]; then + XENDOM_CONFIG=/etc/sysconfig/xendomains +else + XENDOM_CONFIG=/etc/default/xendomains +fi test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing"; if [ "$1" = "stop" ]; then exit 0; Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xend ==================================================================--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xend 2010-09-17 10:40:05.000000000 -0700 +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xend 2010-09-17 10:54:29.000000000 -0700 @@ -40,14 +40,20 @@ echo "xencommons should be started first." exit 1 fi - mkdir -p /var/lock/subsys - touch /var/lock/subsys/xend + # mkdir shouldn''t be needed as most distros have this already created. Default to using subsys. + # See docs/misc/distro_mapping.txt + mkdir -p /var/lock + if [ -d /var/lock/subsys ] ; then + touch /var/lock/subsys/xend + else + touch /var/lock/xend + fi xend start await_daemons_up ;; stop) xend stop - rm -f /var/lock/subsys/xend + rm -f /var/lock/subsys/xend /var/lock/xend ;; status) xend status Index: xen-unstable.hg/tools/hotplug/Linux/Makefile ==================================================================--- xen-unstable.hg.orig/tools/hotplug/Linux/Makefile 2010-09-17 10:40:05.000000000 -0700 +++ xen-unstable.hg/tools/hotplug/Linux/Makefile 2010-09-17 10:54:29.000000000 -0700 @@ -62,16 +62,17 @@ .PHONY: install install: all install-initd install-scripts $(HOTPLUGS) +# See docs/misc/distro_mapping.txt for INITD_DIR location .PHONY: install-initd install-initd: - [ -d $(DESTDIR)$(CONFIG_DIR)/init.d ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/init.d + [ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR) [ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR) - $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d - $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d + $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(INITD_DIR) + $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR) $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains - $(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d + $(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR) $(INSTALL_PROG) $(XENCOMMONS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xencommons - $(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(CONFIG_DIR)/init.d + $(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR) .PHONY: install-scripts install-scripts: Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xen-watchdog ==================================================================--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xen-watchdog 2010-09-17 10:40:05.000000000 -0700 +++ xen-unstable.hg/tools/hotplug/Linux/init.d/xen-watchdog 2010-09-17 10:54:29.000000000 -0700 @@ -18,7 +18,24 @@ # # Source function library. -. /etc/init.d/functions +if [ -e /etc/init.d/functions ] ; then + . /etc/init.d/functions +elif [ -e /lib/lsb/init-functions ] ; then + . /lib/lsb/init-functions + success () { + log_success_msg $* + } + failure () { + log_failure_msg $* + } +else + success () { + echo $* + } + failure () { + echo $* + } +fi start() { local r Index: xen-unstable.hg/Config.mk ==================================================================--- xen-unstable.hg.orig/Config.mk 2010-09-17 10:40:05.000000000 -0700 +++ xen-unstable.hg/Config.mk 2010-09-17 10:54:29.000000000 -0700 @@ -31,6 +31,12 @@ MANDIR ?= $(SHAREDIR)/man BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d +# These are the Red Hat settings. +# See distro_mapping.txt for other options +CONFIG_LEAF_DIR ?= sysconfig +SUBSYS_DIR ?= /var/run/subsys +INITD_DIR ?= /etc/rc.d/init.d + ifneq ($(EXTRA_PREFIX),) EXTRA_INCLUDES += $(EXTRA_PREFIX)/include EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBLEAFDIR) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
user virtual
2011-Jan-04 21:09 UTC
Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options
Hi Stefano I was encouraged by Bruce to forward my patches upstream to make Xen sources buildable from debian makefile debian/rules and for debian based target systems. I tried to make my 3 of 4 (5) patches to xen40-testing.hg as non intrusive as possible - backport-StdGNU.mk.diff (from xen-devel, already here) - debian-sysconfig-default.diff (conditional Makefile expansion) - tools-blktap2-libs.patch (from debian Xen-4.0 sources) - debian-python-2.6.diff (conditional Makefile expansion) - debian-stubdom.Makefile.diff (conditional Makefile expansion) Config.mk gets patched with the line: DEBIANBASE ?= \ $(shell test ! -d /etc/sysconfig && test -d /etc/default && echo y || echo n) ... and three other patches depend on it. tools-blktap2-libs.patch is non conditional but it seems quite reasonable (only moves FLAGS definitions closer to the sources requiring them) and comes from a respected source. If these are applied Xen sources build without errors from superior debian build makefile "debian/rules", bringing updating Xen through debian package management. See for example of debian packager: http://virtualusr.wordpress.com/2011/01/03/xen-4-0-packager-for-ubuntu/ Original 4.0.1 source builds on Ubuntu Lenny 10.04 with make dist and produces similar result as pached 4.0.1 source builds with make dist DEBIANBASE=n Patched source runs with make dist DEBIANBASE=y same as with simple make dist and builds debian-based version without errors. I hope you will find this useful and apply it upstream. Best regards PS: I find the last xend.patch useful here if init.d/xend is run before xenfs kernel module is loaded. Mount attempt autoloads the module. Otherwise mount is never attempted. Is it ok to load xenfs module so late in the boot process? If so, the last patch might also be interesting for upload, right? On Mon, Jul 12, 2010 at 4:08 AM, Bruce Edge <bruce.edge@gmail.com> wrote:> FYI - > > You could submit a patch to the Xen Gods directly and it would be accepted. > > I already got the debug options accepted in xen-unstable, so they do listen > to people who have never contributed before. > (21752 (29e545151078) tools/debugger/gdbsx: build enabled by default) > > -Bruce > > > ---------- Forwarded message ---------- > From: Stefano Stabellini <stefano.stabellini@eu.citrix.com> > Date: Wed, Jul 7, 2010 at 4:19 AM > Subject: Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options > To: Bruce Edge <bruce.edge@gmail.com> > Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com> > > > On Wed, 7 Jul 2010, Bruce Edge wrote: > > What''s the right way to address these sort RedHat vs. Debian things in > the Xen build? > > > > - rm -f $(D)$(CONFIG_DIR)/sysconfig/xendomains > > + rm -f $(D)$(CONFIG_DIR)/default/xendomains > > > > - mkdir -p /var/lock/subsys > > - touch /var/lock/subsys/xend > > + mkdir -p /var/lock > > + touch /var/lock/xend > > > > Can I submit a patch that uses a config var to switch on which path use ? > > > > Or, where should such a build time switch go? Env, or? > > ...assuming that it''s even an option. > > > > There''s a couple of different downstream patches that others are > maintaining to handle this kind of stuff, but that lag > > behind the xen-unstable tree and it seems like an upstream patch to > handle this distro variation in the Xen build itself > > would be a better long term solution. > > > > A way to switch between the two would be nice, I would accept a patch > that accomplish that using a config var (something in Config.mk ?. > The default value of this config variable might be detected looking at > the existence of /etc/sysconfig or /etc/default. > > Keep in mind that besides sysconfig vs. default there are other subtle > differences, like the chkconfig line in the init scripts > (tools/hotplug/Linux/init.d/xencommons for example). > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2011-Jan-06 15:02 UTC
Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options
On Tue, 4 Jan 2011, user virtual wrote:> Hi Stefano > > I was encouraged by Bruce to forward my patches upstream to make Xen sources buildable from debian makefile debian/rules > and for debian based target systems. >We always welcome good patches, thanks! Could you please port your patches to xen-unstable? We usually don''t apply new patches to the stable trees directly. Unfortunately we made many changes to the init scripts in xen-unstable so porting the patches might not be straightforward. I''ll post some comments inline.> I tried to make my 3 of 4 (5) patches to xen40-testing.hg as non intrusive as possible > > - backport-StdGNU.mk.diff (from xen-devel, already here) > - debian-sysconfig-default.diff (conditional Makefile expansion) > Description: Adapt init.d and sysconfig files to Debian based systems > An attempt to assess that the build is to be made for Debian > based systems. Based on the assessment adapt init.d and sysconfig > files > * Config.mk: DEBIANBASE - guess if the target system is debian based > * tools/hotplug/Linux/Makefile: target install-initd: if DEBIANBASE=y > - use /etc/default instead for /etc/sysconfig as destination folder > - replace references of /etc/sysconfig for /etc/default in init.d-files > Author: User Virtual <virtualusr@gmail.com> > Origin: http://virtualusr.wordpress.com > Index: xen-4.0-4.0.1/Config.mk > ==================================================================> --- xen-4.0-4.0.1.orig/Config.mk 2010-08-25 10:22:42.000000000 +0200 > +++ xen-4.0-4.0.1/Config.mk 2011-01-04 19:08:17.816312723 +0100 > @@ -185,5 +185,6 @@ > PYTHON_TOOLS ?= y > CONFIG_MINITERM ?= n > CONFIG_LOMOUNT ?= n > +DEBIANBASE ?= $(shell test ! -d /etc/sysconfig && test -d /etc/default && echo y || echo n) > > -include $(XEN_ROOT)/.config > Index: xen-4.0-4.0.1/tools/hotplug/Linux/Makefile > ==================================================================> --- xen-4.0-4.0.1.orig/tools/hotplug/Linux/Makefile 2010-08-25 10:22:42.000000000 +0200 > +++ xen-4.0-4.0.1/tools/hotplug/Linux/Makefile 2011-01-04 19:08:17.816312723 +0100 > @@ -59,14 +59,22 @@ > .PHONY: install > install: all install-initd install-scripts $(HOTPLUGS) > > +SYSCONF_DIR = $(if $(filter y,$(DEBIANBASE)),default,sysconfig) > .PHONY: install-initd > install-initd: > [ -d $(DESTDIR)$(CONFIG_DIR)/init.d ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/init.d > - [ -d $(DESTDIR)$(CONFIG_DIR)/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/sysconfig > + [ -d $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR) > $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d > - $(INSTALL_PROG) $(XEND_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xend > + $(INSTALL_PROG) $(XEND_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR)/xend > $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d > - $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xendomains > + $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR)/xendomains > +ifeq ($(DEBIANBASE),y) > + set -e; for i in $(DESTDIR)$(CONFIG_DIR)/$(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/$(XENDOMAINS_INITD) ; do \ > + cp -a $$i $$i.tmp ; cp /dev/null $$i ; \ > + sed -e ''s|/etc/sysconfig\b|/etc/default|g'' $$i.tmp >> $$i ; \ > + rm -f $$i.tmp ; \ > + done > +endif >Using sed on the init scripts is not the right way of doing it. On xen-unstable we have a new init script called xencommons (tools/hotplug/Linux/init.d/xencommons), if you open it you''ll see that we already check for the presence of /etc/sysconfig or /etc/default and act accordingly. Something equivalent has been introduced to the xendomains script too. Thus I hope that on xen-unstable running sed on the init scripts is not required anymore.> .PHONY: install-scripts > install-scripts: > > - tools-blktap2-libs.patch (from debian Xen-4.0 sources) > - debian-python-2.6.diff (conditional Makefile expansion) > - debian-stubdom.Makefile.diff (conditional Makefile expansion)Could you please explain why is this needed?> PS: I find the last xend.patch useful here if init.d/xend is run before xenfs kernel module is loaded. Mount attempt > autoloads the module. Otherwise mount is never attempted. Is it ok to load xenfs module so late in the boot process? If > so, the last patch might also be interesting for upload, right?I believe we fixed this issue on xen-unstable moving the xenfs mount request in the xencommons script and removing the check for xenfs in /proc/filesystems. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Jan-11 17:37 UTC
Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options
user virtual writes ("Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options"):> I was encouraged by Bruce to forward my patches upstream to make Xen sources > buildable from debian makefile debian/rules and for debian based target > systems.Thanks.> I tried to make my 3 of 4 (5) patches to xen40-testing.hg as non intrusive > as possible > > - backport-StdGNU.mk.diff (from xen-devel, already here)Thanks for this. Posting them all one after another in a single message is not the most convenient format for a submission; better would be one per email. And there is no need to send us patches we already have; it just causes confusion ...> - debian-sysconfig-default.diff (conditional Makefile expansion)We have machinery in xen-unstable.hg now which should cope with this, so I don''t think we need that change. Stefano has dealt with most of these I think, but we still had outstanding this:> Description: Simple Python install layout for Debian based systems > Ported from origin below (Xen-3.4), which is a follower of > previous version from ubuntu Xen-3.3 sources > xen-3.3-3.3.0/debian/patches/use-python-2.6.diff > Drivers: User Virtual <virtualusr@gmail.com> > URL: http://virtualusr.wordpress.com > Origin: https://bugs.launchpad.net/ubuntu/+source/xen-3.3/+bug/378240/+attachment/662345/+files/xen-3.4_3.4.1-1ubuntu1.diff.gz > Index: xen-4.0-4.0.1/tools/pygrub/Makefile > ==================================================================> --- xen-4.0-4.0.1.orig/tools/pygrub/Makefile 2010-08-25 10:22:42.000000000 +0200 > +++ xen-4.0-4.0.1/tools/pygrub/Makefile 2011-01-04 19:08:18.556582404 +0100 > @@ -11,7 +11,8 @@ > .PHONY: install > install: all > CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \ > - $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force > + $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force \ > + $(if $(filter y,$(DEBIANBASE)),--install-layout=deb) > $(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(BINDIR)/pygrub > $(INSTALL_DIR) $(DESTDIR)/var/run/xend/bootThis special casing of Debian is pretty horrid. How about we provide a general way to pass arguments to setup.py install and setup.py build, with the variables set by default to the empty string ? Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
user virtual
2011-Jan-20 13:45 UTC
Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options
Hi Guys I summarize all patches in one mail here because I am not certain each is the best way to go, more like a discussion on how to finally close all holes to support debian builds. Stefano provoked me to port all patches to unstable resulting in a big step forward: http://virtualusr.wordpress.com/2011/01/20/xen-4-x-testing-unstable-ubuntu/ Right! Almost all of the patches are already resolved in unstable repository. For building xen-unstable debian packeges in my last attempt, only one patch was absolutely necessary (debian-stubdom.Makefile.diff). Strangely, manual run of "rules" makefile “fakeroot debian/rules binary” builds everything even without this last patch applied, while using the official packaging command "dpkg-buildpackage -rfakeroot" which calls the above "rules" makefile fails without the patch. It might be even theoretically possible to avoid this last patch, if one could find which environment options applied by running dpkg-buildpackage break the “make stubdom” command inside the "rules" makefile; find and unset them. Unfortunately I have no time for this unsure guessing game now. I found one more bug (xen-watchdog-bug.diff) preventing the stopping of xen-watchdog and by that provoking errors during the install and debian packet management. While analyzing python patch (not on debian), I found out that it can be dropped if I use the newer recommended debhelper command dh_pysupport to pack python related parts. The issue however remains open (patch required) if somebody only wishes to build sources without using packaging to debian and dh_pysupport. Ian: - This special casing of Debian is pretty horrid. How about we provide a general way to pass arguments to setup.py install and setup.py build, with the variables set by default to the empty string? Sounds great Ian, but after looking into tools/python/setup.py, I feel this exceeds my current knowledge of your python tools. Summary of attached patches against xen-unstable.hg: 1. debian-stubdom.Makefile.diff - necessary for official packaging command "dpkg-buildpackage -rfakeroot", not needed for simple build without .deb packages 2. xen-watchdog-bug.diff - obvious bug on all platforms 3. debian-python-2.6.diff - only needed for simple build on debian with no .deb packaging *.err - describes the error resolved by the patch I would personally like 1. to be included in xen-unstable.hg, and of course bug 2. resolved. Personally, I don''t find 3. critical any more, as I always avoid installing software which is not .deb packaged, but there might be other opinions out there. Otherwise, great work guys. I find xen-unstable.hg "almost fully debian-compatible". Best regards PS: Please note that there is an outstanding issue which prevents compiling from xen-unstable.hg with "export debug=n". I will summarize my latest experience regarding missing debian patches in xen-4.0-testing.hg in my next mail. On Tue, Jan 11, 2011 at 11:07 PM, Ian Jackson <Ian.Jackson@eu.citrix.com>wrote:> user virtual writes ("Re: [Xen-devel] Xen build - Debian vs Redhat layout > patch options"): > > I was encouraged by Bruce to forward my patches upstream to make Xen > sources > > buildable from debian makefile debian/rules and for debian based target > > systems. > > Thanks. > > > I tried to make my 3 of 4 (5) patches to xen40-testing.hg as non > intrusive > > as possible > > > > - backport-StdGNU.mk.diff (from xen-devel, already here) > > Thanks for this. Posting them all one after another in a single > message is not the most convenient format for a submission; better > would be one per email. > > And there is no need to send us patches we already have; it just > causes confusion ... > > > - debian-sysconfig-default.diff (conditional Makefile expansion) > > We have machinery in xen-unstable.hg now which should cope with this, > so I don''t think we need that change. > > Stefano has dealt with most of these I think, but we still had > outstanding this: > > > > Description: Simple Python install layout for Debian based systems > > Ported from origin below (Xen-3.4), which is a follower of > > previous version from ubuntu Xen-3.3 sources > > xen-3.3-3.3.0/debian/patches/use-python-2.6.diff > > Drivers: User Virtual <virtualusr@gmail.com> > > URL: http://virtualusr.wordpress.com > > Origin: > https://bugs.launchpad.net/ubuntu/+source/xen-3.3/+bug/378240/+attachment/662345/+files/xen-3.4_3.4.1-1ubuntu1.diff.gz > > Index: xen-4.0-4.0.1/tools/pygrub/Makefile > > ==================================================================> > --- xen-4.0-4.0.1.orig/tools/pygrub/Makefile 2010-08-25 > 10:22:42.000000000 +0200 > > +++ xen-4.0-4.0.1/tools/pygrub/Makefile 2011-01-04 > 19:08:18.556582404 +0100 > > @@ -11,7 +11,8 @@ > > .PHONY: install > > install: all > > CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \ > > - $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force > > + $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force \ > > + $(if $(filter y,$(DEBIANBASE)),--install-layout=deb) > > $(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(BINDIR)/pygrub > > $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot > > This special casing of Debian is pretty horrid. How about we provide > a general way to pass arguments to setup.py install and setup.py > build, with the variables set by default to the empty string ? > > Ian. >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
user virtual
2011-Jan-21 15:30 UTC
Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options
Hi Please ignore the patch debian-stubdom.Makefile.diff . Not needed if make in debian/rules is simply run as "env -u LDFLAGS make install-stubdom". Sorry for noise. Only 2 issues on xen-unstable.hg ... - xen-watchdog-bug.diff - obvious bug on all platforms - debian-python-2.6.diff - only needed for simple build on debian with no .deb packaging ... and one issue for debian packager: - "env -u LDFLAGS" must be used in debian/rules makefile on two commands: env -u LDFLAGS make install-xen env -u LDFLAGS make install-stubdom When the above is resolved xen-unstable.hg will be "fully debian-compatible". :-) Regards On Thu, Jan 20, 2011 at 7:15 PM, user virtual <virtualusr@gmail.com> wrote:> Hi Guys > > I summarize all patches in one mail here because I am not certain each is > the best way to go, more like a discussion on how to finally close all holes > to support debian builds. > > Stefano provoked me to port all patches to unstable resulting in a big step > forward: > http://virtualusr.wordpress.com/2011/01/20/xen-4-x-testing-unstable-ubuntu/ > > Right! Almost all of the patches are already resolved in unstable > repository. For building xen-unstable debian packeges in my last attempt, > only one patch was absolutely necessary (debian-stubdom.Makefile.diff). > Strangely, manual run of "rules" makefile “fakeroot debian/rules binary” > builds everything even without this last patch applied, while using the > official packaging command "dpkg-buildpackage -rfakeroot" which calls the > above "rules" makefile fails without the patch. > It might be even theoretically possible to avoid this last patch, if one > could find which environment options applied by running dpkg-buildpackage > break the “make stubdom” command inside the "rules" makefile; find and unset > them. Unfortunately I have no time for this unsure guessing game now. > > I found one more bug (xen-watchdog-bug.diff) preventing the stopping of > xen-watchdog and by that provoking errors during the install and debian > packet management. > > While analyzing python patch (not on debian), I found out that it can be > dropped if I use the newer recommended debhelper command dh_pysupport to > pack python related parts. The issue however remains open (patch required) > if somebody only wishes to build sources without using packaging to debian > and dh_pysupport. > > Ian: - This special casing of Debian is pretty horrid. How about we > provide a general way to pass arguments to setup.py install and setup.py > build, with the variables set by default to the empty string? > > Sounds great Ian, but after looking into tools/python/setup.py, I feel this > exceeds my current knowledge of your python tools. > > Summary of attached patches against xen-unstable.hg: > 1. debian-stubdom.Makefile.diff - necessary for official packaging command > "dpkg-buildpackage -rfakeroot", not needed for simple build without .deb > packages > 2. xen-watchdog-bug.diff - obvious bug on all platforms > 3. debian-python-2.6.diff - only needed for simple build on debian with no > .deb packaging > *.err - describes the error resolved by the patch > > I would personally like 1. to be included in xen-unstable.hg, and of course > bug 2. resolved. > Personally, I don''t find 3. critical any more, as I always avoid installing > software which is not .deb packaged, but there might be other opinions out > there. > > Otherwise, great work guys. I find xen-unstable.hg "almost fully > debian-compatible". > > Best regards > > > PS: Please note that there is an outstanding issue which prevents compiling > from xen-unstable.hg with "export debug=n". > I will summarize my latest experience regarding missing debian patches in > xen-4.0-testing.hg in my next mail. > > > On Tue, Jan 11, 2011 at 11:07 PM, Ian Jackson <Ian.Jackson@eu.citrix.com>wrote: > >> user virtual writes ("Re: [Xen-devel] Xen build - Debian vs Redhat layout >> patch options"): >> > I was encouraged by Bruce to forward my patches upstream to make Xen >> sources >> > buildable from debian makefile debian/rules and for debian based target >> > systems. >> >> Thanks. >> >> > I tried to make my 3 of 4 (5) patches to xen40-testing.hg as non >> intrusive >> > as possible >> > >> > - backport-StdGNU.mk.diff (from xen-devel, already here) >> >> Thanks for this. Posting them all one after another in a single >> message is not the most convenient format for a submission; better >> would be one per email. >> >> And there is no need to send us patches we already have; it just >> causes confusion ... >> >> > - debian-sysconfig-default.diff (conditional Makefile expansion) >> >> We have machinery in xen-unstable.hg now which should cope with this, >> so I don''t think we need that change. >> >> Stefano has dealt with most of these I think, but we still had >> outstanding this: >> >> >> > Description: Simple Python install layout for Debian based systems >> > Ported from origin below (Xen-3.4), which is a follower of >> > previous version from ubuntu Xen-3.3 sources >> > xen-3.3-3.3.0/debian/patches/use-python-2.6.diff >> > Drivers: User Virtual <virtualusr@gmail.com> >> > URL: http://virtualusr.wordpress.com >> > Origin: >> https://bugs.launchpad.net/ubuntu/+source/xen-3.3/+bug/378240/+attachment/662345/+files/xen-3.4_3.4.1-1ubuntu1.diff.gz >> > Index: xen-4.0-4.0.1/tools/pygrub/Makefile >> > ==================================================================>> > --- xen-4.0-4.0.1.orig/tools/pygrub/Makefile 2010-08-25 >> 10:22:42.000000000 +0200 >> > +++ xen-4.0-4.0.1/tools/pygrub/Makefile 2011-01-04 >> 19:08:18.556582404 +0100 >> > @@ -11,7 +11,8 @@ >> > .PHONY: install >> > install: all >> > CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \ >> > - $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force >> > + $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force \ >> > + $(if $(filter y,$(DEBIANBASE)),--install-layout=deb) >> > $(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(BINDIR)/pygrub >> > $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot >> >> This special casing of Debian is pretty horrid. How about we provide >> a general way to pass arguments to setup.py install and setup.py >> build, with the variables set by default to the empty string ? >> >> Ian. >> > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Bruce Edge
2011-Jan-21 17:28 UTC
Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options
On Fri, Jan 21, 2011 at 7:30 AM, user virtual <virtualusr@gmail.com> wrote:> Hi > > Please ignore the patch debian-stubdom.Makefile.diff . > Not needed if make in debian/rules is simply run as "env -u LDFLAGS make > install-stubdom". Sorry for noise. > > Only 2 issues on xen-unstable.hg ... > > - xen-watchdog-bug.diff - obvious bug on all platforms > - debian-python-2.6.diff - only needed for simple build on debian with no > .deb packaging > > ... and one issue for debian packager: > - "env -u LDFLAGS" must be used in debian/rules makefile on two commands: > env -u LDFLAGS make install-xen > env -u LDFLAGS make install-stubdom > > When the above is resolved xen-unstable.hg will be "fully > debian-compatible". :-) >Nice work! Now what''s going to happen to that giant debian xen patch ? :-) In all seriousness one has to wonder why so much effort was put into a downstream distro adaptation patch while fixing the problem at the source is so much cleaner. I really don''t mean to piss off the debian Xen guys, I''m truly grateful for the work they''ve done, but it does seem a little mis-targeted. Or is there some other reason for putting the work into the downstream adaptation that I''ve missed? -Bruce> > Regards > > > > On Thu, Jan 20, 2011 at 7:15 PM, user virtual <virtualusr@gmail.com>wrote: > >> Hi Guys >> >> I summarize all patches in one mail here because I am not certain each is >> the best way to go, more like a discussion on how to finally close all holes >> to support debian builds. >> >> Stefano provoked me to port all patches to unstable resulting in a big >> step forward: >> >> http://virtualusr.wordpress.com/2011/01/20/xen-4-x-testing-unstable-ubuntu/ >> >> Right! Almost all of the patches are already resolved in unstable >> repository. For building xen-unstable debian packeges in my last attempt, >> only one patch was absolutely necessary (debian-stubdom.Makefile.diff). >> Strangely, manual run of "rules" makefile “fakeroot debian/rules binary” >> builds everything even without this last patch applied, while using the >> official packaging command "dpkg-buildpackage -rfakeroot" which calls the >> above "rules" makefile fails without the patch. >> It might be even theoretically possible to avoid this last patch, if one >> could find which environment options applied by running dpkg-buildpackage >> break the “make stubdom” command inside the "rules" makefile; find and unset >> them. Unfortunately I have no time for this unsure guessing game now. >> >> I found one more bug (xen-watchdog-bug.diff) preventing the stopping of >> xen-watchdog and by that provoking errors during the install and debian >> packet management. >> >> While analyzing python patch (not on debian), I found out that it can be >> dropped if I use the newer recommended debhelper command dh_pysupport to >> pack python related parts. The issue however remains open (patch required) >> if somebody only wishes to build sources without using packaging to debian >> and dh_pysupport. >> >> Ian: - This special casing of Debian is pretty horrid. How about we >> provide a general way to pass arguments to setup.py install and setup.py >> build, with the variables set by default to the empty string? >> >> Sounds great Ian, but after looking into tools/python/setup.py, I feel >> this exceeds my current knowledge of your python tools. >> >> Summary of attached patches against xen-unstable.hg: >> 1. debian-stubdom.Makefile.diff - necessary for official packaging command >> "dpkg-buildpackage -rfakeroot", not needed for simple build without .deb >> packages >> 2. xen-watchdog-bug.diff - obvious bug on all platforms >> 3. debian-python-2.6.diff - only needed for simple build on debian with no >> .deb packaging >> *.err - describes the error resolved by the patch >> >> I would personally like 1. to be included in xen-unstable.hg, and of >> course bug 2. resolved. >> Personally, I don''t find 3. critical any more, as I always avoid >> installing software which is not .deb packaged, but there might be other >> opinions out there. >> >> Otherwise, great work guys. I find xen-unstable.hg "almost fully >> debian-compatible". >> >> Best regards >> >> >> PS: Please note that there is an outstanding issue which prevents >> compiling from xen-unstable.hg with "export debug=n". >> I will summarize my latest experience regarding missing debian patches in >> xen-4.0-testing.hg in my next mail. >> >> >> On Tue, Jan 11, 2011 at 11:07 PM, Ian Jackson <Ian.Jackson@eu.citrix.com>wrote: >> >>> user virtual writes ("Re: [Xen-devel] Xen build - Debian vs Redhat layout >>> patch options"): >>> > I was encouraged by Bruce to forward my patches upstream to make Xen >>> sources >>> > buildable from debian makefile debian/rules and for debian based target >>> > systems. >>> >>> Thanks. >>> >>> > I tried to make my 3 of 4 (5) patches to xen40-testing.hg as non >>> intrusive >>> > as possible >>> > >>> > - backport-StdGNU.mk.diff (from xen-devel, already here) >>> >>> Thanks for this. Posting them all one after another in a single >>> message is not the most convenient format for a submission; better >>> would be one per email. >>> >>> And there is no need to send us patches we already have; it just >>> causes confusion ... >>> >>> > - debian-sysconfig-default.diff (conditional Makefile expansion) >>> >>> We have machinery in xen-unstable.hg now which should cope with this, >>> so I don''t think we need that change. >>> >>> Stefano has dealt with most of these I think, but we still had >>> outstanding this: >>> >>> >>> > Description: Simple Python install layout for Debian based systems >>> > Ported from origin below (Xen-3.4), which is a follower of >>> > previous version from ubuntu Xen-3.3 sources >>> > xen-3.3-3.3.0/debian/patches/use-python-2.6.diff >>> > Drivers: User Virtual <virtualusr@gmail.com> >>> > URL: http://virtualusr.wordpress.com >>> > Origin: >>> https://bugs.launchpad.net/ubuntu/+source/xen-3.3/+bug/378240/+attachment/662345/+files/xen-3.4_3.4.1-1ubuntu1.diff.gz >>> > Index: xen-4.0-4.0.1/tools/pygrub/Makefile >>> > ==================================================================>>> > --- xen-4.0-4.0.1.orig/tools/pygrub/Makefile 2010-08-25 >>> 10:22:42.000000000 +0200 >>> > +++ xen-4.0-4.0.1/tools/pygrub/Makefile 2011-01-04 >>> 19:08:18.556582404 +0100 >>> > @@ -11,7 +11,8 @@ >>> > .PHONY: install >>> > install: all >>> > CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \ >>> > - $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force >>> > + $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force \ >>> > + $(if $(filter y,$(DEBIANBASE)),--install-layout=deb) >>> > $(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(BINDIR)/pygrub >>> > $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot >>> >>> This special casing of Debian is pretty horrid. How about we provide >>> a general way to pass arguments to setup.py install and setup.py >>> build, with the variables set by default to the empty string ? >>> >>> Ian. >>> >> >> >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2011-Jan-21 17:29 UTC
Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options
On Fri, 21 Jan 2011, user virtual wrote:> Hi > > Please ignore the patch debian-stubdom.Makefile.diff . > Not needed if make in debian/rules is simply run as "env -u LDFLAGS make install-stubdom". Sorry for noise. > > Only 2 issues on xen-unstable.hg ... > - xen-watchdog-bug.diff - obvious bug on all platformsI think this patch is fine.> - debian-python-2.6.diff - only needed for simple build on debian with no .deb packagingOn the other hand I don''t think this patch is suitable for xen-unstable as is, but I''ll let Ian comment on it.> When the above is resolved xen-unstable.hg will be "fully debian-compatible". :-) >great!! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Jan-21 18:40 UTC
Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options
Stefano Stabellini writes ("Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options"):> On Fri, 21 Jan 2011, user virtual wrote: > > Only 2 issues on xen-unstable.hg ... > > - xen-watchdog-bug.diff - obvious bug on all platforms > > I think this patch is fine.Yes. Unfortunately it (like your others) is lacking a Signed-Off-By. Can you provide a Signed-off-By please, as your confirmation of the statements in the Developer''s Certificate of Origin (below) ?> > - debian-python-2.6.diff - only needed for simple build on debian with no .deb packaging > > On the other hand I don''t think this patch is suitable for xen-unstable > as is, but I''ll let Ian comment on it.I''m going to do something to make doing this easier for Debian users. But it still won''t work out of the box. I think the bug is in Debian''s python system. I can''t seem to find the bug# offhand. Re debian-stubdom.Makefile.diff, this is due to an unconscionable bug in dpkg-buildpackage. #560070. Thanks, Ian.>From Documentation/SubmittingPatches in the Linux kernel tree:Developer''s Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Jan-21 18:42 UTC
Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options
Bruce Edge writes ("Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options"):> I really don''t mean to piss off the debian Xen guys, I''m truly > grateful for the work they''ve done, but it does seem a little > mis-targeted. Or is there some other reason for putting the work > into the downstream adaptation that I''ve missed?Well, the LDFLAGS/CFLAGS thing is a bug in Debian which we[1] don''t plan to fix. Ian. [1] That''s me wearing my Xen.org hat, not my Debian hat :-). _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
User Virtual
2011-Jul-13 13:41 UTC
[Xen-devel] Re: Xen build - Debian vs Redhat layout patch options
Ian Jackson <Ian.Jackson <at> eu.citrix.com> writes:> > Bruce Edge writes ("Re: [Xen-devel] Xen build - Debian vs Redhat layout patchoptions"): ...> Well, the LDFLAGS/CFLAGS thing is a bug in Debian which we[1] don''t > plan to fix.Luckily, for my packager works LDFLAGS/CFLAGS ok as it is. FYI, updated "Xen 4.x Testing and Unstable packager for Ubuntu" (2011-07-10) http://virtualusr.wordpress.com/2011/01/20/xen-4-x-testing-unstable-ubuntu/ Updated to enable packaging 4.1.1 and 4.0.2. No more patches needed for 4.1.1, all is directly from XenSource just packaged. The same goes for packager for dom0-kernels used here - directly from xensource.com. Let''s hope this was the last update. (Using this to run packaged xen4* since Jun''10) Great news making my packager of all Xen-4 versions finally obsolete. Xen is at version 4.1.0-3ubuntu4 in Ubuntu Oneiric. https://bugs.launchpad.net/ubuntu/+source/xen/+bug/378240/comments/88 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel