Nexus Application Development - Yocto
About Yocto
The Cisco NX-OS Release 10.1(1) software is based on Yocto 2.6. More applications can be installed by downloading Yocto 2.6, downloading the new software to be built, building the software, and installing the software on the switch.
Installing Yocto
In the example below, we are building Ruby version 2.2.2 in a Ubuntu 16.04 virtual machine.
Procedure
-
Step 1: Install essential packages on Ubuntu 16.04.
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping libsdl1.2-dev xterm
-
Step 2: Download Yocto 2.6.
wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.6/poky-thud-20.0.0.tar.bz2
tar xjfv poky-thud-20.0.0.tar.bz2
cd poky-thud-20.0.0
-
Step 3: Source the oe-init-build-env file.
source oe-init-build-env
-
Step 4: Edit conf/local.conf.
Use a text editor to add the following lines:
MACHINE = "genericx86-64"
DEFAULTTUNE = "x86-64"
-
Step 5: Build Ruby.
Enter the following command:
bitbake ruby
After the build completes, the RPMs are present in
tmp/deploy/rpm/x86_64/*.rpm
. -
Step 6: Copy RPMs to the switch.
Switch# copy scp://<username>@<IP_address>/ruby-2.2.2-r0.x86_64.rpm bootflash: vrf management use-kstack
Switch# copy scp://<username>@<IP_address>/libyaml-0-2-0.1.6-r0.x86_64.rpm bootflash: vrf management use-kstack
-
Step 7: Install libyaml.
From the Bash shell, enter the following commands. You will be entering 'y' at one point in the install process.
bash-4.3% dnf install /bootflash/libyaml-0-2-0.1.6-r0.x86_64.rpm
The output shows package installation details, including dependencies, transaction summary, and completion status.
[####################] 100%
-
Step 8: Install Ruby.
The following commands provide an example of building Ruby version 2.2.2 in a Ubuntu 16.04 virtual machine. You will be entering 'y' at one point in the install process.
bash-4.3% dnf install /bootflash/ruby-2.2.2-r0.x86_64.rpm
The output shows package installation details, including dependencies, transaction summary, and completion status.
[####################] 100%