All of lore.kernel.org
 help / color / mirror / Atom feed
* Xen build - Debian vs Redhat layout patch options
@ 2010-07-07  0:07 Bruce Edge
  2010-07-07 11:19 ` Stefano Stabellini
  0 siblings, 1 reply; 49+ messages in thread
From: Bruce Edge @ 2010-07-07  0:07 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 741 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1340 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Xen build - Debian vs Redhat layout patch options
  2010-07-07  0:07 Xen build - Debian vs Redhat layout patch options Bruce Edge
@ 2010-07-07 11:19 ` Stefano Stabellini
  2010-09-13 23:53   ` [patch] " Bruce Edge
       [not found]   ` <AANLkTim48T7Y3Pq0_nS1zZ5jWH_kXrS8JceWLf-yUOM6@mail.gmail.com>
  0 siblings, 2 replies; 49+ messages in thread
From: Stefano Stabellini @ 2010-07-07 11:19 UTC (permalink / raw)
  To: Bruce Edge; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1280 bytes --]

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).

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-07-07 11:19 ` Stefano Stabellini
@ 2010-09-13 23:53   ` Bruce Edge
  2010-09-14  0:23     ` Mike Viau
                       ` (3 more replies)
       [not found]   ` <AANLkTim48T7Y3Pq0_nS1zZ5jWH_kXrS8JceWLf-yUOM6@mail.gmail.com>
  1 sibling, 4 replies; 49+ messages in thread
From: Bruce Edge @ 2010-09-13 23:53 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 11556 bytes --]

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

[-- Attachment #2: sysconfig-alias.patch --]
[-- Type: text/x-patch, Size: 9378 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* RE: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-13 23:53   ` [patch] " Bruce Edge
@ 2010-09-14  0:23     ` Mike Viau
  2010-09-14  6:45     ` Sander Eikelenboom
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 49+ messages in thread
From: Mike Viau @ 2010-09-14  0:23 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 278 bytes --]


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 
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 487 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-13 23:53   ` [patch] " Bruce Edge
  2010-09-14  0:23     ` Mike Viau
@ 2010-09-14  6:45     ` Sander Eikelenboom
  2010-09-14 14:18       ` Bruce Edge
  2010-09-14 14:31     ` Olaf Hering
  2010-09-14 17:05     ` Ian Jackson
  3 siblings, 1 reply; 49+ messages in thread
From: Sander Eikelenboom @ 2010-09-14  6:45 UTC (permalink / raw)
  To: Bruce Edge; +Cc: xen-devel, Stefano Stabellini

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

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-14  6:45     ` Sander Eikelenboom
@ 2010-09-14 14:18       ` Bruce Edge
  0 siblings, 0 replies; 49+ messages in thread
From: Bruce Edge @ 2010-09-14 14:18 UTC (permalink / raw)
  To: Sander Eikelenboom; +Cc: xen-devel, Stefano Stabellini

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.
>
> --
>
> Sander


Makes 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
>
>

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-13 23:53   ` [patch] " Bruce Edge
  2010-09-14  0:23     ` Mike Viau
  2010-09-14  6:45     ` Sander Eikelenboom
@ 2010-09-14 14:31     ` Olaf Hering
  2010-09-14 17:05     ` Ian Jackson
  3 siblings, 0 replies; 49+ messages in thread
From: Olaf Hering @ 2010-09-14 14:31 UTC (permalink / raw)
  To: Bruce Edge; +Cc: xen-devel, Stefano Stabellini

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

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-13 23:53   ` [patch] " Bruce Edge
                       ` (2 preceding siblings ...)
  2010-09-14 14:31     ` Olaf Hering
@ 2010-09-14 17:05     ` Ian Jackson
  2010-09-14 17:13       ` Bruce Edge
  2010-09-14 18:56       ` Bruce Edge
  3 siblings, 2 replies; 49+ messages in thread
From: Ian Jackson @ 2010-09-14 17:05 UTC (permalink / raw)
  To: Bruce Edge; +Cc: xen-devel, Stefano Stabellini

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.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-14 17:05     ` Ian Jackson
@ 2010-09-14 17:13       ` Bruce Edge
  2010-09-14 18:56       ` Bruce Edge
  1 sibling, 0 replies; 49+ messages in thread
From: Bruce Edge @ 2010-09-14 17:13 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Stefano Stabellini

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

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-14 17:05     ` Ian Jackson
  2010-09-14 17:13       ` Bruce Edge
@ 2010-09-14 18:56       ` Bruce Edge
  2010-09-15 10:03         ` Ian Jackson
  1 sibling, 1 reply; 49+ messages in thread
From: Bruce Edge @ 2010-09-14 18:56 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Stefano Stabellini

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.
>

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-14 18:56       ` Bruce Edge
@ 2010-09-15 10:03         ` Ian Jackson
  2010-09-15 16:06           ` Bruce Edge
  0 siblings, 1 reply; 49+ messages in thread
From: Ian Jackson @ 2010-09-15 10:03 UTC (permalink / raw)
  To: Bruce Edge; +Cc: xen-devel, Stefano Stabellini

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.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-15 10:03         ` Ian Jackson
@ 2010-09-15 16:06           ` Bruce Edge
  2010-09-15 16:16             ` Olaf Hering
  2010-09-16 16:29             ` Ian Jackson
  0 siblings, 2 replies; 49+ messages in thread
From: Bruce Edge @ 2010-09-15 16:06 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Stefano Stabellini

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.
>

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-15 16:06           ` Bruce Edge
@ 2010-09-15 16:16             ` Olaf Hering
  2010-09-16 16:29             ` Ian Jackson
  1 sibling, 0 replies; 49+ messages in thread
From: Olaf Hering @ 2010-09-15 16:16 UTC (permalink / raw)
  To: Bruce Edge; +Cc: xen-devel, Ian Jackson, Stefano Stabellini

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
> endif

SuSE has /etc/sysconfig, /var/run and /etc/init.d

Olaf

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-15 16:06           ` Bruce Edge
  2010-09-15 16:16             ` Olaf Hering
@ 2010-09-16 16:29             ` Ian Jackson
  2010-09-16 18:52               ` Bruce Edge
                                 ` (2 more replies)
  1 sibling, 3 replies; 49+ messages in thread
From: Ian Jackson @ 2010-09-16 16:29 UTC (permalink / raw)
  To: Bruce Edge; +Cc: xen-devel

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.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-16 16:29             ` Ian Jackson
@ 2010-09-16 18:52               ` Bruce Edge
  2010-09-16 20:45                 ` Olaf Hering
  2010-09-16 20:24               ` Dan Magenheimer
  2010-09-17 15:01               ` [patch] Xen build - Debian vs Redhat layout patch options [and 1 more messages] Ian Jackson
  2 siblings, 1 reply; 49+ messages in thread
From: Bruce Edge @ 2010-09-16 18:52 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 12866 bytes --]

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)

[-- Attachment #2: sysconfig-alias.patch --]
[-- Type: text/x-patch, Size: 10752 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* RE: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-16 16:29             ` Ian Jackson
  2010-09-16 18:52               ` Bruce Edge
@ 2010-09-16 20:24               ` Dan Magenheimer
  2010-09-16 20:34                 ` Dan Magenheimer
  2010-09-17 15:01               ` [patch] Xen build - Debian vs Redhat layout patch options [and 1 more messages] Ian Jackson
  2 siblings, 1 reply; 49+ messages in thread
From: Dan Magenheimer @ 2010-09-16 20:24 UTC (permalink / raw)
  To: Ian Jackson, Bruce Edge; +Cc: xen-devel

> 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.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* RE: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-16 20:24               ` Dan Magenheimer
@ 2010-09-16 20:34                 ` Dan Magenheimer
  0 siblings, 0 replies; 49+ messages in thread
From: Dan Magenheimer @ 2010-09-16 20:34 UTC (permalink / raw)
  To: Dan Magenheimer, Ian Jackson, Bruce Edge; +Cc: xen-devel

> 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

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-16 18:52               ` Bruce Edge
@ 2010-09-16 20:45                 ` Olaf Hering
  2010-09-16 20:56                   ` Bruce Edge
  0 siblings, 1 reply; 49+ messages in thread
From: Olaf Hering @ 2010-09-16 20:45 UTC (permalink / raw)
  To: Bruce Edge; +Cc: xen-devel, Ian Jackson

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.

Olaf

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-16 20:45                 ` Olaf Hering
@ 2010-09-16 20:56                   ` Bruce Edge
  2010-09-16 20:59                     ` Olaf Hering
  0 siblings, 1 reply; 49+ messages in thread
From: Bruce Edge @ 2010-09-16 20:56 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel, Ian Jackson

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
>
>

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-16 20:56                   ` Bruce Edge
@ 2010-09-16 20:59                     ` Olaf Hering
  2010-09-16 21:02                       ` Bruce Edge
  0 siblings, 1 reply; 49+ messages in thread
From: Olaf Hering @ 2010-09-16 20:59 UTC (permalink / raw)
  To: Bruce Edge; +Cc: xen-devel, Ian Jackson

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

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-16 20:59                     ` Olaf Hering
@ 2010-09-16 21:02                       ` Bruce Edge
  2010-09-17 16:11                         ` Ian Jackson
  0 siblings, 1 reply; 49+ messages in thread
From: Bruce Edge @ 2010-09-16 21:02 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel, Ian Jackson

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

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

[-- Attachment #2: sysconfig-alias.patch --]
[-- Type: text/x-patch, Size: 10796 bytes --]

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 11:16:47.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 11:16:47.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 11:16:47.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 11:16:47.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 11:16:47.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 13:55:23.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,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 11:16:47.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 11:16:47.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 11:16:47.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 11:16:47.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-15 10:14:31.000000000 -0700
+++ xen-unstable.hg/Config.mk	2010-09-16 11:16:47.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)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* RE: [patch] Xen build - Debian vs Redhat layout patch options [and 1 more messages]
  2010-09-16 16:29             ` Ian Jackson
  2010-09-16 18:52               ` Bruce Edge
  2010-09-16 20:24               ` Dan Magenheimer
@ 2010-09-17 15:01               ` Ian Jackson
  2 siblings, 0 replies; 49+ messages in thread
From: Ian Jackson @ 2010-09-17 15:01 UTC (permalink / raw)
  To: Dan Magenheimer; +Cc: xen-devel, Bruce Edge

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.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-16 21:02                       ` Bruce Edge
@ 2010-09-17 16:11                         ` Ian Jackson
  2010-09-17 17:05                           ` Bruce Edge
  0 siblings, 1 reply; 49+ messages in thread
From: Ian Jackson @ 2010-09-17 16:11 UTC (permalink / raw)
  To: Bruce Edge; +Cc: Olaf Hering, xen-devel

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 docs

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 ?
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-based

This can be removed now ?

Ian.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-17 16:11                         ` Ian Jackson
@ 2010-09-17 17:05                           ` Bruce Edge
  2010-09-17 17:52                             ` Ian Jackson
  0 siblings, 1 reply; 49+ messages in thread
From: Bruce Edge @ 2010-09-17 17:05 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Olaf Hering, xen-devel

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 docs

OK, 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.
>

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-17 17:05                           ` Bruce Edge
@ 2010-09-17 17:52                             ` Ian Jackson
  2010-09-17 18:13                               ` Bruce Edge
  0 siblings, 1 reply; 49+ messages in thread
From: Ian Jackson @ 2010-09-17 17:52 UTC (permalink / raw)
  To: Bruce Edge; +Cc: Olaf Hering, xen-devel

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.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [patch] Xen build - Debian vs Redhat layout patch options
  2010-09-17 17:52                             ` Ian Jackson
@ 2010-09-17 18:13                               ` Bruce Edge
  0 siblings, 0 replies; 49+ messages in thread
From: Bruce Edge @ 2010-09-17 18:13 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Olaf Hering, xen-devel

[-- Attachment #1: Type: text/plain, Size: 12666 bytes --]

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)

[-- Attachment #2: sysconfig-alias.patch --]
[-- Type: text/x-patch, Size: 10999 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Xen build - Debian vs Redhat layout patch options
       [not found]   ` <AANLkTim48T7Y3Pq0_nS1zZ5jWH_kXrS8JceWLf-yUOM6@mail.gmail.com>
@ 2011-01-04 21:09     ` user virtual
  2011-01-06 15:02       ` Stefano Stabellini
  2011-01-11 17:37       ` Ian Jackson
  0 siblings, 2 replies; 49+ messages in thread
From: user virtual @ 2011-01-04 21:09 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel, Bruce Edge


[-- Attachment #1.1: Type: text/plain, Size: 3876 bytes --]

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).
>
>

[-- Attachment #1.2: Type: text/html, Size: 5149 bytes --]

[-- Attachment #2: backport-StdGNU.mk.diff --]
[-- Type: text/x-patch, Size: 900 bytes --]

Description: Backported patch from xen-devel
 Some GNU systems (including Debian) do not use /usr/lib64 [1].  This
 change makes it easier to have the Xen build system on amd64 put its
 64-bit libraries files in /usr/lib.
 Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Origin: upstream, http://lists.xensource.com/archives/html/xen-devel/2010-09/msg00667.html
Index: xen-4.0-4.0.1/config/StdGNU.mk
===================================================================
--- xen-4.0-4.0.1.orig/config/StdGNU.mk	2010-08-25 10:22:42.000000000 +0200
+++ xen-4.0-4.0.1/config/StdGNU.mk	2011-01-04 19:08:17.386079236 +0100
@@ -28,7 +28,7 @@
 INCLUDEDIR = $(PREFIX)/include
 LIBLEAFDIR = lib
 LIBLEAFDIR_x86_32 = lib
-LIBLEAFDIR_x86_64 = lib64
+LIBLEAFDIR_x86_64 ?= lib64
 LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
 LIBDIR_x86_32 = $(PREFIX)/$(LIBLEAFDIR_x86_32)
 LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)

[-- Attachment #3: debian-sysconfig-default.diff --]
[-- Type: text/x-patch, Size: 2618 bytes --]

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
 
 .PHONY: install-scripts
 install-scripts:

[-- Attachment #4: tools-blktap2-libs.patch --]
[-- Type: text/x-patch, Size: 2088 bytes --]

Description: Adapt tools/blktap2 libs Makefiles for Debian based build system
 Enables build from simple debian/rules based build system.
 Backported from debian Xen-4.0 sources to replace older required similar
 patch fix-blktap2.diff from 
 http://virtualusr.wordpress.com/2010/07/14/xen-4-0-rc-source-kernels-packaged-for-ubuntu/
 Drivers: User Virtual <virtualusr@gmail.com>
 URL: http://virtualusr.wordpress.com
Origin: http://patch-tracker.debian.org/patch/series/view/xen/4.0.1-1/tools-blktap2-libs.patch
Index: xen-4.0-4.0.1/tools/blktap2/Makefile
===================================================================
--- xen-4.0-4.0.1.orig/tools/blktap2/Makefile	2010-08-25 10:22:42.000000000 +0200
+++ xen-4.0-4.0.1/tools/blktap2/Makefile	2011-01-04 19:08:18.186455878 +0100
@@ -1,9 +1,6 @@
 XEN_ROOT = ../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS  += $(CFLAGS_libxenctrl)
-LDFLAGS += $(LDFLAGS_libxenctrl)
-
 SUBDIRS-y :=
 SUBDIRS-y += include
 SUBDIRS-y += lvm
Index: xen-4.0-4.0.1/tools/blktap2/vhd/Makefile
===================================================================
--- xen-4.0-4.0.1.orig/tools/blktap2/vhd/Makefile	2010-08-25 10:22:42.000000000 +0200
+++ xen-4.0-4.0.1/tools/blktap2/vhd/Makefile	2011-01-04 19:08:18.186455878 +0100
@@ -12,6 +12,7 @@
 CFLAGS            += -Wno-unused
 CFLAGS            += -I../include
 CFLAGS            += -D_GNU_SOURCE
+CFLAGS  += $(CFLAGS_libxenctrl)
 
 ifeq ($(CONFIG_X86_64),y)
 CFLAGS            += -fPIC
Index: xen-4.0-4.0.1/tools/blktap2/vhd/lib/Makefile
===================================================================
--- xen-4.0-4.0.1.orig/tools/blktap2/vhd/lib/Makefile	2010-08-25 10:22:42.000000000 +0200
+++ xen-4.0-4.0.1/tools/blktap2/vhd/lib/Makefile	2011-01-04 19:08:18.186455878 +0100
@@ -18,10 +18,12 @@
 CFLAGS          += -D_GNU_SOURCE
 CFLAGS          += -fPIC
 CFLAGS          += -g
+CFLAGS  += $(CFLAGS_libxenctrl)
 
 ifeq ($(CONFIG_Linux),y)
 LIBS            := -luuid
 endif
+LDFLAGS += $(LDFLAGS_libxenctrl)
 
 # Get gcc to generate the dependencies for us.
 CFLAGS          += -Wp,-MD,.$(@F).d

[-- Attachment #5: debian-python-2.6.diff --]
[-- Type: text/x-patch, Size: 2323 bytes --]

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
 
Index: xen-4.0-4.0.1/tools/python/Makefile
===================================================================
--- xen-4.0-4.0.1.orig/tools/python/Makefile	2010-08-25 10:22:42.000000000 +0200
+++ xen-4.0-4.0.1/tools/python/Makefile	2011-01-04 19:08:18.556582404 +0100
@@ -60,7 +60,8 @@
 .PHONY: install
 install: install-messages install-dtd
 	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-dtd: all
 	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/xen
Index: xen-4.0-4.0.1/tools/security/Makefile
===================================================================
--- xen-4.0-4.0.1.orig/tools/security/Makefile	2010-08-25 10:22:42.000000000 +0200
+++ xen-4.0-4.0.1/tools/security/Makefile	2011-01-04 19:08:18.556582404 +0100
@@ -61,7 +61,8 @@
 	$(INSTALL_DIR) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
 	$(INSTALL_PROG) $(ACM_INST_CGI) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
 	$(PYTHON) python/setup.py install $(PYTHON_PREFIX_ARG) \
-		--root="$(DESTDIR)" --force
+		--root="$(DESTDIR)" --force \
+		$(if $(filter y,$(DEBIANBASE)),--install-layout=deb)
 else
 .PHONY: all
 all:

[-- Attachment #6: debian-stubdom.Makefile.diff --]
[-- Type: text/x-patch, Size: 1171 bytes --]

Description: Adapt stubdom/Makefile to build on Debian based systems
 Adapted for Debian based systems from the origin below, file:
 xen-3.4-3.4.1/debian/patches/fix-pvgrub.diff
 Drivers: User Virtual <virtualusr@gmail.com>
 URL: http://virtualusr.wordpress.com
Origin: http://launchpadlibrarian.net/30283878/xen-3.4_3.4.1-1ubuntu1.diff.gz
Index: xen-4.0-4.0.1/stubdom/Makefile
===================================================================
--- xen-4.0-4.0.1.orig/stubdom/Makefile	2010-08-25 10:22:42.000000000 +0200
+++ xen-4.0-4.0.1/stubdom/Makefile	2011-01-04 19:08:19.046874315 +0100
@@ -108,6 +108,7 @@
 $(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION)
 	mkdir -p newlib-$(XEN_TARGET_ARCH)
 	( cd newlib-$(XEN_TARGET_ARCH) && \
+	  $(if $(filter y,$(DEBIANBASE)),LDFLAGS="") \
 	  CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
 	  $(MAKE) && \
 	  DESTDIR= $(MAKE) install )

[-- Attachment #7: xend.patch --]
[-- Type: text/x-patch, Size: 409 bytes --]

--- tools/hotplug/Linux/init.d/xend.orig	2010-08-25 10:22:42.000000000 +0200
+++ tools/hotplug/Linux/init.d/xend	2011-01-04 19:22:09.226083819 +0100
@@ -25,7 +25,6 @@
 if   test "x$1" = xstart && \
      test -d /proc/xen && \
    ! test -d /proc/xen/capabilities && \
-     grep '	xenfs$' /proc/filesystems >/dev/null && \
    ! grep '^xenfs ' /proc/mounts >/dev/null;
 then
 	mount -t xenfs xenfs /proc/xen

[-- Attachment #8: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Xen build - Debian vs Redhat layout patch options
  2011-01-04 21:09     ` Xen build - Debian vs Redhat layout patch options user virtual
@ 2011-01-06 15:02       ` Stefano Stabellini
  2011-01-11 17:37       ` Ian Jackson
  1 sibling, 0 replies; 49+ messages in thread
From: Stefano Stabellini @ 2011-01-06 15:02 UTC (permalink / raw)
  To: user virtual; +Cc: xen-devel, Ian Jackson, Bruce Edge, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 4734 bytes --]

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.

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Xen build - Debian vs Redhat layout patch options
  2011-01-04 21:09     ` Xen build - Debian vs Redhat layout patch options user virtual
  2011-01-06 15:02       ` Stefano Stabellini
@ 2011-01-11 17:37       ` Ian Jackson
  2011-01-20 13:45         ` user virtual
  1 sibling, 1 reply; 49+ messages in thread
From: Ian Jackson @ 2011-01-11 17:37 UTC (permalink / raw)
  To: user virtual; +Cc: xen-devel, Bruce Edge, Stefano Stabellini

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.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: xen-unstable: ImportError: No module named xen.xm
       [not found]           ` <AANLkTimCA_T1QsfCVfABtW8776Mkg3toBtmHYHgea56=@mail.gmail.com>
@ 2011-01-19 22:34             ` chris
  2011-01-20  8:38               ` Ian Campbell
  0 siblings, 1 reply; 49+ messages in thread
From: chris @ 2011-01-19 22:34 UTC (permalink / raw)
  To: Xen-Devel List; +Cc: Xen-Users List

On Wed, Jan 19, 2011 at 2:29 PM, chris <tknchris@gmail.com> wrote:
> I have pulled the latest from xen-unstable on a new machine, I run
> make world and make install and after rebooting into xen, when i run
> xm list or anything else i get:
>
> # xm list
> Traceback (most recent call last):
>  File "/usr/sbin/xm", line 5, in <module>
>    from xen.xm import main
> ImportError: No module named xen.xm
>
> I also tried going into the tools dir and make install, because i read
> that somewhere on google.
>
> I don't get any errors when compiling or installing so I don't know
> where to go from here?
>
> - chris
>

I just tried this again after pulling everything down again and
recompiling. Is something broken?

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Re: xen-unstable: ImportError: No module named xen.xm
  2011-01-19 22:34             ` xen-unstable: ImportError: No module named xen.xm chris
@ 2011-01-20  8:38               ` Ian Campbell
  2011-01-20 16:49                 ` [Xen-devel] " chris
       [not found]                 ` <m2n.s.1PfxnK-153952@chiark.greenend.org.uk>
  0 siblings, 2 replies; 49+ messages in thread
From: Ian Campbell @ 2011-01-20  8:38 UTC (permalink / raw)
  To: chris; +Cc: Xen-Devel List, Xen-Users List

On Wed, 2011-01-19 at 22:34 +0000, chris wrote:
> On Wed, Jan 19, 2011 at 2:29 PM, chris <tknchris@gmail.com> wrote:
> > I have pulled the latest from xen-unstable on a new machine, I run
> > make world and make install and after rebooting into xen, when i run
> > xm list or anything else i get:
> >
> > # xm list
> > Traceback (most recent call last):
> >  File "/usr/sbin/xm", line 5, in <module>
> >    from xen.xm import main
> > ImportError: No module named xen.xm
> >
> > I also tried going into the tools dir and make install, because i read
> > that somewhere on google.
> >
> > I don't get any errors when compiling or installing so I don't know
> > where to go from here?
> >
> > - chris
> >
> 
> I just tried this again after pulling everything down again and
> recompiling. Is something broken?

Nothing currently known.

Which host OS are you running?

Do:
$ python
>>> import sys
>>> print sys.path

This should tell you the python path which is where python is looking
for stuff. The install process should have dropped xen/xm/main.py
somewhere on the system, the build log or "find" should tell you where.
Do they correspond?

Ian.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Xen build - Debian vs Redhat layout patch options
  2011-01-11 17:37       ` Ian Jackson
@ 2011-01-20 13:45         ` user virtual
       [not found]           ` <AANLkTimCA_T1QsfCVfABtW8776Mkg3toBtmHYHgea56=@mail.gmail.com>
  2011-01-21 15:30           ` Xen build - Debian vs Redhat layout patch options user virtual
  0 siblings, 2 replies; 49+ messages in thread
From: user virtual @ 2011-01-20 13:45 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Bruce Edge, Stefano Stabellini


[-- Attachment #1.1: Type: text/plain, Size: 5551 bytes --]

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.
>

[-- Attachment #1.2: Type: text/html, Size: 6647 bytes --]

[-- Attachment #2: debian-stubdom.Makefile.diff --]
[-- Type: application/octet-stream, Size: 1194 bytes --]

Description: Adapt stubdom/Makefile to build on Debian based systems
 Adapted for Debian based systems from the origin below, file:
 xen-3.4-3.4.1/debian/patches/fix-pvgrub.diff
 Drivers: User Virtual <virtualusr@gmail.com>
 URL: http://virtualusr.wordpress.com
Origin: http://launchpadlibrarian.net/30283878/xen-3.4_3.4.1-1ubuntu1.diff.gz
Index: xen-4.1-4.1.0rc0/stubdom/Makefile
===================================================================
--- xen-4.1-4.1.0rc0.orig/stubdom/Makefile	2011-01-06 00:54:15.000000000 +0100
+++ xen-4.1-4.1.0rc0/stubdom/Makefile	2011-01-14 00:38:00.334171054 +0100
@@ -112,6 +112,7 @@
 $(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION)
 	mkdir -p newlib-$(XEN_TARGET_ARCH)
 	( cd newlib-$(XEN_TARGET_ARCH) && \
+	  $(if $(filter default,$(CONFIG_LEAF_DIR)),LDFLAGS="") \
 	  CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
 	  $(CROSS_MAKE) && \
 	  $(CROSS_MAKE) install )

[-- Attachment #3: xen-watchdog-bug.diff --]
[-- Type: application/octet-stream, Size: 1370 bytes --]

Description: Bug when stopping xenwatchdogd
 "xen-watchdog stop" attempts to kill non existing "watchdogd"
 missing running "xenwatchdogd"
 Also provokes error during install and debian package management.
Author: User Virtual <virtualusr@gmail.com>
Origin: http://virtualusr.wordpress.com/2011/01/20/xen-4-x-testing-unstable-ubuntu/
Index: xen-4.1-4.1.0rc0/tools/hotplug/Linux/init.d/xen-watchdog
===================================================================
--- xen-4.1-4.1.0rc0.orig/tools/hotplug/Linux/init.d/xen-watchdog	2011-01-17 03:46:10.032713076 +0100
+++ xen-4.1-4.1.0rc0/tools/hotplug/Linux/init.d/xen-watchdog	2011-01-17 03:47:01.905244747 +0100
@@ -17,6 +17,9 @@
 ### END INIT INFO
 #
 
+DAEMON=/usr/sbin/xenwatchdogd
+base=$(basename $DAEMON)
+
 # Source function library.
 if [ -e  /etc/init.d/functions ] ; then
     . /etc/init.d/functions
@@ -39,10 +42,9 @@
 
 start() {
 	local r
-	base="watchdogd"
 	echo -n $"Starting domain watchdog daemon: "
 
-	/usr/sbin/xenwatchdogd 30 15
+	$DAEMON 30 15
 	r=$?
 	[ "$r" -eq 0 ] && success $"$base startup" || failure $"$base startup"
 	echo
@@ -52,10 +54,9 @@
 
 stop() {
 	local r
-	base="watchdogd"
 	echo -n $"Stopping domain watchdog daemon: "
 
-	killall -USR1 watchdogd 2>/dev/null
+	killall -USR1 $base 2>/dev/null
 	r=$?
 	[ "$r" -eq 0 ] && success $"$base stop" || failure $"$base stop"
 	echo

[-- Attachment #4: debian-python-2.6.diff --]
[-- Type: application/octet-stream, Size: 2383 bytes --]

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.1-4.1.0rc0/tools/pygrub/Makefile
===================================================================
--- xen-4.1-4.1.0rc0.orig/tools/pygrub/Makefile	2011-01-06 00:54:15.000000000 +0100
+++ xen-4.1-4.1.0rc0/tools/pygrub/Makefile	2011-01-14 00:07:21.194158212 +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 default,$(CONFIG_LEAF_DIR)),--install-layout=deb)
 	$(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(BINDIR)/pygrub
 	$(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
 
Index: xen-4.1-4.1.0rc0/tools/python/Makefile
===================================================================
--- xen-4.1-4.1.0rc0.orig/tools/python/Makefile	2011-01-06 00:54:15.000000000 +0100
+++ xen-4.1-4.1.0rc0/tools/python/Makefile	2011-01-14 00:07:21.214179102 +0100
@@ -65,7 +65,8 @@
 .PHONY: install
 install: install-messages install-dtd
 	CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \
-		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
+		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force \
+		$(if $(filter default,$(CONFIG_LEAF_DIR)),--install-layout=deb)
 
 install-dtd: all
 	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/xen
Index: xen-4.1-4.1.0rc0/tools/security/Makefile
===================================================================
--- xen-4.1-4.1.0rc0.orig/tools/security/Makefile	2011-01-06 00:54:15.000000000 +0100
+++ xen-4.1-4.1.0rc0/tools/security/Makefile	2011-01-14 00:07:21.234179052 +0100
@@ -61,7 +61,8 @@
 	$(INSTALL_DIR) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
 	$(INSTALL_PROG) $(ACM_INST_CGI) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
 	$(PYTHON) python/setup.py install $(PYTHON_PREFIX_ARG) \
-		--root="$(DESTDIR)" --force
+		--root="$(DESTDIR)" --force \
+		$(if $(filter default,$(CONFIG_LEAF_DIR)),--install-layout=deb)
 else
 .PHONY: all
 all:

[-- Attachment #5: debian-stubdom.Makefile.diff.err --]
[-- Type: application/octet-stream, Size: 3490 bytes --]

patch -d newlib-1.16.0 -p1 < newlib-stdint-size_max-fix-from-1.17.0.patch
patching file newlib/libc/include/stdint.h
find newlib-1.16.0 -type f | xargs perl -i.bak \
                -pe 's/\b_(tzname|daylight|timezone)\b/$1/g'
touch newlib-1.16.0
mkdir -p newlib-x86_64
( cd newlib-x86_64 && \
          CC_FOR_TARGET="gcc  -isystem /usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom/../extras/mini-os/include -D__MINIOS__ -DHAVE_LIBC -isystem /usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom/../extras/mini-os/include/posix -isystem /usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom/../tools/xenstore  -isystem /usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom/../extras/mini-os/include/x86 -isystem /usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom/../extras/mini-os/include/x86/x86_64 -U __linux__ -U __FreeBSD__ -U __sun__ -nostdinc -isystem /usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom/../extras/mini-os/include/posix -isystem /usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom/cross-root-x86_64/x86_64-xen-elf/include -isystem /usr/lib/gcc/x86_64-linux-gnu/4.4.1/include -isystem /usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom/lwip-x86_64/src/include -isystem /usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom/lwip-x86_64/src/include/ipv4 -I/usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom/include -I../xen/include -mno-red-zone -g -O2 -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls  -m64 -mno-red-zone -fno-reorder-blocks -fno-asynchronous-unwind-tables -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -fno-stack-protector -fno-exceptions -D_I386MACH_ALLOW_HW_INTERRUPTS" AR_FOR_TARGET=ar LD_FOR_TARGET=ld RANLIB_FOR_TARGET=ranlib ../newlib-1.16.0/configure --prefix=/usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom/cross-root-x86_64 --verbose --target=x86_64-xen-elf --enable-newlib-io-long-long --disable-multilib && \
          /usr/bin/make DESTDIR= && \
          /usr/bin/make DESTDIR= install )
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-xen-elf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
make[2]: *** [cross-root-x86_64/x86_64-xen-elf/lib/libc.a] Error 77
make[2]: Leaving directory `/usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source/stubdom'
make[1]: *** [install-stubdom] Error 2
make[1]: Leaving directory `/usr/src/build-karmic/xen-4.1-4.1.0rc0/debian/build/source'
make: *** [debian/stamps/build-stubdom] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
user@x0:/usr/src/build-karmic/xen-4.1-4.1.0rc0$ 


AND grep -- '-m\b' stubdom/newlib-x86_64/config.log





[-- Attachment #6: xen-watchdog-bug.diff.err --]
[-- Type: application/octet-stream, Size: 322 bytes --]

xen-watchdog-bug.diff.err

/etc/init.d/xen-watchdog stop doesn't work,
 attempts to kill nonexisting process watchdogd instead of xenwatchdogd

-       killall -USR1 watchdogd 2>/dev/null
+       killall -USR1 $base 2>/dev/null

This error also prevents clean install:

	dpkg -i xen-utils-4.1_4.1.0rc0-0ubuntu2_amd64.deb


[-- Attachment #7: debian-python-2.6.diff.err --]
[-- Type: application/octet-stream, Size: 135 bytes --]

#
Python files are installed into  usr/lib/python2.6/site-packages/
instead the expected:            usr/lib/python2.6/dist-packages/


[-- Attachment #8: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm
  2011-01-20  8:38               ` Ian Campbell
@ 2011-01-20 16:49                 ` chris
  2011-01-20 16:54                   ` Ian Campbell
       [not found]                 ` <m2n.s.1PfxnK-153952@chiark.greenend.org.uk>
  1 sibling, 1 reply; 49+ messages in thread
From: chris @ 2011-01-20 16:49 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Xen-Devel List, Xen-Users List

On Thu, Jan 20, 2011 at 3:38 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Wed, 2011-01-19 at 22:34 +0000, chris wrote:
>> On Wed, Jan 19, 2011 at 2:29 PM, chris <tknchris@gmail.com> wrote:
>> > I have pulled the latest from xen-unstable on a new machine, I run
>> > make world and make install and after rebooting into xen, when i run
>> > xm list or anything else i get:
>> >
>> > # xm list
>> > Traceback (most recent call last):
>> >  File "/usr/sbin/xm", line 5, in <module>
>> >    from xen.xm import main
>> > ImportError: No module named xen.xm
>> >
>> > I also tried going into the tools dir and make install, because i read
>> > that somewhere on google.
>> >
>> > I don't get any errors when compiling or installing so I don't know
>> > where to go from here?
>> >
>> > - chris
>> >
>>
>> I just tried this again after pulling everything down again and
>> recompiling. Is something broken?
>
> Nothing currently known.
>
> Which host OS are you running?
>
> Do:
> $ python
>>>> import sys
>>>> print sys.path
>
> This should tell you the python path which is where python is looking
> for stuff. The install process should have dropped xen/xm/main.py
> somewhere on the system, the build log or "find" should tell you where.
> Do they correspond?
>
> Ian.
>
>

This is debian squeeze. I'm guessing something just changed in the
python package?

# python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload',
'/usr/local/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages', '/usr/lib/pymodules/python2.6']


Any idea where to go from here? I don't know a whole lot about python

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm
  2011-01-20 16:49                 ` [Xen-devel] " chris
@ 2011-01-20 16:54                   ` Ian Campbell
  2011-01-20 17:23                     ` chris
  0 siblings, 1 reply; 49+ messages in thread
From: Ian Campbell @ 2011-01-20 16:54 UTC (permalink / raw)
  To: chris; +Cc: Xen-Devel List, Xen-Users List

On Thu, 2011-01-20 at 16:49 +0000, chris wrote:
> On Thu, Jan 20, 2011 at 3:38 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Wed, 2011-01-19 at 22:34 +0000, chris wrote:
> >> On Wed, Jan 19, 2011 at 2:29 PM, chris <tknchris@gmail.com> wrote:
> >> > I have pulled the latest from xen-unstable on a new machine, I run
> >> > make world and make install and after rebooting into xen, when i run
> >> > xm list or anything else i get:
> >> >
> >> > # xm list
> >> > Traceback (most recent call last):
> >> >  File "/usr/sbin/xm", line 5, in <module>
> >> >    from xen.xm import main
> >> > ImportError: No module named xen.xm
> >> >
> >> > I also tried going into the tools dir and make install, because i read
> >> > that somewhere on google.
> >> >
> >> > I don't get any errors when compiling or installing so I don't know
> >> > where to go from here?
> >> >
> >> > - chris
> >> >
> >>
> >> I just tried this again after pulling everything down again and
> >> recompiling. Is something broken?
> >
> > Nothing currently known.
> >
> > Which host OS are you running?
> >
> > Do:
> > $ python
> >>>> import sys
> >>>> print sys.path
> >
> > This should tell you the python path which is where python is looking
> > for stuff. The install process should have dropped xen/xm/main.py
> > somewhere on the system, the build log or "find" should tell you where.
> > Do they correspond?
> >
> > Ian.
> >
> >
> 
> This is debian squeeze. I'm guessing something just changed in the
> python package?
> 
> # python
> Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import sys
> >>> print sys.path
> ['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
> '/usr/lib/python2.6/lib-dynload',
> '/usr/local/lib/python2.6/dist-packages',
> '/usr/lib/python2.6/dist-packages', '/usr/lib/pymodules/python2.6']
> 
> 
> Any idea where to go from here? I don't know a whole lot about python

As I said before -- use "find" or the build log to figure out where Xen
installed itself to, then we can try and figure out where it went wrong.

Ian.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm
  2011-01-20 16:54                   ` Ian Campbell
@ 2011-01-20 17:23                     ` chris
  2011-01-20 17:38                       ` Ian Campbell
  0 siblings, 1 reply; 49+ messages in thread
From: chris @ 2011-01-20 17:23 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Xen-Devel List, Xen-Users List

On Thu, Jan 20, 2011 at 11:54 AM, Ian Campbell
<Ian.Campbell@eu.citrix.com> wrote:
> On Thu, 2011-01-20 at 16:49 +0000, chris wrote:
>> On Thu, Jan 20, 2011 at 3:38 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> > On Wed, 2011-01-19 at 22:34 +0000, chris wrote:
>> >> On Wed, Jan 19, 2011 at 2:29 PM, chris <tknchris@gmail.com> wrote:
>> >> > I have pulled the latest from xen-unstable on a new machine, I run
>> >> > make world and make install and after rebooting into xen, when i run
>> >> > xm list or anything else i get:
>> >> >
>> >> > # xm list
>> >> > Traceback (most recent call last):
>> >> >  File "/usr/sbin/xm", line 5, in <module>
>> >> >    from xen.xm import main
>> >> > ImportError: No module named xen.xm
>> >> >
>> >> > I also tried going into the tools dir and make install, because i read
>> >> > that somewhere on google.
>> >> >
>> >> > I don't get any errors when compiling or installing so I don't know
>> >> > where to go from here?
>> >> >
>> >> > - chris
>> >> >
>> >>
>> >> I just tried this again after pulling everything down again and
>> >> recompiling. Is something broken?
>> >
>> > Nothing currently known.
>> >
>> > Which host OS are you running?
>> >
>> > Do:
>> > $ python
>> >>>> import sys
>> >>>> print sys.path
>> >
>> > This should tell you the python path which is where python is looking
>> > for stuff. The install process should have dropped xen/xm/main.py
>> > somewhere on the system, the build log or "find" should tell you where.
>> > Do they correspond?
>> >
>> > Ian.
>> >
>> >
>>
>> This is debian squeeze. I'm guessing something just changed in the
>> python package?
>>
>> # python
>> Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
>> [GCC 4.4.5] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import sys
>> >>> print sys.path
>> ['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
>> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
>> '/usr/lib/python2.6/lib-dynload',
>> '/usr/local/lib/python2.6/dist-packages',
>> '/usr/lib/python2.6/dist-packages', '/usr/lib/pymodules/python2.6']
>>
>>
>> Any idea where to go from here? I don't know a whole lot about python
>
> As I said before -- use "find" or the build log to figure out where Xen
> installed itself to, then we can try and figure out where it went wrong.
>
> Ian.
>
>

/usr/lib/python2.6/site-packages/xen/xm/main.py

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm
  2011-01-20 17:23                     ` chris
@ 2011-01-20 17:38                       ` Ian Campbell
  2011-01-21 18:20                         ` [Xen-users] " Mike Viau
  0 siblings, 1 reply; 49+ messages in thread
From: Ian Campbell @ 2011-01-20 17:38 UTC (permalink / raw)
  To: chris; +Cc: Xen-Devel List, Xen-Users List

> >> ['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
> >> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
> >> '/usr/lib/python2.6/lib-dynload',
> >> '/usr/local/lib/python2.6/dist-packages',
> >> '/usr/lib/python2.6/dist-packages', '/usr/lib/pymodules/python2.6']

vs.

> /usr/lib/python2.6/site-packages/xen/xm/main.py

So the Xen python bits are not installed to a path which the python
interpreter is searching.

Xen relies on the python distutils library to build and install its
python bits and makes no specific reference to site-packages in its
makefiles (that I can find).

The Debian python policy
(http://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html) suggests that this change of location is deliberate from python 2.6 onwards. However /usr/lib/python2.6/distutils/command/install.py still makes reference to site-packages which is no doubt where it is coming from.

At this point my Debian python-fu is running low but I think you have
found a bug in Debian and should report it to them as such.

I also suspect that the fact that distutils is installing
non-packaged/locally-built python bits in /usr/lib/python2.6 rather
than /usr/local/lib/python2.6 is also a bug in the python system.

Ian.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm
       [not found]                 ` <m2n.s.1PfxnK-153952@chiark.greenend.org.uk>
@ 2011-01-20 18:19                   ` Ian Jackson
  2011-01-20 18:35                     ` chris
  0 siblings, 1 reply; 49+ messages in thread
From: Ian Jackson @ 2011-01-20 18:19 UTC (permalink / raw)
  To: chris; +Cc: Xen-Devel List, Ian Campbell, Xen-Users List

chris writes ("Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm"):
> On Thu, Jan 20, 2011 at 3:38 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> This is debian squeeze. I'm guessing something just changed in the
> python package?

Unfortunately the combination of Python and the Debian Python
packaging is a complete disaster.

We have had some suggested patches that involve passing a strange
option to all instances of setup.py.  What I'll do is prepare a
version of that patch which might be suitable for applying to
xen-unstable, and post it here.

Would you then be able to test it ?

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Re: xen-unstable: ImportError: No module named xen.xm
  2011-01-20 18:19                   ` Ian Jackson
@ 2011-01-20 18:35                     ` chris
  2011-01-21 18:59                       ` [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm [and 1 more messages] Ian Jackson
  0 siblings, 1 reply; 49+ messages in thread
From: chris @ 2011-01-20 18:35 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Xen-Devel List, Ian Campbell, Xen-Users List


[-- Attachment #1.1: Type: text/plain, Size: 741 bytes --]

I would be very willing to. Thanks

On Jan 20, 2011 1:19 PM, "Ian Jackson" <Ian.Jackson@eu.citrix.com> wrote:

chris writes ("Re: [Xen-devel] Re: xen-unstable: ImportError: No module
named xen.xm"):

> On Thu, Jan 20, 2011 at 3:38 AM, Ian Campbell <Ian.Campbell@citrix.com>
wrote:

> This is debian squeeze. I'm guessing something just changed in the
> python package?
Unfortunately the combination of Python and the Debian Python
packaging is a complete disaster.

We have had some suggested patches that involve passing a strange
option to all instances of setup.py.  What I'll do is prepare a
version of that patch which might be suitable for applying to
xen-unstable, and post it here.

Would you then be able to test it ?

Thanks,
Ian.

[-- Attachment #1.2: Type: text/html, Size: 1114 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Xen build - Debian vs Redhat layout patch options
  2011-01-20 13:45         ` user virtual
       [not found]           ` <AANLkTimCA_T1QsfCVfABtW8776Mkg3toBtmHYHgea56=@mail.gmail.com>
@ 2011-01-21 15:30           ` user virtual
  2011-01-21 17:28             ` Bruce Edge
  2011-01-21 17:29             ` Stefano Stabellini
  1 sibling, 2 replies; 49+ messages in thread
From: user virtual @ 2011-01-21 15:30 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Bruce Edge, Stefano Stabellini


[-- Attachment #1.1: Type: text/plain, Size: 6468 bytes --]

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.
>>
>
>

[-- Attachment #1.2: Type: text/html, Size: 7780 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Xen build - Debian vs Redhat layout patch options
  2011-01-21 15:30           ` Xen build - Debian vs Redhat layout patch options user virtual
@ 2011-01-21 17:28             ` Bruce Edge
  2011-01-21 18:42               ` Ian Jackson
  2011-01-21 17:29             ` Stefano Stabellini
  1 sibling, 1 reply; 49+ messages in thread
From: Bruce Edge @ 2011-01-21 17:28 UTC (permalink / raw)
  To: user virtual; +Cc: xen-devel, Ian Jackson, Stefano Stabellini


[-- Attachment #1.1: Type: text/plain, Size: 7242 bytes --]

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.
>>>
>>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 8937 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Xen build - Debian vs Redhat layout patch options
  2011-01-21 15:30           ` Xen build - Debian vs Redhat layout patch options user virtual
  2011-01-21 17:28             ` Bruce Edge
@ 2011-01-21 17:29             ` Stefano Stabellini
  2011-01-21 18:40               ` Ian Jackson
  1 sibling, 1 reply; 49+ messages in thread
From: Stefano Stabellini @ 2011-01-21 17:29 UTC (permalink / raw)
  To: user virtual
  Cc: Ian, Campbell, Stefano Stabellini, Ian Jackson, Bruce Edge, xen-devel

[-- Attachment #1: Type: text/plain, Size: 669 bytes --]

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 platforms

I think this patch is fine.

> - 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.

> When the above is resolved xen-unstable.hg will be "fully debian-compatible".  :-)
> 

great!!

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* RE: [Xen-users] Re: Re: xen-unstable: ImportError: No module named xen.xm
  2011-01-20 17:38                       ` Ian Campbell
@ 2011-01-21 18:20                         ` Mike Viau
  2011-01-21 19:16                           ` Ian Jackson
  2011-01-26 14:51                           ` Re: [Xen-devel] " Ian Jackson
  0 siblings, 2 replies; 49+ messages in thread
From: Mike Viau @ 2011-01-21 18:20 UTC (permalink / raw)
  To: xen-devel, xen-users


[-- Attachment #1.1: Type: text/plain, Size: 3523 bytes --]


> On Thu, 20 Jan 2011 17:38:23 +0000 <Ian.Campbell@eu.citrix.com> wrote:
> 
> > >> ['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
> > >> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
> > >> '/usr/lib/python2.6/lib-dynload',
> > >> '/usr/local/lib/python2.6/dist-packages',
> > >> '/usr/lib/python2.6/dist-packages', '/usr/lib/pymodules/python2.6']
> 
> vs.
> 
> > /usr/lib/python2.6/site-packages/xen/xm/main.py

Have you tried modifying the Config.mk is the root directory of your Xen.4.1 sources before compiling?

hg diff Config.mk output:

--- a/Config.mk    Tue Jan 18 17:23:24 2011 +0000
+++ b/Config.mk    Fri Jan 21 13:03:32 2011 +0000
@@ -1,7 +1,8 @@
 # -*- mode: Makefile; -*-
 
 # A debug build of Xen and tools?
-debug ?= y
+#debug ?= y
+debug ?= n
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
                          -e s/i86pc/x86_32/ -e s/amd64/x86_64/)
@@ -56,7 +57,8 @@
 FLEX    ?= flex
 
 PYTHON      ?= python
-PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)"
+PYTHON_PREFIX_ARG  ?= 
+#PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)"
 # The above requires that PREFIX contains *no spaces*. This variable is here
 # to permit the user to set PYTHON_PREFIX_ARG to '' to workaround this bug:
 #  https://bugs.launchpad.net/ubuntu/+bug/362570



My resulting python path with when changing PYTHON_PREFIX_ARG was apparently /usr/local/lib/python2.6/dist-packages which I noticed was in your python's interpreter search path(s).

ls -l /usr/local/lib/python2.6/dist-packages
total 48
-rwxr-xr-x  1 topgun topgun 30693 Jan 18 20:27 fsimage.so
drwxr-xr-x  2 topgun topgun  4096 Jan 18 20:57 grub
-rw-r--r--  1 topgun topgun   226 Jan 18 20:31 pygrub-0.3.egg-info
drwxr-xr-x 10 topgun topgun  4096 Jan 18 20:57 xen
-rw-r--r--  1 topgun topgun   171 Jan 18 20:31 xen-3.0.egg-info


This is only a hack, as I am not sure if I bug has already been reported on the Debian BTS to fix the issue with python 2.6 onwards. 

 /usr/lib/python2.6/distutils/command/install.py still makes reference
to site-packages <-- causing the issue (personally unconfirmed, source Xen developer: Ian Campbell who definatly knows more than I do when it comes to Xen or python).

> 
> So the Xen python bits are not installed to a path which the python
> interpreter is searching.
> 
> Xen relies on the python distutils library to build and install its
> python bits and makes no specific reference to site-packages in its
> makefiles (that I can find).
> 
> The Debian python policy
> (http://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html) suggests that this change of location is deliberate from python 2.6 onwards. However /usr/lib/python2.6/distutils/command/install.py still makes reference to site-packages which is no doubt where it is coming from.
> 
> At this point my Debian python-fu is running low but I think you have
> found a bug in Debian and should report it to them as such.
> 
> I also suspect that the fact that distutils is installing
> non-packaged/locally-built python bits in /usr/lib/python2.6 rather
> than /usr/local/lib/python2.6 is also a bug in the python system.

As pointed out above my /usr/local/lib/python2.6/dist-packages does contain xen realated files, but just incase some locally built python stuff realted to xen did end up /usr/lib/python2.6/ I have attached that larger directory listing as well... a simple search for xen returns nothing.


 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 4345 bytes --]

[-- Attachment #2: ls_listing.txt --]
[-- Type: text/plain, Size: 26387 bytes --]

total 9172
-rw-r--r--  1 root root  13913 Dec 26 23:10 _abcoll.py
-rw-r--r--  1 root root  21102 Jan 12 18:15 _abcoll.pyc
-rw-r--r--  1 root root  21102 Jan 12 18:30 _abcoll.pyo
-rw-r--r--  1 root root   7034 Dec 26 23:10 abc.py
-rw-r--r--  1 root root   6049 Jan 12 18:15 abc.pyc
-rw-r--r--  1 root root   5991 Jan 12 18:30 abc.pyo
-rw-r--r--  1 root root  33188 Dec 26 23:10 aifc.py
-rw-r--r--  1 root root  29424 Jan 12 18:15 aifc.pyc
-rw-r--r--  1 root root   2620 Dec 26 23:10 anydbm.py
-rw-r--r--  1 root root   2769 Jan 12 18:15 anydbm.pyc
-rw-r--r--  1 root root  11347 Dec 26 23:10 ast.py
-rw-r--r--  1 root root  12732 Jan 12 18:15 ast.pyc
-rw-r--r--  1 root root  11402 Dec 26 23:10 asynchat.py
-rw-r--r--  1 root root   8677 Jan 12 18:15 asynchat.pyc
-rw-r--r--  1 root root  20061 Dec 26 23:10 asyncore.py
-rw-r--r--  1 root root  18334 Jan 12 18:15 asyncore.pyc
-rw-r--r--  1 root root   1705 Dec 26 23:10 atexit.py
-rw-r--r--  1 root root   2203 Jan 12 18:15 atexit.pyc
-rw-r--r--  1 root root   2203 Jan 12 18:30 atexit.pyo
-rw-r--r--  1 root root   7597 Dec 26 23:10 audiodev.py
-rw-r--r--  1 root root   8483 Jan 12 18:15 audiodev.pyc
-rwxr-xr-x  1 root root  11331 Dec 26 23:10 base64.py
-rw-r--r--  1 root root  10967 Jan 12 18:15 base64.pyc
-rw-r--r--  1 root root  21974 Dec 26 23:10 BaseHTTPServer.py
-rw-r--r--  1 root root  21535 Jan 12 18:15 BaseHTTPServer.pyc
-rw-r--r--  1 root root   5744 Dec 26 23:10 Bastion.py
-rw-r--r--  1 root root   6637 Jan 12 18:15 Bastion.pyc
-rw-r--r--  1 root root  20597 Dec 26 23:10 bdb.py
-rw-r--r--  1 root root  18449 Jan 12 18:15 bdb.pyc
-rw-r--r--  1 root root  14878 Dec 26 23:10 binhex.py
-rw-r--r--  1 root root  15773 Jan 12 18:15 binhex.pyc
-rw-r--r--  1 root root   2662 Dec 26 23:10 bisect.py
-rw-r--r--  1 root root   3163 Jan 12 18:15 bisect.pyc
drwxr-xr-x  2 root root   4096 Jan 12 18:15 bsddb
-rw-r--r--  1 root root  23110 Dec 26 23:10 calendar.py
-rw-r--r--  1 root root  28007 Jan 12 18:15 calendar.pyc
-rw-r--r--  1 root root  11508 Dec 26 23:10 CGIHTTPServer.py
-rw-r--r--  1 root root   9891 Jan 12 18:15 CGIHTTPServer.pyc
-rwxr-xr-x  1 root root  34474 Dec 26 23:10 cgi.py
-rw-r--r--  1 root root  32680 Jan 12 18:15 cgi.pyc
-rw-r--r--  1 root root  12155 Dec 26 23:10 cgitb.py
-rw-r--r--  1 root root  12425 Jan 12 18:15 cgitb.pyc
-rw-r--r--  1 root root   5372 Dec 26 23:10 chunk.py
-rw-r--r--  1 root root   5623 Jan 12 18:15 chunk.pyc
-rw-r--r--  1 root root  14962 Dec 26 23:10 cmd.py
-rw-r--r--  1 root root  13914 Jan 12 18:15 cmd.pyc
-rw-r--r--  1 root root  35266 Dec 26 23:10 codecs.py
-rw-r--r--  1 root root  36533 Jan 12 18:15 codecs.pyc
-rw-r--r--  1 root root  36533 Jan 12 18:30 codecs.pyo
-rw-r--r--  1 root root   5999 Dec 26 23:10 codeop.py
-rw-r--r--  1 root root   6616 Jan 12 18:15 codeop.pyc
-rw-r--r--  1 root root  10217 Dec 26 23:10 code.py
-rw-r--r--  1 root root  10395 Jan 12 18:15 code.pyc
-rw-r--r--  1 root root   6150 Dec 26 23:10 collections.py
-rw-r--r--  1 root root   6611 Jan 12 18:15 collections.pyc
-rw-r--r--  1 root root   6558 Jan 12 18:30 collections.pyo
-rw-r--r--  1 root root   3459 Dec 26 23:10 colorsys.py
-rw-r--r--  1 root root   4025 Jan 12 18:15 colorsys.pyc
-rw-r--r--  1 root root   2543 Dec 26 23:10 commands.py
-rw-r--r--  1 root root   2477 Jan 12 18:15 commands.pyc
-rw-r--r--  1 root root   2477 Jan 12 18:30 commands.pyo
-rw-r--r--  1 root root   6984 Dec 26 23:10 compileall.py
-rw-r--r--  1 root root   6534 Jan 12 18:15 compileall.pyc
drwxr-xr-x  2 root root   4096 Jan 12 18:15 compiler
drwxr-xr-x  2 root root   4096 Jan 14 09:49 config
-rw-r--r--  1 root root  24509 Dec 26 23:10 ConfigParser.py
-rw-r--r--  1 root root  23232 Jan 12 18:15 ConfigParser.pyc
-rw-r--r--  1 root root  23232 Jan 12 18:30 ConfigParser.pyo
-rw-r--r--  1 root root   4136 Dec 26 23:10 contextlib.py
-rw-r--r--  1 root root   4127 Jan 12 18:15 contextlib.pyc
-rw-r--r--  1 root root  64452 Dec 26 23:10 cookielib.py
-rw-r--r--  1 root root  55052 Jan 12 18:15 cookielib.pyc
-rwxr-xr-x  1 root root  25669 Dec 26 23:10 Cookie.py
-rw-r--r--  1 root root  22346 Jan 12 18:15 Cookie.pyc
-rw-r--r--  1 root root  10996 Dec 26 23:10 copy.py
-rw-r--r--  1 root root  11375 Jan 12 18:15 copy.pyc
-rw-r--r--  1 root root  11279 Jan 12 18:30 copy.pyo
-rw-r--r--  1 root root   6800 Dec 26 23:10 copy_reg.py
-rw-r--r--  1 root root   5156 Jan 12 18:15 copy_reg.pyc
-rw-r--r--  1 root root   5110 Jan 12 18:30 copy_reg.pyo
-rwxr-xr-x  1 root root   6258 Dec 26 23:10 cProfile.py
-rw-r--r--  1 root root   6115 Jan 12 18:15 cProfile.pyc
-rw-r--r--  1 root root  15730 Dec 26 23:10 csv.py
-rw-r--r--  1 root root  13170 Jan 12 18:15 csv.pyc
drwxr-xr-x  2 root root   4096 Jan 12 18:30 ctypes
drwxr-xr-x  2 root root   4096 Jan 12 18:15 curses
-rw-r--r--  1 root root    535 Dec 26 23:10 dbhash.py
-rw-r--r--  1 root root    756 Jan 12 18:15 dbhash.pyc
-rw-r--r--  1 root root 199273 Dec 26 23:10 decimal.py
-rw-r--r--  1 root root 155185 Jan 12 18:15 decimal.pyc
-rwxr-xr-x  1 root root  81102 Dec 26 23:10 difflib.py
-rw-r--r--  1 root root  61093 Jan 12 18:15 difflib.pyc
-rw-r--r--  1 root root   1126 Dec 26 23:10 dircache.py
-rw-r--r--  1 root root   1576 Jan 12 18:15 dircache.pyc
-rw-r--r--  1 root root   6449 Dec 26 23:10 dis.py
-rw-r--r--  1 root root   6350 Jan 12 18:15 dis.pyc
-rw-r--r--  1 root root   6350 Jan 12 18:30 dis.pyo
drwxr-xr-x 24 root root   4096 Jan 14 09:50 dist-packages
drwxr-xr-x  3 root root   4096 Jan 12 18:15 distutils
-rw-r--r--  1 root root 101516 Dec 26 23:10 doctest.py
-rw-r--r--  1 root root  80782 Jan 12 18:15 doctest.pyc
-rw-r--r--  1 root root  10599 Dec 26 23:10 DocXMLRPCServer.py
-rw-r--r--  1 root root   9921 Jan 12 18:15 DocXMLRPCServer.pyc
-rw-r--r--  1 root root   8820 Dec 26 23:10 dumbdbm.py
-rw-r--r--  1 root root   6547 Jan 12 18:15 dumbdbm.pyc
-rw-r--r--  1 root root   2804 Dec 26 23:10 dummy_threading.py
-rw-r--r--  1 root root   1295 Jan 12 18:15 dummy_threading.pyc
-rw-r--r--  1 root root   4418 Dec 26 23:10 dummy_thread.py
-rw-r--r--  1 root root   5383 Jan 12 18:15 dummy_thread.pyc
drwxr-xr-x  3 root root   4096 Jan 12 18:15 email
drwxr-xr-x  2 root root  20480 Jan 12 19:01 encodings
-rw-r--r--  1 root root   9470 Dec 26 23:10 filecmp.py
-rw-r--r--  1 root root   9592 Jan 12 18:15 filecmp.pyc
-rw-r--r--  1 root root  14143 Dec 26 23:10 fileinput.py
-rw-r--r--  1 root root  14870 Jan 12 18:15 fileinput.pyc
-rw-r--r--  1 root root   3239 Dec 26 23:10 fnmatch.py
-rw-r--r--  1 root root   3567 Jan 12 18:15 fnmatch.pyc
-rw-r--r--  1 root root   3567 Jan 12 18:30 fnmatch.pyo
-rw-r--r--  1 root root  14911 Dec 26 23:10 formatter.py
-rw-r--r--  1 root root  19149 Jan 12 18:15 formatter.pyc
-rw-r--r--  1 root root   4699 Dec 26 23:10 fpformat.py
-rw-r--r--  1 root root   4719 Jan 12 18:15 fpformat.pyc
-rw-r--r--  1 root root  20073 Dec 26 23:10 fractions.py
-rw-r--r--  1 root root  18041 Jan 12 18:15 fractions.pyc
-rw-r--r--  1 root root  28739 Dec 26 23:10 ftplib.py
-rw-r--r--  1 root root  28022 Jan 12 18:15 ftplib.pyc
-rw-r--r--  1 root root   2162 Dec 26 23:10 functools.py
-rw-r--r--  1 root root   1921 Jan 12 18:15 functools.pyc
-rw-r--r--  1 root root   1921 Jan 12 18:30 functools.pyo
-rw-r--r--  1 root root   4380 Dec 26 23:10 __future__.py
-rw-r--r--  1 root root   4221 Jan 12 18:15 __future__.pyc
-rw-r--r--  1 root root   4221 Jan 12 18:30 __future__.pyo
-rw-r--r--  1 root root   3020 Dec 26 23:10 genericpath.py
-rw-r--r--  1 root root   3272 Jan 12 18:15 genericpath.pyc
-rw-r--r--  1 root root   3272 Jan 12 18:30 genericpath.pyo
-rw-r--r--  1 root root   7328 Dec 26 23:10 getopt.py
-rw-r--r--  1 root root   6710 Jan 12 18:15 getopt.pyc
-rw-r--r--  1 root root   6663 Jan 12 18:30 getopt.pyo
-rw-r--r--  1 root root   5549 Dec 26 23:10 getpass.py
-rw-r--r--  1 root root   4756 Jan 12 18:15 getpass.pyc
-rw-r--r--  1 root root  19890 Dec 26 23:10 gettext.py
-rw-r--r--  1 root root  15626 Jan 12 18:15 gettext.pyc
-rw-r--r--  1 root root  15626 Jan 12 18:30 gettext.pyo
-rw-r--r--  1 root root   2249 Dec 26 23:10 glob.py
-rw-r--r--  1 root root   2395 Jan 12 18:15 glob.pyc
-rw-r--r--  1 root root  16754 Dec 26 23:10 gzip.py
-rw-r--r--  1 root root  14322 Jan 12 18:15 gzip.pyc
-rw-r--r--  1 root root   4993 Dec 26 23:10 hashlib.py
-rw-r--r--  1 root root   4252 Jan 12 18:15 hashlib.pyc
-rw-r--r--  1 root root  15995 Dec 26 23:10 heapq.py
-rw-r--r--  1 root root  12668 Jan 12 18:15 heapq.pyc
-rw-r--r--  1 root root   4531 Dec 26 23:10 hmac.py
-rw-r--r--  1 root root   4489 Jan 12 18:15 hmac.pyc
drwxr-xr-x  2 root root   4096 Jan 12 18:15 hotshot
-rw-r--r--  1 root root  18054 Dec 26 23:10 htmlentitydefs.py
-rw-r--r--  1 root root   6369 Jan 12 18:15 htmlentitydefs.pyc
-rw-r--r--  1 root root  12869 Dec 26 23:10 htmllib.py
-rw-r--r--  1 root root  20202 Jan 12 18:15 htmllib.pyc
-rw-r--r--  1 root root  13576 Dec 26 23:10 HTMLParser.py
-rw-r--r--  1 root root  12198 Jan 12 18:15 HTMLParser.pyc
-rw-r--r--  1 root root  45486 Dec 26 23:10 httplib.py
-rw-r--r--  1 root root  35533 Jan 12 18:15 httplib.pyc
-rw-r--r--  1 root root  17452 Dec 26 23:10 ihooks.py
-rw-r--r--  1 root root  20699 Jan 12 18:15 ihooks.pyc
-rw-r--r--  1 root root  47232 Dec 26 23:10 imaplib.py
-rw-r--r--  1 root root  44888 Jan 12 18:15 imaplib.pyc
-rw-r--r--  1 root root   3544 Dec 26 23:10 imghdr.py
-rw-r--r--  1 root root   4873 Jan 12 18:15 imghdr.pyc
-rw-r--r--  1 root root  26009 Dec 26 23:10 imputil.py
-rw-r--r--  1 root root  15959 Jan 12 18:15 imputil.pyc
-rw-r--r--  1 root root  38189 Dec 26 23:10 inspect.py
-rw-r--r--  1 root root  37033 Jan 12 18:15 inspect.pyc
-rw-r--r--  1 root root  37041 Jan 12 18:30 inspect.pyo
-rw-r--r--  1 root root  66165 Dec 26 23:10 io.py
-rw-r--r--  1 root root  62712 Jan 12 18:15 io.pyc
drwxr-xr-x  2 root root   4096 Jan 12 18:15 json
-rwxr-xr-x  1 root root   1993 Dec 26 23:10 keyword.py
-rw-r--r--  1 root root   2113 Jan 12 18:15 keyword.pyc
-rw-r--r--  1 root root   2113 Jan 12 18:30 keyword.pyo
drwxr-xr-x  4 root root   4096 Jan 12 18:15 lib2to3
drwxr-xr-x  2 root root   4096 Jan 12 18:15 lib-dynload
drwxr-xr-x  2 root root   4096 Jan 12 18:15 lib-tk
-rw-r--r--  1 root root  14171 Dec 26 23:10 LICENSE.txt
-rw-r--r--  1 root root   4282 Dec 26 23:10 linecache.py
-rw-r--r--  1 root root   3299 Jan 12 18:15 linecache.pyc
-rw-r--r--  1 root root   3299 Jan 12 18:30 linecache.pyo
-rw-r--r--  1 root root  88483 Dec 26 23:10 locale.py
-rw-r--r--  1 root root  49071 Jan 12 18:15 locale.pyc
-rw-r--r--  1 root root  49072 Jan 12 18:30 locale.pyo
drwxr-xr-x  2 root root   4096 Jan 12 18:30 logging
-rw-r--r--  1 root root   6553 Dec 26 23:10 _LWPCookieJar.py
-rw-r--r--  1 root root   5589 Jan 12 18:15 _LWPCookieJar.pyc
-rw-r--r--  1 root root   6253 Dec 26 23:10 macpath.py
-rw-r--r--  1 root root   7669 Jan 12 18:15 macpath.pyc
-rw-r--r--  1 root root   3275 Dec 26 23:10 macurl2path.py
-rw-r--r--  1 root root   2815 Jan 12 18:15 macurl2path.pyc
-rwxr-xr-x  1 root root  75846 Dec 26 23:10 mailbox.py
-rw-r--r--  1 root root  75633 Jan 12 18:15 mailbox.pyc
-rw-r--r--  1 root root   7427 Dec 26 23:10 mailcap.py
-rw-r--r--  1 root root   7167 Jan 12 18:15 mailcap.pyc
-rw-r--r--  1 root root  14350 Dec 26 23:10 markupbase.py
-rw-r--r--  1 root root   9430 Jan 12 18:15 markupbase.pyc
-rw-r--r--  1 root root    410 Dec 26 23:10 md5.py
-rw-r--r--  1 root root    376 Jan 12 18:15 md5.pyc
-rw-r--r--  1 root root  33434 Dec 26 23:10 mhlib.py
-rw-r--r--  1 root root  33981 Jan 12 18:15 mhlib.pyc
-rw-r--r--  1 root root   7168 Dec 26 23:10 mimetools.py
-rw-r--r--  1 root root   8280 Jan 12 18:15 mimetools.pyc
-rw-r--r--  1 root root  18822 Dec 26 23:10 mimetypes.py
-rw-r--r--  1 root root  16838 Jan 12 18:15 mimetypes.pyc
-rw-r--r--  1 root root   6482 Dec 26 23:10 MimeWriter.py
-rw-r--r--  1 root root   7365 Jan 12 18:15 MimeWriter.pyc
-rwxr-xr-x  1 root root  15020 Dec 26 23:10 mimify.py
-rw-r--r--  1 root root  12189 Jan 12 18:15 mimify.pyc
-rw-r--r--  1 root root  24283 Dec 26 23:10 modulefinder.py
-rw-r--r--  1 root root  18939 Jan 12 18:15 modulefinder.pyc
-rw-r--r--  1 root root   5809 Dec 26 23:10 _MozillaCookieJar.py
-rw-r--r--  1 root root   4509 Jan 12 18:15 _MozillaCookieJar.pyc
-rw-r--r--  1 root root   4820 Dec 26 23:10 multifile.py
-rw-r--r--  1 root root   5449 Jan 12 18:15 multifile.pyc
drwxr-xr-x  3 root root   4096 Jan 12 18:15 multiprocessing
-rw-r--r--  1 root root   1866 Dec 26 23:10 mutex.py
-rw-r--r--  1 root root   2512 Jan 12 18:15 mutex.pyc
-rw-r--r--  1 root root   4111 Dec 26 23:10 netrc.py
-rw-r--r--  1 root root   3586 Jan 12 18:15 netrc.pyc
-rw-r--r--  1 root root    706 Dec 26 23:10 new.py
-rw-r--r--  1 root root    908 Jan 12 18:15 new.pyc
-rw-r--r--  1 root root  21135 Dec 26 23:10 nntplib.py
-rw-r--r--  1 root root  20986 Jan 12 18:15 nntplib.pyc
-rw-r--r--  1 root root  17752 Dec 26 23:10 ntpath.py
-rw-r--r--  1 root root  11582 Jan 12 18:15 ntpath.pyc
-rw-r--r--  1 root root   2239 Dec 26 23:10 nturl2path.py
-rw-r--r--  1 root root   1771 Jan 12 18:15 nturl2path.pyc
-rw-r--r--  1 root root  10271 Dec 26 23:10 numbers.py
-rw-r--r--  1 root root  13840 Jan 12 18:15 numbers.pyc
-rw-r--r--  1 root root   5248 Dec 26 23:10 opcode.py
-rw-r--r--  1 root root   5907 Jan 12 18:15 opcode.pyc
-rw-r--r--  1 root root   5911 Jan 12 18:30 opcode.pyo
-rw-r--r--  1 root root  60849 Dec 26 23:10 optparse.py
-rw-r--r--  1 root root  53959 Jan 12 18:15 optparse.pyc
-rw-r--r--  1 root root  53877 Jan 12 18:30 optparse.pyo
-rw-r--r--  1 root root   4603 Dec 26 23:10 os2emxpath.py
-rw-r--r--  1 root root   4518 Jan 12 18:15 os2emxpath.pyc
-rw-r--r--  1 root root  26338 Dec 26 23:10 os.py
-rw-r--r--  1 root root  26303 Jan 12 18:15 os.pyc
-rw-r--r--  1 root root  26303 Jan 12 18:30 os.pyo
-rw-r--r--  1 root root   7899 Dec 26 23:10 pdb.doc
-rwxr-xr-x  1 root root  45329 Dec 26 23:10 pdb.py
-rw-r--r--  1 root root  43585 Jan 12 18:15 pdb.pyc
-rw-r--r--  1 root root     64 Dec 26 23:10 __phello__.foo.py
-rw-r--r--  1 root root    123 Jan 12 18:15 __phello__.foo.pyc
-rw-r--r--  1 root root  44811 Dec 26 23:10 pickle.py
-rw-r--r--  1 root root  38437 Jan 12 18:15 pickle.pyc
-rw-r--r--  1 root root  38232 Jan 12 18:30 pickle.pyo
-rw-r--r--  1 root root  74348 Dec 26 23:10 pickletools.py
-rw-r--r--  1 root root  57079 Jan 12 18:15 pickletools.pyc
-rw-r--r--  1 root root   9647 Dec 26 23:10 pipes.py
-rw-r--r--  1 root root   9428 Jan 12 18:15 pipes.pyc
-rw-r--r--  1 root root   9428 Jan 12 18:30 pipes.pyo
-rw-r--r--  1 root root  20001 Dec 26 23:10 pkgutil.py
-rw-r--r--  1 root root  18954 Jan 12 18:15 pkgutil.pyc
-rwxr-xr-x  1 root root  53555 Dec 26 23:10 platform.py
-rw-r--r--  1 root root  39368 Jan 12 18:15 platform.pyc
drwxr-xr-x  2 root root   4096 Jan 12 18:15 plat-linux2
-rw-r--r--  1 root root  15185 Dec 26 23:10 plistlib.py
-rw-r--r--  1 root root  19212 Jan 12 18:15 plistlib.pyc
-rw-r--r--  1 root root   8416 Dec 26 23:10 popen2.py
-rw-r--r--  1 root root   9032 Jan 12 18:15 popen2.pyc
-rw-r--r--  1 root root  12388 Dec 26 23:10 poplib.py
-rw-r--r--  1 root root  13187 Jan 12 18:15 poplib.pyc
-rw-r--r--  1 root root   8003 Dec 26 23:10 posixfile.py
-rw-r--r--  1 root root   7700 Jan 12 18:15 posixfile.pyc
-rw-r--r--  1 root root  13119 Dec 26 23:10 posixpath.py
-rw-r--r--  1 root root  11142 Jan 12 18:15 posixpath.pyc
-rw-r--r--  1 root root  11142 Jan 12 18:30 posixpath.pyo
-rw-r--r--  1 root root  11932 Dec 26 23:10 pprint.py
-rw-r--r--  1 root root  10356 Jan 12 18:15 pprint.pyc
-rw-r--r--  1 root root   4869 Dec 26 23:10 pty.py
-rw-r--r--  1 root root   4899 Jan 12 18:15 pty.pyc
-rw-r--r--  1 root root  13282 Dec 26 23:10 pyclbr.py
-rw-r--r--  1 root root   9706 Jan 12 18:15 pyclbr.pyc
-rw-r--r--  1 root root   6238 Dec 26 23:10 py_compile.py
-rw-r--r--  1 root root   6924 Jan 12 18:15 py_compile.pyc
-rwxr-xr-x  1 root root  92980 Dec 26 23:10 pydoc.py
-rw-r--r--  1 root root  91146 Jan 12 18:15 pydoc.pyc
-rw-r--r--  1 root root 423126 Dec 26 23:10 pydoc_topics.py
-rw-r--r--  1 root root 407586 Jan 12 18:15 pydoc_topics.pyc
-rw-r--r--  1 root root   8574 Dec 26 23:10 Queue.py
-rw-r--r--  1 root root   9391 Jan 12 18:15 Queue.pyc
-rwxr-xr-x  1 root root   6968 Dec 26 23:10 quopri.py
-rw-r--r--  1 root root   6666 Jan 12 18:15 quopri.pyc
-rw-r--r--  1 root root  31966 Dec 26 23:10 random.py
-rw-r--r--  1 root root  25022 Jan 12 18:15 random.pyc
-rw-r--r--  1 root root  25022 Jan 12 18:30 random.pyo
-rw-r--r--  1 root root   4296 Dec 26 23:10 repr.py
-rw-r--r--  1 root root   5400 Jan 12 18:15 repr.pyc
-rw-r--r--  1 root root  12966 Dec 26 23:10 re.py
-rw-r--r--  1 root root  13122 Jan 12 18:15 re.pyc
-rw-r--r--  1 root root  13122 Jan 12 18:30 re.pyo
-rw-r--r--  1 root root  20152 Dec 26 23:10 rexec.py
-rw-r--r--  1 root root  24102 Jan 12 18:15 rexec.pyc
-rw-r--r--  1 root root  33295 Dec 26 23:10 rfc822.py
-rw-r--r--  1 root root  31990 Jan 12 18:15 rfc822.pyc
-rw-r--r--  1 root root   5866 Dec 26 23:10 rlcompleter.py
-rw-r--r--  1 root root   6057 Jan 12 18:15 rlcompleter.pyc
-rw-r--r--  1 root root   7014 Dec 26 23:10 robotparser.py
-rw-r--r--  1 root root   7804 Jan 12 18:15 robotparser.pyc
-rwxr-xr-x  1 root root   5413 Dec 26 23:10 runpy.py
-rw-r--r--  1 root root   3965 Jan 12 18:15 runpy.pyc
-rw-r--r--  1 root root   5091 Dec 26 23:10 sched.py
-rw-r--r--  1 root root   4987 Jan 12 18:15 sched.pyc
-rw-r--r--  1 root root  19050 Dec 26 23:10 sets.py
-rw-r--r--  1 root root  16885 Jan 12 18:15 sets.pyc
-rw-r--r--  1 root root  17884 Dec 26 23:10 sgmllib.py
-rw-r--r--  1 root root  15504 Jan 12 18:15 sgmllib.pyc
-rw-r--r--  1 root root    445 Dec 26 23:10 sha.py
-rw-r--r--  1 root root    419 Jan 12 18:15 sha.pyc
-rw-r--r--  1 root root   8078 Dec 26 23:10 shelve.py
-rw-r--r--  1 root root  10242 Jan 12 18:15 shelve.pyc
-rw-r--r--  1 root root  11137 Dec 26 23:10 shlex.py
-rw-r--r--  1 root root   7684 Jan 12 18:15 shlex.pyc
-rw-r--r--  1 root root   8632 Dec 26 23:10 shutil.py
-rw-r--r--  1 root root   9519 Jan 12 18:15 shutil.pyc
-rw-r--r--  1 root root   9519 Jan 12 18:30 shutil.pyo
-rw-r--r--  1 root root   7341 Dec 26 23:10 SimpleHTTPServer.py
-rw-r--r--  1 root root   7648 Jan 12 18:15 SimpleHTTPServer.pyc
-rw-r--r--  1 root root  21906 Dec 26 23:10 SimpleXMLRPCServer.py
-rw-r--r--  1 root root  19541 Jan 12 18:15 SimpleXMLRPCServer.pyc
lrwxrwxrwx  1 root root     31 Jan 12 18:15 sitecustomize.py -> /etc/python2.6/sitecustomize.py
-rw-r--r--  1 root root    234 Jan 12 18:15 sitecustomize.pyc
-rw-r--r--  1 root root    234 Jan 12 18:30 sitecustomize.pyo
-rw-r--r--  1 root root  19139 Dec 26 23:10 site.py
-rw-r--r--  1 root root  18614 Jan 12 18:15 site.pyc
-rw-r--r--  1 root root  18599 Jan 12 18:30 site.pyo
-rwxr-xr-x  1 root root  18228 Dec 26 23:10 smtpd.py
-rw-r--r--  1 root root  15818 Jan 12 18:15 smtpd.pyc
-rwxr-xr-x  1 root root  30388 Dec 26 23:10 smtplib.py
-rw-r--r--  1 root root  29397 Jan 12 18:15 smtplib.pyc
-rw-r--r--  1 root root   5973 Dec 26 23:10 sndhdr.py
-rw-r--r--  1 root root   7386 Jan 12 18:15 sndhdr.pyc
-rw-r--r--  1 root root  19999 Dec 26 23:10 socket.py
-rw-r--r--  1 root root  15885 Jan 12 18:15 socket.pyc
-rw-r--r--  1 root root  15800 Jan 12 20:27 socket.pyo
-rw-r--r--  1 root root  22032 Dec 26 23:10 SocketServer.py
-rw-r--r--  1 root root  22638 Jan 12 18:15 SocketServer.pyc
drwxr-xr-x  2 root root   4096 Jan 12 18:15 sqlite3
-rw-r--r--  1 root root  16507 Dec 26 23:10 sre_compile.py
-rw-r--r--  1 root root  11455 Jan 12 18:15 sre_compile.pyc
-rw-r--r--  1 root root  11342 Jan 12 18:30 sre_compile.pyo
-rw-r--r--  1 root root   7137 Dec 26 23:10 sre_constants.py
-rw-r--r--  1 root root   6083 Jan 12 18:15 sre_constants.pyc
-rw-r--r--  1 root root   6083 Jan 12 18:30 sre_constants.pyo
-rw-r--r--  1 root root  26878 Dec 26 23:10 sre_parse.py
-rw-r--r--  1 root root  19622 Jan 12 18:15 sre_parse.pyc
-rw-r--r--  1 root root  19622 Jan 12 18:30 sre_parse.pyo
-rw-r--r--  1 root root    384 Dec 26 23:10 sre.py
-rw-r--r--  1 root root    517 Jan 12 18:15 sre.pyc
-rw-r--r--  1 root root  14670 Dec 26 23:10 ssl.py
-rw-r--r--  1 root root  13540 Jan 12 18:15 ssl.pyc
-rw-r--r--  1 root root   1718 Dec 26 23:10 stat.py
-rw-r--r--  1 root root   2683 Jan 12 18:15 stat.pyc
-rw-r--r--  1 root root   2683 Jan 12 18:30 stat.pyo
-rw-r--r--  1 root root    898 Dec 26 23:10 statvfs.py
-rw-r--r--  1 root root    618 Jan 12 18:15 statvfs.pyc
-rw-r--r--  1 root root  10621 Dec 26 23:10 StringIO.py
-rw-r--r--  1 root root  11494 Jan 12 18:15 StringIO.pyc
-rw-r--r--  1 root root  12449 Dec 26 23:10 stringold.py
-rw-r--r--  1 root root  12539 Jan 12 18:15 stringold.pyc
-rw-r--r--  1 root root  13522 Dec 26 23:10 stringprep.py
-rw-r--r--  1 root root  14486 Jan 12 18:15 stringprep.pyc
-rw-r--r--  1 root root  20745 Dec 26 23:10 string.py
-rw-r--r--  1 root root  19964 Jan 12 18:15 string.pyc
-rw-r--r--  1 root root  19964 Jan 12 18:30 string.pyo
-rw-r--r--  1 root root  19754 Dec 26 23:10 _strptime.py
-rw-r--r--  1 root root  14926 Jan 12 18:15 _strptime.pyc
-rw-r--r--  1 root root     82 Dec 26 23:10 struct.py
-rw-r--r--  1 root root    237 Jan 12 18:15 struct.pyc
-rw-r--r--  1 root root    237 Jan 12 18:30 struct.pyo
-rw-r--r--  1 root root  47433 Dec 26 23:10 subprocess.py
-rw-r--r--  1 root root  34904 Jan 12 18:15 subprocess.pyc
-rw-r--r--  1 root root  34904 Jan 12 18:30 subprocess.pyo
-rw-r--r--  1 root root   1399 Dec 26 23:10 sunaudio.py
-rw-r--r--  1 root root   1987 Jan 12 18:15 sunaudio.pyc
-rw-r--r--  1 root root  16537 Dec 26 23:10 sunau.py
-rw-r--r--  1 root root  17976 Jan 12 18:15 sunau.pyc
-rwxr-xr-x  1 root root   2046 Dec 26 23:10 symbol.py
-rw-r--r--  1 root root   3021 Jan 12 18:15 symbol.pyc
-rw-r--r--  1 root root   7911 Dec 26 23:10 symtable.py
-rw-r--r--  1 root root  12503 Jan 12 18:15 symtable.pyc
-rwxr-xr-x  1 root root  11335 Dec 26 23:10 tabnanny.py
-rw-r--r--  1 root root   8293 Jan 12 18:15 tabnanny.pyc
-rwxr-xr-x  1 root root  86867 Dec 26 23:10 tarfile.py
-rw-r--r--  1 root root  73191 Jan 12 18:15 tarfile.pyc
-rw-r--r--  1 root root  21808 Dec 26 23:10 telnetlib.py
-rw-r--r--  1 root root  19855 Jan 12 18:15 telnetlib.pyc
-rw-r--r--  1 root root  17774 Dec 26 23:10 tempfile.py
-rw-r--r--  1 root root  19463 Jan 12 18:15 tempfile.pyc
-rw-r--r--  1 root root  19463 Jan 12 18:30 tempfile.pyo
drwxr-xr-x  2 root root   4096 Jan 12 18:15 test
-rw-r--r--  1 root root  16889 Dec 26 23:10 textwrap.py
-rw-r--r--  1 root root  11766 Jan 12 18:15 textwrap.pyc
-rw-r--r--  1 root root  11674 Jan 12 18:30 textwrap.pyo
-rw-r--r--  1 root root   1002 Dec 26 23:10 this.py
-rw-r--r--  1 root root   1239 Jan 12 18:15 this.pyc
-rw-r--r--  1 root root   7114 Dec 26 23:10 _threading_local.py
-rw-r--r--  1 root root   6367 Jan 12 18:15 _threading_local.pyc
-rw-r--r--  1 root root  31808 Dec 26 23:10 threading.py
-rw-r--r--  1 root root  27956 Jan 12 18:15 threading.pyc
-rw-r--r--  1 root root  25884 Jan 12 18:30 threading.pyo
-rwxr-xr-x  1 root root  12025 Dec 26 23:10 timeit.py
-rw-r--r--  1 root root  11801 Jan 12 18:15 timeit.pyc
-rw-r--r--  1 root root   3142 Dec 26 23:10 toaiff.py
-rw-r--r--  1 root root   3126 Jan 12 18:15 toaiff.pyc
-rw-r--r--  1 root root  16326 Dec 26 23:10 tokenize.py
-rw-r--r--  1 root root  13986 Jan 12 18:15 tokenize.pyc
-rw-r--r--  1 root root  13893 Jan 12 18:30 tokenize.pyo
-rwxr-xr-x  1 root root   2943 Dec 26 23:10 token.py
-rw-r--r--  1 root root   3830 Jan 12 18:15 token.pyc
-rw-r--r--  1 root root   3830 Jan 12 18:30 token.pyo
-rw-r--r--  1 root root  11211 Dec 26 23:10 traceback.py
-rw-r--r--  1 root root  11637 Jan 12 18:15 traceback.pyc
-rw-r--r--  1 root root  11637 Jan 12 18:30 traceback.pyo
-rwxr-xr-x  1 root root  30347 Dec 26 23:10 trace.py
-rw-r--r--  1 root root  22989 Jan 12 18:15 trace.pyc
-rw-r--r--  1 root root    879 Dec 26 23:10 tty.py
-rw-r--r--  1 root root   1311 Jan 12 18:15 tty.pyc
-rw-r--r--  1 root root   2323 Dec 26 23:10 types.py
-rw-r--r--  1 root root   2608 Jan 12 18:15 types.pyc
-rw-r--r--  1 root root   2608 Jan 12 18:30 types.pyo
-rwxr-xr-x  1 root root  31179 Dec 26 23:10 unittest.py
-rw-r--r--  1 root root  34656 Jan 12 18:15 unittest.pyc
-rw-r--r--  1 root root  49853 Dec 26 23:10 urllib2.py
-rw-r--r--  1 root root  45130 Jan 12 18:15 urllib2.pyc
-rw-r--r--  1 root root  58148 Dec 26 23:10 urllib.py
-rw-r--r--  1 root root  50812 Jan 12 18:15 urllib.pyc
-rw-r--r--  1 root root  13618 Dec 26 23:10 urlparse.py
-rw-r--r--  1 root root  13432 Jan 12 18:15 urlparse.pyc
-rw-r--r--  1 root root   5778 Dec 26 23:10 UserDict.py
-rw-r--r--  1 root root   8802 Jan 12 18:15 UserDict.pyc
-rw-r--r--  1 root root   8802 Jan 12 18:30 UserDict.pyo
-rw-r--r--  1 root root   3644 Dec 26 23:10 UserList.py
-rw-r--r--  1 root root   6535 Jan 12 18:15 UserList.pyc
-rw-r--r--  1 root root   1627 Dec 26 23:10 user.py
-rw-r--r--  1 root root   1734 Jan 12 18:15 user.pyc
-rwxr-xr-x  1 root root   9687 Dec 26 23:10 UserString.py
-rw-r--r--  1 root root  14786 Jan 12 18:15 UserString.pyc
-rw-r--r--  1 root root  20944 Dec 26 23:10 uuid.py
-rw-r--r--  1 root root  21201 Jan 12 18:15 uuid.pyc
-rwxr-xr-x  1 root root   5938 Dec 26 23:10 uu.py
-rw-r--r--  1 root root   4227 Jan 12 18:15 uu.pyc
-rw-r--r--  1 root root  14172 Dec 26 23:10 warnings.py
-rw-r--r--  1 root root  12996 Jan 12 18:15 warnings.pyc
-rw-r--r--  1 root root  12149 Jan 12 18:30 warnings.pyo
-rw-r--r--  1 root root  17952 Dec 26 23:10 wave.py
-rw-r--r--  1 root root  19336 Jan 12 18:15 wave.pyc
-rw-r--r--  1 root root  10087 Dec 26 23:10 weakref.py
-rw-r--r--  1 root root  13277 Jan 12 18:15 weakref.pyc
-rw-r--r--  1 root root  13277 Jan 12 18:30 weakref.pyo
-rwxr-xr-x  1 root root  21354 Dec 26 23:10 webbrowser.py
-rw-r--r--  1 root root  18826 Jan 12 18:15 webbrowser.pyc
-rw-r--r--  1 root root   3353 Dec 26 23:10 whichdb.py
-rw-r--r--  1 root root   2243 Jan 12 18:15 whichdb.pyc
drwxr-xr-x  2 root root   4096 Jan 12 18:15 wsgiref
-rw-r--r--  1 root root    187 Dec 26 23:10 wsgiref.egg-info
-rw-r--r--  1 root root   5513 Dec 26 23:10 xdrlib.py
-rw-r--r--  1 root root   9079 Jan 12 18:15 xdrlib.pyc
drwxr-xr-x  6 root root   4096 Jan 12 18:30 xml
-rw-r--r--  1 root root  34865 Dec 26 23:10 xmllib.py
-rw-r--r--  1 root root  27166 Jan 12 18:15 xmllib.pyc
-rw-r--r--  1 root root  47775 Dec 26 23:10 xmlrpclib.py
-rw-r--r--  1 root root  41230 Jan 12 18:15 xmlrpclib.pyc
-rw-r--r--  1 root root  53092 Dec 26 23:10 zipfile.py
-rw-r--r--  1 root root  37546 Jan 12 18:15 zipfile.pyc

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Xen build - Debian vs Redhat layout patch options
  2011-01-21 17:29             ` Stefano Stabellini
@ 2011-01-21 18:40               ` Ian Jackson
  0 siblings, 0 replies; 49+ messages in thread
From: Ian Jackson @ 2011-01-21 18:40 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: Ian, Campbell, xen-devel, Bruce Edge, user virtual

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.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Xen build - Debian vs Redhat layout patch options
  2011-01-21 17:28             ` Bruce Edge
@ 2011-01-21 18:42               ` Ian Jackson
  2011-07-13 13:41                 ` User Virtual
  0 siblings, 1 reply; 49+ messages in thread
From: Ian Jackson @ 2011-01-21 18:42 UTC (permalink / raw)
  To: Bruce Edge; +Cc: xen-devel, user virtual, Stefano Stabellini

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 :-).

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm [and 1 more messages]
  2011-01-20 18:35                     ` chris
@ 2011-01-21 18:59                       ` Ian Jackson
  0 siblings, 0 replies; 49+ messages in thread
From: Ian Jackson @ 2011-01-21 18:59 UTC (permalink / raw)
  To: user virtual, chris
  Cc: Xen-Devel List, Bruce Edge, Ian Campbell, Stefano Stabellini,
	Xen-Users List

chris writes ("Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm"):
> I would be very willing to. Thanks

Having looked into this in more detail it would seem likely that you
are running into this bug:
  https://bugs.launchpad.net/ubuntu/+bug/362570

Can you please try running the build again but setting
   PYTHON_PREFIX_ARG=''
on the make command line or in the environment ?

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* RE: [Xen-users] Re: Re: xen-unstable: ImportError: No module named xen.xm
  2011-01-21 18:20                         ` [Xen-users] " Mike Viau
@ 2011-01-21 19:16                           ` Ian Jackson
  2011-01-26 14:51                           ` Re: [Xen-devel] " Ian Jackson
  1 sibling, 0 replies; 49+ messages in thread
From: Ian Jackson @ 2011-01-21 19:16 UTC (permalink / raw)
  To: Mike Viau; +Cc: xen-devel, xen-users

Mike Viau writes ("RE: [Xen-users] Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm"):
> -PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)"
> +PYTHON_PREFIX_ARG  ?= 
> +#PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)"
>  # The above requires that PREFIX contains *no spaces*. This variable is here
>  # to permit the user to set PYTHON_PREFIX_ARG to '' to workaround this bug:
>  #  https://bugs.launchpad.net/ubuntu/+bug/362570
...
> My resulting python path with when changing PYTHON_PREFIX_ARG was
> apparently /usr/local/lib/python2.6/dist-packages which I noticed
> was in your python's interpreter search path(s).

Thanks for investigating this.

> This is only a hack, as I am not sure if I bug has already been
> reported on the Debian BTS to fix the issue with python 2.6 onwards.

Launchpad has a facility to refer to Debian bugs, so if anyone has
submitted it to Debian they're probably not a Launchpad user.

I had a look in the Debian BTS myself and found no trace of it.  We
should certainly file a bug there, but this is probably best done when
we have figured out whether or not it's the same as the Ubuntu bug
mentioned in Config.mk.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* RE: Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm
  2011-01-21 18:20                         ` [Xen-users] " Mike Viau
  2011-01-21 19:16                           ` Ian Jackson
@ 2011-01-26 14:51                           ` Ian Jackson
  2011-01-26 17:32                             ` Mike Viau
  1 sibling, 1 reply; 49+ messages in thread
From: Ian Jackson @ 2011-01-26 14:51 UTC (permalink / raw)
  To: Mike Viau; +Cc: xen-devel, xen-users

Mike Viau writes ("RE: [Xen-users] Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm"):
> My resulting python path with when changing PYTHON_PREFIX_ARG was apparently /usr/local/lib/python2.6/dist-packages which I noticed was in your python's interpreter search path(s).

Can you tell me the version of python that you were using when you did
this test ?  I need the Debian package name and the Debian package
version, for the bug report.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 49+ messages in thread

* RE: Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm
  2011-01-26 14:51                           ` Re: [Xen-devel] " Ian Jackson
@ 2011-01-26 17:32                             ` Mike Viau
  0 siblings, 0 replies; 49+ messages in thread
From: Mike Viau @ 2011-01-26 17:32 UTC (permalink / raw)
  To: ian.jackson; +Cc: xen-devel, xen-users


[-- Attachment #1.1: Type: text/plain, Size: 894 bytes --]


> On Wed, 26 Jan 2011 14:51:19 +0000 <Ian.Jackson@eu.citrix.com> wrote:
> 
> > Mike Viau writes ("RE: [Xen-users] Re: [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm"):
> > My resulting python path with when changing PYTHON_PREFIX_ARG was apparently /usr/local/lib/python2.6/dist-packages which I noticed was in your python's interpreter search path(s).
> 
> Can you tell me the version of python that you were using when you did
> this test ?  I need the Debian package name and the Debian package
> version, for the bug report.
> 


Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)


apt-cache policy python
python:
  Installed: 2.6.6-3+squeeze5
  Candidate: 2.6.6-3+squeeze5
  Version table:
 *** 2.6.6-3+squeeze5 0
        500 http://mirror.csclub.uwaterloo.ca/debian/ squeeze/main amd64 Packages
        100 /var/lib/dpkg/status



 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 1270 bytes --]

[-- Attachment #2: Type: text/plain, Size: 137 bytes --]

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: Xen build - Debian vs Redhat layout patch options
  2011-01-21 18:42               ` Ian Jackson
@ 2011-07-13 13:41                 ` User Virtual
  0 siblings, 0 replies; 49+ messages in thread
From: User Virtual @ 2011-07-13 13:41 UTC (permalink / raw)
  To: xen-devel

Ian Jackson <Ian.Jackson <at> eu.citrix.com> writes:

> 
> Bruce Edge writes ("Re: [Xen-devel] Xen build - Debian vs Redhat layout patch
options"):
...
> 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

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2011-07-13 13:41 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-07  0:07 Xen build - Debian vs Redhat layout patch options Bruce Edge
2010-07-07 11:19 ` Stefano Stabellini
2010-09-13 23:53   ` [patch] " Bruce Edge
2010-09-14  0:23     ` Mike Viau
2010-09-14  6:45     ` Sander Eikelenboom
2010-09-14 14:18       ` Bruce Edge
2010-09-14 14:31     ` Olaf Hering
2010-09-14 17:05     ` Ian Jackson
2010-09-14 17:13       ` Bruce Edge
2010-09-14 18:56       ` Bruce Edge
2010-09-15 10:03         ` Ian Jackson
2010-09-15 16:06           ` Bruce Edge
2010-09-15 16:16             ` Olaf Hering
2010-09-16 16:29             ` Ian Jackson
2010-09-16 18:52               ` Bruce Edge
2010-09-16 20:45                 ` Olaf Hering
2010-09-16 20:56                   ` Bruce Edge
2010-09-16 20:59                     ` Olaf Hering
2010-09-16 21:02                       ` Bruce Edge
2010-09-17 16:11                         ` Ian Jackson
2010-09-17 17:05                           ` Bruce Edge
2010-09-17 17:52                             ` Ian Jackson
2010-09-17 18:13                               ` Bruce Edge
2010-09-16 20:24               ` Dan Magenheimer
2010-09-16 20:34                 ` Dan Magenheimer
2010-09-17 15:01               ` [patch] Xen build - Debian vs Redhat layout patch options [and 1 more messages] Ian Jackson
     [not found]   ` <AANLkTim48T7Y3Pq0_nS1zZ5jWH_kXrS8JceWLf-yUOM6@mail.gmail.com>
2011-01-04 21:09     ` Xen build - Debian vs Redhat layout patch options user virtual
2011-01-06 15:02       ` Stefano Stabellini
2011-01-11 17:37       ` Ian Jackson
2011-01-20 13:45         ` user virtual
     [not found]           ` <AANLkTimCA_T1QsfCVfABtW8776Mkg3toBtmHYHgea56=@mail.gmail.com>
2011-01-19 22:34             ` xen-unstable: ImportError: No module named xen.xm chris
2011-01-20  8:38               ` Ian Campbell
2011-01-20 16:49                 ` [Xen-devel] " chris
2011-01-20 16:54                   ` Ian Campbell
2011-01-20 17:23                     ` chris
2011-01-20 17:38                       ` Ian Campbell
2011-01-21 18:20                         ` [Xen-users] " Mike Viau
2011-01-21 19:16                           ` Ian Jackson
2011-01-26 14:51                           ` Re: [Xen-devel] " Ian Jackson
2011-01-26 17:32                             ` Mike Viau
     [not found]                 ` <m2n.s.1PfxnK-153952@chiark.greenend.org.uk>
2011-01-20 18:19                   ` Ian Jackson
2011-01-20 18:35                     ` chris
2011-01-21 18:59                       ` [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm [and 1 more messages] Ian Jackson
2011-01-21 15:30           ` Xen build - Debian vs Redhat layout patch options user virtual
2011-01-21 17:28             ` Bruce Edge
2011-01-21 18:42               ` Ian Jackson
2011-07-13 13:41                 ` User Virtual
2011-01-21 17:29             ` Stefano Stabellini
2011-01-21 18:40               ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.