xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: xen-devel@lists.xenproject.org
Cc: "Luis R. Rodriguez" <mcgrof@suse.com>
Subject: [PATCH v5 13/14] xencommons: move module list into a generic place
Date: Tue, 20 May 2014 05:31:34 -0700	[thread overview]
Message-ID: <1400589095-3872-14-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1400589095-3872-1-git-send-email-mcgrof@do-not-panic.com>

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

Please run ./autgen.sh after this patch is applied.

 README                                             | 18 +++++++++++
 config/modules                                     | 16 ++++++++++
 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} (88%)

diff --git a/README b/README
index 4183b34..480a829 100644
--- a/README
+++ b/README
@@ -179,6 +179,24 @@ generated at build time after running ./configure.
 [1] http://wiki.xen.org/wiki/XenStoreReference
 [2] http://wiki.xen.org/wiki/Xenstored
 
+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:
+
+  * 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:
+
+http://wiki.xen.org/wiki/Category:Host_Configuration#Linux_kernel_modules
+
 Python Runtime Libraries
 ========================
 
diff --git a/config/modules b/config/modules
new file mode 100644
index 0000000..525c60e
--- /dev/null
+++ b/config/modules
@@ -0,0 +1,16 @@
+xen-evtchn
+xen-gntdev
+xen-gntalloc
+xen-blkback
+xen-netback
+xen-pciback
+evtchn
+gntdev
+netbk
+blkbk
+xen-scsibk
+usbbk
+pciback
+xen-acpi-processor
+# Prefer to load blktap2 if found, otherwise load blktap
+blktap2|blktap
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						;\
+		done							\
+	) > $@
+	@rm -f $(XENCOMMONS_INITD).modules
 
 .PHONY: build
-build:
+build: all
 
 .PHONY: install
 install: all install-initd install-scripts install-udev
 
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
-install-initd:
+install-initd: all
 	[ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
 	[ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
 	[ -d $(DESTDIR)$(LIBEXEC) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)
@@ -55,7 +83,7 @@ install-initd:
 	$(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR)
 
 .PHONY: install-scripts
-install-scripts:
+install-scripts: all
 	[ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
 		$(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
 	set -e; for i in $(XEN_SCRIPTS); \
diff --git a/tools/hotplug/Linux/init.d/xencommons b/tools/hotplug/Linux/init.d/xencommons.in
similarity index 88%
rename from tools/hotplug/Linux/init.d/xencommons
rename to tools/hotplug/Linux/init.d/xencommons.in
index 2bb6f26..a0484a0 100644
--- a/tools/hotplug/Linux/init.d/xencommons
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -57,21 +57,7 @@ do_start () {
         local time=0
 	local timeout=30
 
-	modprobe xen-evtchn 2>/dev/null
-	modprobe xen-gntdev 2>/dev/null
-	modprobe xen-gntalloc 2>/dev/null
-	modprobe xen-blkback 2>/dev/null
-	modprobe xen-netback 2>/dev/null
-	modprobe xen-pciback 2>/dev/null
-	modprobe evtchn 2>/dev/null
-	modprobe gntdev 2>/dev/null
-	modprobe netbk 2>/dev/null
-	modprobe blkbk 2>/dev/null
-	modprobe xen-scsibk 2>/dev/null
-	modprobe usbbk 2>/dev/null
-	modprobe pciback 2>/dev/null
-	modprobe xen-acpi-processor 2>/dev/null
-	modprobe blktap2 2>/dev/null || modprobe blktap 2>/dev/null
+	@LOAD_MODULES@
 	mkdir -p /var/run/xen
 
 	if ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1`
-- 
2.0.0.rc3.18.g00a5b79

  parent reply	other threads:[~2014-05-20 12:32 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 12:31 [PATCH v5 00/14] xen: add systemd support Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 01/14] xenstored: enable usage of config.h on both xenstored and oxenstored Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 02/14] libxenstore.so: add support for systemd Luis R. Rodriguez
2014-05-21 14:35   ` Ian Campbell
2014-05-21 14:56     ` Ian Campbell
2014-05-21 16:32       ` Luis R. Rodriguez
2014-05-21 16:48         ` Ian Campbell
2014-05-21 17:15           ` Luis R. Rodriguez
2014-05-22  9:36             ` Ian Campbell
2014-05-22  9:59               ` Luis R. Rodriguez
2014-05-21 16:24     ` Luis R. Rodriguez
2014-05-21 16:39       ` Ian Campbell
2014-05-21 17:29         ` Luis R. Rodriguez
2014-05-22  9:39           ` Ian Campbell
2014-05-22 10:01             ` Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 03/14] cxenstored: add support for systemd active sockets Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 04/14] oxenstored: " Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 05/14] oxenstored: force FD_CLOEXEC with Unix.set_close_on_exec on LSB init Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 06/14] tools/xendomains: make xl the default Luis R. Rodriguez
2014-05-21 15:05   ` Ian Campbell
2014-05-21 17:29     ` Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 07/14] tools/xendomains: do space cleanups Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 08/14] tools/xendomains: move to libexec and use a smaller init helper Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 09/14] autoconf: xen: force a refresh with autoconf Luis R. Rodriguez
2014-05-21 15:07   ` Ian Campbell
2014-05-21 17:35     ` Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 10/14] autoconf: update m4/pkg.m4 Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 11/14] autoconf: xen: move standard variables to a generic place Luis R. Rodriguez
2014-05-20 13:37   ` Jan Beulich
     [not found]   ` <537B76D1020000780001422C@suse.com>
2014-05-20 17:54     ` Luis R. Rodriguez
2014-05-21  7:32       ` Jan Beulich
2014-05-21  8:03         ` Luis R. Rodriguez
2014-05-21  8:11           ` Jan Beulich
2014-05-21  8:27             ` Luis R. Rodriguez
2014-05-21 10:33             ` Ian Campbell
2014-05-21 13:54               ` Jan Beulich
2014-05-21 15:14               ` Ian Campbell
2014-05-21 15:20                 ` Jan Beulich
2014-05-21 15:26   ` Ian Campbell
2014-05-21 21:54     ` Luis R. Rodriguez
2014-05-22  9:46       ` Ian Campbell
2014-05-20 12:31 ` [PATCH v5 12/14] autoconf: xen: enable explicit preference option for xenstored preference Luis R. Rodriguez
2014-05-21 15:44   ` Ian Campbell
2014-05-21 23:02     ` Luis R. Rodriguez
2014-05-22 10:05       ` Ian Campbell
2014-05-23 23:20         ` Luis R. Rodriguez
2014-05-28  9:30           ` Ian Campbell
2014-05-29 16:09             ` Don Koch
2014-05-29 23:29             ` Luis R. Rodriguez
     [not found]             ` <20140529232918.GG26450@wotan.suse.de>
2014-06-01  6:15               ` [systemd-devel] " Lennart Poettering
     [not found]               ` <20140601061547.GC16257@tango.0pointer.de>
2014-06-05  0:31                 ` Luis R. Rodriguez
     [not found]                 ` <20140605003103.GB22052@wotan.suse.de>
2014-06-05  2:52                   ` Cameron Norman
2014-06-05 11:22                   ` Lennart Poettering
     [not found]                   ` <20140605112213.GA17673@tango.0pointer.de>
2014-06-05 18:01                     ` Luis R. Rodriguez
     [not found]                     ` <20140605180137.GD22052@wotan.suse.de>
2014-06-05 19:24                       ` Lennart Poettering
     [not found]                       ` <20140605192421.GA6248@tango.0pointer.de>
2014-06-05 19:26                         ` Andrew Lutomirski
     [not found]                   ` <CALZWFR+LQ3XK4RQ335CNqjr8zucWw4GieKwZS3N5m0w4yJXuBA@mail.gmail.com>
2014-06-10  1:15                     ` Luis R. Rodriguez
2014-05-20 12:31 ` Luis R. Rodriguez [this message]
2014-05-20 13:40   ` [PATCH v5 13/14] xencommons: move module list into a generic place Jan Beulich
     [not found]   ` <537B776D020000780001425E@suse.com>
2014-05-20 18:03     ` Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 14/14] systemd: add xen systemd service and module files Luis R. Rodriguez
2014-05-20 12:48   ` Luis R. Rodriguez

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=1400589095-3872-14-git-send-email-mcgrof@do-not-panic.com \
    --to=mcgrof@do-not-panic.com \
    --cc=mcgrof@suse.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).