Run snapcraft in container as a user

@kyrofa Isn’t that responding your question:

It was not particularly clear to what you were referring, but now that we’ve connected the dots, yes.

1 Like

the issue is not live-build but:

a) debootstrap which creates a rootfs including a populated /dev and daemon owned dirs/files so it needs permission to change dir ownership etc.

b) the chroot command to run dpkg inside the bootstrapped env. because by nature deb’s need to be able to execute their maintainer scripts as root to be fully functional (else you could just unpack the debs and be done, that wouldnt need root necessarily)

we would probably be able to handle a) somehow, but as long as a requirement is that the deb shipped binaries function the same as in a normal distro, we will not get around b) … live-build only gives us the guarantee that the same tool we use for all rootfs creation across the distro is used, it is only wrapper scripts around the above two points.

android simply doesnt use general-purpose binary packages as input so it doesnt face such problems :wink:

For when it happens, here’s some useful thing for the mounting side of things https://insights.ubuntu.com/2016/12/08/mounting-your-home-directory-in-lxd/