You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Paul <pa...@nosphere.org> on 2008/10/27 16:55:12 UTC

Felix on read-only filesystem

Hello felix users :)

As I'm not felix-fluent yet, excuse me if I throw some WrongTermExceptions 
here.

I'm looking at plugins/osgi bundles frameworks for a JavaSE app that must run 
in a readonly environment, no writable filesystem is available.

I'm discovering felix and tried some samples and some little home made 
bundles. I understood the bundle cache mechanism too.

Is there any effort going into the direction of being able to run felix 
without the bundle cache stored on disk ? If that is the case, where can I 
learn more ? :)

If that is not the case, can some-felixaware-body explain me what would be the 
steps needed to achieve this ?

I'm not closed about other options, but felix is oss and is supported by the 
asf. This is important to me.

Thanks in advance

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix on read-only filesystem

Posted by Kristof Taveirne <kr...@gmail.com>.
Hi,

Don't know if this will work for you but you could just install RamDisk and
put your bundlecache on a virtual disk in memory...
Ofcourse your bundlecache will be empty on restart, but if you run felix
embedded you can easily download and install them on your ramdisk from a
remote location.

Just an idea.

Grtz,
Kristof Taveirne

On Mon, Oct 27, 2008 at 4:55 PM, Paul <pa...@nosphere.org> wrote:

> Hello felix users :)
>
> As I'm not felix-fluent yet, excuse me if I throw some WrongTermExceptions
> here.
>
> I'm looking at plugins/osgi bundles frameworks for a JavaSE app that must
> run
> in a readonly environment, no writable filesystem is available.
>
> I'm discovering felix and tried some samples and some little home made
> bundles. I understood the bundle cache mechanism too.
>
> Is there any effort going into the direction of being able to run felix
> without the bundle cache stored on disk ? If that is the case, where can I
> learn more ? :)
>
> If that is not the case, can some-felixaware-body explain me what would be
> the
> steps needed to achieve this ?
>
> I'm not closed about other options, but felix is oss and is supported by
> the
> asf. This is important to me.
>
> Thanks in advance
>
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Felix on read-only filesystem

Posted by "Richard S. Hall" <he...@ungoverned.org>.
I would definitely be happy to come up with a better abstract here. The 
cache stuff isn't too great, but it covers what is needed. Of course, 
any abstraction should be simple, since we don't want to bloat the core.

We can discuss proposals on dev@felix.

-> richard

Marcel Offermans wrote:
> On Oct 28, 2008, at 17:38 , Richard S. Hall wrote:
>
>> BundleCache has getSystemBundleData() returning File, but this method 
>> is only used for framework customization, so I think you are probably 
>> safe to return null for it.
>>
>> BundleArchive has one method that returns a File (getDataFile()), 
>> which is required by the OSGi spec, but you are free to return null 
>> here.
>
>
> Just an observation. A better filesystem abstraction would be very 
> nice here. It seems Java 7 is going that way 
> (http://today.java.net/pub/a/today/2008/07/03/jsr-203-new-file-apis.html) 
> but I was wondering if OSGi is actually considering adding some kind 
> of abstraction. Or, differently, can we at Felix come up with some 
> kind of scheme for this? We probably could if we could change the 
> java.io implementation itself, but that's not allowed. ;)
>
> Greetings, Marcel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix on read-only filesystem

Posted by Marcel Offermans <ma...@luminis.nl>.
On Oct 28, 2008, at 17:38 , Richard S. Hall wrote:

> BundleCache has getSystemBundleData() returning File, but this  
> method is only used for framework customization, so I think you are  
> probably safe to return null for it.
>
> BundleArchive has one method that returns a File (getDataFile()),  
> which is required by the OSGi spec, but you are free to return null  
> here.


Just an observation. A better filesystem abstraction would be very  
nice here. It seems Java 7 is going that way (http://today.java.net/pub/a/today/2008/07/03/jsr-203-new-file-apis.html 
) but I was wondering if OSGi is actually considering adding some kind  
of abstraction. Or, differently, can we at Felix come up with some  
kind of scheme for this? We probably could if we could change the  
java.io implementation itself, but that's not allowed. ;)

Greetings, Marcel


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix on read-only filesystem

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Paul,

BundleCache has getSystemBundleData() returning File, but this method is 
only used for framework customization, so I think you are probably safe 
to return null for it.

BundleArchive has one method that returns a File (getDataFile()), which 
is required by the OSGi spec, but you are free to return null here.

BundleRevision has a method that returns a File, but that is only used 
by subtypes JarRevision and DirectoryRevision, which you could safely 
ignore.

-> richard

Paul wrote:
> Le Monday 27 October 2008 18:39:34 Karl Pauls, vous avez écrit :
>   
>>> No I can't write on the usb disk itself.
>>>       
>> Ok, well, then the only thing left seems to be to have a look at
>> org/apache/felix/framework/cache/*.java (in the framework subproject)
>> and try to implement a cache that is in memory. Again, not all bundles
>> will work without a cache (i.e., file system access) but depending on
>> your project this might be the way to go. Furthermore, we would be
>> very interested in this implementation if you get it done :-)
>>     
>
> Hello Karl,
>
> I've taken a look at BundleCache, BundleArchive and BundleRevision and several 
> public methods use File as parameter or return type so I feel that 
> implementing a full inmemory bundle cache won't be trivial.
>
> I've not yet looked at bundle installation by reference, could you tell me a 
> little bit more about ?
>
> Best regards,
>
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix on read-only filesystem

Posted by Paul <pa...@nosphere.org>.
Le Monday 27 October 2008 18:39:34 Karl Pauls, vous avez écrit :
> > No I can't write on the usb disk itself.
>
> Ok, well, then the only thing left seems to be to have a look at
> org/apache/felix/framework/cache/*.java (in the framework subproject)
> and try to implement a cache that is in memory. Again, not all bundles
> will work without a cache (i.e., file system access) but depending on
> your project this might be the way to go. Furthermore, we would be
> very interested in this implementation if you get it done :-)

Hello Karl,

I've taken a look at BundleCache, BundleArchive and BundleRevision and several 
public methods use File as parameter or return type so I feel that 
implementing a full inmemory bundle cache won't be trivial.

I've not yet looked at bundle installation by reference, could you tell me a 
little bit more about ?

Best regards,

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix on read-only filesystem

Posted by Karl Pauls <ka...@gmail.com>.
On Mon, Oct 27, 2008 at 6:07 PM, Paul <pa...@nosphere.org> wrote:
> Le Monday 27 October 2008 17:38:56 Karl Pauls, vous avez écrit :
>> well, could you write on the usb disk? You could install the bundles
>> by reference which will leave you with a very small amount of data in
>> the cache ...
>
> No I can't write on the usb disk itself.

Ok, well, then the only thing left seems to be to have a look at
org/apache/felix/framework/cache/*.java (in the framework subproject)
and try to implement a cache that is in memory. Again, not all bundles
will work without a cache (i.e., file system access) but depending on
your project this might be the way to go. Furthermore, we would be
very interested in this implementation if you get it done :-)

regards,

Karl

> Thanks a lot for your time Karl.
>
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Karl Pauls
karlpauls@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix on read-only filesystem

Posted by Paul <pa...@nosphere.org>.
Le Monday 27 October 2008 17:38:56 Karl Pauls, vous avez écrit :
> well, could you write on the usb disk? You could install the bundles
> by reference which will leave you with a very small amount of data in
> the cache ...

No I can't write on the usb disk itself.

Thanks a lot for your time Karl.

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix on read-only filesystem

Posted by Karl Pauls <ka...@gmail.com>.
well, could you write on the usb disk? You could install the bundles
by reference which will leave you with a very small amount of data in
the cache ...

regards,

Karl

On Mon, Oct 27, 2008 at 5:20 PM, Paul <pa...@nosphere.org> wrote:
> Hi Karl and Kristof, thanks for your quick answers.
>
> I should have given more details about the environment.
> The application is run from an usb disk and _must not_ write on the computer
> hard drive. Plus it must be usable without admin rights so installing a
> ramdisk is not possible.
>
> It seems felix is not my buddy on this one :)
>
> Any other idea ?
>
> Paul
>
>
>
> Le Monday 27 October 2008 17:04:04 Karl Pauls, vous avez écrit :
>> Hi Paul,
>>
>> the simple answer is no. Currently, there is no way to configure felix
>> without the bundle cache stored on disk. However, it should be
>> possible to replace the cache implementation with an in memory
>> implementation (with the exception of native libraries which wouldn't
>> work like this). Unfortunately, It is not easily plugable so you would
>> need to look around a little to get this done.
>>
>> Notice, many bundles assume that they get access to the disc as well.
>> Couldn't you just mount a ramdisk and configure felix to use that one
>> as cache location?
>>
>> regards,
>>
>> Karl
>
>
> Le Monday 27 October 2008 17:04:05 Kristof Taveirne, vous avez écrit :
>> Hi,
>>
>> Don't know if this will work for you but you could just install RamDisk and
>> put your bundlecache on a virtual disk in memory...
>> Ofcourse your bundlecache will be empty on restart, but if you run felix
>> embedded you can easily download and install them on your ramdisk from a
>> remote location.
>>
>> Just an idea.
>>
>> Grtz,
>> Kristof Taveirne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Karl Pauls
karlpauls@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix on read-only filesystem

Posted by Paul <pa...@nosphere.org>.
Hi Karl and Kristof, thanks for your quick answers.

I should have given more details about the environment.
The application is run from an usb disk and _must not_ write on the computer 
hard drive. Plus it must be usable without admin rights so installing a 
ramdisk is not possible.

It seems felix is not my buddy on this one :)

Any other idea ?

Paul



Le Monday 27 October 2008 17:04:04 Karl Pauls, vous avez écrit :
> Hi Paul,
>
> the simple answer is no. Currently, there is no way to configure felix
> without the bundle cache stored on disk. However, it should be
> possible to replace the cache implementation with an in memory
> implementation (with the exception of native libraries which wouldn't
> work like this). Unfortunately, It is not easily plugable so you would
> need to look around a little to get this done.
>
> Notice, many bundles assume that they get access to the disc as well.
> Couldn't you just mount a ramdisk and configure felix to use that one
> as cache location?
>
> regards,
>
> Karl


Le Monday 27 October 2008 17:04:05 Kristof Taveirne, vous avez écrit :
> Hi,
>
> Don't know if this will work for you but you could just install RamDisk and
> put your bundlecache on a virtual disk in memory...
> Ofcourse your bundlecache will be empty on restart, but if you run felix
> embedded you can easily download and install them on your ramdisk from a
> remote location.
>
> Just an idea.
>
> Grtz,
> Kristof Taveirne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Felix on read-only filesystem

Posted by Karl Pauls <ka...@gmail.com>.
Hi Paul,

the simple answer is no. Currently, there is no way to configure felix
without the bundle cache stored on disk. However, it should be
possible to replace the cache implementation with an in memory
implementation (with the exception of native libraries which wouldn't
work like this). Unfortunately, It is not easily plugable so you would
need to look around a little to get this done.

Notice, many bundles assume that they get access to the disc as well.
Couldn't you just mount a ramdisk and configure felix to use that one
as cache location?

regards,

Karl

On Mon, Oct 27, 2008 at 4:55 PM, Paul <pa...@nosphere.org> wrote:
> Hello felix users :)
>
> As I'm not felix-fluent yet, excuse me if I throw some WrongTermExceptions
> here.
>
> I'm looking at plugins/osgi bundles frameworks for a JavaSE app that must run
> in a readonly environment, no writable filesystem is available.
>
> I'm discovering felix and tried some samples and some little home made
> bundles. I understood the bundle cache mechanism too.
>
> Is there any effort going into the direction of being able to run felix
> without the bundle cache stored on disk ? If that is the case, where can I
> learn more ? :)
>
> If that is not the case, can some-felixaware-body explain me what would be the
> steps needed to achieve this ?
>
> I'm not closed about other options, but felix is oss and is supported by the
> asf. This is important to me.
>
> Thanks in advance
>
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Karl Pauls
karlpauls@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org