porting python in tz_vmm demo

Christian Helmuth christian.helmuth at ...1...
Fri Aug 12 11:49:31 CEST 2016


Hello Abhay,

On Fri, Aug 12, 2016 at 12:05:00AM +0200, Abhay Amala wrote:
> I could manage to enable python modules for my python project. I put the
> directory containing the project file (python modules) and the python
> standard libraries into a tar archive to be accessed by the tz_vmm (see the
> configuration below). The project runs successfully, but I get the
> following message when os module is imported. This message is repeated for
> each python module imported in the project. Anyone has any idea to fix
> this? Thank you in advance for your answers.
> 
> 
> [init -> tar_fs] Could not find record for /Lib/os
> [init -> tar_fs] Could not find record for /Lib/os.so
> [init -> tar_fs] Could not find record for /Lib/osmodule.so
> [init -> tar_fs] Could not find record for /Lib/os.pyc
> [init -> tar_fs] Could not find record for /Lib/os.pyc
> [init -> tz_vmm] plugin()->open("./Lib/os.pyc") failed

I suppose you did not archive 'Lib/os.pyc'? What does

  tar tf pyproject.tar

look like? If I understand you correctly your program runs anyway, so
it seems the log output is an artifact of heuristics in the Python
implementation looking for modules names 'os'.

> Here is the configuration.
> 
> <start name="tar_fs">
>         <resource name="RAM" quantum="50M"/>
>         <provides> <service name="File_system"/> </provides>
>         <config>
>             <archive name="pyproject.tar" />
>             <policy root="/" />
>         </config>
>     </start>
> 
>     <start name="tz_vmm">
>         <resource name="RAM" quantum="100M"/>
>         <config>
>              <fstab> <tar name="pyproject.tar" /> </fstab>
>              <libc stdout="/dev/log" stderr="/dev/log" >
>                  <vfs>
>                        <dir name="dev"> <log/> </dir>
>                        <fs/>
>                  </vfs>
>              </libc>
>          </config>
>     </start>

Your configuration has parts of both (the old and the new) ways to use
TAR archives in libc programs. I suggest to remove tar_fs and fix the
VFS integration of pyproject.tar like follows

  <libc stdout="/dev/log" stderr="/dev/log">
    <vfs>
      <dir name="dev"> <log/> </dir>
      <tar name="pyproject.tar"/>
    </vfs>
  </libc>

Regards
-- 
Christian Helmuth
Genode Labs

http://www.genode-labs.com/ · http://genode.org/
https://twitter.com/GenodeLabs · /ˈdʒiː.nəʊd/

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth




More information about the users mailing list