xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@suse.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	"Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Subject: Re: [PATCH v6 11/13] xencommons: move module list into	a generic place
Date: Wed, 2 Jul 2014 23:56:19 +0200	[thread overview]
Message-ID: <20140702215619.GA27687@wotan.suse.de> (raw)
In-Reply-To: <1404308643.5562.90.camel@kazak.uk.xensource.com>

On Wed, Jul 02, 2014 at 02:44:03PM +0100, Ian Campbell wrote:
> On Thu, 2014-06-12 at 18:18 -0700, Luis R. Rodriguez wrote:
> > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > 
> > This will allows us to share the same module list with
> > sysemd, and lets us upkeep it in one place. Document this
> > while at it on the top level README and expand on the wiki:
> > 
> > http://wiki.xen.org/wiki/Category:Host_Configuration#Linux_kernel_modules
> > 
> > In order to upkeep parallelism builds be explicit about the
> > requirement to complete all actions before any installation
> > targets.
> > 
> > Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> > ---
> >  README                                             | 18 +++++++++++
> >  config/modules                                     | 16 ++++++++++
> 
> This list is Linux specific. If tools/hotplug/Linux/config or something
> doesn't work for the upcoming system patches then perhaps
> config/Linux.modules, where Linux is chosen to match $(XEN_OS) aka
> "uname -s".

Moved to config/Linux.modules, and made the Makefile use $(XEN_OS).

> >  tools/hotplug/Linux/Makefile                       | 36 +++++++++++++++++++---
> >  .../Linux/init.d/{xencommons => xencommons.in}     | 16 +---------
> >  4 files changed, 67 insertions(+), 19 deletions(-)
> >  create mode 100644 config/modules
> >  rename tools/hotplug/Linux/init.d/{xencommons => xencommons.in} (89%)
> > 
> > diff --git a/README b/README
> > index 9bbe734..34d7c0b 100644
> > --- a/README
> > +++ b/README
> > @@ -129,6 +129,24 @@ performed with root privileges.]
> >     versions of those scripts, so that you can copy the dist directory
> >     to another machine and install from that distribution.
> >  
> > +Required Linux modules
> > +======================
> > +
> > +Xen has a set of Linux modules which the init scripts ensure to load before
> > +enablement of xen guests. The list of modules are upkept in one place:
> 
> enablement isn't a word. I think "before starting Xen guests" is OK.
> 
> upkept also isn't, "maintained" perhaps.

Amended.

> 
> Also, end users don't care a jot about any of this. Move it right to the
> end of the README? At the moment it comes before the Python stuff which
> is end user focused.

Moved to the bottom.

> TBH if it were me I'd just put the "The file supports a simple.." as a
> comment in config/modules (wherever it ends up) and leave it at that.

Put as a comment on the config OS Linux file.

> > +  * config/modules
> > +
> > +The file supports a simple language, comments are ignored, and if you there
> > +are module replacements this can be listed by using a pipe to show preference
> > +for the first module, followed by the older module.
> > +
> > +We should strive to not require statically loading modules but it seems some
> > +systems have had issues with automatically loading some Linux kernel modules.
> > +For more details refer to:
> 
> This last paragraph is just meta commentary, IMHO it is commit log
> material (at best) rather than README material.

Nuked.

> > +http://wiki.xen.org/wiki/Category:Host_Configuration#Linux_kernel_modules
> > +
> >  Python Runtime Libraries
> >  ========================
> >  
> > diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
> > index d5de9e6..90b0b0c 100644
> > --- a/tools/hotplug/Linux/Makefile
> > +++ b/tools/hotplug/Linux/Makefile
> > @@ -33,17 +33,45 @@ UDEV_RULES_DIR = $(CONFIG_DIR)/udev
> >  UDEV_RULES = xen-backend.rules $(UDEV_RULES-y)
> >  
> >  .PHONY: all
> > -all:
> > +all: $(XENCOMMONS_INITD)
> > +
> > +$(XENCOMMONS_INITD): $(XEN_ROOT)/config/modules $(XENCOMMONS_INITD).in
> > +	@set -e ;							\
> > +	IFS=''								;\
> > +	cat  $(XEN_ROOT)/config/modules	| (				\
> > +		while read l ; do					\
> > +			if echo $${l} | egrep -q "^#" ; then		\
> > +				continue				;\
> > +			fi						;\
> > +			if echo "$${l}" | egrep -q "\|" ; then		\
> > +				m1=$${l%%|*}				;\
> > +				m2=$${l#*|} 				;\
> > +				echo "        modprobe $$m1 2>/dev/null || modprobe $$m2 2>/dev/null" ;\
> > +			else						\
> > +				echo "        modprobe $$l 2>/dev/null"		;\
> > +			fi						;\
> > +		done							\
> > +	) > $(XENCOMMONS_INITD).modules					;\
> > +	cat  $(XENCOMMONS_INITD).in	| (				\
> > +		while read l ; do					\
> > +			if echo "$${l}" | egrep -q "@LOAD_MODULES@" ; then \
> > +				cat $(XENCOMMONS_INITD).modules 	;\
> > +			else						\
> > +				echo $$l				;\
> > +			fi						;\
> 
> Sed with something like "/@LOAD_MODULES@/r$(...).modules" can replace
> this second loop.

I gave this a few minues minutes but couldn't figure it out, surely this can be
an evolution after ? Below is what I tried.

  Luis

diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 90b0b0c..f652451 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -35,10 +35,10 @@ UDEV_RULES = xen-backend.rules $(UDEV_RULES-y)
 .PHONY: all
 all: $(XENCOMMONS_INITD)
 
-$(XENCOMMONS_INITD): $(XEN_ROOT)/config/modules $(XENCOMMONS_INITD).in
+$(XENCOMMONS_INITD): $(XEN_ROOT)/config/$(XEN_OS).modules $(XENCOMMONS_INITD).in
 	@set -e ;							\
 	IFS=''								;\
-	cat  $(XEN_ROOT)/config/modules	| (				\
+	cat  $(XEN_ROOT)/config/$(XEN_OS).modules	| (		\
 		while read l ; do					\
 			if echo $${l} | egrep -q "^#" ; then		\
 				continue				;\
@@ -52,15 +52,12 @@ $(XENCOMMONS_INITD): $(XEN_ROOT)/config/modules $(XENCOMMONS_INITD).in
 			fi						;\
 		done							\
 	) > $(XENCOMMONS_INITD).modules					;\
-	cat  $(XENCOMMONS_INITD).in	| (				\
-		while read l ; do					\
-			if echo "$${l}" | egrep -q "@LOAD_MODULES@" ; then \
-				cat $(XENCOMMONS_INITD).modules 	;\
-			else						\
-				echo $$l				;\
-			fi						;\
-		done							\
-	) > $@
+	cat $(XENCOMMONS_INITD).in | ( 					\
+			sed -e '/@LOAD_MODULES@/ {			\
+				r $(XENCOMMONS_INITD).modules		\
+				d					\
+			}' 						\
+	) > $@								;\
 	@rm -f $(XENCOMMONS_INITD).modules
 
 .PHONY: build

  reply	other threads:[~2014-07-02 21:56 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13  1:18 [PATCH v6 00/13] xen: add systemd support Luis R. Rodriguez
2014-06-13  1:18 ` [PATCH v6 01/13] xenstored: enable usage of config.h on both xenstored and oxenstored Luis R. Rodriguez
2014-06-13  1:18 ` [PATCH v6 02/13] cxenstored: add support for systemd active sockets Luis R. Rodriguez
2014-07-02 13:02   ` Ian Campbell
2014-07-02 19:00     ` Luis R. Rodriguez
2014-07-03  9:13       ` Ian Campbell
2014-07-03 17:06         ` Luis R. Rodriguez
2014-07-04 14:32           ` Ian Campbell
2014-07-08  3:08             ` Luis R. Rodriguez
2014-07-17 19:45           ` Luis R. Rodriguez
2014-07-17 20:16             ` Dave Scott
2014-07-17 23:13               ` Luis R. Rodriguez
2014-07-18  9:27                 ` Anil Madhavapeddy
2014-06-13  1:18 ` [PATCH v6 03/13] oxenstored: " Luis R. Rodriguez
2014-07-02 13:08   ` Ian Campbell
2014-07-02 19:09     ` Luis R. Rodriguez
2014-07-03  8:42       ` Dave Scott
2014-07-03 17:43         ` Luis R. Rodriguez
2014-06-13  1:18 ` [PATCH v6 04/13] oxenstored: force FD_CLOEXEC with Unix.set_close_on_exec on LSB init Luis R. Rodriguez
2014-07-02 13:08   ` Ian Campbell
2014-06-13  1:18 ` [PATCH v6 05/13] tools/xendomains: make xl the default and remove xm usage Luis R. Rodriguez
2014-06-13  1:18 ` [PATCH v6 06/13] tools/xendomains: do space cleanups Luis R. Rodriguez
2014-06-13  1:18 ` [PATCH v6 07/13] tools/xendomains: move to libexec and use a smaller init helper Luis R. Rodriguez
2014-06-13  7:06   ` Jacek Konieczny
2014-06-13 18:32     ` Luis R. Rodriguez
2014-07-02 13:12   ` Ian Campbell
2014-06-13  1:18 ` [PATCH v6 08/13] autoconf: xen: force a refresh with autoconf Luis R. Rodriguez
2014-06-13  1:18 ` [PATCH v6 09/13] autoconf: update m4/pkg.m4 Luis R. Rodriguez
2014-07-02 13:13   ` Ian Campbell
2014-07-02 19:10     ` Luis R. Rodriguez
2014-06-13  1:18 ` [PATCH v6 10/13] autoconf: xen: move standard path variables to config/Paths.mk.in Luis R. Rodriguez
2014-07-02 13:34   ` Ian Campbell
2014-07-02 19:32     ` Luis R. Rodriguez
2014-07-03  9:15       ` Ian Campbell
2014-07-03 18:30         ` Luis R. Rodriguez
2014-07-04 14:33           ` Ian Campbell
2014-07-08 18:41             ` Luis R. Rodriguez
2014-07-08 18:53               ` Luis R. Rodriguez
2014-07-10 16:18                 ` Ian Campbell
2014-07-14 23:41                   ` Luis R. Rodriguez
2014-07-03 18:53     ` Luis R. Rodriguez
2014-07-04 14:36       ` Ian Campbell
2014-07-08 18:52         ` Luis R. Rodriguez
2014-07-10 16:16           ` Ian Campbell
2014-07-14 23:42             ` Luis R. Rodriguez
2014-06-13  1:18 ` [PATCH v6 11/13] xencommons: move module list into a generic place Luis R. Rodriguez
2014-07-02 13:44   ` Ian Campbell
2014-07-02 21:56     ` Luis R. Rodriguez [this message]
2014-07-03  9:15       ` Ian Campbell
2014-06-13  1:18 ` [PATCH v6 12/13] autoconf: xen: enable explicit preference option for xenstored preference Luis R. Rodriguez
2014-07-02 13:54   ` Ian Campbell
2014-07-02 20:09     ` Luis R. Rodriguez
2014-07-03  9:20       ` Ian Campbell
2014-07-03 18:57         ` Luis R. Rodriguez
2014-07-04 14:37           ` Ian Campbell
2014-07-08 18:54             ` Luis R. Rodriguez
2014-06-13  1:18 ` [PATCH v6 13/13] systemd: add xen systemd service and module files Luis R. Rodriguez
2014-06-13 19:55   ` Luis R. Rodriguez
2014-06-19 19:47   ` Bastian Blank
2014-06-19 20:21     ` Luis R. Rodriguez
2014-06-19 20:26       ` Luis R. Rodriguez
2014-06-20  5:59         ` David Sutton
2014-07-02 14:02   ` Ian Campbell
2014-07-02 20:25     ` Luis R. Rodriguez
2014-06-19 19:03 ` [PATCH v6 00/13] xen: add systemd support Luis R. Rodriguez
2014-07-02 14:48 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140702215619.GA27687@wotan.suse.de \
    --to=mcgrof@suse.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=mcgrof@do-not-panic.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).