Ubuntu core can not run any snap apps

HI, I have already porting ubuntu core to imx6ull platform.And the system running well.The new problem is the snapweb can not start. I follow two links to enable kernel features, also has error.

xxxx@localhost:~$ snap list
Name            Version     Rev   Developer  Notes
core            16-2.26.14  2466  canonical  -
imx6ull-gadget  16.04-1     x1               -
imx6ull-kernel  4.1.15      x1               -
snapweb         0.26-10     305   canonical  -

xxxx@localhost:~$ snap run snapweb
cannot change profile for the next exec call: No such file or directory

xxxx@localhost:~$ systemctl start snap.snapweb.snapweb.service
Failed to start snap.snapweb.snapweb.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status snap.snapweb.snapweb.service' for details.

xxxx@localhost:~$ systemctl status snap.snapweb.snapweb.service
● snap.snapweb.snapweb.service - Service for snap application snapweb.snapweb
   Loaded: loaded (/etc/systemd/system/snap.snapweb.snapweb.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Tue 2017-08-22 03:55:38 UTC; 2min 10s ago
  Process: 1836 ExecStart=/usr/bin/snap run snapweb (code=exited, status=1/FAILURE)
 Main PID: 1836 (code=exited, status=1/FAILURE) 

I search more info above issue.And found it caused by ubuntu core developer has a set patch for ubuntu kernel.I checked the /var/lib/snapd/apparmor directory wasn’t exist.

https://github.com/RocketChat/Rocket.Chat/issues/7000

Now, i have serial questions.
1.Did ubuntu core developer support those patch files?
2.Is it running when disable AppArmor?

This seems to imply that you are missing the apparmor patches. In that case snapd won’t generate the apparmor profile and snap-confine will fail in the way you are seeing.

I would recommend looking at security/apparmor in your tree and in the corresponding (major.minor) ubuntu kernel.

Can you publish somewhere your kernel tree?

Thanks, I will review and diff my kernel and ubuntu kernel with security/apparmor code.

Well, it will be publish when i finish those dam things.

1 Like

note that @ppisati is one of the ubuntu kernel maintainers and could help you (if he could look at the code) :wink:

Wah, That’s great.:grinning: @ppisati I referenced the NXP official linux repo. I just modify the dts source code, other are same with that.I use branch 4.1-2.0.x-imx.

https://github.com/Freescale/linux-fslc

This branch is based off the Freescale/4.1-2.0.x-imx, plus the AA patches
and the Ubuntu core config changes in snapcraft.yaml:

$ snapcraft --target-arch=armhf

Staging kernel
Priming kernel
Snapping ‘ubuntucore-v41-20x-imx’ |

Snapped ubuntucore-v41-20x-imx_4.1.0_armhf.snap

Since i don’t have the hardware i couldn’t boot it, but i’m confident it’ll
work fine - further customize snapcraft.yaml for your needs.

Thank you very much. It’s very well on my hardware.:clap: