Question about meta-snappy layer for Yocto

Hi!

I’m wondering whether the meta-snappy layer is still being actively worked on. I see that it still only supports “rocko” and builds a somewhat old version of snapd (2.32.2). Are there any plans to update the snapd recipe to use a more recent snapd (such as 2.37.4)? Or has anyone done that work on their own already? I’m trying to add snapd to a Yocto “thud” build.

Thanks,

Pascal

In default configuration snapd will attempt to re-exec the newer distribution of itself shipped in the core snap, is that work at your end?

Run snap version command to verify your actual snapd version.

Reexec is not enabled on Yocto.

1 Like

That’s my bad. I haven’t updated the layer for some time. However, updating the recipe should be rather straightforward. There may be some extra files (probably some systemd services) that need appending to snapd package, but that should be about it.

You may also want to look into bumping the version of libseccomp if meta-security carries a newer recipe.

Feel free ping me in the forums in IRC (same nick) if you need help.

Once you go through with the updates, would you mind contributing the PR to meta-snappy?

1 Like

Hi mborzecki,

I did finally manage to get snap up and running on Yocto thud. But I only did a portion of the work, so I feel a bit insecure about posting back my changes to meta-snappy.

The changes I did are the following:

  • Created my own copy of the snapd recipe and named it snapd_2.37.4.bb (changed the URL, sha256sum and md5sum accordingly).
  • I did not apply any of the currently existing patches from meta-snappy. I started with the assumption that any issues had been fixed upstream. This might have caused some issues that I have not detected yet, such as re-exec now being enabled because I didn’t include my distro name in cmd.go.
  • I did not look for “new” components in the new snapd package, so some new files might be missing from my installation.
  • I removed the install instruction “mv ${D}${libdir}/snapd/snapd-generator ${D}${systemd_unitdir}/system-generators/” because in the latest snapd, that file is already installed in the correct location.
  • I added “GO_DYNLINK_x86-64 = “”” because without this, both “snapd” and “snap” would badly crash (I found a thread about this on this forum, something about libstd.so).

Now snapd works fine. I did not run into any issues once I got all of the above sorted out. But not applying patches and not adding new snap components to the recipe make me somewhat hesitant to publish what I have. Do you still suggest that I submit what I have?

Sounds sane. Bit sad to hear about GO_DYNLINK, maybe things have regressed there. OTOH, I’m aware of any distribution using -buildmode=shared in their packaging, maybe Alpine?.

Yes, please. Be sure to enable edits from maintainers, so that I can clean it up a bit if needed to match @morphis liking.

I’m unable to create a branch on https://github.com/morphis/meta-snappy to put my changes in. Permission denied.

Please apply the regular github workflow:

  1. fork to your own repo
  2. push stuff to a separate branch in your fork
  3. open the PR on github via the web interface
1 Like

I thought the correct workflow was to create a branch, push stuff to it and open the PR. Oh well. I’m unfamiliar with the forking method. Do I need to create a new repo on Github?

Github workflow is through forks and pull requests from forks. It’s actually quite simple once you get used to it. The relevant steps:

  1. https://help.github.com/en/articles/fork-a-repo
  2. push changes to a branch in your fork
  3. https://help.github.com/en/articles/creating-a-pull-request-from-a-fork
1 Like

PR created: https://github.com/morphis/meta-snappy/pull/21

I forgot to mention that I also removed the INSANE_SKIP at the end of the recipe, as that’s no longer required.

1 Like

Thank you for the PR!

One more PR : https://github.com/morphis/meta-snappy/pull/22
Forgot to include the go-cross fix I had done to make it work on Yocto 2.6.x Thud.

1 Like

Could you try this PR locally and see if it works for you? https://github.com/morphis/meta-snappy/pull/23
It contains all the fixed I had. It builds and basic snap operations work fine here, but I’d like someone else to try it too.

1 Like

That PR is integrated, so I was able to use meta-snappy directly. I tried it and here are my observations and further fixes:

  1. I get the following warning while building (not new with this new PR, but easy to fix):
    WARNING: Layer snappy should set LAYERSERIES_COMPAT_snappy in its conf/layer.conf file to list the core layer names it is compatible with.
    I added the following to meta-snappy’s layer.conf (based on what some other layer is doing) and that warning is gone:
    LAYERSERIES_COMPAT_snappy = "thud"

  2. I saw that snap-failure was added to the list SHARED_GO_INSTALL, yet snap-failure still doesn’t end up on the filesytem. I added an “install” instruction for this executable in “do_install” and now I get it on my root filesystem.

All in all, good update. I have created a new PR with the above fixes here:

1 Like

Found some remaining references to rocko in the README.md, which would confuse new users. Created a new commit which fixes these and is now part of the same PR I just linked.

I would like to suggest to the maintainers of morphis/meta-snappy to start using branches to support more than one version of Yocto at once, like many other metas are doing. Some of the changes merged recently most certainly broke rocko support. Right now, perserving rocko support is still possible by creating a “rocko” branch on the commit that is just before my first commit (so create the branch at this commit: 0b97a631282b6b8350de10d0265d726e8c7d6f77). Then you can create a “thud” branch on the head of master (preferably after having merged my PR). Just my 2 cents, take it or leave it.

1 Like

Thank you for the PR! I will review and build it tomorrow.

Yeah, we used this approach back when I was still working on meta-mender. Seemed to work fine across a number of Yocto releases, though IIRC we’d stick with current and the previous one.

I’d love to support at least one previous release in meta-snappy too, but since I’m no longer tracking OE-Core and Yocto mailing lists and, in general, Yocto upstream, the support is mostly reactive at this point. Frankly, I’m counting a bit on getting some contributions from the community, thus your’s is greatly appreciated.

I’d happily review and proof-build any PRs for Sumo/Thud/Warrior.

Merged. Thank you!

We’ve released 2.38 just yesterday. I’ve updated the recipe. Would you mind taking a look at https://github.com/morphis/meta-snappy/pull/25 and checking it out locally too?

That new recipe with snapd 2.38 works fine for me.

1 Like

Thanks for testing! I’ll ping @morphis to have the PR merged.

1 Like