View Single Post
Old 03-18-2009, 08:29 PM   #11
kostap
Member
kostap began at the beginning.
 
kostap's Avatar
 
Posts: 10
Karma: 10
Join Date: Mar 2009
Location: Israel
Device: PRS-505
Yes, that's it. The post install script produces the error.
I found that /bin/sh is used in the script header. The Ubuntu has "dash" shell pointed by /bin/sh, not bash as it can be expected. I usually use another header for ensuring that script will run on bash:
!#/usr/bin/env bash
However just /bin/bash should work as well.
Anyway, I started post-install script with debug switch and got the following output:
kostap@shark:/opt/calibre$ sudo ./calibre_postinstall
+ export CALIBRE_CX_EXE=calibre_postinstall
+ CALIBRE_CX_EXE=calibre_postinstall
++ readlink -e ./calibre_postinstall
+ path=/home/sata0/opt/calibre/calibre_postinstall
++ dirname /home/sata0/opt/calibre/calibre_postinstall
+ base=/home/sata0/opt/calibre
+ loader=/home/sata0/opt/calibre/loader
+ export LD_LIBRARY_PATH=/home/sata0/opt/calibre:
+ LD_LIBRARY_PATH=/home/sata0/opt/calibre:
+ /home/sata0/opt/calibre/loader
./calibre_postinstall: line 7: 8979 Illegal instruction $loader "$@"

It works that way:
#!/bin/bash -x
export CALIBRE_CX_EXE=calibre_postinstall
path=`readlink -e $0`
base=`dirname $path`
loader=$base/loader
export LD_LIBRARY_PATH=$base:$LD_LIBRARY_PATH
exec $loader "$@"

But still "Illegal instruction" when loader is started.
So I tried to export all variables manually and start the loader using sudo:
kostap@shark:/opt/calibre$ sudo ./loader
Traceback (most recent call last):
File "/tmp/init.py", line 10, in <module>
File "/usr/lib/python2.6/locale.py", line 15, in <module>
File "/usr/lib/python2.6/functools.py", line 10, in <module>
ImportError: libpython2.6.so.1.0: cannot open shared object file: No such file or directory

That's right, I do not have Python 2.6 installation. My system is based on 2.5.
Is it really needed? I mean is it possible to re-build Calibre using pyton 2.5 and PyQt 4.3.3 instead of python 2.6 and PyQt 4.4.2 ?
I think then it will work on older systems too...
Unfortunately I cannot run the system upgrade - it will ruine all my cross-build toolchains...
Anyway, if it's impossible to adopt Calibre to older Ubuntu's, I will have to work with windows books management SW running on virtual machine (I hate this mode of operation, but sometimes there is no other choice)
kostap is offline   Reply With Quote