Blog from December, 2020

This is a new category of article that falls under "RARE software architecture" special blog series. As its name implies, it deals with topics related to Operating System is certified RARE/freeRouter software can runs.

Requirement

  • Basic Linux/Unix knowledge
  • Service provider networking knowledge

Overview

 

This comes alongside "Winter" as a famous TV show would say. (smile). Mion is an interesting Operating System meant to run on network appliance. It is built on top of Yocto project and inherently share its root with Linux Open Embedded system. In order to learn more about the Operating system I invite you to read Mion project page.

Why consider such an OS you would say ? It actually boils down to:

  1. having a minimalistic Operating system with the smallest software footprint.
  2. predictable Operating System with the minimum software requirement
  3. A supported Operating System powered by a regular release cycle


Note

While trying to reach a minimalistic image in order to run the RARE software, for now we only managed to have a 5Gb image (with INTEL SDE installed). We are confident that we can still slimmed down the image but times is running against us. (smile) The very initial Mion image has a size of 45Mbytes !

Tip

Mion will support multiple network equipments ranging from APS bf2556x-1t, bf6064x, Edgecore wedge100bf32x and wedge100bf65x and many more (Delta, asgvolt64 etc.)

Article objective

In this article, we will present :

  • how to build Mion from scratch
  • how to install it on our favorites P4 switches (bf2556x-1t and wedge-100bf-32x)

[ #001 ] - Cookbook

Mion docs has an excellent getting started page. In this section we will emphasize how easy it is to build Mion. First, make sure you have a machine compliant to the "Build host" requirements. Install a pristine Debian 10 and you should be go to go ...

Install Yocto software requirement (5 minutes depending on your Internet connection)
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
     build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
     xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa \
     libsdl1.2-dev pylint3 xterm
Get Mion softwares (1 minute)
git clone --recursive git@github.com:NetworkGradeLinux/mion.git
cd mion
# To obtain related mion layers:
git clone git@github.com:NetworkGradeLinux/meta-mion.git
# Obtain the mion hardware layer
git clone git@github.com:NetworkGradeLinux/meta-mion-bsp.git


Note

The above steps require you have a GitHub account and uploaded public key to your account. You'll also have to activate ssh-agent as the build script will fetch software from Git using SSH transport.

Source Yocto Build environment variables (5 seconds)
source openembedded-core/oe-init-build-env
Launch APS bf2556x-1t ONIE build (can be very long if you have a small build host ... It is time to do something else ...)
    time ../mc_build.sh -m stordis-bf2556x-1t -h host-onie:mion-onie-image-onlpv1 
(EDIT) Reward after a long build process ... (~151 minutes on a 4 vCPU VM)
Sstate summary: Wanted 1251 Found 0 Missed 1251 Current 0 (0% match, 0% complete)
NOTE: Executing Tasks
WARNING: mc:host-onie:expat-native-2.2.9-r0 do_fetch: Failed to fetch URL https://downloads.sourceforge.net/expat/expat-2.2.9.tar.bz2, attempting MIRRORS if available
NOTE: Tasks Summary: Attempted 3161 tasks of which 1 didn't need to be rerun and all succeeded.

Summary: There was 1 WARNING message shown.

real    150m43.758s
user    0m16.407s
sys     0m3.836s

Tip

Even if the build process can be long depending on your build host, build duration can reach 30 minutes with a 32 cores machines. Subsequent builds will take significantly less time as a cache mechanism will avoid to to redo the whole build process.

Believe me, you are done !

Just wait the end of the build process and grab the freshly baked image.

Let's relaunch the build again ... (~27 seconds on a 4 vCPU VM) Thanks sstate cache !
Sstate summary: Wanted 0 Found 0 Missed 0 Current 1251 (0% match, 100% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 3161 tasks of which 3161 didn't need to be rerun and all succeeded.

real    0m27.430s
user    0m1.939s
sys     0m0.585s
Get the freshly baked Mion image !
p4@mion-build-host:~/mion/build$ cd tmp-glibc/deploy/images/stordis-bf2556x-1t/
p4@mion-build-host:~/mion/build/tmp-glibc/deploy/images/stordis-bf2556x-1t$ ls
bzImage
bzImage--5.4.49+git0+d626f9108d_ec485bd4af-r0-stordis-bf2556x-1t-20201216195930.bin
bzImage-stordis-bf2556x-1t.bin
grub-efi-bootx64.efi
mion-onie-image-onlpv1-stordis-bf2556x-1t-20201216195930.rootfs.ext4
mion-onie-image-onlpv1-stordis-bf2556x-1t-20201216195930.rootfs.manifest
mion-onie-image-onlpv1-stordis-bf2556x-1t-20201216195930.rootfs.tar.bz2
mion-onie-image-onlpv1-stordis-bf2556x-1t-20201216195930.rootfs.tar.xz
mion-onie-image-onlpv1-stordis-bf2556x-1t-20201216195930.rootfs.tar.xz.bmap
mion-onie-image-onlpv1-stordis-bf2556x-1t-20201216195930.testdata.json
mion-onie-image-onlpv1-stordis-bf2556x-1t.ext4
mion-onie-image-onlpv1-stordis-bf2556x-1t.manifest
mion-onie-image-onlpv1-stordis-bf2556x-1t.tar.bz2
mion-onie-image-onlpv1-stordis-bf2556x-1t.tar.xz
mion-onie-image-onlpv1-stordis-bf2556x-1t.tar.xz.bmap
mion-onie-image-onlpv1-stordis-bf2556x-1t.testdata.json
modules--5.4.49+git0+d626f9108d_ec485bd4af-r0-stordis-bf2556x-1t-20201216195930.tgz
modules-stordis-bf2556x-1t.tgz
onie-installer.bin
onie-installer-x86_64-stordis_bf2556x_1t.bin

Of course get onie-installer-x86_64-stordis_bf2556x_1t.bin image and you are good to go for next section (smile)

  • Boot bf2556x-1t via ONIE rescue session
  • put you Mion image at the root of a web server 


Kickstart Mion ONIE installation (1 minutes)
onie-nos-install http://<your_web_server>/onie-installer-x86_64-stordis_bf2556x_1t.bin

Once the installation has finished, your system reboot and you'll be rewarded by Mion Grub welcome page:

Tip

And in just 1 minute (warning) you have installed a minimalistic OS on your bf2556x-1t. In this post we will stop here. However, in order to finalise the installation you'll to install INTEL P4 Software Development Environment as of course you'll want to run your P4 program on the bf2556x-1t. We will cover this subsequent installation in a subsequent post.


Conclusion

In this short article we saw:

  • how to build Mion 
  • how to install Mion (process is the same on every ONIE based system: we tested bf2556x-1t, bf6064x wedge100bf-32x, wedge100bf-64x)

Please let us know if you want us to test your P4 platform with the RARE P4 software. We will then add it to the RARE Hardware Compatibility List (RARE HCL) !

(In that case you might have to arrange access to your P4 equipment or better ... Send us a sample !   (smile) )

Final words

Mion build is quite straightforward. As it share its root from Yocto, adding specificities related to your project is easy. Most probably a Bitbake recipe already exist and you'll just have to add a reference to the layer of your interest in Bitbake config file. First time build can be long and tedious if you have a small build host machine but subsequent build will be faster thanks to the sstate cache mechanism. 

Last but not least, we covered only the base OS installation, now that you have a minimal OS required to manage your machine, you need to add specific drivers and software needed to run P4 programs on APS or WEDGE platform.