Hi,
I have been trying to port python2.6 into Genode in tz_vmm demo.
I did the following steps.
- In the Genode source directory <source directory>/repo/libports make prepare PKG=python
- Uncomment the following line in <build directory>/etc/build.conf
REPOSITORIES += $(GENODE_DIR)/libports
- Add '*python.lib.so http://python.lib.so*' to the boot module list in the tz_vmm run script.
- Add '*python*' in the target file of the tz_vmm as follows LIBS += python
Finally, I got the following error when I compiled the tz_vmm run script.
Program core/core COMPILE kernel/test.o LINK core make[1]: Leaving directory `/home/genode/build/hw_imx53_qsb_tz' genode build completed cp: cannot stat ‘bin/tz_vmm’: No such file or directory while executing "exec cp bin/$binary [run_dir]/genode" (procedure "copy_and_strip_genode_binaries_to_run_dir" line 4) invoked from within "copy_and_strip_genode_binaries_to_run_dir $binaries" (procedure "run_boot_dir" line 14) invoked from within "run_boot_dir $binaries" (procedure "build_boot_image" line 2) invoked from within "build_boot_image [join $boot_modules " "]" (file "/home/genode/repos/os/run/tz_vmm.run" line 262) invoked from within "source $include_name" ("foreach" body line 6) invoked from within "foreach include_name [get_cmd_arg --include ""] { # first check if the include name is absolute if {[string first "/" $include_name] == 0} { puts ..." (file "/home/genode/tool/run/run" line 642) make: *** [run/tz_vmm] Error 1
Could anyone have an idea how to fix this error?
Thanks, Abhay
Hi,
After some trials and errors, I could manage to compile python2.6. I tried to run the test-python and got the following output. It seems the interpreter works fine now but I don't understand what is "*int _sigaction(int, const sigaction*, sigaction*): _sigaction not implemented*" message? Does anyone have any idea? Thanks in advance for your answers.
[init -> test-python] int _sigaction(int, const sigaction*, sigaction*): _sigaction not implemented [init -> test-python] int _sigaction(int, const sigaction*, sigaction*): _sigaction not implemented [init -> test-python] int _sigaction(int, const sigaction*, sigaction*): _sigaction not implemented [init -> test-python] int main(): Starting python ... [init -> test-python] [init -> test-python] [init -> test-python] -============================- [init -> test-python] || || [init -> test-python] || Python Core 2.6.4 || [init -> test-python] || || [init -> test-python] || Genode 11.11 || [init -> test-python] || || [init -> test-python] -============================- [init -> test-python] [init -> test-python] 2011 by Genode Labs www.genode-labs.com [init -> test-python] [init -> test-python] [init] virtual void Genode::Child_policy::exit(int): child "test-python" exited with exit value 0
Thanks,
On Sat, Jul 9, 2016 at 10:09 PM, Abhay Amala <amalaabhay@...9...> wrote:
Hi,
I have been trying to port python2.6 into Genode in tz_vmm demo.
I did the following steps.
In the Genode source directory <source directory>/repo/libports make prepare PKG=python
Uncomment the following line in <build directory>/etc/build.conf
REPOSITORIES += $(GENODE_DIR)/libports
Add '*python.lib.so http://python.lib.so*' to the boot module list in
the tz_vmm run script.
- Add '*python*' in the target file of the tz_vmm as follows LIBS += python
Finally, I got the following error when I compiled the tz_vmm run script.
Program core/core COMPILE kernel/test.o LINK core make[1]: Leaving directory `/home/genode/build/hw_imx53_qsb_tz' genode build completed cp: cannot stat ‘bin/tz_vmm’: No such file or directory while executing "exec cp bin/$binary [run_dir]/genode" (procedure "copy_and_strip_genode_binaries_to_run_dir" line 4) invoked from within "copy_and_strip_genode_binaries_to_run_dir $binaries" (procedure "run_boot_dir" line 14) invoked from within "run_boot_dir $binaries" (procedure "build_boot_image" line 2) invoked from within "build_boot_image [join $boot_modules " "]" (file "/home/genode/repos/os/run/tz_vmm.run" line 262) invoked from within "source $include_name" ("foreach" body line 6) invoked from within "foreach include_name [get_cmd_arg --include ""] { # first check if the include name is absolute if {[string first "/" $include_name] == 0} { puts ..." (file "/home/genode/tool/run/run" line 642) make: *** [run/tz_vmm] Error 1
Could anyone have an idea how to fix this error?
Thanks, Abhay
Hello,
On 29.07.2016 01:09, Abhay Amala wrote:
interpreter works fine now but I don't understand what is "*int _sigaction(int, const sigaction*, sigaction*): _sigaction not implemented*" message? Does anyone have any idea? Thanks in advance for your answers.
[init -> test-python] int _sigaction(int, const sigaction*, sigaction*): _sigaction not implemented
some code in python _probably_ calls the libc signal() function which calls in our ported libc _sigaction().
The function is, as written, not implemented - that means everything which requires signal support in python will not work.
Alex.
On 08/01/2016 02:54 PM, Alexander Boettcher wrote:
Hello,
On 29.07.2016 01:09, Abhay Amala wrote:
interpreter works fine now but I don't understand what is "*int _sigaction(int, const sigaction*, sigaction*): _sigaction not implemented*" message? Does anyone have any idea? Thanks in advance for your answers.
[init -> test-python] int _sigaction(int, const sigaction*, sigaction*): _sigaction not implemented
some code in python _probably_ calls the libc signal() function which calls in our ported libc _sigaction().
The function is, as written, not implemented - that means everything which requires signal support in python will not work.
it's much likely that the python interpreter just registers some exit handlers. So you do not need to worry about it too much.
Regards Stefan
Alex.
genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
Hi Alexander and Stefan,
Thank you for your responses.
I have another issue now. I couldn't import python built-in modules such as math, time, itertools, etc. I got "*No module named* " ImportError. However, I need this modules to run my python project. Does anyone have any idea to fix this issue? I will be grateful for any help you can provide.
Thanks,
On Monday, August 1, 2016, Stefan Kalkowski < stefan.kalkowski@...1...> wrote:
On 08/01/2016 02:54 PM, Alexander Boettcher wrote:
Hello,
On 29.07.2016 01:09, Abhay Amala wrote:
interpreter works fine now but I don't understand what is "*int _sigaction(int, const sigaction*, sigaction*): _sigaction not
implemented*"
message? Does anyone have any idea? Thanks in advance for your answers.
[init -> test-python] int _sigaction(int, const sigaction*, sigaction*): _sigaction not implemented
some code in python _probably_ calls the libc signal() function which calls in our ported libc _sigaction().
The function is, as written, not implemented - that means everything which requires signal support in python will not work.
it's much likely that the python interpreter just registers some exit handlers. So you do not need to worry about it too much.
Regards Stefan
Alex.
genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
-- Stefan Kalkowski Genode Labs
https://github.com/skalk · http://genode.org/
genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
Hey Abhay,
On 08/03/2016 11:10 AM, Abhay Amala wrote:
Hi Alexander and Stefan,
Thank you for your responses.
I have another issue now. I couldn't import python built-in modules such as math, time, itertools, etc. I got "*No module named* " ImportError. However, I need this modules to run my python project. Does anyone have any idea to fix this issue? I will be grateful for any help you can provide.
I ported the Python interpreter to Genode back in 2010 and omitted any module support at the time. My line of thinking was, if someone wants to use Python on Genode, this lack will get noticed. Congratulations you are the first one! So, basically it should not be that hard to enable module support. One has to look at the "import" side of Python, which should somehow provide the "to be interpreted" code to the interpreter, while also handling the C-code side of some modules. Since our resources are very limited, I invite you to fill in this gap and will gladly answer questions if you chose to proceed in this direction.
Cheers,
Sebastian
Hi,
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
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>
Thanks,
On Wed, Aug 3, 2016 at 9:14 PM, Sebastian Sumpf < Sebastian.Sumpf@...1...> wrote:
Hey Abhay,
On 08/03/2016 11:10 AM, Abhay Amala wrote:
Hi Alexander and Stefan,
Thank you for your responses.
I have another issue now. I couldn't import python built-in modules such as math, time, itertools, etc. I got "*No module named* " ImportError. However, I need this modules to run my python project. Does anyone have any idea to fix this issue? I will be grateful for any help you can
provide.
I ported the Python interpreter to Genode back in 2010 and omitted any module support at the time. My line of thinking was, if someone wants to use Python on Genode, this lack will get noticed. Congratulations you are the first one! So, basically it should not be that hard to enable module support. One has to look at the "import" side of Python, which should somehow provide the "to be interpreted" code to the interpreter, while also handling the C-code side of some modules. Since our resources are very limited, I invite you to fill in this gap and will gladly answer questions if you chose to proceed in this direction.
Cheers,
Sebastian
-- Sebastian Sumpf Genode Labs
http://www.genode-labs.com · http://genode.org
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
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