DebiAndroid [WIP] - Debian native/chroot for datamedia Android installations
So I got an idea that I'm working on. I have been using Debian in a chroot on my Note 3 and it's really convenient to have both Debian and Android running side-by-side, but there are some things (mainly hardware/GPU hacking) that work better with a native install of Debian/Ubuntu/etc. On my Note 3 (which uses a datamedia partitioning scheme) I decided to forgo using a loopback mounted img file for my chroot and instead dump the Debian rootfs straight into my /data partition in the /data/debian directory. Why? With this configuration, Android, Debian, and Internal SD all share the same storage partition and can grow or shrink as space allows rather than deal with micromanaging partitions and having to resize. Want to install a desktop environment and delete it later? Go ahead, space allows.
So I decided to reformat my TouchPad with TP Toolbox last night and get CM11 running on it so my Ubuntu partition got wiped. That got me thinking...if I install my datamedia Debian installation, could I then write an init script to boot directly into it from a kernel? If so, the same Debian installation (residing in cm-data LVM in the debian directory) could be used both as a native install as well as a chroot from Android. Awesome!
So that's what this project is, create a Debian rootfs that doesn't require repartitioning, works as a chroot, and works natively as well. I'm calling the project DebiAndroid because it merges Debian and Android. Got some time to work on it over the weekend so hopefully I get something up, but for those who want to do it yourself it's basically just that:
1. Use debootstrap to generate a Debian armhf rootfs
2. Use qemu-user-static and chroot on your PC to install all the packages you want on your rootfs
3. Compress rootfs, put it on TouchPad, decompress in /data/debian
4. Write script to bind system FS entries to /data/debian and chroot in
5. Write init script to boot directly into /data/debian for native use
So far I've been successful at all of these, having a working chroot (with MATE desktop through XServer XSDL app) as well as booting into the chroot (terminal only right now, and USB OTG was broken so I couldn't log in). Hopefully I can get some 3.4 kernel action going as well. I'll update this post once something happens.
EDIT 1: I'm in! I forgot to set a password for root and I don't have any other accounts at the moment, so I rebooted into CM11 and chrooted in, set a password. Also had to disable the ALSA service because there's a missing firmware file that crashes it. Now to get networking up and running, I think I'll just build a kernel locally and modules_install rather than deal with cross compiling.