Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
systemd: add support for squashfuse #1380
Conversation
|
This got tested inside an Ubuntu 16.04 container on the distro 4.4 kernel with unprivileged fuse mounts enabled (fuse module option). It's not enough on its own to make snapd work, but it goes get us past the first problem which was that the snap wouldn't mount at all, and now instead gets us stuck on AppArmor profile loading (which @tych0 is working on as part of lxc/lxd#1942). |
|
I added the extra fstype argument to the systemd mount unit writer as there was nothing in the code that suggested that this function was squashfs-specific (despite it only being used for squashfs right now). If you don't expect to ever use this code for anything but squashfs, then my change can be simplified quite a bit. |
|
squashfuse is currently in the review queue for the Ubuntu archive at https://launchpad.net/ubuntu/yakkety/+queue An amd64 package can be found here: https://dl.stgraber.org/squashfuse_0.1.100-0ubuntu1_amd64.deb |
|
add to whitelist |
|
Looks okay |
niemeyer
reviewed
Jun 22, 2016
| @@ -405,16 +406,45 @@ func (l Log) String() string { | ||
| return fmt.Sprintf("%s %s %s", l.Timestamp(), l.SID(), l.Message()) | ||
| } | ||
| +// UseFuse detects if we should be using squashfuse instead |
niemeyer
Jun 22, 2016
•
Contributor
This functionality is misplaced. The systemd package knows nothing about squashfs.
Actually, I take that back. Functionality is fine here. It'll be easier to test and as far as it works in every cases where squashfs works, it should be fine.
niemeyer
Jun 22, 2016
Contributor
The method also shouldn't be public (no reason to call it from outside), and it needs some tests covering its functionality, otherwise we'll break it and won't notice. Should be trivial by mocking the resources depended on (we need a test covering each) and verifying that the service file generated looks good.
niemeyer
Jun 22, 2016
Contributor
Sorry, changed opinion about the proper place. Please see updated comment above.
stgraber
Jun 22, 2016
Contributor
Ok, so we could remove the squashfs logic from WriteMountUnitFile and just require all callers to pass the right fstype (fuse.squashfs if they need to use fuse), then make UseFuse a bit more generic and move it to osutil. Would that make sense or were you thinking about something else?
|
Functionality looks fine. Needs |
niemeyer
added
the
Reviewed
label
Jun 22, 2016
niemeyer
changed the title from
Add support for squashfuse
to
systemd: add support for squashfuse
Jun 22, 2016
|
I've now made UseFuse private (becomes useFuse) and I've added two tests that simulate the container and not-container case, checking the resulting unit. |
|
Looks like the test results are a bit confused:
|
|
I'm going to push re-trigger them all, see if I get more lucky. |
|
Ok, that's better, just autopkgtest still failing for what looks like an unrelated reason now. |
|
Thanks! |
stgraber commentedJun 22, 2016
This attempts to detect cases where a straight squashfs mount won't work
and if squashfuse is available, uses that instead.
The motivation for this is to support snapd running inside containers.
Signed-off-by: Stéphane Graber stgraber@ubuntu.com