]> xenbits.xensource.com Git - xen.git/commitdiff
Add configure --with-linux-backend-modules="mod1 mod2"
authorOlaf Hering <olaf@aepfle.de>
Wed, 1 Oct 2014 16:41:21 +0000 (18:41 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 6 Oct 2014 16:00:22 +0000 (17:00 +0100)
This replaces config/Linux.modules with a configure option. As a result
of this change only a single xencomons.in is required, instead of a
xencomons.in.in and sed hackery.

After this change blktap2 and blktap will be loaded at the same time.
This is already done in out-of-tree xencommons scripts, and systemd will
load both modules as well. No harm is expected by loading both modules.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

README
config/Linux.modules [deleted file]
config/Tools.mk.in
tools/configure
tools/configure.ac
tools/hotplug/Linux/Makefile
tools/hotplug/Linux/init.d/xencommons.in [new file with mode: 0644]
tools/hotplug/Linux/init.d/xencommons.in.in [deleted file]
tools/hotplug/Linux/systemd/Makefile
tools/hotplug/Linux/update-modules.sh [deleted file]

diff --git a/README b/README
index 78c5db24e596c4b2bb8ec261a7cf8d4d1dea4a00..e86064425d0ac54b542b8d195fb44dd3e4ce43b7 100644 (file)
--- a/README
+++ b/README
@@ -235,15 +235,3 @@ There are optional targets as part of Xen's top-level makefile that will
 download and build tboot: install-tboot, build-tboot, dist-tboot, clean-tboot.
 These will download the latest tar file from the SourceForge site using wget,
 then build/install/dist according to Xen's settings.
-
-Required Kernel modules
-======================
-
-Xen has a set of Kernel modules which the init scripts ensure to load before
-before starting Xen guests. The list of modules are maintained in one place:
-
-  * config/$(XEN_OS).modules
-
-For more details refer to:
-
-http://wiki.xen.org/wiki/Category:Host_Configuration#Kernel_modules
diff --git a/config/Linux.modules b/config/Linux.modules
deleted file mode 100644 (file)
index 8a764df..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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.
-
-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
index 7183c32679074b80ae887e8a29a32c4d77d71c9d..bf437f6eb873326ad1dc7e7c69b19cb1173374d2 100644 (file)
@@ -74,6 +74,8 @@ SYSTEMD_LIBS        := @SYSTEMD_LIBS@
 XEN_SYSTEMD_DIR     := @SYSTEMD_DIR@
 XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@
 
+LINUX_BACKEND_MODULES := @LINUX_BACKEND_MODULES@
+
 #System options
 ZLIB                := @zlib@
 CONFIG_LIBICONV     := @libiconv@
index 8ce29aab711bf1fe3665ad28098e04c3c2ae3ea1..831ac6378a7829d07c90d65e1970290c4f55a9fc 100755 (executable)
@@ -699,6 +699,7 @@ qemu_xen
 rombios
 qemu_traditional
 blktap2
+LINUX_BACKEND_MODULES
 blktap1
 debug
 seabios
@@ -789,6 +790,7 @@ enable_ovmf
 enable_seabios
 enable_debug
 enable_blktap1
+with_linux_backend_modules
 enable_blktap2
 enable_qemu_traditional
 enable_rombios
@@ -1474,6 +1476,9 @@ Optional Packages:
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-initddir=DIR     Path to directory with sysv runlevel scripts.
                           [SYSCONFDIR/init.d]
+  --with-linux-backend-modules="mod1 mod2"
+                          List of Linux backend module or modalias names to be
+                          autoloaded on startup.
   --with-system-qemu[=PATH]
                           Use system supplied qemu PATH or qemu (taken from
                           $PATH) as qemu-xen device model instead of building
@@ -2261,7 +2266,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons.in hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xen-watchdog.service hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xenstored.service hotplug/Linux/systemd/xenstored.socket hotplug/Linux/systemd/xenstored_ro.socket hotplug/Linux/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains"
+ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xen-watchdog.service hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xenstored.service hotplug/Linux/systemd/xenstored.socket hotplug/Linux/systemd/xenstored_ro.socket hotplug/Linux/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains"
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -4001,6 +4006,41 @@ blktap1=$ax_cv_blktap1
 
 
 
+
+# Check whether --with-linux-backend-modules was given.
+if test "${with_linux_backend_modules+set}" = set; then :
+  withval=$with_linux_backend_modules; LINUX_BACKEND_MODULES="$withval"
+else
+  case "$host_os" in
+*linux*)
+LINUX_BACKEND_MODULES="
+xen-evtchn
+xen-gntdev
+xen-gntalloc
+xen-blkback
+xen-netback
+xen-pciback
+evtchn
+gntdev
+netbk
+blkbk
+xen-scsibk
+usbbk
+pciback
+xen-acpi-processor
+blktap2
+blktap
+"
+;;
+*)
+LINUX_BACKEND_MODULES=
+;;
+esac
+fi
+
+LINUX_BACKEND_MODULES="`eval echo $LINUX_BACKEND_MODULES`"
+
+
 # Check whether --enable-blktap2 was given.
 if test "${enable_blktap2+set}" = set; then :
   enableval=$enable_blktap2;
@@ -9541,7 +9581,7 @@ do
     "hotplug/FreeBSD/rc.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/FreeBSD/rc.d/xencommons" ;;
     "hotplug/Linux/init.d/sysconfig.xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/sysconfig.xencommons" ;;
     "hotplug/Linux/init.d/xen-watchdog") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xen-watchdog" ;;
-    "hotplug/Linux/init.d/xencommons.in") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xencommons.in" ;;
+    "hotplug/Linux/init.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xencommons" ;;
     "hotplug/Linux/init.d/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/init.d/xendomains" ;;
     "hotplug/Linux/systemd/proc-xen.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/proc-xen.mount" ;;
     "hotplug/Linux/systemd/var-lib-xenstored.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/var-lib-xenstored.mount" ;;
index b9a1f6e1c46129a056b6b530b4303edb97900124..a882948af1c620333f424dc4543dc40627b0c62b 100644 (file)
@@ -10,7 +10,7 @@ AC_CONFIG_FILES([
 hotplug/FreeBSD/rc.d/xencommons
 hotplug/Linux/init.d/sysconfig.xencommons
 hotplug/Linux/init.d/xen-watchdog
-hotplug/Linux/init.d/xencommons.in
+hotplug/Linux/init.d/xencommons
 hotplug/Linux/init.d/xendomains
 hotplug/Linux/systemd/proc-xen.mount
 hotplug/Linux/systemd/var-lib-xenstored.mount
@@ -90,6 +90,38 @@ AX_ARG_DEFAULT_ENABLE([seabios], [Disable SeaBIOS])
 AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of tools])
 AX_ARG_DEFAULT_DISABLE([blktap1], [Enable blktap1 tools])
 
+AC_ARG_WITH([linux-backend-modules],
+    AS_HELP_STRING([--with-linux-backend-modules="mod1 mod2"],
+    [List of Linux backend module or modalias names to be autoloaded on startup.]),
+    [LINUX_BACKEND_MODULES="$withval"],
+    [case "$host_os" in
+*linux*)
+LINUX_BACKEND_MODULES="
+xen-evtchn
+xen-gntdev
+xen-gntalloc
+xen-blkback
+xen-netback
+xen-pciback
+evtchn
+gntdev
+netbk
+blkbk
+xen-scsibk
+usbbk
+pciback
+xen-acpi-processor
+blktap2
+blktap
+"
+;;
+*)
+LINUX_BACKEND_MODULES=
+;;
+esac])
+LINUX_BACKEND_MODULES="`eval echo $LINUX_BACKEND_MODULES`"
+AC_SUBST(LINUX_BACKEND_MODULES)
+
 dnl Enable blktap2 on Linux only.
 AC_ARG_ENABLE([blktap2],
     AS_HELP_STRING([--enable-blktap2],
index 184f56dd0105d9a98747b62f3b1b9883b69f4110..8cdaa9a35b2fa2dc37a9ed51776bb84c937e97fb 100644 (file)
@@ -37,23 +37,17 @@ UDEV_RULES_DIR = $(CONFIG_DIR)/udev
 UDEV_RULES = xen-backend.rules $(UDEV_RULES-y)
 
 .PHONY: all
-all: $(XENCOMMONS_INITD) subdirs-all
-
-$(XENCOMMONS_INITD): $(XEN_ROOT)/config/$(XEN_OS).modules $(XENCOMMONS_INITD).in
-       $(XEN_ROOT)/tools/hotplug/Linux/update-modules.sh \
-               $(XEN_ROOT) \
-               $(XEN_OS) \
-               $(XENCOMMONS_INITD) > $@
+all: subdirs-all
 
 .PHONY: build
-build: all
+build:
 
 .PHONY: install
 install: all install-initd install-scripts install-udev subdirs-install
 
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
-install-initd: all
+install-initd:
        [ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
        [ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
        [ -d $(DESTDIR)$(LIBEXEC_BIN) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
@@ -65,7 +59,7 @@ install-initd: all
        $(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR)
 
 .PHONY: install-scripts
-install-scripts: all
+install-scripts:
        [ -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.in b/tools/hotplug/Linux/init.d/xencommons.in
new file mode 100644 (file)
index 0000000..10edf29
--- /dev/null
@@ -0,0 +1,152 @@
+#!/bin/bash
+#
+# xencommons    Script to start and stop xenstored and xenconsoled
+#
+# Author:       Ian Jackson <ian.jackson@eu.citrix.com>
+#
+# chkconfig: 2345 70 10
+# description: Starts and stops xenstored and xenconsoled
+### BEGIN INIT INFO
+# Provides:          xenstored xenconsoled
+# Required-Start:    $syslog $remote_fs
+# Should-Start:
+# Required-Stop:     $syslog $remote_fs
+# Should-Stop:
+# Default-Start:     2 3 5
+# Default-Stop:      0 1 6
+# Short-Description: Start/stop xenstored and xenconsoled
+# Description:       Starts and stops the daemons neeeded for xl/xend
+### END INIT INFO
+
+XENSTORED=@XENSTORED@
+BACKEND_MODULES="@LINUX_BACKEND_MODULES@"
+
+. @XEN_SCRIPT_DIR@/hotplugpath.sh
+
+if [ -d /etc/sysconfig ]; then
+       xencommons_config=/etc/sysconfig
+else
+       xencommons_config=/etc/default
+fi
+
+test -f $xencommons_config/xencommons && . $xencommons_config/xencommons
+
+XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid
+QEMU_PIDFILE=/var/run/qemu-dom0.pid
+shopt -s extglob
+
+# not running in Xen dom0 or domU
+if ! test -d /proc/xen ; then
+       exit 0
+fi
+
+# mount xenfs in dom0 or domU with a pv_ops kernel
+if test "x$1" = xstart && \
+   ! test -f /proc/xen/capabilities && \
+   ! grep '^xenfs ' /proc/mounts >/dev/null;
+then
+       mount -t xenfs xenfs /proc/xen
+fi
+
+# run this script only in dom0:
+# no capabilities file in xenlinux domU kernel
+# empty capabilities file in pv_ops domU kernel
+if test -f /proc/xen/capabilities && \
+   ! grep -q "control_d" /proc/xen/capabilities ; then
+       exit 0
+fi
+
+do_start () {
+        local time=0
+       local timeout=30
+       local mod
+
+       for mod in $BACKEND_MODULES ; do modprobe "$mod" &>/dev/null ; done
+
+       mkdir -p ${XEN_RUN_DIR}
+       mkdir -p ${XEN_LOCK_DIR}
+
+       if ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1`
+       then
+               test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored"
+               rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
+               test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
+
+               if [ -n "$XENSTORED" ] ; then
+                   echo -n Starting $XENSTORED...
+                   $XENSTORED --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
+               else
+                   echo "No xenstored found"
+                   exit 1
+               fi
+
+               # Wait for xenstored to actually come up, timing out after 30 seconds
+                while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
+                    echo -n .
+                   time=$(($time+1))
+                    sleep 1
+                done
+               echo
+
+               # Exit if we timed out
+               if ! [ $time -lt $timeout ] ; then
+                   echo Could not start xenstored
+                   exit 1
+               fi
+
+               echo Setting domain 0 name, domid and JSON config...
+               ${LIBEXEC_BIN}/xen-init-dom0
+       fi
+
+       echo Starting xenconsoled...
+       test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
+       ${SBINDIR}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
+       echo Starting QEMU as disk backend for dom0
+       test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC_BIN}/qemu-system-i386"
+       $QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \
+               -monitor /dev/null -serial /dev/null -parallel /dev/null \
+               -pidfile $QEMU_PIDFILE
+}
+do_stop () {
+        echo Stopping xenconsoled
+       if read 2>/dev/null <$XENCONSOLED_PIDFILE pid; then
+               kill $pid
+               while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
+               rm -f $XENCONSOLED_PIDFILE
+       fi
+
+       echo Stopping QEMU
+       if read 2>/dev/null <$QEMU_PIDFILE pid; then
+               kill $pid
+               while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
+               rm -f $QEMU_PIDFILE
+       fi
+
+       echo WARNING: Not stopping xenstored, as it cannot be restarted.
+}
+
+case "$1" in
+  start)
+       do_start
+       ;;
+  status)
+        ${BINDIR}/xenstore-read -s /
+       ;;
+  stop)
+       do_stop
+       ;;
+  reload)
+       echo >&2 'Reload not available; use force-reload'; exit 1
+       ;;
+  force-reload|restart)
+        do_stop
+       do_start
+       ;;
+  *)
+       # do not advertise unreasonable commands that there is no reason
+       # to use with this device
+       echo $"Usage: $0 {start|stop|status|restart|force-reload}"
+       exit 1
+esac
+
+exit $?
diff --git a/tools/hotplug/Linux/init.d/xencommons.in.in b/tools/hotplug/Linux/init.d/xencommons.in.in
deleted file mode 100644 (file)
index 590f745..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/bin/bash
-#
-# xencommons    Script to start and stop xenstored and xenconsoled
-#
-# Author:       Ian Jackson <ian.jackson@eu.citrix.com>
-#
-# chkconfig: 2345 70 10
-# description: Starts and stops xenstored and xenconsoled
-### BEGIN INIT INFO
-# Provides:          xenstored xenconsoled
-# Required-Start:    $syslog $remote_fs
-# Should-Start:
-# Required-Stop:     $syslog $remote_fs
-# Should-Stop:
-# Default-Start:     2 3 5
-# Default-Stop:      0 1 6
-# Short-Description: Start/stop xenstored and xenconsoled
-# Description:       Starts and stops the daemons neeeded for xl/xend
-### END INIT INFO
-
-XENSTORED=@XENSTORED@
-
-. @XEN_SCRIPT_DIR@/hotplugpath.sh
-
-if [ -d /etc/sysconfig ]; then
-       xencommons_config=/etc/sysconfig
-else
-       xencommons_config=/etc/default
-fi
-
-test -f $xencommons_config/xencommons && . $xencommons_config/xencommons
-
-XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid
-QEMU_PIDFILE=/var/run/qemu-dom0.pid
-shopt -s extglob
-
-# not running in Xen dom0 or domU
-if ! test -d /proc/xen ; then
-       exit 0
-fi
-
-# mount xenfs in dom0 or domU with a pv_ops kernel
-if test "x$1" = xstart && \
-   ! test -f /proc/xen/capabilities && \
-   ! grep '^xenfs ' /proc/mounts >/dev/null;
-then
-       mount -t xenfs xenfs /proc/xen
-fi
-
-# run this script only in dom0:
-# no capabilities file in xenlinux domU kernel
-# empty capabilities file in pv_ops domU kernel
-if test -f /proc/xen/capabilities && \
-   ! grep -q "control_d" /proc/xen/capabilities ; then
-       exit 0
-fi
-
-do_start () {
-        local time=0
-       local timeout=30
-
-       @LOAD_MODULES@
-       mkdir -p ${XEN_RUN_DIR}
-       mkdir -p ${XEN_LOCK_DIR}
-
-       if ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1`
-       then
-               test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored"
-               rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
-               test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
-
-               if [ -n "$XENSTORED" ] ; then
-                   echo -n Starting $XENSTORED...
-                   $XENSTORED --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
-               else
-                   echo "No xenstored found"
-                   exit 1
-               fi
-
-               # Wait for xenstored to actually come up, timing out after 30 seconds
-                while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
-                    echo -n .
-                   time=$(($time+1))
-                    sleep 1
-                done
-               echo
-
-               # Exit if we timed out
-               if ! [ $time -lt $timeout ] ; then
-                   echo Could not start xenstored
-                   exit 1
-               fi
-
-               echo Setting domain 0 name, domid and JSON config...
-               ${LIBEXEC_BIN}/xen-init-dom0
-       fi
-
-       echo Starting xenconsoled...
-       test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
-       ${SBINDIR}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
-       echo Starting QEMU as disk backend for dom0
-       test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC_BIN}/qemu-system-i386"
-       $QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \
-               -monitor /dev/null -serial /dev/null -parallel /dev/null \
-               -pidfile $QEMU_PIDFILE
-}
-do_stop () {
-        echo Stopping xenconsoled
-       if read 2>/dev/null <$XENCONSOLED_PIDFILE pid; then
-               kill $pid
-               while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
-               rm -f $XENCONSOLED_PIDFILE
-       fi
-
-       echo Stopping QEMU
-       if read 2>/dev/null <$QEMU_PIDFILE pid; then
-               kill $pid
-               while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
-               rm -f $QEMU_PIDFILE
-       fi
-
-       echo WARNING: Not stopping xenstored, as it cannot be restarted.
-}
-
-case "$1" in
-  start)
-       do_start
-       ;;
-  status)
-        ${BINDIR}/xenstore-read -s /
-       ;;
-  stop)
-       do_stop
-       ;;
-  reload)
-       echo >&2 'Reload not available; use force-reload'; exit 1
-       ;;
-  force-reload|restart)
-        do_stop
-       do_start
-       ;;
-  *)
-       # do not advertise unreasonable commands that there is no reason
-       # to use with this device
-       echo $"Usage: $0 {start|stop|status|restart|force-reload}"
-       exit 1
-esac
-
-exit $?
index 90ba16e0f27b7ba1570516a64f020734eb5699d4..6950d246c6cd1c8a1076bac5f1e5025559fa7f1f 100644 (file)
@@ -38,31 +38,9 @@ install: $(ALL_XEN_SYSTEMD)
        $(INSTALL_DATA) *.mount $(DESTDIR)$(XEN_SYSTEMD_DIR)
        $(INSTALL_DATA) *.conf $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD)
 
-$(XEN_SYSTEMD_MODULES): $(XEN_ROOT)/config/$(XEN_OS).modules
-       @set -e ;                                                       \
-       IFS=''                                                          ;\
-       cat  $(XEN_ROOT)/config/$(XEN_OS).modules       | (             \
-               while read l ; do                                       \
-                       if echo $${l} | egrep -q "^#" ; then            \
-                               continue                                ;\
-                       fi                                              ;\
-                       if echo "$${l}" | egrep -q "\|" ; then          \
-                               m1=$${l%%|*}                            ;\
-                               m2=$${l#*|}                             ;\
-                               # Systemd modules-load.d lacks support  ;\
-                               # for module replacement options, we    ;\
-                               # need to add that support upstream but ;\
-                               # its best instead to ensure this file  ;\
-                               # is no longer needed. Some folks       ;\
-                               # however have reported issues with     ;\
-                               # some modules automatically loading    ;\
-                               # so we just load all necessary xen     ;\
-                               # modules and for replacements we load  ;\
-                               # the latest module                     ;\
-                               echo "$$m1" ;\
-                               echo "$$m2" ;\
-                       else                                            \
-                               echo "$$l"                              ;\
-                       fi                                              ;\
-               done                                                    \
-       ) > $@
+$(XEN_SYSTEMD_MODULES):
+       rm -f $@.tmp
+       for mod in $(LINUX_BACKEND_MODULES) ; do \
+               echo $$mod ; \
+               done > $@.tmp
+       $(call move-if-changed,$@.tmp,$@)
diff --git a/tools/hotplug/Linux/update-modules.sh b/tools/hotplug/Linux/update-modules.sh
deleted file mode 100755 (executable)
index 692d220..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-IFS=''
-
-XEN_ROOT=$1
-XEN_OS=$2
-XENCOMMONS_INITD=$3
-
-cat  $XEN_ROOT/config/${XEN_OS}.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