I managed to run pure Debian (debootstraped) ON my Android-based device. That means that my Nexus 5 runs a perfectly normal GNU/Linux system but with the CyanogenMod 11 Linux kernel (has some model-specific patches).
I have serial connection to the phone (through 4-pin modded headphone jack) and I can see the full kernel log.
The problem is that although the system DOES boot and work I can't find a way to interface with it, as I can't find the correct tty settings I need to use.
First of all the system is for sure alive, as I put something like
/sbin/ls /dev > /hello in the inittab (where the getty should be) and I got the directory listing.
The serial port is on /dev/ttyHSL0 and I've tried a lot with getty and the last is
/sbin/getty -8 -L -m -w 115200 ttyHSL0 with no luck at all. I've tried the other 2 ports that the listing reported (tty1 & ttyS0) without any luck as well...
Note: I tried to initiate WiFi on boot so I can get SSH but it did not work, it would not connect to the network and I don't know why. When I have a bash prompt, I'll be able to debug it...
Note 2: This is NOT a chroot system, it's Debian running on the device purely. This has nothing to do with Android.