Search code examples
equinoxosdi

Can I avoid having all my OSDI containers copied?


I'm running on a platform that has very limited disk space and I was looking at disk usage of OpenDaylight.

The biggest directories are the plugins and configuration/org.eclipse.osgi/bundles directories. The plugins directory is where all my bundles are, so I'm OK with it. But the configuration/org.eclipse.osgi/bundles directory seems to contain mostly copies of my bundles.

For example configuration/org.eclipse.osgi/bundles/117/1/bundlefile is an exact copy of plugins/org.opendaylight.controller.clustering.services-implementation-0.4.0.jar. That is a big waste of disk space.

I've tried to find a configuration option to disable that and found nothing. Is there something?

I've looked at the Equinox source code as well and didn't find anything. Can somebody point me to the location in the code where this is done? I'd like to disable that or at least replace it by a hard link.


Solution

  • After asking the nice people on the Equinox mailing list, I've got to those conclusions:

    1. With Equinox and some other OSDI implementations, you can add a "reference:" in front of the bundle URLs to avoid useless copies (still have to copy the native libs embedded in the bundles).
    2. OpenDaylight is using org.apache.felix.fileinstall to avoid having to specify all the bundles to load. It just loads all the bundles found in a directory. And FileInstall doesn't allow to add the "reference:" in front of the URLs.

    My solution was to remove FileInstall from the loaded bundles and add all the bundles manually to the list with the "reference:" string added to the "file:" URLs.