Reply
Thread Tools
Posts: 131 | Thanked: 241 times | Joined on Feb 2012
#1
Hello, i managed to get APL running on Sailfish. By using this, scilab code can be started including plots! It may not very usefull, but it is opensource.

Here is the installer help site, which i were using.

Here is a Demo-Video from Android It looks almost the same on sailfish, if APL.apk is used.

On sailfish it is possible to use instead the webbrowser.
The code input can be done on http://127.0.0.1/html/scilab.
The Code output is on http://127.0.0.1:4200/

It is also possible to install APL.apk, which is mainly a app which shows boths html sites together (http://127.0.0.1/html/scilab and http://127.0.0.1:4200/).
I am not sure how plots are handled, maybe it is only possible to see them on the android app. The android is opensource:
https://github.com/androportal/APL-apk

To start download apl.tar.gz, untar it and move it to /data/sdcard. For other locations, the APL android app wants to download the img on this location.

Here is my chroot script (adaption from here):
#!/bin/bash
MNT=/data/local/linux
EG=/data/example
SDCARD=/data/sdcard/APL
WWW=/data/local/linux/var/www/html

mkdir -p /data/local/linux
mount -o loop /data/sdcard/apl.img /data/local/linux
mount -t proc proc $MNT/proc
mount -o bind /dev $MNT/dev
mount -t sysfs sysfs $MNT/sys
chroot $MNT /bin/bash -c "mount /dev/pts"
chroot $MNT /bin/bash -c "chown -R www-data.www-data /var/www/"
chroot $MNT /bin/bash -c "chmod -R a+x /usr/lib/cgi-bin"
chroot $MNT /bin/bash -c "rm /dev/null"
chroot $MNT /bin/bash -c "rm /var/run/apache2/*"
chroot $MNT /bin/bash -c "rm /var/run/apache2.pid"
chroot $MNT /bin/bash -c "service apache2 stop"
chroot $MNT /bin/bash -c "service apache2 start"
chroot $MNT /bin/bash -c "chmod 777 /var/www/html/c/exbind/.open_file.c"
chroot $MNT /bin/bash -c "chmod 777 /var/www/html/cpp/exbind/.open_file.cpp"
chroot $MNT /bin/bash -c "chmod 777 /var/www/html/python/exbind/.open_file.py"
chroot $MNT /bin/bash -c "chmod 777 /var/www/html/scilab/exbind/.open_file.cde"
chroot $MNT /bin/bash -c "shellinaboxd --localhost-only -t -s /:www-data:www-data:/:true &"
chroot $MNT /bin/bash -c "rm /tmp/.X0-*"
chroot $MNT /bin/bash -c "nohup Xvfb :0 -screen 0 540x960x24 -ac < /dev/null > Xvfb.out 2> Xvfb.err &"

# mkdir -p ${SDCARD}/c/code
mkdir -p ${WWW}/c/code
# mkdir -p ${SDCARD}/cpp/code
mkdir -p ${WWW}/cpp/code
# mkdir -p ${SDCARD}/python/code
mkdir -p ${WWW}/python/code
# mkdir -p ${SDCARD}/scilab/code
mkdir -p ${WWW}/scilab/code
# mkdir -p ${SDCARD}/scilab/image
mkdir -p ${WWW}/scilab/image
#
chroot $MNT /bin/bash -c "nohup python /root/sb_manage.py &>'/dev/null'&"
#
mount -o bind ${SDCARD}/c/code ${WWW}/c/code
mount -o bind ${SDCARD}/cpp/code ${WWW}/cpp/code
mount -o bind ${SDCARD}/python/code ${WWW}/python/code
mount -o bind ${SDCARD}/scilab/code ${WWW}/scilab/code
mount -o bind ${SDCARD}/scilab/image ${WWW}/scilab/image
and the unload script
#!/bin/bash
MNT=/data/local/linux
EG=/data/example
SDCARD=/data/sdcard/APL
WWW=/data/local/linux/var/www/html

chroot $MNT /bin/bash -c "killall shellinaboxd"
chroot $MNT /bin/bash -c "service apache2 stop"
chroot $MNT /bin/bash -c "service apache2 stop"
chroot $MNT /bin/bash -c "kill $(ps -ef |grep nohup | awk '{print $2}')"
chroot $MNT /bin/bash -c "umount /dev/pts"
umount $MNT/dev/pts
umount $MNT/sys
umount $MNT/dev
umount $MNT/proc
umount -l /data/local/linux
I did not managed to stop both python commands and the Xvfb. This means after running the unload script these processes are running in the background. The only clear way to unload is rebooting. I am sorry for this.

I am not responsible for any damage on your jolla! I run both scripts on my phone and it survived. After a reboot, everything is running as normal, but you have been warned!

This may not be useful, it was fun to try. Therefore, i am posting it here.
 
Reply


 
Forum Jump


All times are GMT. The time now is 16:34.