自定义目录或分区中的libertine容器

有没有办法在自定义目录或分区中安装自己的libertine容器? 我认为容器安装的主要大小(卷)属于这样的目录:

/home/phablet/.cache/libertine-container/my-container/rootfs 

当然,了解自己容器的其他文件位置列表会很有帮助,例如:

 ~/.local/share/libertine/ContainersConfig.json ~/.cache/libertine-container/my-container ~/.cache/my-container ~/.local/share/libertine-container/user-data/my-container ~/.local/share/libertine-container/user-data/my-container/.cach/libertine-container/my-container 

我现在只看到使用mount --bind.. ,但是这样做我们在/etc/fstab编辑或使用/etc/rc.local或upstart脚本在设备启动时自动挂载有几个问题。

所以, 第二个问题是:如果我/home/phablet/.cache/libertine-container/my-container/rootfs手动使用mount --bind..来绑定/home/phablet/.cache/libertine-container/my-container/rootfs ,那么我会在正确的工作中遇到麻烦放射性范围 ( 如那里所述 )?

在我们的行动之前,我们应该有带有ext2/3/4分区的SD卡。 在Ubuntu Touch中,它可以表示为/dev/mmcblk1p2 (在我的例子中)。 如果我们想要永久安装,我们不能使用/etc/fstab/但我们可以使用/lib/init/fstab因为我在那里回答 。 在Ubuntu Touch中永久安装SD不方便且不稳定。 有时,由于ext2分区上的文件系统错误,我在启动Ubuntu Touch时遇到了问题。 也许,击落设备不能正确执行拆卸。 所以,我决定安装SD卡,并不时在其上使用Libertine容器。

首先,我像往常一样在内部磁盘空间中创建了一个名为sd-container新容器: /home/phablet/.cache/libertine-container/sd-container 。 然后,我用这样的命令在SD上安装了ext2分区:

 sudo mount /dev/mmcblk1p2 /home/phablet/mnt/sd -t ext2 -o defaults,noatime,nodiratime,errors=remount-ro 

然后我创建了目录/home/phablet/mnt/sd/sd-container/并将/home/phablet/mnt/sd/sd-container/的rootfs副本复制到SD上的ext2分区:

 cd /home/phablet/.cache/libertine-container/sd-container rsync -aAXvH ./ /home/phablet/mnt/sd/sd-container/ 

在准备之后,我制作了在SD上挂载ext2分区并绑定rootfs( sdgo.sh )的sdgo.sh

 #!/bin/sh sudo mount /dev/mmcblk1p2 /home/phablet/mnt/sd -t ext2 -o defaults,noatime,nodiratime,errors=remount-ro sudo mount --bind /home/phablet/mnt/sd/sd-container/rootfs /home/phablet/.cache/libertine-container/sd-container/rootfs restart unity8-dash 

和脚本停止玩这个( sdstop.sh ):

 #!/bin/sh sudo umount /home/phablet/.cache/libertine-container/sd-container/rootfs sudo umount /dev/mmcblk1p2 restart unity8-dash 

最后,在我运行sdgo.sh unity8-dash重启之后,我可以在Desktop App Scope下看到新的SD容器范围及其应用程序。 我可以像往常一样运行或安装新的应用程序。 但是这个容器的rootfs位于SD卡上! 当我想停止时,我运行sdstop.sh并且SD容器范围消失。 并且小的原始rootfs (由此绑定隐藏)保留在内部磁盘空间而不进行更改。

结论:我在SD卡上有Libertine容器的rootfs,并且可以根据需要打开/关闭它及其范围。