Python on board with OS uclinux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PhongPham
    New Member
    • Mar 2008
    • 5

    Python on board with OS uclinux

    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
  • woooee
    New Member
    • Mar 2008
    • 43

    #2
    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_inf o". 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

    Comment

    • bgeddy
      New Member
      • Aug 2007
      • 16

      #3
      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.

      Comment

      • PhongPham
        New Member
        • Mar 2008
        • 5

        #4
        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

        Comment

        • PhongPham
          New Member
          • Mar 2008
          • 5

          #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.

          Comment

          • bgeddy
            New Member
            • Aug 2007
            • 16

            #6
            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.

            Comment

            • woooee
              New Member
              • Mar 2008
              • 43

              #7
              ./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")

              Comment

              • PhongPham
                New Member
                • Mar 2008
                • 5

                #8
                Originally posted by woooee
                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>.

                Comment

                • woooee
                  New Member
                  • Mar 2008
                  • 43

                  #9
                  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.

                  Comment

                  Working...