diff mbox

[ovs-dev] INSTALL.md: Add details about kernel module preference.

Message ID 1474899214-25488-1-git-send-email-guru@ovn.org
State Superseded
Headers show

Commit Message

Gurucharan Shetty Sept. 26, 2016, 2:13 p.m. UTC
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
---
 INSTALL.md | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

Comments

Joe Stringer Sept. 27, 2016, 12:32 a.m. UTC | #1
On 26 September 2016 at 07:13, Gurucharan Shetty <guru@ovn.org> wrote:
> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
> ---
>  INSTALL.md | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/INSTALL.md b/INSTALL.md
> index bb40e4a..a9b70db 100644
> --- a/INSTALL.md
> +++ b/INSTALL.md
> @@ -322,9 +322,29 @@ Building the Sources
>  4. Run "make install" to install the executables and manpages into the
>     running system, by default under /usr/local.
>
> -5. If you built kernel modules, you may install and load them, e.g.:
> +5. If you built kernel modules, you may install them, e.g.:
>
>        `% make modules_install`
> +
> +    It is possible that you already had a Open vSwitch kernel module
> +    installed on your machine that came from upstream Linux (in a
> +    different directory).  To make sure that you insert the Open vSwitch
> +    kernel module you built from this repository, you should create a
> +    depmod.d file that prefers your newly installed kernel modules over
> +    the kernel modules from upstream Linux.  The following snippet of
> +    code achieves the same.
> +
> +    ```
> +    % config_file="/etc/depmod.d/openvswitch.conf"
> +    % for module in datapath/linux/*.ko; do
> +      modname="$(basename ${module})"
> +      echo "override $modname * extra" >> "$config_file"
> +      echo "override $modname * weak-updates" >> "$config_file"
> +      done
> +    ```

Don't forget to "depmod" after writing this file.
Gurucharan Shetty Sept. 27, 2016, 12:39 a.m. UTC | #2
>
>
> Don't forget to "depmod" after writing this file.
>
How about the v2?
diff mbox

Patch

diff --git a/INSTALL.md b/INSTALL.md
index bb40e4a..a9b70db 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -322,9 +322,29 @@  Building the Sources
 4. Run "make install" to install the executables and manpages into the
    running system, by default under /usr/local.
 
-5. If you built kernel modules, you may install and load them, e.g.:
+5. If you built kernel modules, you may install them, e.g.:
 
       `% make modules_install`
+
+    It is possible that you already had a Open vSwitch kernel module
+    installed on your machine that came from upstream Linux (in a
+    different directory).  To make sure that you insert the Open vSwitch
+    kernel module you built from this repository, you should create a
+    depmod.d file that prefers your newly installed kernel modules over
+    the kernel modules from upstream Linux.  The following snippet of
+    code achieves the same.
+
+    ```
+    % config_file="/etc/depmod.d/openvswitch.conf"
+    % for module in datapath/linux/*.ko; do
+      modname="$(basename ${module})"
+      echo "override $modname * extra" >> "$config_file"
+      echo "override $modname * weak-updates" >> "$config_file"
+      done
+    ```
+
+    Finally, load the kernel modules that you need.  e.g.:
+
       `% /sbin/modprobe openvswitch`
 
    To verify that the modules have been loaded, run "/sbin/lsmod" and