Table of Contents Ubuntu and OpenNSL installation guide 1. Ubuntu Installation Guide... 2 1.1. Install Ubuntu Server 14.04.4 LTS 64-Bit.... 2 1.2. Enable the console device.... 2 1.3. Install the Ethernet device driver for the management interface.... 3 2. How to Install OpenNSL Binary... 5 2.1. Building OpenNSL... 5 2.2. Building example Applications... 5 2.3. Downloading and running OpenNSL sample applications... 5 1
1. Ubuntu Installation Guide 1.1. Install Ubuntu Server 14.04.4 LTS 64-Bit. 1. Download the ISO image from Ubuntu official website: http://releases.ubuntu.com/trusty/ 2. Connect a USB thumb device to the front panel USB port. 3. Connect to the switch via serial console using standard settings: 4. Power on the switch and change the boot option to CD-ROM/USB thumb in BIOS. 5. Start installing Ubuntu and create default user with username/password as "admin/admin" during installation. 6. Disable automatic updates during installation. 7. After installation completes restart and boot from hard disk and log in using above username/password. 1.2. Enable the console device. 1. Create a console configuration file. sudo cp /etc/init/tty1.conf /etc/init/ttys1.conf 2. Edit the following text into /etc/init/ttys1.conf: # ttys1 - getty # # This service maintains a getty on ttys1 from the point the system is # started until it is shut down again. start on stopped rc or RUNLEVEL=[2345] 2
stop on runlevel [!2345] respawn exec /sbin/getty -L 115200 ttys1 vt102 3. Start the console device (This will get you access to console): sudo start ttys1 4. Modify the following text into /etc/default/grub to get access to Linux init console: GRUB_CMDLINE_LINUX="console=tty1 console=ttys1,115200n8" GRUB_TERMINAL=serial GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1" 5. Update GRUB: sudo update-grub 6. Boot to Linux and type lspci and you should observe an entry for the switch chip. 01:00.0 Ethernet controller: Broadcom Corporation Device b960 (rev 01) 01:00.1 Ethernet controller: Broadcom Corporation Device b960 (rev 01) 1.3. Install the Ethernet device driver for the management interface. The management interface is using embedded Intel Atom MAC controller and PHY from Broadcom. 1. Use USB storage device to install make and gcc package. (The packages should be downloaded from the Ubuntu official website) sudo mkdir /media/usb sudo mount -t vfat /dev/sdb1 /media/usb cd /media/usb sudo dpkg -i binutils_2.22-6ubuntu1.3_amd64.deb sudo dpkg -i make_3.81-8.1ubuntu1.1_amd64.deb sudo dpkg -i libmpfr4_3.1.0-3ubuntu2_amd64.deb sudo dpkg -i libmpc2_0.9-4_amd64.deb sudo dpkg -i cpp-4.6_4.6.3-1ubuntu5_amd64.deb sudo dpkg -i cpp_4.6.3-1ubuntu5_amd64.deb sudo dpkg -i libgomp1_4.6.3-1ubuntu5_amd64.deb sudo dpkg -i libquadmath0_4.6.3-1ubuntu5_amd64.deb sudo dpkg -i gcc-4.6_4.6.3-1ubuntu5_amd64.deb sudo dpkg -i gcc_4.6.3-1ubuntu5_amd64.deb 2. Install the IGB device driver (the package is provided, please note that we use a customized driver) cd igb-5.0.6/src sudo make 3
sudo make install 3. Edit the following text into /etc/network/interfaces: # The primary network interface auto eth0 iface eth0 inet dhcp Now you can log into the installed Linux using ssh. 4
2. How to Install OpenNSL Binary Using the package we provide. 2.1. Building OpenNSL Source code for OpenNSL sample applications may be built on the switch. Use the following steps to compile OpenNSL including sample applications. 1. Extract the code tarball into the destination directory say opennsl_root. 2. Go to output directory. For Netberg Aurora platform, it is opennsl_root/opennsl/output/x86-ub14 3. Issue "make" to create an OpenNSL shared library object, linux kernel modules. 4. The deliverables folder : opennsl_root/opennsl/output/x86-ub14/build shall have the following files. a) Linux kernel module : linux-kernel-bde.ko b) Linux user module : linux-user-bde.ko c) KNET driver module : linux-bcm-knet.ko d) OpenNSL shared object library : libopennsl.so 2.2. Building example Applications This section is applicable only if the package includes example applications. Source code for OpenNSL sample applications may be built on the switch. The example applications are dynamically linked with the OpenNSL shared library. Use the following steps to compile example applications. 1. Go to output directory. For Netberg Aurora platform, it is opennsl_root/opennsl/output/x86-ub14. 2. Issue "make examples" to compile all the sample applications 2.3. Downloading and running OpenNSL sample applications 1. cd to target deliverables directory. For Netberg Aurora platform, it is opennsl_root/opennsl/output/x86-ub14/build. 5
2. Use the following commands to update the linux kernel modules Execute "lsmod" to list the installed linux kernel modules. Remove the linux kernel and user modules by using "rmmod" command. Install linux kernel modules built for OpenNSL platform by using the following commands. Please ensure that the modules are removed before inserting it using rmmod command. # mknod /dev/linux-kernel-bde c 127 0 # mknod /dev/linux-user-bde c 126 0 # mknod /dev/linux-bcm-knet c 122 0 # insmod linux-kernel-bde.ko # insmod linux-user-bde.ko # insmod linux-bcm-knet.ko 3. Install OpenNSL shared library. The destination directory to install the shared library depends on the host environment configuration. Install the library files in a location included in the system s library search path. # mv libopennsl.so.1 /usr/lib # cd /usr/lib # ln -sf libopennsl.so.1 libopennsl.so 4. cd to the target deliverables directory and run the sample application. # chmod +x sample_application #./sample_application 6