文件系统"覆盖"
时间:2020-03-06 14:58:09 来源:igfitidea点击:
具体用例:
在Eclipse IDE中,可以通过将插件的文件复制到$ ECLIPSE_HOME / plugins目录中来添加新的"插件"。但是,我想保持原始Eclipse安装的"干净"状态,而无需其他插件,因为我想偶尔自行运行此基本安装。
有什么方法可以避免必须复制文件(因此不能运行干净版本),而又可以在逻辑上"覆盖"另一个目录的内容,从而使它在运行时似乎位于目录中?
例如就像是:
gravelld@gravelld-laptop:~$ ls $ECLIPSE_HOME/plugins/ org.junit_3.8.2.v200706111738 org.junit4_4.3.1 org.junit.source_3.8.2.v200706111738 gravelld@gravelld-laptop:~$ ls myplugins/ org.dangravell.myplugin.jar gravelld@gravelld-laptop:~$ overlay myplugins/ $ECLIPSE_HOME/plugins gravelld@gravelld-laptop:~$ ls $ECLIPSE_HOME/plugins/ org.dangravell.myplugin.jar org.junit_3.8.2.v200706111738 org.junit4_4.3.1 org.junit.source_3.8.2.v200706111738
另一个用例可能是围绕修补程序等等。
可以使用符号链接或者mnt来完成此操作吗?
谢谢!
解决方案
看一下"管理日食环境"文章,特别是方法3
Creating a links folder to manage product extensions If you have product extensions sitting on your file system, like the one we made in Method 1, you can create a few simple files in your Eclipse program directory to notify Eclipse that it needs to check these directories for plug-ins. First, create a directory inside your Eclipse installation folder (for example, /opt/eclipse) called links. Within this folder, you can create *.link files (for example, emfPlugins.link). Each link file points to a product extension location. Eclipse will scan this links folder on startup and find the plug-ins in each product extension pointed to by a link file.
即使新的p2设置系统有很大的不同,eclipse3.4仍然支持此功能。
现在,"链接"目录机制已为人所知,这意味着原始日食和具有自定义通用插件的日食之间的区别仅在于该"链接"目录的存在。
因此,为什么不具有"香草蚀分布",其内部具有指向" ../links"的符号链接" links"呢?
首先,获得该日食的任何用户旁边都将没有" links"目录,因此它将作为原始发行版运行。但是一旦用户创建了一个链接目录或者建立了另一个符号链接到一个通用的远程"链接"目录,该相同的发行版就会选择通用的插件远程目录...
/path/links -> /remote/links/commonPlugins /eclipse/links -> ../links
最后,如果我们使用给定的组" aGroup"创建" / remote / links / commonPlugins",并使用" 750"遮罩对其进行保护,则我们将拥有一个蚀设置:
- 对于" id -a"不包括" aGroup"的任何用户,将出现日食
- 使用" aGroup"的任何用户部分的插件使日食黯然失色
我们可以为此使用覆盖文件系统。我在Linux中知道的三个覆盖文件系统是unionfs,aufs和minifo。
Unionfs包含在最新的Ubuntu内核中。