python 2.6 Folder on SD almost empty?


Maschinenherz

Member
Joined
Dec 27, 2013
Messages
68
Hello..

Some Python PNDs like Keepnote wont work since I upgraded the OS on SD to 1.62. Now I have upgraded to 1.71 and hoped it would fix it. But, surprise, nothing like that. Today I looked on the Python folder on Nand and could see much more files and folders on NAND than SD. My problem is, every time I try to copy to /media/root/usr/lib/python2.6 it says directory not found...

of course I tried with sudo. I have no idea....
 
Python was updated to python2.7 in one of the recent SuperZaxxon releases. 
 
I know. The PNDs  that wont run refer in the pnd.out first to 2.7, then to something from 2.6 they cant find. they work with the old OS from NAND, but not with any newer OS. on SD. And I installed the OS 3 times, to be sure. So without any other idea, I thought this might work, if i was able to copy the old 2.6 from NAND to the same folder on SD, where everything but one folder is missing. .

and with keepnote as PND most important to me, I allready contacted the maintainer a while ago, but without a solution
 
Last edited by a moderator:
Can you post the pndrun.out file? I've not come across anything that tries one python version then falls back to a previous one, so I'd be interested to see that working if that's what it's doing.

Copying to /usr/lib/python2.6 should work fine, you'll just have to make the directory first if it doesn't exist, and there's no guarantee anything other than python 2.6 will look in there.

FWIW, your thread title should probably mention keepnote, if that's what you're trying to run. As Trashy noted, your /usr/lib/python2.6 folder is expected not to be there if you're running python 2.7, but without trying it or seeing any logs, it's unclear to me why it wouldn't work in python 2.7.
 
I've downloaded keepnote and had a quick look. It looks like it just launches straight into python, so it shouldn't be forwarding to an older python version, but looking at the logs would help a lot.
 
=======================================================================================
PND             : /media/BOOT/pandora/menu/KeepNote.pnd
PND_FSTYPE      : Squashfs
APPDATADIR      : /media/BOOT/pandora/appdata/keepnote
APPDD_FSTYPE    : vfat
PND_CPUSPEED    : <unset>
EXENAME         : keepnote
ARGUMENTS       : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -t squashfs -o ro "/dev/loop0" "/mnt/utmp/keepnote"
Mounting the Union FS : mount -t aufs -o exec,noplink,dirs="/media/BOOT/pandora/appdata/keepnote=rw+nolwh":"/mnt/pnd/keepnote=rr" none "/mnt/utmp/keepnote"
[sUCCESS]--- Mount the PND ----------
[ START ]--- Starting the application ( keepnote  ) ----------
Traceback (most recent call last):
  File "./keepnote", line 79, in <module>
    import keepnote
  File "/mnt/utmp/keepnote/keepnote/__init__.py", line 51, in <module>
    from keepnote.notebook import \
  File "/mnt/utmp/keepnote/keepnote/notebook/__init__.py", line 47, in <module>
    from keepnote import trans
  File "/mnt/utmp/keepnote/keepnote/trans.py", line 28, in <module>
    import ctypes
  File "/usr/lib/python2.7/ctypes/__init__.py", line 10, in <module>
    from _ctypes import Union, Structure, Array
ImportError: libpython2.6.so.1.0: cannot open shared object file: No such file or directory
[ FAILED]--- Starting the application ( keepnote  ) ----------
[ START ]--- Restoring the frame buffer status ----------
[sUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- Restoring nub mode ----------
[sUCCESS]--- Restoring nub mode ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[sUCCESS]--- Waiting the Union to be available ----------
rmdir: failed to remove `/mnt/utmp/keepnote': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[sUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[sUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 4
 
 
Perhaps it could help. I looked at Gearhead 2, which is also Python based as I remeber and crashes, or the  gourmet recipe program, but these two have other reasons, like disk full (with 10gb free space Oo) or libpango import error. hoped for a pattern there, but nope. but geting keepnote running would help me very much
 
  File "/usr/lib/python2.7/ctypes/__init__.py", line 10, in <module>
    from _ctypes import Union, Structure, Array
ImportError: libpython2.6.so.1.0: cannot open shared object file: No such file or directory

ctypes is a python lib for loading up arbitrary compiled shared libs (non-python code). I would guess then that trans.py is specifically set to load up the py 2.6 lib, which is not there; might be able to symlink from py 2.7 to 2.6 and cross your fingers... but I would bet the pnd has a config, or modded py file, that specifically mentions the now missing file, by full path and filename. That is likely a fixable thing.

jeff
 
Ok. But, because I am a noob and have no idea how to do this, I will first try something different.


Yesterday I remembered that i downloaded the most PNDs on a shitty inet connection on a thumbdrive via netbook, before the freshly ordered pandy arrived. I deleted an reinstalled other non working PNDs on a now available better connection and diectly with pndmanager and they worked. But they had other errors in the pnd.out like no disk space or bus failure.


I also downloaded the OS image for SD that way. So i try with a fresh downloaded image.Because maybe was the image also broken. And reflashing 3 times with a broken image is no help. After work I will take this way
 
Last edited by a moderator:
ctypes is a python lib for loading up arbitrary compiled shared libs (non-python code). I would guess then that trans.py is specifically set to load up the py 2.6 lib, which is not there; might be able to symlink from py 2.7 to 2.6 and cross your fingers... but I would bet the pnd has a config, or modded py file, that specifically mentions the now missing file, by full path and filename. That is likely a fixable thing.
I don't think there's anything in trans.py at fault - I can't find anything in it doing python path mangling, or anything like that. However:

/mnt/Keepnote.pnd$ grep -r libpython2\.6\.so *


Binary file bin/_ctypes.so matches


I can't immediately see the source or any build scripts for that, so I'd propose the quickest fix might be a symlink.


It does seem a little odd that ctypes.py in /usr/lib/python2.7 is loading something from inside the pnd though - perhaps it was a hack to fix something in python2.6's ctypes as on the old sz image. I don't know if it's possible to delete files from pnds using the appdata directory, but I'd also be tempted to try eliminating it if possible to see if the supplied _ctypes.so works now.
 
I asked in the keepnote thread about the problem. Another user with the os on SD experienced no problems. I think, it might be a problem thats not pnd specific
 
No this IS a PND issue. It's broken when using it on the NAND and that IS the default method, my guess with the SD install it kept some residual python2.6 binary/libraries or that user that claim it still works hasn't updated his version of SuperZaxxon.
 
Last edited by a moderator:
Hmm, there might be a problem with a simple symlink solution. From my copy of ctypes/__init__.py in my local Py2.7 install:


__version__ = "1.1.0"


...


from _ctypes import __version__ as _ctypes_version


...


if __version__ != _ctypes_version:


raise Exception("Version number mismatch", __version__, _ctypes_version)


As I understand it, we can't use the old _ctypes.so in the pnd, as that we'll be version 1.0, and will fail that test.


I guess that means the user running an SD install was still using Python 2.6, probably in an old OS image.


I'm not sure how you configure python to look for .so files, but it might be possible to blat over that bit in the launcher script if I can find it.
 
Here, I've made a hacked version of keepnote for testing purposes, just by knocking out that _ctypes.so. I don't really expect this to work, but I've no way of testing it locally, and it certainly won't work on old SZ installs, but it might get a bit further on before falling over, so logs would be good.

keepnote_hack.pnd
 

Attachments

  • keepnote_hack.pnd
    869 KB · Views: 312
So I reflashed the SD with a complete new downloaded 1.71 with the gui tool... aaand now I am stuck in a commandline login without nowing any user and pw... Oo


Now i have to do it manually starting from 1.62.zip because I cant find the tarball...and then run the upgrade process... yay.


After that I will first try the original keepnote pnd, and if this wont work the hacked one. man, sometimes quantumphysics ia easier... -.-
 
=======================================================================================
PND             : /media/64GB/pandora/menu/KeepNote.pnd
PND_FSTYPE      : Squashfs
APPDATADIR      : /media/64GB/pandora/appdata/keepnote
APPDD_FSTYPE    : vfat
PND_CPUSPEED    : <unset>
EXENAME         : keepnote
ARGUMENTS       : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -t squashfs -o ro "/dev/loop1" "/mnt/utmp/keepnote"
Mounting the Union FS : mount -t aufs -o exec,noplink,dirs="/media/64GB/pandora/appdata/keepnote=rw+nolwh":"/mnt/pnd/keepnote=rr" none "/mnt/utmp/keepnote"
[sUCCESS]--- Mount the PND ----------
[ START ]--- Starting the application ( keepnote  ) ----------

==============================================
KeepNote 0.7.5: Wed May  6 19:28:04 2015
enabling extension 'backup_tar'
enabling extension 'new_file'

Traceback (most recent call last):
  File "/mnt/utmp/keepnote/keepnote/__init__.py", line 1184, in init_extensions
    enabled = ext.enable(True)
  File "/mnt/utmp/keepnote/keepnote/extension.py", line 234, in enable
    self.enabled.notify(enable)
  File "/mnt/utmp/keepnote/keepnote/listening.py", line 60, in notify
    listener(*args, **kargs)
  File "/mnt/utmp/keepnote/keepnote/extensions/new_file/__init__.py", line 85, in on_enabled
    self.load_config()
  File "/mnt/utmp/keepnote/keepnote/extensions/new_file/__init__.py", line 103, in load_config
    self.save_default_example_files()
  File "/mnt/utmp/keepnote/keepnote/extensions/new_file/__init__.py", line 168, in save_default_example_files
    shutil.copy(os.path.join(base, fn), os.path.join(data_dir, fn))
  File "/usr/lib/python2.7/shutil.py", line 118, in copy
    copymode(src, dst)
  File "/usr/lib/python2.7/shutil.py", line 91, in copymode
    os.chmod(dst, mode)
OSError: [Errno 1] Operation not permitted: '/mnt/utmp/keepnote/keepnote/extensions_data/new_file/plain_text.txt'
enabling extension 'editor_insert_date'
enabling extension 'command_basics'
enabling extension 'export_html'
enabling extension 'python_prompt'
enabling extension 'keepnote'
/usr/pandora/scripts/pnd_run.sh: line 522: 25557 Segmentation fault      "./$EXENAME" $ARGUMENTS "$@"
[ FAILED]--- Starting the application ( keepnote  ) ----------
[ START ]--- Restoring the frame buffer status ----------
[sUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[sUCCESS]--- Waiting the Union to be available ----------
auplink:plink.c:223: AUFS_CTL_PLINK_MAINT: Inappropriate ioctl for device
rmdir: failed to remove `/mnt/utmp/keepnote': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[sUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[sUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 3
 
 
successfully flashed 1.71 on SD like it should on first try. then I started your haked pnd... and now we have a segfault. the original pnd wont work like before
 
Is that last log from my hacked version, or the original - because the filename suggests the original, but it ends in a different error and then a segfault?  I'll assume it's the hacked version.

That python's crashing with a segfault isn't good - it means we've hit a bug in python, since even in error it should normally process the errors internally then return a numeric error code, not segfault.  But it fires off an OSError before it crashes, so it may be worth investigating the cause of that.

Looking at the stack trace, and not looking at any of the other code yet, it looks like the new_file extension is trying to create some template files in its data directory.  But for some reason, it's determined that its data directory should be inside the mounted pnd, which is read-only, so saving files there is never going to work.  I can't envisage how upgrading to python 2.7 has changed that, although perhaps now we're not relying on a hacked _ctypes.so, that's changed the situation.  Although if that was a hack to redirect the data directory to the user's appdata, well it boggles my mind who decided that was a good hack.

I'll take a look at the code it uses to determine its data_dir tomorrow, and see if it uses ctypes for that, and at the same time seeing if I can hack it slightly to use a more appropriate location, then see how it runs from there.
 
Erm... that's how aufs works though, to the application it looks like it's saving files directly to the mounted PND, when in reality they are being saved to the appdata folder. Are you sure it's not just a case of it trying to write to a folder which doesn't exist in appdata but does in the PND? in that case it may just be a matter of ensuring that that folder has been created first.

- Neelix
 
Back
Top