On Mon, Sep 26, 2016 at 7:34 AM, Gurucharan Shetty <g...@ovn.org> wrote:

> Signed-off-by: Gurucharan Shetty <g...@ovn.org>
> ---
>  INSTALL.md | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/INSTALL.md b/INSTALL.md
> index bb40e4a..6ecefdf 100644
> --- a/INSTALL.md
> +++ b/INSTALL.md
> @@ -322,9 +322,30 @@ 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
> +    % depmod -a
> +    ```
> +
>

I tried the script

#!/bin/bash
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
depmod -a

on Ubuntu 14.04 and the script generated the expected
file contents

dball@ubuntu:~/openvswitch/ovs/_gcc$ cat /etc/depmod.d/openvswitch.conf
override openvswitch.ko * extra
override openvswitch.ko * weak-updates
override vport-geneve.ko * extra
override vport-geneve.ko * weak-updates
override vport-gre.ko * extra
override vport-gre.ko * weak-updates
override vport-lisp.ko * extra
override vport-lisp.ko * weak-updates
override vport-stt.ko * extra
override vport-stt.ko * weak-updates
override vport-vxlan.ko * extra
override vport-vxlan.ko * weak-updates

However the "extra" directory where locally built ovs kos are installed is
not
taking precedence

dball@ubuntu:~/openvswitch/ovs/_gcc$ sudo modinfo openvswitch
filename:       /lib/modules/3.19.0-25-generic/kernel/net/
openvswitch/openvswitch.ko
license:        GPL
description:    Open vSwitch switching datapath
srcversion:     EB1236CA2503B5F233DE125
depends:        libcrc32c
intree:         Y
vermagic:       3.19.0-25-generic SMP mod_unload modversions
signer:         Magrathea: Glacier signing key
sig_key:        6A:AA:11:D1:8C:2D:3A:40:B1:B4:DB:E5:BF:8A:D6:56:DD:F5:18:38
sig_hashalgo:   sha512

So I edited the script to do something minimal, although it may not
work for all distributions ?

#!/bin/bash
config_file="/etc/depmod.d/openvswitch.conf"
echo "search extra" >> "$config_file"
depmod -a

dball@ubuntu:~/openvswitch/ovs/_gcc$ cat /etc/depmod.d/openvswitch.conf
search extra

and it seems to work (i.e. overrides my default config file) on Ubuntu

dball@ubuntu:~/openvswitch/ovs/_gcc$ sudo modinfo openvswitch
filename:       /lib/modules/3.19.0-25-generic/extra/openvswitch.ko
alias:          net-pf-16-proto-16-family-ovs_packet
alias:          net-pf-16-proto-16-family-ovs_flow
alias:          net-pf-16-proto-16-family-ovs_vport
alias:          net-pf-16-proto-16-family-ovs_datapath
version:        2.6.90
license:        GPL
description:    Open vSwitch switching datapath
srcversion:     E30F336D9883ACAE1CB02EA
depends:        nf_conntrack,nf_nat,nf_defrag_ipv6,libcrc32c,nf_nat_
ipv6,nf_nat_ipv4,gre,nf_defrag_ipv4
vermagic:       3.19.0-25-generic SMP mod_unload modversions
parm:           udp_port:Destination UDP port (ushort)





> +    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
> --
> 1.9.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to