Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] How to specify the configuration area for P2 ProvisioningAgent to locate the bundles.info

The majority of the handling of the configuration files is done from the LazyManipulator class in the eclipse touchpoint, which is a facade for classes in equinox.fwkadmin.equinox bundles.

Pascal

On 2013-02-18, at 6:34 AM, Dileepa Jayakody wrote:

Hi All,

Can I please know how P2 ProvisioningAgent updates the configuration files after a feature installation?

At the moment in my new multi-profile target enviorment with a shared p2-data area, after a feature installation only the P2-Profile is updated with the newly installed features.
I also see that the new feature and plugins are properly extracted to ${install.area}/features and {install.area}/plugins directories but the relevant configuraton files (configuration/org.eclipse.equinox.simpleconfigurator/bundles.info and configuration/org.eclipse.update/platform.xml) are not updated with the new features and pluging entries.

Are these files located by the P2-Agent relative to the URI given when we create the provisioningAgent? (provisioningAgent = provisioningAgentProvider.createAgent(agentURI);)
What could be the possible reasons for the provisioning agent properly updating the Profile and not the configuration files after a feature installation?

Thanks,
Dileepa

How does the ProvisioningAgent update these files during a feature installation?

On Sun, Feb 17, 2013 at 2:09 AM, Dileepa Jayakody <dileepa@xxxxxxxx> wrote:
Hi All,

We use a P2 ProvisioningAgent to perform provisioning operations in our runtime. Our initial product distribution structure was similar to a generic Eclipse installation with (dropins, plugins, features, configuration and p2 directories).
Now we are looking at shipping multiple-profile installations in a single distribution using a shared p2 data area along with different configuration directories for each Profile, see the new layout at [1]. So now default the configuration directory is changed to have separate configuration directory per Profile.

AFAIU during the provisioning action, the P2 Agent updates the relevant Profile and also adds the newly installed bundles to the configuration/org.eclipse.equinox.simpleconfigurator/bundles.info
But with the new directory layout to support multiple-profile installations, after performing a provisioning action, only the Profile is updated with the newly installed IUs. The bundles.info in the relavant configuration directory is not updated.

Is there a way to provide the osgi.configuration.area argument to the P2 Agent so that it can find the bundles.info file to update after a provisioning action?
I have also added the code-segment here on how we are performing P2 provisioning actions using P2 API [2].
Any help/pointers on this is a life-saver!

Thanks,
Dileepa

[1] new layout;

repository/components/
|--ProfileA
|    /configuration
|       |--config.ini
|       |--org.eclipse.equinox.
simpleconfigurator/bundles.info
|
|--ProfileB
|    /configuration
|       |--config.ini
|       |--org.eclipse.equinox.simpleconfigurator/bundles.info 

repository/components/p2 {shared p2 data directory for created profiles}
|--org.eclipse.equinox.p2.engine
|          |--profileRegistry
|                |---ProfileA.profile
|                |---ProfileB.profile 


[2] The Provisioning code segment;

           String P2_AGENT_LOCATION = System.getProperty("carbon.home") + File.separator + "repository" + File.separator +"components" + File.separator + "p2";
           URI agentURI = getAgentURI(P2_AGENT_LOCATION);
           provisioningAgent = provisioningAgentProvider.createAgent(agentURI);
            IPlanner planner = (IPlanner)provisioningAgent.getService(IPlanner.SERVICE_NAME);
            setPlanner(planner);
            IMetadataRepositoryManager metadataRepositoryManager =
                    (IMetadataRepositoryManager)provisioningAgent.getService(IMetadataRepositoryManager.SERVICE_NAME);
            setMetadataRepositoryManager(metadataRepositoryManager);
            IArtifactRepositoryManager artifactRepositoryManager =
                    (IArtifactRepositoryManager)provisioningAgent.getService(IArtifactRepositoryManager.SERVICE_NAME);
            setArtifactRepositoryManager(artifactRepositoryManager);
            IProfileRegistry profileRegistry = (IProfileRegistry)provisioningAgent.getService(IProfileRegistry.SERVICE_NAME);
            setProfileRegistry(profileRegistry);
            IEngine engine = (IEngine)provisioningAgent.getService(IEngine.SERVICE_NAME);
            setP2Engine(engine);
            setProvisioningContext(new ProvisioningContext(provisioningAgent));
            
             provisioningAgent.registerService(IProvisioningAgent.INSTALLER_AGENT, provisioningAgentProvider.createAgent(null)); 
             ProvisioningContext context = ServiceHolder.getProvisioningContext();
             IEngine engine = ServiceHolder.getP2Engine();
             context.setMetadataRepositories(ServiceHolder.getMetadataRepositoryManager().getKnownRepositories(IRepositoryManager.REPOSITORIES_ALL));
             context.setArtifactRepositories(ServiceHolder.getArtifactRepositoryManager().getKnownRepositories(IRepositoryManager.REPOSITORIES_ALL));
             IStatus status = PlanExecutionHelper.executePlan(provisioningPlan, engine, context, new NullProgressMonitor());
--
Dileepa Jayakody,
Software Engineer, WSO2 Inc.
Lean . Enterprise . Middleware

Mobile : +94777-857616



--
Dileepa Jayakody,
Software Engineer, WSO2 Inc.
Lean . Enterprise . Middleware

Mobile : +94777-857616
_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev


Back to the top