Snappy on OpenSwitch

Simon Fels simon.fels at canonical.com
Mon Aug 29 12:46:00 UTC 2016


Hey Mike,

> I'm very interested in adding Snappy support to OpenSwitch
> (www.openswitch.net <http://www.openswitch.net/>).
> 
> OpenSwitch is a Network Operating System for network switches build upon
> OpenEmbedded/Yocto/Poky.

Pretty nice idea!

> I'm using a branch of OpenSwitch in which they've upgraded to Yocto 2.1
> - https://github.com/open-switch/ops-build
> <https://git.openswitch.net/openswitch/ops-build> branch
> "feature/yocto_2.1".
> 
> I've added meta-snappy to the bblayers.conf file used to build
> OpenSwitch and I was able to successfully 'bitbake snappy-demo-image' so
> that I at least know your meta-snappy layer is compatible with the
> OpenSwitch layers.
> 
> My knowledge of OE/bitbake is limited and I'm hoping someone could
> provide some pointers or guidance to integrating Snappy onto an existing
> OE/Yocto distribution such as OpenSwitch.

You already did the first step and verified the build of the relevant
components (snapd and snap-confine) works well in OpenSwitch.

The next step is to get the different config options for the kernel into
your kernel defconfig. We have various sample kernel trees at [1] which
you can use as reference. In meta-snappy I extended the default
linux-yocto defconfig with the bits listed in [2]. I suspect OpenSwitch
may use a different kernel tree so you have to apply the different
options for it as well. You don't need any AppArmor related patches if
you want just unconfined snaps working for a first step.

As next thing you have to add snapd and snap-confine to the content of
the OpenSwitch image. Adding snap-confine and snapd in [3] is ok to get
it things working. Later you want to add a packagegroup especially for
snappy which I am planing to add to meta-snappy which then will
automatically pull in all necessary dependencies for you.

Once that is done you should be able to build a regular OpenSwitch
image, flash it on a device or boot it in an emulator and should have
snapd running and being able to install snaps and run their applications.

If you need further help or have questions, just ask here or ping me
(nick morphis) on IRC in #snappy on FreeNode.

regards,
Simon

[1]: https://github.com/snapcore/sample-kernels
[2]:
https://github.com/morphis/meta-snappy/blob/master/recipes-kernel/linux/files/snappy.cfg
[3]:
https://git.openswitch.net/cgit/openswitch/ops-build/tree/yocto/openswitch/meta-distro-openswitch/recipes-core/packagegroups/packagegroup-openswitch.bb?h=feature/yocto_2.1





More information about the Snapcraft mailing list