WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Xen build - Debian vs Redhat layout patch options

On Tue, 4 Jan 2011, user virtual wrote:
> Hi Stefano
> 
> I was encouraged by Bruce to forward my patches upstream to make Xen sources 
> buildable from debian makefile debian/rules
> and for debian based target systems.
> 

We always welcome good patches, thanks!
Could you please port your patches to xen-unstable?
We usually don't apply new patches to the stable trees directly.
Unfortunately we made many changes to the init scripts in xen-unstable so
porting the patches might not be straightforward.

I'll post some comments inline.


> I tried to make my 3 of 4 (5) patches to xen40-testing.hg as non intrusive as 
> possible
> 
> - backport-StdGNU.mk.diff  (from xen-devel, already here)
> - debian-sysconfig-default.diff  (conditional Makefile expansion)
> Description: Adapt init.d and sysconfig files to Debian based systems
>  An attempt to assess that the build is to be made for Debian
>  based systems. Based on the assessment adapt init.d and sysconfig
>  files
>    * Config.mk: DEBIANBASE - guess if the target system is debian based
>    * tools/hotplug/Linux/Makefile: target install-initd: if DEBIANBASE=y
>      - use /etc/default instead for /etc/sysconfig as destination folder
>      - replace references of /etc/sysconfig for /etc/default in init.d-files
> Author: User Virtual <virtualusr@xxxxxxxxx>
> Origin: http://virtualusr.wordpress.com
> Index: xen-4.0-4.0.1/Config.mk
> ===================================================================
> --- xen-4.0-4.0.1.orig/Config.mk      2010-08-25 10:22:42.000000000 +0200
> +++ xen-4.0-4.0.1/Config.mk   2011-01-04 19:08:17.816312723 +0100
> @@ -185,5 +185,6 @@
>  PYTHON_TOOLS       ?= y
>  CONFIG_MINITERM    ?= n
>  CONFIG_LOMOUNT     ?= n
> +DEBIANBASE         ?= $(shell test ! -d /etc/sysconfig && test -d 
> /etc/default && echo y || echo n)
>  
>  -include $(XEN_ROOT)/.config
> Index: xen-4.0-4.0.1/tools/hotplug/Linux/Makefile
> ===================================================================
> --- xen-4.0-4.0.1.orig/tools/hotplug/Linux/Makefile   2010-08-25 
> 10:22:42.000000000 +0200
> +++ xen-4.0-4.0.1/tools/hotplug/Linux/Makefile        2011-01-04 
> 19:08:17.816312723 +0100
> @@ -59,14 +59,22 @@
>  .PHONY: install
>  install: all install-initd install-scripts $(HOTPLUGS)
>  
> +SYSCONF_DIR = $(if $(filter y,$(DEBIANBASE)),default,sysconfig)
>  .PHONY: install-initd
>  install-initd:
>       [ -d $(DESTDIR)$(CONFIG_DIR)/init.d ] || $(INSTALL_DIR) 
> $(DESTDIR)$(CONFIG_DIR)/init.d
> -     [ -d $(DESTDIR)$(CONFIG_DIR)/sysconfig ] || $(INSTALL_DIR) 
> $(DESTDIR)$(CONFIG_DIR)/sysconfig
> +     [ -d $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR) ] || $(INSTALL_DIR) 
> $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR)
>       $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
> -     $(INSTALL_PROG) $(XEND_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xend
> +     $(INSTALL_PROG) $(XEND_SYSCONFIG) 
> $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR)/xend
>       $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
> -     $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) 
> $(DESTDIR)$(CONFIG_DIR)/sysconfig/xendomains
> +     $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) 
> $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR)/xendomains
> +ifeq ($(DEBIANBASE),y)
> +     set -e; for i in $(DESTDIR)$(CONFIG_DIR)/$(XEND_INITD) 
> $(DESTDIR)$(CONFIG_DIR)/$(XENDOMAINS_INITD) ; do \
> +         cp -a $$i $$i.tmp ; cp /dev/null $$i ; \
> +         sed -e 's|/etc/sysconfig\b|/etc/default|g' $$i.tmp >> $$i ; \
> +         rm -f $$i.tmp ; \
> +     done
> +endif
>  

Using sed on the init scripts is not the right way of doing it.
On xen-unstable we have a new init script called xencommons
(tools/hotplug/Linux/init.d/xencommons), if you open it you'll see that
we already check for the presence of /etc/sysconfig or /etc/default and
act accordingly. Something equivalent has been introduced to the
xendomains script too.
Thus I hope that on xen-unstable running sed on the init scripts is not
required anymore.


>  .PHONY: install-scripts
>  install-scripts:
> 
> - tools-blktap2-libs.patch   (from debian Xen-4.0 sources)
> - debian-python-2.6.diff  (conditional Makefile expansion)
> - debian-stubdom.Makefile.diff  (conditional Makefile expansion)

Could you please explain why is this needed?

 
> PS: I find the last xend.patch useful here if init.d/xend is run before xenfs 
> kernel module is loaded. Mount attempt
> autoloads the module. Otherwise mount is never attempted. Is it ok to load 
> xenfs module so late in the boot process? If
> so, the last patch might also be interesting for upload, right?

I believe we fixed this issue on xen-unstable moving the xenfs mount
request in the xencommons script and removing the check for xenfs in
/proc/filesystems.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel