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 all essential packages on the Ubuntu 16.04 virtual machine.

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

Use a text editor to edit conf/local.conf to add the following lines:

MACHINE = "genericx86-64"
DEFAULTTUNE  = "x86-64"

Step 5

Enter the following command:

bitbake ruby

After the build completes, the RPMs are present in tmp/deploy/rpm/x86_64/*.rpm.

Step 6

Copy the 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

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 
Loaded plugins: downloadonly, importpubkey, localrpmDB, patchaction, patching, protect-packages
groups-repo                           | 1.1 kB     00:00 ... 
localdb                               |  951 B     00:00 ... 
patching                              |  951 B     00:00 ... 
thirdparty                            |  951 B     00:00 ... 
Setting up Install Process
Examining /bootflash/libyaml-0-2-0.1.6-r0.x86_64.rpm: libyaml-0-2-0.1.6-r0.x86_64
Marking /bootflash/libyaml-0-2-0.1.6-r0.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package libyaml-0-2.x86_64 0:0.1.6-r0 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
===========================================================================================
 Package          Arch             Version         Repository                        Size
===========================================================================================
Installing:
 libyaml-0-2      x86_64           0.1.6-r0        /libyaml-0-2-0.1.6-r0.x86_64      119 k
 
Transaction Summary
===========================================================================================
Install       1 Package
 
Total size: 119 k
Installed size: 119 k
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libyaml-0-2-0.1.6-r0.x86_64                                    1/1 
/sbin/ldconfig: /usr/lib/libboost_regex.so.1.49.0 is not a symbolic link
 
 
Installed:
  libyaml-0-2-0.1.6-r0.x86_64
         
 
Complete!
Install operation 2450 completed successfully at Fri Jul 27 18:54:55 2018.
 
[####################] 100%

Step 8

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 
Loaded plugins: downloadonly, importpubkey, localrpmDB, patchaction, patching, protect-packages
groups-repo                           | 1.1 kB     00:00 ... 
localdb                               |  951 B     00:00 ... 
patching                              |  951 B     00:00 ... 
thirdparty                            |  951 B     00:00 ... 
thirdparty/primary                    | 1.8 kB     00:00 ... 
thirdparty                                 2/2
Setting up Install Process
Examining /bootflash/ruby-2.2.2-r0.x86_64.rpm: ruby-2.2.2-r0.x86_64
Marking /bootflash/ruby-2.2.2-r0.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package ruby.x86_64 0:2.2.2-r0 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
===========================================================================================
 Package          Arch             Version         Repository                        Size
===========================================================================================
Installing:
 ruby             x86_64           2.2.2-r0        /ruby-2.2.2-r0.x86_64             32 M
 
Transaction Summary
===========================================================================================
Install       1 Package
 
Total size: 32 M
Installed size: 32 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : ruby-2.2.2-r0.x86_64                                 1/1 
/sbin/ldconfig: /usr/lib/libboost_regex.so.1.49.0 is not a symbolic link
 
 
Installed:
  ruby.x86_64 0:2.2.2-r0                                  
 
Complete!
Install operation 2451 completed successfully at Fri Jul 27 18:55:23 2018.
 
[####################] 100%