From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Edge Subject: Re: [patch] Xen build - Debian vs Redhat layout patch options Date: Tue, 14 Sep 2010 11:56:13 -0700 Message-ID: References: <19599.43888.826450.690087@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <19599.43888.826450.690087@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Tue, Sep 14, 2010 at 10:05 AM, Ian Jackson w= rote: > 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 distribution= s. >> These are /etc/sysconfig, and /var/subsys. >> Debian uses /etc/default and /var for these respectively. > > Thanks for this contribution. =A0I 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. =A0What's wrong > with simply setting SYSCONFIG_DIR ? =A0Perhaps SYSCONFIG_DIR needs to be > defined with "?=3D" rather than "=3D" ? In order to honor the $PREFIX setting, $SYSCONFIG_DIR has to depend on $PRE= FIX: ifeq ($(PREFIX),/usr) CONFIG_DIR =3D /etc else CONFIG_DIR =3D $(PREFIX)/etc endif SYSCONFIG_DIR =3D $(CONFIG_DIR)/$(XEN_CONFIG_ARCH) So using ?=3D 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. =A0ARCH is for CPU architectures. What's a good word to differentiate bewteen debian/red hat distros? DISTRO_TYPE=3D 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. > >> =A0Creating network initscripts >> =A0---------------------------- >> >> -In the /etc/sysconfig/network-scripts directory it is necccessary to cr= eate >> +In the /network-scripts directory it is necccessary to creat= e >> =A02 config files. The first (ifcfg-eth0) defines your physical network = interface, >> =A0and 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. > >> =A0if [ -f /etc/sysconfig/xenballoon.conf ]; then >> =A0 =A0 =A0 =A0 . /etc/sysconfig/xenballoon.conf >> +else >> + =A0 =A0 =A0 if [ -f /etc/default/xenballoon.conf ]; then > > Use elif ? :-) > >> +if [ -d /etc/sysconfig ]; then >> + =A0 =A0 =A0 LOCKFILE=3D/var/lock/subsys/xendomains >> + =A0 =A0 =A0 XENDOM_CONFIG=3D/etc/sysconfig/xendomains >> +else >> + =A0 =A0 =A0 LOCKFILE=3D/var/lock/xendomains >> + =A0 =A0 =A0 XENDOM_CONFIG=3D/etc/default/xendomains >> +fi > > I don't think this is correct. =A0You 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. >