This chapter contains the following sections: About the Cisco, page 1 Installing the, page 1 Using the to Build Applications, page 2 About ISO, page 3 Installing the ISO, page 3 Using the ISO to Build Applications, page 4 Moving the Build Application to the Target Switch, page 5 About the Cisco The Cisco is a development kit based on Yocto 1.2. It contains all of the tools needed to build applications for execution on a Cisco Nexus switch running the NX-OS Release 7.0(3)I2(1). The basic components are the C compiler, linker, libraries, and header files that are commonly used in many applications. The list is not exhaustive, and it might be required that the you download and build any dependencies needed for any particular application. Note that some applications are ready to be downloaded and used from the Cisco devhub website and do not require building. Installing the Download the. The is available for download at: http://devhub.cisco.com/artifactory/simple/open-nxos/7.0-3-i2-1/x86_ 64. This file is a self-extracting archive that copies the contents of the into a directory of your choice. You are prompted for a path to an installation directory. The binaries included in the are built for 32-bit 1
Using the to Build Applications architecture, so it needs to be run on a platform that supports a 32-bit architecture. To get support in 64-bit Centos 7, you can enter the following command: sudo yum install glibc.i686 Using the to Build Applications Before You Begin The must be installed. Step 1 Step 2 Browse to the installation directory. Enter the following command from the Bash prompt: bash$ source environment-setup-x86_64-wrs-linux The source environment-setup-x86_64-wrs-linux command adds the specific paths to your shell environment. This must be done for each shell you intend to use with the. This is the key to setting up the in order to use the correct versions of the build tools and libraries. Many of the common Linux build processes work for this and you should the techniques that are best suited for your situation. Below are examples of some of the most common cases. The source code or a package can be retrieved in various ways, for example either in tar file form or by downloading from a git repository where the package resides. In any case, the package should contain the meta data for use with autoconf and RPM packaging tools. Assuming all of the dependencies are met, we can enter the standard RPM build procedure: bash$ mkdir rpm; cd rpm bash$ mkdir BUILD RPMS SOURCES SPECS SRPMS bash$ cp../example-app-1.0.tgz SOURCES bash$ cp../example-app.spec SPECS bash$ rpmbuild -v bb SPECS/example-app.spec The result a binary RPM in RPMS/ that can be copied to the switch and installed. Installation and configuration of applications can vary. Refer to the application documents for those instructions. This rpmbuild and installation on the switch is required for every software package needed to support the application. If a software dependency is required that is not already included in the, the source code must be obtained and the dependencies built. On the build machine, the package can be built manually for verification of dependencies. The following example is the most common procedure: bash$ tar xvzf example-lib.tgz bash$ mkdir example-lib-install bash$ cd example-lib/ bash$./configure prefix=<path_to_example-lib-install> bash$ make bash$ make install These commands place the build files (binaries, headers, libraries, etc.) into the installation directory. From here you can use standard compiler and linker flags to pick up the location to these new dependencies. Any 2
About ISO runtime code such as libraries are required to be installed on the switch as well, so packaging this into an RPM is also needed. Note There are many support libraries already in RPM form on the Cisco devhub website. Step 3 Build the source code. a) tar xvzf example-lib.tgz b) mkdir example-lib-install c) cd example-lib/ d)./configure prefix=path_to_example-lib-install e) make f) make install The steps are normal Linux. Example: The following example shows how to build the source code: bash$ tar xvzf example-lib.tgz bash$ mkdir example-lib-install bash$ cd example-lib/ bash$./configure prefix=<path_to_example-lib-install> bash$ make bach$ make install This places the build files (binaries, headers, libraries, etc.) into the installation directory. From here you can use standard compiler and linker flags to pick up the location to these new dependencies. Any runtime code such as libraries are required to be installed on the switch as well. Packaging this into an RPM is also needed. Note There are many support libraries already in RPM form on the Cisco devhub website. About ISO The ISO image is a bootable Wind River 5 environment that includes the necessary tools, libraries, and headers to build and RPM-package third-party applications to run natively on a Cisco Nexus switch. The content is not exhaustive, and it might be required that the user download and build any dependencies needed for any particular application. Note Some applications are ready to be downloaded and used from the Cisco devhub website and do not require building. Installing the ISO The ISO image is available for download at: http://devhub.cisco.com/artifactory/simple/open-nxos/7.0-3-i2-1/ x86_64. 3
Using the ISO to Build Applications The ISO is intended to be installed as a virtual machine. Use instructions from your virtualization vendor to install the ISO. Before You Begin Step 1 Step 2 (Optional) VMware-based installation. The ISO image installation requires a SATA disk and will not work on a SCSI drive. (Optional) QEMU-based installation. Enter the following commands: bash$ qemu-img create satori.img 10G bash$ qemu-system-x86_64 -cdrom./satori-vm-intel-xeon-core.iso -hda./satori.img -m 8192 Once the ISO starts to boot, a menu is displayed. Choose the Graphics Console Install option. This installs to the virtual HD. Once the install is complete, the virtual machine must be rebooted. What to Do Next To login to the system, enter root as the login and root as the password. Using the ISO to Build Applications Most of the build procedures that work with the, and Linux in general, also apply to the ISO environment. However, there is no shell environment script to run. The default paths should be fine to use the tools installed. The source code for applications needs to be obtained through the usual mechanisms such as a source tar file or git repository. Build the source code. a) tar xvzf example-lib.tgz b) mkdir example-lib-install c) cd example-lib/ d)./configure prefix=path_to_example-lib-install e) make f) make install The steps are normal Linux. Example: The following example shows how to build the source code: bash$ tar xvzf example-lib.tgz bash$ mkdir example-lib-install bash$ cd example-lib/ bash$./configure prefix=<path_to_example-lib-install> 4
Moving the Build Application to the Target Switch bash$ make bach$ make install Moving the Build Application to the Target Switch The recommended procedure is to build an RPM package and copy to the switch for installation. Move the build application. a) mkdir rpm; cd rpm b) mkdir BUILD RPMS SOURCES SPECS SRPMS c) cp../example-app-1.0.tgz SOURCES d) cp../example-app.spec SPECS e) rpmbuild -v bb SPECS/example-app.spec Example: The following example shows how to build move the build application: bash$ mkdir rpm; cd rpm bash$ mkdir BUILD RPMS SOURCES SPECS SRPMS bash$ cp../example-app-1.0.tgz SOURCES bash$ cp../example-app.spec SPECS bash$ rpmbuild -v bb SPECS/example-app.spec 5
Moving the Build Application to the Target Switch 6