By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,767 Members | 1,995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,767 IT Pros & Developers. It's quick & easy.

Python on board with OS uclinux

P: 5
Hello,

Info relate:
OS : uclinux
Platform : unix version 2.4.22 (or 2.4.26)
Chip on board : ARM7


I want to get a python package on network to "make" in linux (Fedora core 1 or anything if it maybe done) and run python on board with above info .After I made package 2.2.3 and 2.5.2 of Python, I tried run on board such: ./python <script> with <script> is a script file and get error :
BINFMT_FLAT: bad magic/rev (0x1010100, need 0x4)
BINFMT_FLAT: bad magic/rev (0x1010100, need 0x4)
python: applet not found

I tried with python 2.5.2 package on board chip mips and platform 2.6 ( core 6 ) is ok (although when "make" still have error but I can run it on this board).

Please help me this problem , show details about it such as : get package in where? number version of python for fitting. How to configure this package to run good on board? and any info about it . Thank you so much
Mar 13 '08 #1
Share this Question
Share on Google+
8 Replies


P: 43
Python is installed on almost all distros. Key "python" (without the quotes) into a teminal. You should get >>> Then key in "import sys" (again without the leading and trailing quotes), and then "print sys.version_info". If that works you will have the version number of the installed python package printed on the screen. If you don't have Python, then use the package manager to install it. I think that is RPM on Fedora.
You can learn Python via Guido's tutorial here http://www.python.org/doc/current/tut/tut.html (be sure to look at "Executable Python Scripts") and for general reference this list links to other Python sites http://www.python-eggs.org
Mar 13 '08 #2

bgeddy
P: 16
I think the compilation of python did not convert the binary to a FLAT format binary. I think your make has gone wrong somewhere. Apparently the compiler (gcc) needs a "-Wl,-elf2flt" option on the final gcc/ld
lines. Perhaps you have to rerun configure ?

I'm no expert on compiling packages for uclinux so you'll have to google for info for the os and microprocessor options.

In fact I got the above information from google - (I looked it up as I compile from source often under linux) - but I have no experience of your setup I'm afraid.

In any case - this looks like a uclinux python interpreter source compilation problem and not a python language one. Sorry I can't be of more help.
Mar 14 '08 #3

P: 5
Yes, but i want make an application (python) to run on board such : ./python <script> .RPM can't use because can't run on board with
Info relate:
OS : uclinux
Platform : unix version 2.4.22 (or 2.4.26)
Chip on board : ARM7

I got a package with ".tgz" . After i tar it ( tar zxvf ), will have a <configure> file. I used a other file to call via <confige file> , in this file I assign some thing such :CC, CXX, AR, RANLIB, LD, CFLAGS, CXXFLAGS, LDFLAGS for my target to run board.

./python <script>
but not :
python

Hope you see my idea. Thank you
Mar 14 '08 #4

P: 5
I used:

AS=arm-elf--as
AR=arm-elf--ar
RANLIB=arm-elf--ranlib
STRIP=arm-elf--strip
CC=arm-elf--gcc
CXX=arm-elf--g++
LD=arm-elf--ld
CFLAGS="-Wl -elf2flt="-s32768" -Wa,-elf2flt="-s32768" -fno-strict-aliasing -I$INSTALL_DIR/include $CFLAGS_EXTRA"

CXXFLAGS="-Wl -elf2flt="-s32768" -Wa,-elf2flt="-s32768" -fno-strict-aliasing -I$INSTALL_DIR/include $CFLAGS_EXTRA"
LDFLAGS="-L$INSTALL_DIR/lib"

to configure but don't success.I wonder that these macros is right or wrong. If wrong I need how to modify.
Mar 14 '08 #5

bgeddy
P: 16
Yes - this is what I'm saying - you have a problem compiling python itself which I can't help you with but answers may be found on a forum dealing with uclinux. Sorry.
Mar 14 '08 #6

P: 43
./python <script>
but not :
python

Hope you see my idea. Thank you
Once again, follow the instructions here to run a script.
You can learn Python via Guido's tutorial here http://www.python.org/doc/current/tut/tut.html (be sure to look at "Executable Python Scripts")
Mar 14 '08 #7

P: 5
Once again, follow the instructions here to run a script.
Thank you,

I see that. But my board don't have python. "#! /usr/bin/env python" line is only useful when run a script(as shell script) on environment on which have set up python. So i need to build a python app for running on board : ./python <script>.
Mar 19 '08 #8

P: 43
First "./python <script>" will only work if you are in /usr/bin and <script> is in a directory that is in $PATH. If you want to run a unique version of Python, it is simpler to remove the /usr/bin/python symlink, and symlink to the version of Python that you want, instead of using ./python which requires you to always be in the directory that contains the Python executable.
Mar 19 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.