The sections below provide instructions for building OpenNSL sample applications.
Build Variables
The environment variables are set in the Makefile available in the opennsl_root/example directory.
Build Process
The package include pre-compiled binary tarballs for all the supported platforms. Use the following instructions to compile the source code, if needed:
- Download source tarball
- Extract source tarball. Example: tar -xf opennsl-3.4.1.3-odp.tar.bz2
- Change to opennsl_root/examples directory where sample applications resides and then issue 'make' to build the sample applications. This will generate the sample application executables.
Use the following commands to clean the builds
- make clean: deletes the temporary files (.d and .o) created as part of the build process.
Supported Platforms
Wedge Network Switch Platform - x86/Trident2/Tomahawk
For Wedge Network Switch platforms, OpenNSL can be compiled on the Wedge Switch OR using offline UBUNTU build server. The boot loader, kernel headers, toolchain are assumed to be pre-installed on the Switch/Server.
- Toolchain: /usr/lib/gcc/x86_64-linux-gnu/4.6/cc1 (Pre-installed)
- Kernel headers: Located at 'os/cpu/common/debian_8.0'
- Bootloader: ONIE (Pre-installed)
- Kernel version: Linux version 3.16.39-OpenNetworkLinux (Pre-installed)
- Root file system: Pre-installed on Wedge Switch
Celestica Redstone-XP/Seastone-XP Switch - x86/Trident2
For Celestica Redstone-XP/Seastone-XP Switch, OpenNSL can be compiled on the Switch OR using offline UBUNTU build server. The boot loader, kernel headers, toolchain are assumed to be pre-installed on the Switch/Server.
- Toolchain: /usr/lib/gcc/x86_64-linux-gnu/4.8/cc1 (Pre-installed)
- Kernel headers: Linux headers for kernel version 3.16.0-29 (Pre-installed)
- Bootloader: ONIE (Pre-installed)
- Kernel version: Linux version 3.16.0-29-generic (Pre-installed)
- Root file system: Pre-installed on Celestica Redstone-XP/Seastone-XP Switch
Accton AS5712(x86/Trident2) or AS7712(x86/Tomahawk) Switches
For Accton AS5712/AS7712 Network Switch platform, OpenNSL can be compiled using offline build server. The boot loader, kernel headers, toolchain are assumed to be pre-installed on the Server.
- Toolchain: build/tmp/sysroots/x86_64-linux/usr/bin/x86_64-openswitch-linux/x86_64-openswitch-linux-gcc (Pre-installed)
- Kernel headers: Linux headers for kernel version 3.9.11 (Pre-installed)
- Bootloader: ONIE (Pre-installed)
- Kernel version: Linux version 3.9.11 (Pre-installed)
- Root file system: Pre-installed on the Switch
Dell S6000 (x86/Trident2) or S6100 (x86/Tomahawk) Switch
For Dell S6000/S6100 Network Switch platforms, OpenNSL can be compiled using offline build server. The boot loader, kernel headers, toolchain are assumed to be pre-installed on the Server.
- Toolchain: /usr/lib/gcc/x86_64-linux-gnu/4.9/cc1 (Pre-installed)
- Kernel headers: Linux headers for kernel version 3.16.0.4 (Pre-installed)
- Bootloader: ONIE (Pre-installed)
- Kernel version: Linux version "Sonic 3.16.0-4-amd64" (Pre-installed)
- Root file system: Pre-installed on the Switch
Agema AG7648 (x86/Trident2) Switch
For Agema AG7648 Network Switch platforms, OpenNSL can be compiled on the Switch OR using offline UBUNTU build server. The boot loader, kernel headers, toolchain are assumed to be pre-installed on the Switch/Server.
- Toolchain: /usr/lib/gcc/x86_64-linux-gnu/4.9/cc1 (Pre-installed)
- Kernel headers: Linux headers for kernel version 3.16.0.4 (Pre-installed)
- Bootloader: ONIE (Pre-installed)
- Kernel version: Linux version 3.16.0.4 (Pre-installed)
- Root file system: Pre-installed on the Switch
Agema AGC7648A (x86/Qumran) Switch
For Agema AGC7648A Network Switch platform, OpenNSL can be compiled using offline build server. The boot loader, kernel headers, toolchain are assumed to be pre-installed on the Server.
- Toolchain: /usr/lib/gcc/x86_64-linux-gnu/4.9/cc1 (Pre-installed)
- Kernel headers: Linux headers for kernel version 3.16.0-29 (Pre-installed)
- Bootloader: ONIE (Pre-installed)
- Kernel version: Linux version 3.16.0-29-generic (Pre-installed)
- Root file system: Pre-installed on the Switch
Arista 7260CX3(x86/Tomahawk2) Switch
For Arista 7260CX3 Network Switch platform, OpenNSL can be compiled using offline build server. The boot loader, kernel headers, toolchain are assumed to be pre-installed on the Server.
- Toolchain: /usr/lib/gcc/x86_64-linux-gnu/4.9/cc1 (Pre-installed)
- Kernel headers: Linux headers for kernel version 3.16.0.4 (Pre-installed)
- Bootloader: Arista Custom Loader (Pre-installed)
- Kernel version: Linux version "Sonic 3.16.0-4-amd64" (Pre-installed)
- Root file system: Pre-installed on the Switch
GPL Linux Kernel modules
OpenNSL includes source code for Linux kernel modules that handle low-level configuration of Broadcom network Switch silicon. For the supported platforms, pre-compiled binaries of the kernel modules are included in the OpenNSL package. Note that the kernel modules are compiled for a specific Linux kernel version as mentioned in the above section.
To re-compile the Linux kernel modules:
- Identify the Linux kernel version being used on the target platform.
- Identify the path for Linux header files associated with the kernel.
- Identify the path for toolchain used for the target platform.
- Update the KERNDIR, LINUX_INCLUDE, CROSS_COMPILE variables in the platform specific Makefile.
- For x86 CPU based platforms, use the "sdk-x.y.z-gpl-modules/make/Makefile.linux-x86-smp_generic_64-2_6" file.
- Invoke 'make' from the platform specific target folder 'sdk-x.y.z-gpl-modules/systems/linux/user/{PLATFORM}'.
- For x86 CPU based platforms, invoke 'make' from 'sdk-x.y.z-gpl-modules/systems/linux/user/x86-smp_generic_64-2_6' folder.
- The compiled kernel modules are available in 'sdk-x.y.z-gpl-modules/build/linux/user/{PLATFORM}' folder.