我要评分
获取效率
正确性
完整性
易理解

Installation from the Source Code Package

In this document, /open-vswitch/ is used as the path for storing the downloaded and decompressed files.

  1. Obtain the source code package.
  2. (Optional) Set the booting for the code package.

    This step is applicable to the scenario where you use method 2 in step 1 to download and decompress the source code package. You need to set the booting for the code package.

    1
    $ ./boot.sh
    

  3. Run the configuration script to configure the software compilation package.
    • Generally, you can invoke the configuration script without any parameters. By default, all executable files and shared library files are installed in the /usr/local directory. In addition, the OVS software searches for the database files in the /usr/local/etc/openvswitch directory.
    • For you need to customize parameters, see Command Reference for Compiling Configuration Scripts.

    To keep the source code path clean, create an independent build directory for configuration and compilation.

    1
    2
    $ mkdir -p build && cd build
    $ ../configure
    
  4. Compile the components.
    1
    $ make -j4
    

    After the compilation dependency installation and compilation configuration are complete, run GNU make in the build directory to compile the components. The figure below shows the build directory after the compilation is complete.

  5. (Optional) Compile the RPM package.

    If you need to compile an RPM or DEB package (CentOS RPM package is used as an example) for installation on other nodes, run the following command to pack the RPM package. After the packaging is complete, the RPM package is generated in the rpmbuild directory, as shown in the figure below.

    1
    2
    $ make rpm-fedora
    $ make rpm-fedora-kmod
    

  6. Install components.
    1
    $ make install
    

    If you recompile and build the kernel module, you need to install, load, and check the kernel module.

    1
    2
    3
    $ make modules_install
    $ /sbin/modprobe openvswitch
    $ /sbin/lsmod | grep openvswitch