Linux Installer - HTC ChaCha

There is this linux installer app in the market (link).
As it needs root, and I haven't done it yet, is there anyone here that have tried it??
Thanks,

Thanks, gonna give it a try later.

What about this?

Oh crap, I completely forgot.. Got mixed up with other stuff
Gonna put a reminder.
EDIT: Done. Screenshots attached, one for the standard terminal, the other from aptitude, before updating packages.

Anyone else tried this? I'm having some issues with getting mysql up and running. If anyone is asking well, I'm trying to transform my phone into a server and host my own site
Just because I CAN! *evil laughter*

It seems we now have a computer much more than a smartphone...
Maybe it's time to root to test this.
If it has aircrack-ng then it will worth the work.

Managed to connect via SSH from PC. Still haven't looked into the MySQL issues though.

I finally unbootlocked and rooted my ChaCha and installed this.
I installed Debian, and I'm ready to start testing things.
I installed stable but manually upgraded to testing. But I couldn't setup a SSH server.
Where did you got from??
What do you have in your sources.list?

Update apt from the Distribution Manager and afterwards:
Code:
apt-get check
apt-get update
apt-get upgrade
apt-get install ssh
I still couldn't get MySQL server 5.1 up and running; I have a strange feeling there's something wrong with the distribution, as I've just installed it on my ubuntu box without any errors.
Can you give it a try?
Code:
apt-get install mysql-server-5.1
It should print out something about package not configured yet at some point.
EDIT: Forgot to add
Code:
apt-get install openssh-server
Start the ssh server with
Code:
/usr/sbin/sshd
with "sshd" only you'll get the following error:
Code:
sshd re-exec requires execution with absolute path
Afaik, the sshd $PATH is defined wrong for the service so that's why running it simply with sshd won't work.
Test the functionality afterwards with:
Code:
ssh localhost
Forgot to add the info you requested for sources.list:
Code:
deb http://ftp.debian.org/debian squeeze main non-free
deb-src http://ftp.debian.org/debian squeeze main non-free
deb http://ftp.debian.org/debian squeeze/squeeze main non-free
deb-src http://ftp.debian.org/debian squeeze/squeeze main non-free
Should be the same though I think. What's yours?

Ok. I'll try that.
I already installed psmisc so I could try the lsdev command.
But as it uses /proc and /dev folders, and none of them are in the chroot, they are useless...
But I will try to somehow link from inside the chroot to the actual folders, to try if they work.
EDIT:
I tried mysql server, and I had an error just in the very final stage of setup.
Is this the same for you??

someone got succes?

tokafondo said:
EDIT:
I tried mysql server, and I had an error just in the very final stage of setup.
Is this the same for you??
Click to expand...
Click to collapse
Yep, it's the same.
I'm thinking that mysql 5.0 is already installed and when trying to upgrade to 5.1 a know issue is occurring, where my.cnf does not contain a skip-bdb command at the end, but it doesn't seem to work either; also tried chmod a+r on the my.cnf file as permissions were not granted properly on my device.
@dr. - success on what?

sorry i meant to boot gnome or lxde on htc chacha

dr.ilijevski said:
sorry i meant to boot gnome or lxde on htc chacha
Click to expand...
Click to collapse
Modifying the init scripts in the boot partition, I think it could be done.
Take a look here to have the information that could lead you to do it:
http://www.androidenea.com/2009/06/android-boot-process-from-power-on.html
http://www.androidenea.com/2009/08/init-process-and-initrc.html
Well, that is really the tip of the iceberg, because you would have then to port the X.org server, searching/porting/writing for the drivers for it to work, and finding a desktop enviroment that would run smoothly and with enough room in such a small screen with such a low resolution.
And not only that... What about the radio? Not the FM radio, but the GSM or CDMA radio that allows you to make voice calls and have mobile internet.

Funny thing is that if you check the market app screenshots, there is a screenshot of a running deb dist, apparently on a device.

Alex C. said:
Funny thing is that if you check the market app screenshots, there is a screenshot of a running deb dist, apparently on a device.
Click to expand...
Click to collapse
I sent the developer a couple of questions and had no answer...
This was a kind of experiment, but I think it won't last that much in my ChaCha, because it has no practical use -- for me.

Hmm, got a few extras:
mysqld (the mysql server's main program)
[ERROR]: Can't create IP socket: Permission denied
[ERROR]: Aborting.
So the ld ain't turning on since it has no "permission" to open up sockets, therefore both the mysql-server and the mysql-server-5.1 won't be able to install, since both of them require the mysqld to start first.
Addendum: missing socket file mysqld.sock in /var/run/mysqld/ seems to be the cause of this problem.

Alex C. said:
Yep, it's the same.
I'm thinking that mysql 5.0 is already installed and when trying to upgrade to 5.1 a know issue is occurring, where my.cnf does not contain a skip-bdb command at the end, but it doesn't seem to work either; also tried chmod a+r on the my.cnf file as permissions were not granted properly on my device.
@dr. - success on what?
Click to expand...
Click to collapse
Hi, reviving this question after all this time, aka message in a bottle out to anyone....
so, the stage: debian wheezy fully upgraded in a chroot jail on a nexus 7. ssh, lxde, vnc, zsh, nodejs, erlang, more stuff installed, no problems.
tried to install mysql-server 5.5, got the exact same error as in the image above. drilled a little bit, after the failed install, i ran this:
[1] % sudo mysqld --console --verbose &
[1] 18920
(ssh)[email protected] : ~
[0] % 130415 15:34:48 [Note] Plugin 'FEDERATED' is disabled.
130415 15:34:48 InnoDB: The InnoDB memory heap is disabled
130415 15:34:48 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130415 15:34:48 InnoDB: Compressed tables use zlib 1.2.7
130415 15:34:48 InnoDB: Using Linux native AIO
130415 15:34:48 InnoDB: Initializing buffer pool, size = 128.0M
130415 15:34:48 InnoDB: Completed initialization of buffer pool
130415 15:34:48 InnoDB: highest supported file format is Barracuda.
130415 15:34:48 InnoDB: Waiting for the background threads to start
130415 15:34:49 InnoDB: 5.5.30 started; log sequence number 1595675
130415 15:34:49 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130415 15:34:49 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130415 15:34:49 [Note] Server socket created on IP: '0.0.0.0'.
130415 15:34:49 [ERROR] mysqld: Can't create/write to file '/home/deimosaffair/mysqlhome/var/run/my
sqld/mysqld.pid' (Errcode: 2)
130415 15:34:49 [ERROR] Can't start server: can't create PID file: No such file or directory
note the two last lines. it seems that there are no permissions somehow to create the PID file. i edited the my.cnf file to point to that dir, tried to change the user from "mysql" to "root", nothing worked.
the dir is valid and has wide open access (i made chmod a+rw on it just to be sure), so the permissions should be ok.
the wall is starting to be bloodied from so much headbumping. any ideas in this?

dr.ilijevski said:
someone got succes?
Click to expand...
Click to collapse
Yes, I sincerely apologize for kicking an old thread but I ran into this issue today and nobody seemed to know the answer.
The fix is:
adduser mysql AID_INET
It adds the mysql user to the AID_INET group. After this MySQLd will start just fine.

Related

INADYN for Android

This is simple cross compile of INADYN 1.96.2 for Android.
"INADYN is a free DynDNS client. It gives the possibility to have your own fixed hostname registered on the internet, although your IP might be changing. It checks periodically whether the IP address stored by the DNS server is the real current IP address of the machine that is running INADYN."
http://www.inatech.eu/inadyn/
To install:
1) extract inadyn.zip to your sdcard
2) copy inadyn to /system/bin
You have two ways to run it:
1) from the shell, run: inadyn --username <DynDNS username> --password <DynDNS password> --alias <DynDNS alias>
e.g. inadyn -u test -t test -a test.thruhere.net
2) create inadyn.conf in /etc with the following contents: "--username <DynDNS username> --password <DynDNS password> --alias <DynDNS alias>" then run inadyn
You may want to use the following commands
--iterations 1 (this will cause inadyn to update the ip and exit)
--background (inadyn will run in the background)
--update_period 6000 (how often the IP is checked. The period is in [ms]. Default is about 1 min. Max is 10 days)
Reserved for build instructions
Reserved for build instructions
Reserved for inadyn-mt
Reserved for inadyn-mt
Good, thank you for sharing.
Work fine on milestone, motofrenzy (froyo whit kernel eclair).
Is there any chance you would add support for zone edit?
Sent from my ADR6300 using XDA App
error
followed instructions but no joy; keep getting:
[1] Illegal instruction
Running Froyo on LG Optimus S. Any ideas?
I have not installed this, but I would like to know the answer to this question before I do:
Is this supposed to work over cellular/3G? Or is it just wifi?
Does this work on all phones ? anybody get this to connect on tmobile?
i get error too
daflores63 said:
followed instructions but no joy; keep getting:
[1] Illegal instruction
Running Froyo on LG Optimus S. Any ideas?
Click to expand...
Click to collapse
I have the same problem running Gingerbread on HTC Wildfire S
'pidof inadyn' repeats the error message
'pidof inadyn' again returns no result

tcsh port to Android

Hi,
I searched the web for a tcsh port to Android, but came up empty. So I ported it
myself today. I've sent the required patches (not many, actually) upstream a couple of
minutes ago. You can also find them attached as file tcsh-android.diff.
There's one problem. Since $HOME isn't set by default, tcsh can't load the user
profiles (.login/.cshrc). My patch tweaks tcsh so that it sets the home directory to
/sdcard on Android if $HOME doesn't exist in the environment.
Does that make sense? On my Samsung i5800, there's an environment variable
EXTERNAL_STORAGE, which is set to /scard. Does this environment variable
exist on all Android platforms or is that a Samsung invention? If it's generically
available it would probably make sense to default the home dir to the content of
EXTERNAL_STORAGE. Is there another, better alternative?
I also made an arm binary available (see attached file tcsh.zip). Sha1sum of the
unzipped binary is 5b19a3de76c0caf20b3d7f5d1ae1e9b9427d7ef4. Tested on
Samsung i5800 w/ 2.1 via `adb shell' and local ConnectBot sessions.
It has been build like this:
configure --host=arm-linux-androideabi --prefix=/system
make
Have fun,
Corinna
cvxda said:
It has been build like this:
configure --host=arm-linux-androideabi --prefix=/system
make
Click to expand...
Click to collapse
I forgot to mention that you have to run `autoreconf' first. The patch file
doesn't include a new configure, only configure.in.
Corinna
Thanks for this! Just got it working on my Samsung Galaxy S. Good to have a decent shell.
How do you installl the shell and run it on the device?
Installing tcsh
sillyfunnypedro said:
How do you installl the shell and run it on the device?
Click to expand...
Click to collapse
I used root file explorer but you can do it with sh/busybox
Steps I under took
Unzip
Mount /system/ read write
copy to /system/xbin/
Change permissions to rwx-rx-rx
Mount /system read only again
The reason I put it in /system/xbin is the sdcards are mounted -noexec this prevents any linux executables from running from anywhere but the write protected system partitions.
To be totally correct I feel I should have used a bin directory in a new read only yafs partition mounted on /opt/
BusyBox Aliases
Attached is a complete list of aliases to busybox suitable for tcsh
add/append to your .cshrc
Or type source shell.aliases.txt just to load them.
Traditional method with busybox is to use links as in
ln -s /system/bin/busybox /somepath/more
I want to modify /system/ as little as possible and am yet to create a separate partition for /opt/. So I am using Aliases.
Hi,
for some reason this breaks resolv.conf. any ideas?
# busybox nslookup google.com
busybox nslookup google.com
Server: 192.168.2.1
Address 1: 192.168.2.1 router
Name: google.com
Address 1: 74.125.73.147 tul01m01-in-f147.1e100.net
Address 2: 74.125.73.99 tul01m01-in-f99.1e100.net
Address 3: 74.125.73.103 tul01m01-in-f103.1e100.net
Address 4: 74.125.73.104 tul01m01-in-f104.1e100.net
Address 5: 74.125.73.105 tul01m01-in-f105.1e100.net
Address 6: 74.125.73.106 tul01m01-in-f106.1e100.net
# tcsh
tcsh
localhost/# busybox nslookup google.com
busybox nslookup google.com
Server: 0.0.0.0
Address 1: 0.0.0.0
nslookup: can't resolve 'google.com'
cvxda said:
Hi,
I searched the web for a tcsh port to Android, but came up empty. So I ported it
myself today... [etc.]
Click to expand...
Click to collapse
At long last I updated the Android port in the upstream tcsh repository to support latest Android. The patches are backward incompatible with Android versions prior to 4.1.
The tcsh repo can be accessed via Github, the patchset is in commits c09b305 and 47ac106.
I attached a new arm version of tcsh to this thread for convenience. It's a zip file which can be installed from recovery mode. It installs tcsh into /system/xbin and default .cshrc and .login files to /sdcard.
Have fun,
Corinna

[Q&A] How to build/modify your own linux image for eMMC install Debian sample inside

[Q&A] How to build/modify your own linux image for eMMC install Debian sample inside
This thread is for help and support with all linux distributions instalable in eeepad asus transformer. I will explain how to build your own image file or modify existing one in order to use lilstive OLife script.
As ubuntu is the most popular distro, please, all de questions related with ubuntu post them in lilstevie's thread.
You can install any distribution with arm architecture support, but you'll need to make some tweaks in the image in order to work propperly. As my experience in linux is most of it related with debian is the distro i will give the best support, but i'll try to answer every question you ask.
I've chosen debian armHardFloat port instead of debian armel fore many reasons, you can read about this port here:
http : //wiki. debian.org/ArmHardFloatPort
This port is still young so right now there are packages still unaviable to install but they are entering in wheeze day to day. If you preffer to use armel instead or armhf you can always do, you will loose improvement but you will have (at the time of writting this) less packages aviable. In the future (not far away) it will be the best option.
Building your own image:
There are many ways to create a image file but because we are going to need qemu in order to debootstrap the instalation the easiest way to create it is with qemu-img
Code:
qemu-img create debian-armhf.img 400M
I have only given 400M of space because is going to be a minimal instalation without desktop enviroment, it could be smaller but, just in case, that's the size i've chosen. The transfer with OLife it will be faster if the image is smaller.
When you boot for your first time you will find an error because there is no valid MSDOS partition table, this is ok, nothing happens because of that but if you want to avoid it use fdisk to create a partition table
Code:
fdisk debian-armhf.img
we need now to give format to the filesistem:
Code:
mkfs.ext4 debian-armhf.img
It will ask if you really want to do because it's not an ordinary partition and you have to type "s" to proceed
Now whe have ready the image and we have to mount it in some folder to install debian in it:
Code:
mount -o loop debian-armhf.img debian
asuming debian as the created folder for that.
We are ready to debootstrap de instalation:
Code:
debootstrap --verbose --arch armhf --foreign --include=btrfs-tools,locales,kbd,wpasupplicant wheezy debian http://ftp.de.debian.org/debian
this will make the first step to install wheezy armhf, --foreing parameter is because the target architecture is different from the host one and it's going to stop before de second-stage, it will include the packages btrfs-tools locales and kbd, you can add as many as you want but it will be always faster if you install them manually once installed in the transformer. I didn't install ssh server because i have a dock, but if you don't have it will be needed to complete the instalation with a remote shell, but you can also install packages later with chroot after the second stage.
In order to be able to chroot we will need qemu-user-static, with armhf it's needed 1.0 version with armel it's not necesary, it can be any version not too old. Also if you have an i386 system it's recomendable to install an amd64 kernel to do chroot or debootstrap will fail configuring cron. Actually i think in this sample image there is anacron instead of cron because there was an issue i thought it was related with that but later twb found out the problem was another different and now it's solved.
we will add qemu-arm-static to the instalation to be able to chroot
Code:
cp /usr/bin/qemu-arm-static debian/usr/bin/
we chroot to the new enviroment:
Code:
chroot debian
and execute the second stage of debootstrap:
Code:
./debootstrap/debootstrap --second-stage
After finish the instalation we will set the root password
Code:
passwd
and now it's ready, you can make tweaks, install packages (as ssh if you need it) or whatever you want, but you will have to add a repository to /etc/apt/sources.list in order to install any packages.
In this image and debootstrap proccess i've used german repositories because are the fastest for me, but you can use another one, right now it's neede also experimental repository to have working touch screen, but as soon xserver-xorg-input-evdev with full multitouch support enters sid as it won't be necesary
example of /etc/apt/sources.list
Code:
http://ftp.de.debian.org/debian unstable main contrib non-free
http://ftp.de.debian.org/debian experimental main contrib non-free
I have already installed in this image necesary packages for that and experimental repositories won't interfiere unless you pass the parameter for apt-file so you can forget about this if you want, but if you are building your own image apt-get install -t experimental xserver-xorg will do the work.
we have ready now our image but it need some files and tweaks to make everithing work in the eepad.
From here you can apply this to any arm image you want to test.
(all the files needed are in the attached file files.tar.gz in the rigth folders)
we need to add modules and firmware, i've extracted them from lilstive ubuntu.img
strictly necesary are:
Code:
/lib/firmware/nvram.txt
/lib/firmware/brcm/*
but you may need another ones if you are going to use external hardware, that's on you.
there are also two folder in /lib/modules one is for the asus kernel and the other one for chrome os kernel, i suggest to add both of them because it's just a bit space and you will be able to use the image with both kernels.
In order to make wifi work i've made /etc/modprobe.d/options.conf file with some parameters found in one of the threads of lilstevie and /etc/modules with the modules to load.
You will also need to configure /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf all this files are in the attached files.tar.gz but wpa_supplicant.conf is not because it depends of each ones wifi, but there is a wpa_supplicant.conf.example and you can always google for it a bit. If you don't have a dock make sure you do this correctly or you won't be able to connect to the internet and ssh device to continue instalation easily
if you want to be able to use adb (wich is really usefull if you for example did not correctly configure wpa_supplicant) you will have tu add also "/usr/bin/adbd" and /etc/init.d/adbd"
I've modify the original init.d script to avid LSB tags missing warning error, it's not really necesary rsyslog as previous service started but ... it works.
In order to make adb service start automatically we will execute (inside the chroot of course)
Code:
update-rc.d /etc/init.d/adb defaults
This may be different in non debian based distributions, but you can always ln manually to rcX.d
Finally, there is the "bug" it has made me think something was wrong and change cron with anacron, when you boot it appears to stop booting starting a service (cron, dbus, deppending what you have installed) but it isn't you can login pressing ctrl + alt + F2 (touchpad key),
we think it's related with the bootloader and default tty as 7 or something like that.
As workaround add in /etc/rc.local "chvt 1" (without quotes) just before exit 0 line
Because there is not oem-installation like in ubuntu after the first boot there are a couple of things to do, we have to resize the image to fit the partition, change password, configure locales and xorg keyboard-layout (if you have more than one locales) add an user and include in relevant groups and maybe more in the future so i've made a postinstalation.sh script included in /usr/bin:
Code:
#!/bin/sh
echo "Making online resize of the root partition"
partition=`mount -l | grep " / " | awk '{print $1}'`
resize2fs $partition
echo "changing root password"
passwd
echo "configure locales"
dpkg-reconfigure locales
echo "configure xserver keyboard layout"
dpkg-reconfigure keyboard-configuration
echo "configure localtime"
dpkg-reconfigure tzdata
echo "Please anter a user name"
read username1
adduser $username1
echo "adding user to relevant groups"
adduser $username1 audio
adduser $username1 video
adduser $username1 netdev
adduser $username1 plugdev
adduser $username1 bluetooth
adduser to bluetooth will fil because there is not installed any bluetooth manager so there is not bluetooth group yet, and remeber tu use OLife script to inject bluetooth firmware in order to have bluetooth working.
And that's it i think i haven't miss anything but i will update this when needed. You can now install your image with lilstevie's OLife script, you will have to rename it to ubuntu.img from now. If everithing went ok you can now install the desktop enviroment you prefer, on screen keyboard or whatever you like.
I haven't test network manager and i've only tested kde-netbook, but there are still broken dependencies and it's a bit slow. This will improve as soon as we have hardware acceleration (if we ever do), and armhf port goes ahead.
Lilstevie is going to host my images and maybe OLife script will have more options in the future, but from now you can download from here:
http://dl.dropbox.com/u/60048492/debian-armhf.img.tar.gz
(md5sum inside)
http://dl.dropbox.com/u/60048492/files.tar.gz
All credits and many thanks for lilstevie and twb for all the help they gave me.
I will apreciate any correction not only in this process but also in my english grammar/ortography
Please, any mod or admin can correct the word modufy in the title?
reserved
Thanks
Following your instructions, I can finally replace ubuntu with debian, which resides my home laptops, office desktop, and now, on my tablet as well. Unfortunately debian has no "onboard" package... and it's rather inconvenient without a dock.
Thanks anyway for bring debian to this tablet.
boseliquid said:
Following your instructions, I can finally replace ubuntu with debian, which resides my home laptops, office desktop, and now, on my tablet as well. Unfortunately debian has no "onboard" package... and it's rather inconvenient without a dock.
Thanks anyway for bring debian to this tablet.
Click to expand...
Click to collapse
What has onboard that haven't other onscreen keyboards? i haven't ever tried onboard and i just tried a couple of onboard keyboards in debian, i also did managed to load it automatically in login screen, But i did never went deeper, like "only appear if the focus is in textbox" or something like that.
Anyway i has to be easy to rebuild that package for debian or just install it from ubuntu. What do you exactly need?
onboard onboard
Onboard has keys that simulate middle-click and right-click of mouse. I tried to install ubuntu's deb file, but runs into problem with dependencies. Compiling the source on the tablet led to error related to gdk/gdk.h which i couldn't figure out how to resolve.
Onboard respond better than others, e.g. xvkbd and florence both have run-away key presses, i.e. a string of letters appear even for a quick single tap on a key.
Also, onboard integrates nicely with lightdm. I used xdm plus florence to log in (the screen keyboard hides most of xdm's GUI).
With fluxbox, debian seems faster than ubuntu+fluxbox on the tablet. That's why onboard is nice since fluxbox menu requires right-clicking on the desktop. Fortunately, fluxbox keys are easily configurable, so i still can shutdown by pressing some key combination.
Hopefully lilstevie has the time to work on hardware acceleration, which would then allows to dump android completely.
boseliquid said:
Onboard has keys that simulate middle-click and right-click of mouse. I tried to install ubuntu's deb file, but runs into problem with dependencies. Compiling the source on the tablet led to error related to gdk/gdk.h which i couldn't figure out how to resolve.
Onboard respond better than others, e.g. xvkbd and florence both have run-away key presses, i.e. a string of letters appear even for a quick single tap on a key.
Also, onboard integrates nicely with lightdm. I used xdm plus florence to log in (the screen keyboard hides most of xdm's GUI).
With fluxbox, debian seems faster than ubuntu+fluxbox on the tablet. That's why onboard is nice since fluxbox menu requires right-clicking on the desktop. Fortunately, fluxbox keys are easily configurable, so i still can shutdown by pressing some key combination.
Hopefully lilstevie has the time to work on hardware acceleration, which would then allows to dump android completely.
Click to expand...
Click to collapse
Ok, i'll give it a look and if i can i will build a debian package in order to include it in the image
I've managed to build a couple of packages for onboard. You can't imagine how much crap it's in building dependencies, mono, unity and so many things, so i've removed appindicator dependency because i don't think it's going to be really necesary. The true is that i don't have so much time right now so,
Can you please test it and tell me if you have any problem? I can try to rebuild another older version in order to avoid unity crap and those things without messing the code, but if this works well it's the eassiest solution.
You have to install both packages, the other dependencies are instalable from debian oficial repository, at least i haven't got any problem installing it in my building environment.
http://dl.dropbox.com/u/60048492/onboard_0.95.1-1_all.deb
http://dl.dropbox.com/u/60048492/python-virtkey_0.60.0-1_armel.deb
arch of python-virtkey is armel instead of armhf
Almost there... but obtained the following error msg:
Unpacking onboard (from onboard_0.95.1-1_all.deb) ...
dpkg: dependency problems prevent configuration of onboard:
onboard depends on python-virtkey (>= 0.60.0); however:
Package python-virtkey is not installed.
onboard depends on python-gconf; however:
Package python-gconf is not installed.
dpkg: error processing onboard (--install):
dependency problems - leaving unconfigured
Thanks again.
boseliquid said:
Almost there... but obtained the following error msg:
Unpacking onboard (from onboard_0.95.1-1_all.deb) ...
dpkg: dependency problems prevent configuration of onboard:
onboard depends on python-virtkey (>= 0.60.0); however:
Package python-virtkey is not installed.
onboard depends on python-gconf; however:
Package python-gconf is not installed.
dpkg: error processing onboard (--install):
dependency problems - leaving unconfigured
Thanks again.
Click to expand...
Click to collapse
python-virtkey is provided in my previous post, just install it, after that
#apt-get install -f
will resolve and install automatically pending dependencies.
I've already tried and it works.
EDIT: i have been working in the suppose you are runnin debian armel and not armhf
To get bluetooth working, you need an armhf build of brcm_patchram_plus.
Thankfully it's GPL'd, so here's a copy.
Hi,
I'm having a bit of trouble getting Debian on my TF101 using OLiFE.
I'm forced to use the android/Ubuntu dual-boot option, but that's another story.
Basically, there's a kernel panic and I can't see the entire screen without it rebooting one second later. I am able to flash my TF101 properly without bricking (it's a B60), but everytime I boot it up as my default OS, I get that rebooting screen.
NothingMuchHereToSay said:
Hi,
I'm having a bit of trouble getting Debian on my TF101 using OLiFE.
I'm forced to use the android/Ubuntu dual-boot option, but that's another story.
Basically, there's a kernel panic and I can't see the entire screen without it rebooting one second later. I am able to flash my TF101 properly without bricking (it's a B60), but everytime I boot it up as my default OS, I get that rebooting screen.
Click to expand...
Click to collapse
Kernel panic kinda implies the problem is with the kernel, not with Debian. If you're using the 3.1 kernel, try the 2.6 one by lilstevie. Whichever kernel you're using, you're better off seeking help in one of the kernel-specific threads.
rdnetto said:
Kernel panic kinda implies the problem is with the kernel, not with Debian. If you're using the 3.1 kernel, try the 2.6 one by lilstevie. Whichever kernel you're using, you're better off seeking help in one of the kernel-specific threads.
Click to expand...
Click to collapse
Could or couldn't it may also be a problem with initramfs and boot parameters. I now because i experienced it. So if you give us more information, better, try to record a video of the bootloop and pass it slowly to see the error, i did that and it worked for me
Franks Tools-new modified Ubuntu install
Hello i dont know if this is right thread,i like to ask you advanced users for some help.I wanna install ubuntua via new modified Franks tools by kenshin,released few days ago,i cannot find exact answer what i need to progress.
My questions are: How can i made nvflashable files system.img boot.img recovery.img and others to use franks tools? how to obtain these images?
2.) and if i will use those images that can be found here on forum can i then just flash for example Revolution HD rom? ,or does it destroy my installation of ubuntu via franks tools?
because i know that there is little play with partitions so i am not sure if i can flash any rom after use of franks tools dual boot option.thank you for help
shaola said:
Could or couldn't it may also be a problem with initramfs and boot parameters. I now because i experienced it. So if you give us more information, better, try to record a video of the bootloop and pass it slowly to see the error, i did that and it worked for me
Click to expand...
Click to collapse
I did everything stock and did exactly what you said to do for Debian, though I used the armel architecture and the adb wouldn't work with an error.
By everything stock, I mean that I didn't alter anything from the OLiFE folder except adding the ubuntu.img file.
NothingMuchHereToSay said:
I did everything stock and did exactly what you said to do for Debian, though I used the armel architecture and the adb wouldn't work with an error.
By everything stock, I mean that I didn't alter anything from the OLiFE folder except adding the ubuntu.img file.
Click to expand...
Click to collapse
The original kernel from OLiFE didn't work for me - I had a boot loop. Try manually compiling the lilstevie kernel, or using a kernel from Jhinta's kernel thread.
The packed kernels (CWM zips) for Ubuntu will work exactly the same under Debian. (or at least in the direct mount case - I don't know about loop mount)
i can't get wifi up ... could someone help?
it is shown in iwlist wlan0 scan but i can't find an network ...
while boot it sends many intervals and abort this progress with givin' up.
i just copied li/firmware file from olife.img und files from this thread over it ...
anyone could help please?
NoDiskNoFun said:
i can't get wifi up ... could someone help?
it is shown in iwlist wlan0 scan but i can't find an network ...
while boot it sends many intervals and abort this progress with givin' up.
i just copied li/firmware file from olife.img und files from this thread over it ...
anyone could help please?
Click to expand...
Click to collapse
what are you uing to scan? this driver ony supports wpasupplicant, not iw nor iwconfig
hi,
i installed the ubuntu image with olife on my transformer. i don't like ubuntu very much, i prefer debian which i run debian on my computer as well. i stumbled over this thread so i wondered what's the status of debian on our transformer.
can anyone tell me whats currently working.
hanswurschtus said:
hi,
i installed the ubuntu image with olife on my transformer. i don't like ubuntu very much, i prefer debian which i run debian on my computer as well. i stumbled over this thread so i wondered what's the status of debian on our transformer.
can anyone tell me whats currently working.
Click to expand...
Click to collapse
The same as in ubuntu. But you may need some tweeks. Depends of the kernel you are using. nvidia has released also a beta of the nvidia drivers for armhf and not only armel so you may use armhf or armel with jintha's kernel and have almost everithung working.

[Tutorial] How To Logcat

Here's how to use logcat:
There are two main ways to do a logcat, within android, and through adb.
Logcat within android can be done one of two ways, through a Logcat app:
Here are two good examples are either: aLogcat or Catlog
I prefer catlog, because in my opinion it has a little bit nicer UI. Both of these programs can dump their logs to a txt file, which is very useful for debugging. Or, you can do it in terminal emulator (same rules as running through adb(see below))
From Moscow Desire:
Moscow Desire said:
Just a little more info when doing logcat.
Remember, Logcat will run till you end the session. And it won't always create the file till you do so. It's possible you may not see the logfile for a minute or so.
Edit: For phones/tablets with internal storage & external sd:
(note that the location naming convention may be different depending on device)
Open your terminal app;
Type: logcat > /sdcard/logcat.txt (this should create it in internal memory on the tablet)
To send to ext sd card: logcat > /mnt/external_sd/logcat.txt
I use a tablet for example Phones may have a different naming convention.
MD
Click to expand...
Click to collapse
On the other hand, using adb to run logcat, in my opinion is much more useful, because you can start using it when android boots (i.e. once the boot animation appears.)
The code for logcat to output to a file is
Code:
adb logcat > name of problem.txt
you can also do
Code:
adb logcat -f name of problem.txt
how I prefer to do it is this way:
Code:
adb logcat -v long > name of problem.txt
with the -v flag & the long argument, it changes output to long style, which means every line of logcat will be on its own line (makes it a little neater, imo)
Note: When outputting to a file, you will see a newline, but nothing printed, this is normal. To stop logcat from writting to a file, you need to press ctrl+c.
Here's where using logcat (via adb makes life really easy)
Lets say you find a problem you're having after looking at a logcat.
For example:
When I was trying to use a different ramdisk, wifi wouldn't work so I got a logcat that's almost 1300 lines long (a lot of stuff happens in the background)
So if you are searching for an error in the logcat file (it's always e/ for error, f/ for fatal. Those are the two main things that will break a system.)
Code:
D/dalvikvm( 871): GC_CONCURRENT freed 472K, 6% free 10224K/10823K, paused 1ms+6ms
V/AmazonAppstore.DiskInspectorServiceImpl( 871): Available blocks: 21981, Block size: 4096, Free: 90034176, Threshold: 5242880, withinThreshold? true
D/AmazonAppstore.UpdateService( 871): Received action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
W/AmazonAppstore.UpdateService( 871): Confused about why I'm running with this intent action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
D/dalvikvm( 890): GC_CONCURRENT freed 175K, 4% free 9375K/9671K, paused 2ms+3ms
V/AmazonAppstore.ReferenceCounter( 871): Reference (MASLoggerDB) count has gone to 0. Closing referenced object.
E/WifiStateMachine( 203): Failed to reload STA firmware java.lang.IllegalStateException: Error communicating to native daemon
V/AmazonAppstore.UpdateService( 871): runUpdateCommand doInBackground started.
V/AmazonAppstore.UpdateService( 871): Running UpdateCommand: digitalLocker
V/AmazonAppstore.UpdateCommand( 871): Not updating key: digitalLocker from: 1334228488057
V/AmazonAppstore.UpdateService( 871): Finished UpdateCommand: digitalLocker
V/AmazonAppstore.UpdateService( 871): Running UpdateCommand: serviceConfig
V/AmazonAppstore.MASLoggerDB( 871): performLogMetric: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
V/AmazonAppstore.MASLoggerDB( 871): onBackgroundTaskSucceeded: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
W/CommandListener( 118): Failed to retrieve HW addr for eth0 (No such device)
D/CommandListener( 118): Setting iface cfg
D/NetworkManagementService( 203): rsp
D/NetworkManagementService( 203): flags
E/WifiStateMachine( 203): Unable to change interface settings: java.lang.IllegalStateException: Unable to communicate with native daemon to interface setcfg - com.android.server.NativeDaemonConnectorException: Cmd {interface setcfg eth0 0.0.0.0 0 [down]} failed with code 400 : {Failed to set address (No such device)}
W/PackageParser( 203): Unknown element under : supports-screen at /mnt/asec/com.android.aldiko-1/pkg.apk Binary XML file line #16
D/wpa_supplicant( 930): wpa_supplicant v0.8.x
D/wpa_supplicant( 930): random: Trying to read entropy from /dev/random
D/wpa_supplicant( 930): Initializing interface 'eth0' conf '/data/misc/wifi/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
D/wpa_supplicant( 930): Configuration file '/data/misc/wifi/wpa_supplicant.conf' -> '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 930): Reading configuration file '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 930): ctrl_interface='eth0'
D/wpa_supplicant( 930): update_config=1
D/wpa_supplicant( 930): Line: 4 - start of a new network block
D/wpa_supplicant( 930): key_mgmt: 0x4
(mind you, that's 29 lines out of 1300ish, just for example)
I then could do the following with logcat:
Code:
adb logcat WifiStateMachine:E *:S -v long > name of problem.txt
and this will only print out any errors associated with WifiStateMachine, and anything which is fatal, which makes it about a million times easier to figure out what's going on!
In WifiStateMachine:E, the :E = to look for Errors, the full list of options is as follows:
V — Verbose (lowest priority)
D — Debug
I — Info (default priority)
W — Warning
E — Error
F — Fatal
S — Silent (highest priority, on which nothing is ever printed)
You can replace the :E with any other letter from above to get more info.
In order to filter out anything other than what you are looking for (in this case, WifiStateMachine) you must put a *:S after your last command (i.e. WifiStateMachine:E ThemeChoose:V ... ... AndroidRuntime:E *:S)
Sources: http://developer.android.com/tools/help/logcat.html
http://developer.android.com/tools/help/adb.html
Update for windows users:
Thank go to FuzzyMeep Two, Here's what he's posted for windows
FuzzyMeep Two said:
I have made a tool to simplify this for people. I will send you the .bat version, to see the validity of the file, and post the .exe for everyone else.
http://logcat-tool.googlecode.com/files/logcatHELPER.exe
I made this in about a half hour, so if you fnd any issues let me know. I believe i worked out all functionality issues, and do plan on expanding functionality in the future.
Click to expand...
Click to collapse
(If you used his tool, here's his post, thank him for his work!)
Very nicely done, now i have something i can refer people to
Perfect tutorial. Well done. ... I'll translate your tutorial into my language to share it other people.
pRo_lama said:
Perfect tutorial. Well done. ... I'll translate your tutorial into my language to share it other people.
Click to expand...
Click to collapse
Thank you! And thanks for taking your time to translate it!
If you need me to clarify anything shoot me a PM, and I'll help! (Same goes for anybody else interested in porting to their language)
Pax
Very nice, but I do have a question (and I started programming for Android recently): What do you do when the system reboots while debugging (in my case musb_hdrc.ko)? I tried catlog, but the logs are empty... Is there another way to do that?
Thank you in advance
Krain said:
Very nice, but I do have a question (and I started programming for Android recently): What do you do when the system reboots while debugging (in my case musb_hdrc.ko)? I tried catlog, but the logs are empty... Is there another way to do that?
Thank you in advance
Click to expand...
Click to collapse
Use adb instead of an in-android method to capture the logs, you can start when the boot animation starts (note: Not when the kernel splash screen appears) and when it reboots, it'll automatically end. (i.e. run the following in command prompt:
Code:
adb logcat *:E > oh_nos_it_crashed.txt
)
If you're not getting to the boot animation (keeps cycling on the Kernel splash screen) then you have kernel issues, and you need a kernel that has integrated last_kmsg (a whole different ball of wax that I'm still learning about) to figure out what's going on. (kmesg's are direct kernel output)
Maybe if someone like AdamOutler (or any other Dev who has a much better handle on them than myself) were to explain them, it'd help
Pax
Hey man regarding your guide .
I was testing a built of cm9 from my htc one v and it wasnt booting so the dev told me to do a logcat for it .
Just wondering what the process and commands would be?
Thanks.
Just a little more info when doing logcat.
Remember, Logcat will run till you end the session. And it won't always create the file till you do so. It's possible you may not see the logfile for a minute or so.
But what if you can't connect ADB to your device? You can do this
(note that the location naming convention may be different depending on device)
Open your terminal app;
Type: logcat > /sdcard/logcat.txt (this should create it in internal memory on the tablet)
To send to ext sd card: logcat > /mnt/external_sd/logcat.txt
I use a tablet for example Phones may have a different naming convention.
Nice definition of the display terminology
MD
tranceph0rmer said:
Hey man regarding your guide .
I was testing a built of cm9 from my htc one v and it wasnt booting so the dev told me to do a logcat for it .
Just wondering what the process and commands would be?
Thanks.
Click to expand...
Click to collapse
What you'll wanna do is run the following,
Code:
adb logcat *:E > crash.txt
And look at the output file specifically for lines that say 0x0deadbaad (if you see that, that means there's a problem with the Java libraries it references above it) otherwise look for other F/ lines, that'll point you in the right direction.
If you're having issues where and is not accessible for to buy having USB debugging turned off because of doing a /data wipe (factory data reset) first install a similar Rom (in your case, a prior, stable CM9, boot into it, turn on usb debugging, reboot into recovery & only write /cache & dalvik cache before installing the offending Rom & getting your logcat (sorry if I rambled, just got done working a double )
Pax
Sent from my R800x using Tapatalk 2
Moscow Desire said:
Just a little more info when doing logcat.
Remember, Logcat will run till you end the session. And it won't always create the file till you do so. It's possible you may not see the logfile for a minute or so.
But what if you can't connect ADB to your device? You can do this
(note that the location naming convention may be different depending on device)
Open your terminal app;
Type: logcat > /sdcard/logcat.txt (this should create it in internal memory on the tablet)
To send to ext sd card: logcat > /mnt/external_sd/logcat.txt
I use a tablet for example Phones may have a different naming convention.
Nice definition of the display terminology
MD
Click to expand...
Click to collapse
Thanks, MD!
The problem is when you can't access terminal (bootloops, fc'ing like it's going out of style, etc.) that adb is really useful. Sometimes to trick the system into working, you can (esp with AOSP based roms) install a same version of android (I.e. 4.0.4) & not wipe /data (after turning on usb debugging) & still have an access (I learned this after spending about 2-3 months crack flashing my own builds & getting tired of titanium restoring all my apps)
Pax
Sent from my R800x using Tapatalk 2
Great guide, thanks! Found it through the portal. I just added to my sig so maybe it will help stop some of those questions.
paxChristos said:
What you'll wanna do is run the following,
Code:
adb logcat *:E > crash.txt
And look at the output file specifically for lines that say 0x0deadbaad (if you see that, that means there's a problem with the Java libraries it references above it) otherwise look for other F/ lines, that'll point you in the right direction.
If you're having issues where and is not accessible for to buy having USB debugging turned off because of doing a /data wipe (factory data reset) first install a similar Rom (in your case, a prior, stable CM9, boot into it, turn on usb debugging, reboot into recovery & only write /cache & dalvik cache before installing the offending Rom & getting your logcat (sorry if I rambled, just got done working a double )
Pax
Sent from my R800x using Tapatalk 2
Click to expand...
Click to collapse
Thanks for the info.
Will do that the next time i get stuck at the boot animation
can anyone tell me how to clear / reset logcat?
Thanks in advance
riteshbendre said:
can anyone tell me how to clear / reset logcat?
Thanks in advance
Click to expand...
Click to collapse
Why would you want to do that?
To my knowledge, the only way logcat is reset is if you reboot your phone.
That's why filtering your results is very helpful, because no matter how long it's been running, you can get the info that you want without extraneous information
Pax
Thanks for the clarifications
Man thank you so much for the awesome guide!
Now I can actually filter out my logcat results instead of searching through the entire log.
Sent using Tapatalk
Helpful Tool
paxChristos said:
Here's how to use logcat.....
Click to expand...
Click to collapse
I have made a tool to simplify this for people. I will send you the .bat version, to see the validity of the file, and post the .exe for everyone else.
FIXED HUGE ISSUE CAUSING EMPTY FILES
DOWNLOAD
PM or post here if you run into any issues. They WILL be addressed.
I have made a tool to simplify Logcat creation for people. The creation of this tool was inspired, and guided, by the thread started HERE by paxChristos.
UPDATE 4.1
Corrected an issue causing empty files.
apparently, if the process id contained a space ( 1234) the file would parse correctly, but if the numbers came up to the parenthesis (12345) it would output an empty file named ACTIVITY(12345) with no extension.
This was a huge issue, and i apologize for not seeing it sooner. It has been corrected, and the logcat tool works better than ever. I just ran through a 20,000 line logcat without any empty files appearing.
a couple more things to help with stability.
Underscores (_) will be replaced by dashes (-)
Brackets ([]) and arrows (<>) will be replaced with paranthesis(())
-------------------------------------------------------------------------------------------------------------
HUGE UPDATE
Added the ability to "SUPER PARSE" Files, which separates files into folders by log level and creates a TXT file for each activity
Super parse DOES NOT Work with LONG format Logs.
SUPER PARSE is in its infancy I do expect errors, please let me know if you run into anything.
OLD STUFF
EDIT V3.6 DONE
Added ability to filter logcats by activity name. (logcat -s "FILTER")
Fixed Log Level Setting
EDIT V3.5 DONE
NOW PROPERLY PARSES "LONG" FORMAT LOGCATS.
Thank you to Senior Member jes0411 for pointing out the issues that lead me to create V3.4 and 3.5. If any of you have an issue please let me know. It could be hours before i get to it or weeks, but i will get to fixing it.
EDIT V3.4 DONE
Changed the way the date variable was handled to hopefully fix issues experienced by users of non-English versions of windows.
EDIT V3.3 DONE
EDIT V 3.2 Finished
Google code won't allow any new uploads, so i uploaded the new update to XDA in a ZIP file.
Fixed ADB Location settings, some users were having trouble if they input the ADB folder with any quotation marks in the path name, it will now automatically remove quotation marks to ensure correct syntax.
Fixed issue with ADB Location setting not exiting to previous menu.
Fixed issue with Log Level setting not exiting to previous menu.
Capitalized some stuff
Added a feature that will automatically create the selected folder if no output folder exists and the user attempts to run a log.
Added a check when selecting an output folder that will ask if you want the folder created if it does not exist
EDIT V3.1 DONE
FIXED OPTIONS 7 & 8, URLS WERE MISSING A "?"
CHANGELOG EDITS
SAVES AND PARSES FILES IN TO DIFFERENT OUPUT FILES BASED ON LOG LEVEL (E , I , D , W , ETC)
LOGCAT TOOL v1.1 by FuzzyMeep TWO
I made this in about a half hour, so if you fnd any issues let me know. I believe i worked out all functionality issues, and do plan on expanding functionality in the future.
reposted HERE
Edit: source here.
Batch Source
EDIT: UPDATED TO V1.1
added the framework to add filtering to your logcat, it is in the exe, but not utilized yet (still bugy). i have also worked out a few minor bugs in this release.
Very nice tut. Will try
thanks a ton for the in depth guide. I was always fairly confused on how to approach this, so now I'll have something to refer to in order to help all of the awesome devs here.
mcmb03 said:
thanks a ton for the in depth guide. I was always fairly confused on how to approach this, so now I'll have something to refer to in order to help all of the awesome devs here.
Click to expand...
Click to collapse
+1

[Scripting][ARM][Installer][Port] Python (static) 2.7.9 and 3.4.2

(Check out https://www.python.org for information on what python is.)
Yes you read that correctly, static python for Android! It took a while to figure out how to get this compiled, but I finally did it. I present you with an installer and a little bit of testing. The second post contains information on compilation and the sources. Btw, any cool python scripts are welcomed!
INSTALLATION
Recovery flash installers are attached that will install python 2.7.9 and/or 3.4.2 to /system/pythonX.X.X. You can install both if you want. Installation size is about 41MB, 43MB, and 49MB respectively for python 2.7.8, python 2.7.9, and python 3.4.2.
After installation, the python director(ies) in /system will contain the static python binary, some scripts, and a bunch of modules and documents. Separate scripted executables will be installed to /system/bin/python or /system/bin/python3 depending on which one is installed. These basically just set the PYTHONHOME environment variable and execute the python binary.
TESTING
When you boot up to Android after installation, you should be able to just open up a terminal and fire off some python commands.
Test using python 2.7.9:
Code:
python -c 'print "Hello World!"'
Test using python 3.4.2:
Code:
python3 -c 'print("Hello World!")'
You can also write scripts shelled with python:
Code:
#!/system/bin/python
print "Hello World!"
Make sure to set them as executable with "chmod +x".
Adjust your screen brightness via /sys (root required, tested on Galaxy Nexus):
Code:
python -c 'f=open("/sys/devices/omapdss/display0/backlight/s6e8aa0/brightness","w"); f.write("40"); f.close()'
A cool script I made to tweak file system I/O like rq_affinity, rotational, etc for I/O blocks:
Code:
#!/system/bin/python
import os,re,sys
list=[]
# find all directories containing rq_affinity
for roots, dirs, files in os.walk('/sys'):
for file in files:
match=re.search(r'\S+/rq_affinity',os.path.join(roots,file))
if match:
list.append(match.group().replace('rq_affinity',''))
# write specific values to files in each directory found before
for dir in list:
for name in 'rq_affinity', 'rotational', 'read_ahead_kb', 'nr_requests', 'iostats', 'nomerges', 'add_random':
try:
f=open(dir+name,'w')
if name is 'rq_affinity': f.write('1')
elif name is 'read_ahead_kb': f.write('512')
elif name is 'nr_requests': f.write('512')
else: f.write('0')
f.close()
except IOError:
sys.stderr.write('Problem writing to ' + dir+name + '\n')
Or execute "python" or "python3" without any parameters to open up the interpreter and go from there. When you start for example "python" (python 2.7.8), you should see something like:
Code:
Python 2.7.8 (default, Dec 2 2014, 05:15:18)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
***I haven't fully tested this yet, so let me know how it goes. I know basic commands work, but there are still some complexities in the compilation that may need to be figured out.***
(update) -- Install Extra Packages/Modules via "easy_install" -- (root required)
1) In a shell, remount /system read-writable with:
Code:
mount -o remount,rw /system
2) Change directory to /system/pythonX.X.X, i.e.,
Code:
cd /system/pythonX.X.X
3) Execute easy_install followed by a package name, i.e.,
Code:
./easy_install [i]package_name[/i]
4) Let it download and install! Then test it out.
5) Remount /system read-only with:
Code:
mount -o remount,ro /system
Also, to remove a package, execute:
Code:
./easy_install -m [i]package_name[/i]
rm -r ../lib/pythonX.X/site-packages/[i]package_name[/i]*.egg
*** Flashing the resolv.conf patch may be required to make an internet connection to download modules.
Also, a few things need to be done to get easy_install working:
1) For python 2.7.8 or 2.7.9 you need to link python2.7 to python like this:
Code:
ln -s /system/python2.7.9/bin/python2.7 /system/python2.7.9/bin/python
I'll make sure this is automatically done in future installs.
2) SSL certificates need to be added to "/etc/pki/tls/certs/" to use SSL with easy_install.
Code:
mkdir -p /etc/pki/tls/certs
curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt
ISSUES
The python installations have the following modules compiled in with external dependencies such as libraries not included at this point:
Code:
--------------PYTHON 2.7.8-2.7.9----------------------
_hashlib _multiprocessing _ssl
_testcapi bz2 crypt
dbm
Code:
--------------PYTHON 3.4.2-----------------------------
_crypt _dbm _decimal
_hashlib _multiprocessing _ssl
_testcapi
I will look into this more.
As @bubbleguuum points out, name resolution with python 3.4.2's urllib wasn't working. I found a workaround by adding the line
Code:
options single-request-reopen
to /system/etc/resolv.conf. This still needs some testing but seemed to work for me. I've included a recovery flash zip to patch /system/etc/resolv.conf if the line is not there since this is a root operation.
UPDATES
* 2014-12-02 * Compiled in more modules for each installation. This makes the installation a bit bigger, but it's worth it. You get a more complete python! To get stuff like help functions and math and readline modules, you need the larger installations linked below under "DOWNLOADS".
* 2014-12-03 * Thanks @cybojenix for pointing out some incapatibility issues with the original edify installer I was using. I have now updated the installers to use SuperSU's great non-edify sh-script installer.
* 2014-12-05 * Some updates to the installers to include more modules, plus size reduction for python 3.4.2. Modules added to python 2.7.8 : _bsddb _ctypes, _ctypes_test, _hotshot, _json, _lsprof, _sqlite3, future_builtins, and ossaudiodev, easy_install, pip(broken for now). Modules added to python 3.4.2: _bz2, _ctypes, _ctypes_test, _gdbm, _json, _lsprof, _opcode, _sqlite3, _testbuffer, _testimportmultiple, ossaudiodev, xxlimited
* 2014-12-05 * Some big updates to the installer to include almost the rest of the modules that wouldn't compile. Also easy_install is working on my end with these new experimental builds. With a little effort, should be able to get pip working as well. I had to use some hacky flags to get it to compile, ignore unresolved-symbols and such, so it definitely needs some testing. Another thing I did was tweak the install script to write over previous installations from these installations. I recommend downloading the experimental builds if you read this. The worst thing that might happen is one of the new modules I've included won't work completely.
* 2014-12-14 * Added python 2.7.9. Trimmed the installation sizes down to the much more reasonable 41MB, 43MB, and 49MB respectively for python 2.7.8, python 2.7.9, and python 3.4.2.
* 2014-12-24 * Attached a recovery flash.zip to patch resolv.conf to try and fix a urllib name resolution error.
* 2014-12-26 * A couple updates: Tweaked python installations so that modules looks for "/system/bin/sh" instead of "/bin/sh" when needed. Also a few "#!" corrections for scripts in the python bin directory. This shouldn't break anything from what I've tested, only make Android python more capable, but I'll keep the old installations attached for now just in case since the modifications involved using "sed". The second update is nice. I've added a little section on installing extra modules with easy_install(included and working with all installations).
Compiling
The environment I compiled in was a debian "wheezy" image mounted as a loop device on Android. The reason I compile this way is so I have full access to the arm environment tools, gcc compiler, etc. without having to go through the trouble of using a cross-compiler (which doesn't work in this case from my testing with uClibc, or eglibc. Code sourcery's might work but I didn't feel like booting an x86 linux installation to try). You can recreate the same environment pretty easily by using either Complete Linux Installer or Linux Deploy apps. I use both.
To get a static python compiled, I first downloaded the following packages with APT:
Code:
[i]apt-get build-dep python python3[/i]
build-essential gcc make # building tools
binutils-gold # awesome gold linker
zlib1g-dev # zlib
libreadline-dev, libncurses5-dev # readline, curses
libbz2-dev # bz2
libsqlite3-dev # sqlite3
python-bsddb3, python3-bsddb3
libgdbm-dev # gdb
libssl-dev # ssl
python-tk, python3-tk # tkinter
libdb-dev # db
python-gdbm python-bsddb3
libffi-dev # _ctypes
tcl8.6-dev # tkinter
libx11-dev # tkinter
libmpdec-dev # decimal
Then I manually installed binutils-gold by unpacking the rpm for armv7h (this isn't available with APT yet). You can get it here though. (Update: this should be available in the debian repositories now.)
For static compilation, you need to make some changes to Modules/Setup from the python source directory. Specifically, you need to add
Code:
*static*
to the top of the file. Then you need to uncomment any commented modules you would like compiled in. When you compile and see a list of failed modules, search for each of these in Modules/Setup and uncomment them. For example, change
Code:
#math mathmodule.c _math.c
to
Code:
math mathmodule.c _math.c
. Then recompile. There may be some shared dependencies and packages as well you need to figure out to get them to compile. Take a look at the attached "Setup" files for more detail.
The actually compile steps look like this:
(1)
Code:
./configure --build=arm --prefix="$PWD"/out LDFLAGS="-static -static-libgcc -Wl,--unresolved-symbols=ignore-all -Wl,--export-dynamic" CPPFLAGS=-static CXXFLAGS=-static CFLAGS="-Os -static" LDFLAGS=-static LD=ld.gold
(2) Modify the Modules/Setup file.
(3)
Code:
make clean; make install
After compiling, there are some things you can do to make your installation in "./out" smaller. Strip the large binaries in "out/bin", i.e.
Code:
strip -s ./out/bin/python2.7
Also remove the python archive library, *.o's, etc. with:
Code:
make clean
This might seem kind of weird, but it works and cleans out unnecessary files from your installation.
**Make sure to backup your Modules/Setup file if you run "make distclean". I lost my 3.4.2 Modules/Setup file after doing this. :silly: Now I gotta recreate it, dammit.
**I should also mention that compile time is very fast given the amount of data generated. It takes about 10 minutes to get python and all it's modules compiled on my Galaxy Nexus.**
:EDITS:
: Updated some configure parameters. Removed unnecessary, extra "./configure". Also added some updates to the included "Setup" files.
: Hacky update to "./conifgure" to ignore unresolved symbols, export dynamic. This allows certain modules to be compiled which have shared dependencies.
: Update to trimming down the installation size after "make". Use another "make clean".
Downloads - Extract in the source directory
Setup (python 2.7.8)
Setup (python 3.4.2)
Setup (Experimental) (python 2.7.8)
Setup (Experimental) (python 3.4.2)
Something that would be interesting to look in to would be to have pip/easy_install running, so you can install extra non c packages onto the sdcard/data/wherever.
Would you also consider opening up the sources please? There is a project I'm interested in doing involving python on Android, however a lack of time meant I couldn't finish building it.
Give me a shout if you need anything. I hope to see even more come out of this thread
Edit:
I've just looked at the updater-script. The mount command won't work on the majority of devices. Can you turn the update-binary in to a shell script please? See the SuperSU updater for reference
cybojenix said:
Something that would be interesting to look in to would be to have pip/easy_install running, so you can install extra non c packages onto the sdcard/data/wherever.
Would you also consider opening up the sources please? There is a project I'm interested in doing involving python on Android, however a lack of time meant I couldn't finish building it.
Give me a shout if you need anything. I hope to see even more come out of this thread
Edit:
I've just looked at the updater-script. The mount command won't work on the majority of devices. Can you turn the update-binary in to a shell script please? See the SuperSU updater for reference
Click to expand...
Click to collapse
Thanks for your reply! I've changed the installer to use SuperSU's no-edify sh-scripted updater. I tested on my device, but let me know if there are any issues though. I kept it pretty basic.
I added some stuff on the source modifications and compilation to the 2nd post. The only file I've actually modified so far in the source is the generated Modules/Setup file, and I've included the one I used for python 2.7.8. Unfortunately, I over-cleaned the python 3.4.2 directory, which deleted my modified Modules/Setup there, so I'll have to add it later when I re-edit it.
That's a great idea on pip/easy_install. I did download the pip_installer and tried out installing on the static python I made. Got some errors though pointing to a few modules I haven't gotten compiled into the static python installation (listed in the OP near the bottom, specifically _ctypes). I'll see what I can do about that. The line for compiling the module might just need to be added to Modules/Setup. Hopefully that's the case.
@7175
Thank you very much for these binaries.
There is however a problem: name resolution (DNS) doesn't seem to work at all (with both python 2 and 3 downloads).
All attempts to use urllib.request.urlopen('http://somehost.com') fail with "<urlopen error [Errno -2] Name or service not known>" (running python as root but it doesn't matter, and a rooted Nexus 4 running 4.4.4 stock ROM):
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/system/python3.4.2/lib/python3.4/urllib/request.py", line 153, in urlopen
return opener.open(url, data, timeout)
File "/system/python3.4.2/lib/python3.4/urllib/request.py", line 455, in open
response = self._open(req, data)
File "/system/python3.4.2/lib/python3.4/urllib/request.py", line 473, in _open
'_open', req)
File "/system/python3.4.2/lib/python3.4/urllib/request.py", line 433, in _call_chain
result = func(*args)
File "/system/python3.4.2/lib/python3.4/urllib/request.py", line 1202, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/system/python3.4.2/lib/python3.4/urllib/request.py", line 1176, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>
Click to expand...
Click to collapse
it works if replacing somehost.com by its ip address.
To reproduce above stack trace with python 3:
import urllib.request
urllib.request.urlopen('http://www.google.com')
while this work:
urllib.request.urlopen('http://173.194.45.229')
nslookup and general name resolution work anywhere else:
[email protected]:/ # nslookup www.google.com
nslookup wwwgoogle.com
Server: 8.8.4.4
Address 1: 8.8.4.4 google-public-dns-b.google.com
Name: wwwgoogle.com
Address 1: 2a00:1450:4007:80c::1014 par03s15-in-x14.1e100.net
Address 2: 173.194.45.242 par03s15-in-f18.1e100.net
Address 3: 173.194.45.240 par03s15-in-f16.1e100.net
Address 4: 173.194.45.244 par03s15-in-f20.1e100.net
Address 5: 173.194.45.241 par03s15-in-f17.1e100.net
Address 6: 173.194.45.243 par03s15-in-f19.1e100.net
Click to expand...
Click to collapse
This issue has probably something to do with how python was compiled to do name resolution. I remember vaguely a similar issue
on Ubuntu 12.04, with a ffmpeg compile that would always fail to resolve hostnames in URLs. No sure what the exact fix was but it had something to do with the libc and its name resolution mechanism. Or maybe something ipv6 related ?
@bubbleguuum : Thanks for checking out that important issue.
I did a little research and it seems there is some issue with DNS name resolution related to ipv6. I recompiled with "--disable-ipv6" and that seemed to fix the issue. I also found that adding the line
Code:
options single-request-reopen
to /etc/resolv.conf did the trick as well. Apparently this tells the resolver to use a new socket for ipv6 resolution instead of same one as ipv4. It thereby reduces wait-time as well. Maybe check on your end and see if that works. Otherwise I'll upload ipv4-only installations since this issue at least needs to be side-stepped.
EDIT: Hmm, looks like re-compiling with "--disable-ipv6" didn't fix the problem. Will have to look more into this issue and hold off on uploading ipv4-only python3 since it didn't fix it. In the meantime, I've attached a recovery flash.zip to the OP to add the above mentioned line to /system/etc/resolv.conf if needed, which seems to fix the issue for me.
7175 said:
@bubbleguuum : Thanks for checking out that important issue.
I did a little research and it seems there is some issue with DNS name resolution related to ipv6. I recompiled with "--disable-ipv6" and that seemed to fix the issue. I also found that adding the line
Code:
options single-request-reopen
to /etc/resolv.conf did the trick as well. Apparently this tells the resolver to use a new socket for ipv6 resolution instead of same one as ipv4. It thereby reduces wait-time as well. Maybe check on your end and see if that works. Otherwise I'll upload ipv4-only installations since this issue at least needs to be side-stepped.
Click to expand...
Click to collapse
Thank you for looking into this so fast.
My intended usage is for running the python binary from a regular non-root app (which works great!), so editing resolv.conf is not an option.
I've been researching that DNS resolving issue and could not find a clear explanation on why it fails on Android and not on other systems, and why exactly the added line in resolv.conf fixes (or rather workaround) it.
All seems to point to socket.getaddrinfo() failing for an unknown reason.
Is Python compiled with HAVE_GETADDRINFO defined ? If that's the case it uses the libc definition of getaddrinfo, otherwise
it uses an emulation function found in getaddrinfo.c.
My guess is that it is the latter, and what is causing this issue on Android.
It's probable this issue has already been solved on Android since other Python binaries exists, but Googling around do not give
much answer.
I get this error when trying to install anything with easy_install (using /system/python3.4.2/bin/easy_install-3.4 because /system/python3.4.2/easy_install doesn't seem to exist like in the OP):
Code:
# ./easy_install-3.4 feedparser
Searching for feedparser
Reading https://pypi.python.org/simple/feedparser/
Download error on https://pypi.python.org/simple/feedparser/: [Errno -2] Name or service not known -- Some packages may not be found!
Couldn't find index page for 'feedparser' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno -2] Name or service not known -- Some packages may not be found!
No local packages or download links found for feedparser
error: Could not find suitable distribution for Requirement.parse('feedparser')
i got curl and the certs installed in /etc/pki/tls/certs/ as per instrucions in the OP, any help?
Thoughts on PIL?
Hmm... new problems here. Android Lollipop have no /system/etc/resolv.conf by-default and urllib patch is no more works.
How it can be fixed?
http://qpython.net/index.php
Where I can find source code and related documents for project
Pratik Raj said:
Where I can find source code and related documents for project
Click to expand...
Click to collapse
I would like to know the same, as well as what license it is under... Also, I don't care about the network, but does it work on Oreo? Also, do you think I could customise the installer to install to a non-system location (/tmp) so that my flashable zip can use python?
hackintosh5 said:
I would like to know the same, as well as what license it is under... Also, I don't care about the network, but does it work on Oreo? Also, do you think I could customise the installer to install to a non-system location (/tmp) so that my flashable zip can use python?
Click to expand...
Click to collapse
Idk about OP, but I can surely post my source for python 2.7 on arm/arm64. I compiled it like a year ago, but it wasn't too bad, just required a bunch of patches and code for dlopen
I just want to say thank you so much.

Categories

Resources