DebiAndroid [WIP] - Debian native/chroot for datamedia Android installations

Search This thread

CalcProgrammer1

Senior Member
Oct 8, 2007
650
756
Kansas City
Debian for the HP TouchPad

Downloads:

todo: add pics and binary links, for now there's https://mega.co.nz/#F!xZ81iKoK!Xio5bV9yjBRPTIzjLhCX3A

Source:

Kernel Builder: https://github.com/CalcProgrammer1/kernel_tenderloin_debian

I put together this kernel builder repository that contains the ramdisks needed to boot either a discrete Debian partition or a chrooted Debian install. It uses submodules for the kernel and backports sources. You can just run the mkbootzip.sh file and it will build the uImage.Debian/uImage.DebiAndroid moboot kernels. Choose the one that fits your installation method and install it to /boot on the TouchPad.

Kernel Source: https://github.com/CalcProgrammer1/..._msm8660-common/tree/tenderloin-cm-11.0-wip-5

Backports Source: https://github.com/CalcProgrammer1/backports-3.10-2

Thanks to jcsullins for porting the TouchPad to the samsung_msm8660-common kernel, without which this would not have been so easy! The Note 1 shares this kernel tree and I already had Debian working on it, made the port to TouchPad dead simple.
 
Last edited:
  • Like
Reactions: preflex

CalcProgrammer1

Senior Member
Oct 8, 2007
650
756
Kansas City
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.

EDIT 2: I'm at it again, this time going to focus on Freedreno graphics as I'm really close on my Note 1 port which uses the same GPU and now the same kernel source tree as well. I was able to get a rendered 3D screensaver to run for a few seconds on my Note, should be repeatable on the TP.

EDIT 3:

Kernel Source: https://github.com/CalcProgrammer1/..._msm8660-common/tree/tenderloin-cm-11.0-wip-5
 
Last edited:

Atari-San

Senior Member
Jun 23, 2013
154
29
O_O

Man, that sound really great ! :D I would like to try it and install it as a zip file on another partition. How much space do you need for the root partition with your mate install ? Did you got some problem with the touchscreen sensibility or with bluetooth, wifi, camera, micro or sound not working ? I guess i could try one with Gnome 3 on my side. Thank in advance for your reply.
 

CalcProgrammer1

Senior Member
Oct 8, 2007
650
756
Kansas City
Right now it's only working in chroot, so Android is providing the X-server and touchscreen and everything else. I'm trying to get the kernel 3.4 to boot it outside of Android.
 

Atari-San

Senior Member
Jun 23, 2013
154
29
I hope you can do it. ^_^ Maybe I will try to find a way to make it work with Arch Linux with your kernel if you succeed to this project.
 

Atari-San

Senior Member
Jun 23, 2013
154
29
So finally, one month later, did you succeed into making Debian work for the Tenderloin ? :confused:
 

CalcProgrammer1

Senior Member
Oct 8, 2007
650
756
Kansas City
I got Debian with Freedreno sorta working on my Galaxy Note:

https://www.youtube.com/watch?v=qtb-TSGumNo

The kernel patch I used to make this work seems compatible with the TouchPad kernel source here:

https://github.com/TLOIN-3X-WIP/android_kernel_samsung_msm8660-common/tree/tenderloin-cm-11.0-wip-5

which is based off the same Samsung msm8660-common 3.0 kernel.

If all goes well, this should be pretty simple to get running on the TouchPad same as it is on the Note, which are pretty similar devices in terms of core (MSM8660 vs APQ8060).

EDIT: My kernel patch applied perfectly! I was able to get into X but the backlight shut off and I couldn't see anything without shining a bright light through the swamp of fingerprints covering the screen. Need to fix that issue but hopefully it's working otherwise!

EDIT: Freedreno confirmed working, but still no backlight. It should be at the same level as where my Note 1 demo is (runs es2gears, rss-glx screensavers) but of course I can't see much anything so once I figure out what's turning off the backlight then we should be good to go.

EDIT: Using jcsullins' wip-5 branch fixes the backlight issues. Here's a video:

https://www.youtube.com/watch?v=vx8_u1jhXJY
 
Last edited:

Atari-San

Senior Member
Jun 23, 2013
154
29
I got Debian with Freedreno sorta working on my Galaxy Note:

https://www.youtube.com/watch?v=qtb-TSGumNo

The kernel patch I used to make this work seems compatible with the TouchPad kernel source here:

https://github.com/TLOIN-3X-WIP/android_kernel_samsung_msm8660-common/tree/tenderloin-cm-11.0-wip-5

which is based off the same Samsung msm8660-common 3.0 kernel.

If all goes well, this should be pretty simple to get running on the TouchPad same as it is on the Note, which are pretty similar devices in terms of core (MSM8660 vs APQ8060).

EDIT: My kernel patch applied perfectly! I was able to get into X but the backlight shut off and I couldn't see anything without shining a bright light through the swamp of fingerprints covering the screen. Need to fix that issue but hopefully it's working otherwise!

EDIT: Freedreno confirmed working, but still no backlight. It should be at the same level as where my Note 1 demo is (runs es2gears, rss-glx screensavers) but of course I can't see much anything so once I figure out what's turning off the backlight then we should be good to go.

EDIT: Using jcsullins' wip-5 branch fixes the backlight issues. Here's a video:

https://www.youtube.com/watch?v=vx8_u1jhXJY

OMG ! It seem great ! Can you share your method how to install it with a zip file and if you can, make a tutorial of how to port a Linux OS on the TP ? It would be really appreciate to be able to finaly run a linux desktop on the Touchpad. Thank you very much for your hard work. ^_^ Cannot wait to try it. ;)
 

arseny1991

Senior Member
May 19, 2009
134
2
Athens
awesome job ! I cannot wait to try it out myself !!!!!!!!!!

let us know how to install it :)

Still lovin and rockin my good ol' Touchpad haha
 

CalcProgrammer1

Senior Member
Oct 8, 2007
650
756
Kansas City
I updated the OP with links to my source code and the build root I use to build the kernel images. If you want to build your own kernel go right ahead and play with it. As for a prebuilt image, it probably won't happen for some time because my rootfs on the TouchPad is a mess (installed a bunch of very large apps like games that aren't feasible to redistribute). I'll have to make a new rootfs from scratch. Since Freedreno is on the verge of making it into Debian testing as it is, it would be best to just wait for that to happen so I don't have to redistribute custom builds of the xserver-xorg-video-freedreno driver (you can build it from source as it's on Debian's git and builds with dpkg-buildpackage, just hasn't made it into a binary release yet). There's also a bug in Mesa that prevents Freedreno from accelerating 3D (GL or GLES). It's a one-line fix and Rob Clark said he's pushed it to master, but it hasn't made its way into a stable Mesa branch yet and thus still needs to be applied manually. Rebuilding Mesa on a TouchPad takes hours. Hopefully that one gets merged soon as well and then we can use straight up Testing without modification. That will make creating a new rootfs image a lot easier. I still haven't messed with getting Bluetooth or touchscreen to work, though the work I and others have done for older Ubuntu releases should apply just fine here. Audio is also going to be tricky, as I deleted WebOS completely and Ubuntu relied on a file from it. I have a webos rootfs that I was able to pull the required files from, but it's not working right.

EDIT: Sound! I talked to jcsullins on #freedreno and he gave me this: https://github.com/CyanogenMod/android_device_hp_tenderloin/blob/cm-11.0/configs/mixer_paths.xml

Those are the initialization settings for ALSA that need to be configured for sound. We can use alsaucm to set these, I just need to figure out how the heck alsaucm configurations work. I got the device initialization working and I threw in the speaker initialization just to test, but no idea how to switch between speaker, headphones, bluetooth, etc. With this method we don't need to pull audiod from webos! That means no more dependency on closed source binaries pulled out of that OS that may or may not exist anymore.

EDIT: I wrote some new alsa ucm files, now it should be able to select headphones or speaker directly. There isn't any jack detection so you'll have to manually switch, though if I could find the input for the jack switch it might not be hard to implement automatic switching. Still need to apply that RGB patch and fix the broken colors.

EDIT: New pic: http://i.imgur.com/SjOPWB5.jpg That's right, applying the RGB patch fixed the desktop and broke the rendering! Some reason the Freedreno GPU-rendered things are using the opposite color format. The big gear should be red and the top one blue. Here's another pic with the TP and Note side by side, running almost the same software: http://i.imgur.com/1kmKDOw.jpg
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    I updated the OP with links to my source code and the build root I use to build the kernel images. If you want to build your own kernel go right ahead and play with it. As for a prebuilt image, it probably won't happen for some time because my rootfs on the TouchPad is a mess (installed a bunch of very large apps like games that aren't feasible to redistribute). I'll have to make a new rootfs from scratch. Since Freedreno is on the verge of making it into Debian testing as it is, it would be best to just wait for that to happen so I don't have to redistribute custom builds of the xserver-xorg-video-freedreno driver (you can build it from source as it's on Debian's git and builds with dpkg-buildpackage, just hasn't made it into a binary release yet). There's also a bug in Mesa that prevents Freedreno from accelerating 3D (GL or GLES). It's a one-line fix and Rob Clark said he's pushed it to master, but it hasn't made its way into a stable Mesa branch yet and thus still needs to be applied manually. Rebuilding Mesa on a TouchPad takes hours. Hopefully that one gets merged soon as well and then we can use straight up Testing without modification. That will make creating a new rootfs image a lot easier. I still haven't messed with getting Bluetooth or touchscreen to work, though the work I and others have done for older Ubuntu releases should apply just fine here. Audio is also going to be tricky, as I deleted WebOS completely and Ubuntu relied on a file from it. I have a webos rootfs that I was able to pull the required files from, but it's not working right.

    EDIT: Sound! I talked to jcsullins on #freedreno and he gave me this: https://github.com/CyanogenMod/android_device_hp_tenderloin/blob/cm-11.0/configs/mixer_paths.xml

    Those are the initialization settings for ALSA that need to be configured for sound. We can use alsaucm to set these, I just need to figure out how the heck alsaucm configurations work. I got the device initialization working and I threw in the speaker initialization just to test, but no idea how to switch between speaker, headphones, bluetooth, etc. With this method we don't need to pull audiod from webos! That means no more dependency on closed source binaries pulled out of that OS that may or may not exist anymore.

    EDIT: I wrote some new alsa ucm files, now it should be able to select headphones or speaker directly. There isn't any jack detection so you'll have to manually switch, though if I could find the input for the jack switch it might not be hard to implement automatic switching. Still need to apply that RGB patch and fix the broken colors.

    EDIT: New pic: http://i.imgur.com/SjOPWB5.jpg That's right, applying the RGB patch fixed the desktop and broke the rendering! Some reason the Freedreno GPU-rendered things are using the opposite color format. The big gear should be red and the top one blue. Here's another pic with the TP and Note side by side, running almost the same software: http://i.imgur.com/1kmKDOw.jpg
    1
    Debian for the HP TouchPad

    Downloads:

    todo: add pics and binary links, for now there's https://mega.co.nz/#F!xZ81iKoK!Xio5bV9yjBRPTIzjLhCX3A

    Source:

    Kernel Builder: https://github.com/CalcProgrammer1/kernel_tenderloin_debian

    I put together this kernel builder repository that contains the ramdisks needed to boot either a discrete Debian partition or a chrooted Debian install. It uses submodules for the kernel and backports sources. You can just run the mkbootzip.sh file and it will build the uImage.Debian/uImage.DebiAndroid moboot kernels. Choose the one that fits your installation method and install it to /boot on the TouchPad.

    Kernel Source: https://github.com/CalcProgrammer1/..._msm8660-common/tree/tenderloin-cm-11.0-wip-5

    Backports Source: https://github.com/CalcProgrammer1/backports-3.10-2

    Thanks to jcsullins for porting the TouchPad to the samsung_msm8660-common kernel, without which this would not have been so easy! The Note 1 shares this kernel tree and I already had Debian working on it, made the port to TouchPad dead simple.