将文件系统融合为 snap 包

将文件系统融合为 snap 包

我正在尝试将 FUSE 文件系统实现作为 snap 包分发,但无法使其工作。即使使用 --devmode 选项安装 snap,安装也会无声无息地失败。

任何能够解决此问题的帮助都将不胜感激!

sshfs 的复现步骤:

snapcraft.yaml 的内容:

name: sshfs
version: 1
summary: Mount a remote filesystem over ssh
description: Mount a remote filesystem over ssh
confinement: devmode 

apps:
    sshfs: 
        command: usr/bin/sshfs
        plugs:
            - home
            - network
            - mount-observe
parts:
    env:
        plugin: nil
        stage-packages:
            - sshfs

尝试让它工作:

x@VirtualBox:~/snaps/sshfs$ snapcraft prime
...
x@VirtualBox:~/snaps/sshfs$ cd prime/bin
x@VirtualBox:~/snaps/sshfs/prime/bin$ sudo chown root:root fusermount
[sudo] password for x: 
x@VirtualBox:~/snaps/sshfs/prime/bin$ sudo chmod +s fusermount 
x@VirtualBox:~/snaps/sshfs/prime/bin$ cd ../..
x@VirtualBox:~/snaps/sshfs$ snapcraft
...
x@VirtualBox:~/snaps/sshfs$ ls
parts  prime  snapcraft.yaml  sshfs_1_amd64.snap  stage
x@VirtualBox:~/snaps/sshfs$ sudo snap install sshfs_1_amd64.snap --devmode
64.75 MB / 64.75 MB [======================================] 100.00 % 5.83 MB/s 

Name   Version  Rev  Developer  Notes
sshfs  1        x1              devmode
x@VirtualBox:~/Downloads$ cd ~
x@VirtualBox:~$ mkdir mountpnt
x@VirtualBox:~$ which sshfs
/snap/bin/sshfs
x@VirtualBox:~$ sshfs <some remote>: mountpnt
x@VirtualBox:~$ ls mountpnt
# Nothing here!
x@VirtualBox:~$ mount
...
/var/lib/snapd/snaps/ubuntu-core_122.snap on /snap/ubuntu-core/122 type squashfs (ro,relatime)
/var/lib/snapd/snaps/sshfs_x1.snap on /snap/sshfs/x1 type squashfs (ro,relatime)
# Remote is not mounted!

相关内容