[DEV] Native Ubuntu (Lubuntu, LXDE) or (Unity2D,Gnome) on TF700T

Search This thread

Hundsbuah

Senior Member
Nov 2, 2012
1,122
840
Landshut
I hacked together a small shell script that can be used in Android to enter the Ubuntu installation as chroot and run console programs like apt-get in it. Maybe it is of use to someone.

Code:
GNU_ROOT=/data/ubuntu
mount -o bind /dev $GNU_ROOT/dev
mount -o bind /dev/pts $GNU_ROOT/dev/pts
mount -o bind /sys $GNU_ROOT/sys
mount -o bind /proc $GNU_ROOT/proc

mkdir $GNU_ROOT/run/resolvconf
rm $GNU_ROOT/run/resolvconf/resolv.conf
for i in 1 2 3 4; do
        ns=`getprop dhcp.wlan0.dns$i`
        if [ $ns ]; then
                echo nameserver $ns >> $GNU_ROOT/run/resolvconf/resolv.conf
        fi
done

chroot $GNU_ROOT /usr/bin/env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -l

umount $GNU_ROOT/proc
umount $GNU_ROOT/sys
umount $GNU_ROOT/dev/pts
umount $GNU_ROOT/dev

Save e.g as /data/enter-ubuntu and chmod 700. Feel free to use it or to post improvements.

ty works perfect.

passwd -d ubuntu in terminal and you can login in unity2d/gnome rootfs wihtout dockkeyboard
dont forget to give your terminal su rights by typing su

/edit:
apt-get install python-gi-cairo
apt-get install onboard

now you can use unity2d gnome without dock and you have a virtual keyboard
 
Last edited:

tpmullan

Senior Member
Jan 17, 2011
138
128
The password should be ubuntu.
If that doesn't work you can always change the password with the chroot

Sent from my SAMSUNG-SGH-I727 using xda app-developers app
 

ryanbadowski

Member
Jun 24, 2010
40
3
Has this happened to anyone else...?

I got the Unity flavor of this mod working splendidly. Then somehow I ended up at the lock screen (I can't remember how--maybe I hit the lock button or power button or closed the lid). The screen flashed and went blank. I hit the power button, but the screen kept flashing the lock screen, and I couldn't get my password in, so I did a hard reboot (held down the power button).

Now I can't boot into Ubuntu. It hangs a black screen.

Any ideas what's going on?
 

l1nuxfre4k

Senior Member
Aug 9, 2008
382
22
Has this happened to anyone else...?

I got the Unity flavor of this mod working splendidly. Then somehow I ended up at the lock screen (I can't remember how--maybe I hit the lock button or power button or closed the lid). The screen flashed and went blank. I hit the power button, but the screen kept flashing the lock screen, and I couldn't get my password in, so I did a hard reboot (held down the power button).

Now I can't boot into Ubuntu. It hangs a black screen.

Any ideas what's going on?

Wrong thread.
Post in http://xdaforums.com/showthread.php?p=34227540, not here! i did the same misstake so please dont posting support issues here and post in SUPPORT thread and not DEV thread.
 

tpmullan

Senior Member
Jan 17, 2011
138
128
I found that there was no button mapped to escape. The simple fix is to run the command "xmodmap -e "keycode 166 = Escape"; xmodmap -pke > ~/.Xmodmap"

Sent from my SAMSUNG-SGH-I727 using xda app-developers app
 
Last edited:

singoutout

Senior Member
Sep 8, 2011
157
15
Hi guys :)
I know this thread is only for development purposes, but I was wondering if one of you could post a video of ubuntu running natively on our tab.
I would like to see how smooth and stable it is before I start to try to dual boot my tf700t. :)
 
Last edited:

l1nuxfre4k

Senior Member
Aug 9, 2008
382
22
Hi guys :)
I know this thread is only for development purposes, but I was wondering if one of you could post a video of ubuntu running natively on our tab.
I would like to see how smooth and stable it is before I start to try to dual boot my tf700t. :)

dude WRONG THREAD! As you stated yourself, this is something you should post in support thread!
And dude, video? ... just ask people if it runs smooth and what ever?
Yes it runs smooth and good, but this is still under DEVELOPMENT, so dont expect to much... dont expect an fault free 100% working system :)
 

h?2

Member
Jul 23, 2012
34
14
Some development questions

Hi,

thanks for making this work first of all! I have been really wanting to get this going, but didn't have the time yet to sit down and work on it.

However I am aiming at a little more complex setup, I hope this is the right place to discuss it.

1) Dual boot CM10 and GNU/Linux (preferrably Debian SID, but Ubuntu would be ok for starters)
2) encrypted partition that serves both as android data and GNU home.

My plan was to:
1) Unlock device
2) install CM10
3) repartition (i.e. shrink data partition "D" by 10GB + create a new ext4 partition "L" of 10GB)
4) install GNU/Linux on "L"
5) encrypt data partition "D"
6) add magic to CM10 to decrypt "D" on boot and bind mount "D"/data to data
7) add magic to GNU/Linux to decrypt "D" on boot and bind mount "D"/home to /home

I have Linux (and bsd) skills, but I don't know too mch about Android. I know how to do steps 1,2,5,7. Assuming I have regular unix tools on CM10, I also know how to do 3. Assuming I can use this thread's instructionts and the image for this setup, I also know how to do 4. The biggest issue will probably be 6, although there is supposed to by encryption support in Android beginning of 4.0, I haven't seen it work, yet...

Do you have any comments on this?

Thank you for your help!
 

tpmullan

Senior Member
Jan 17, 2011
138
128
Hi,

thanks for making this work first of all! I have been really wanting to get this going, but didn't have the time yet to sit down and work on it.

However I am aiming at a little more complex setup, I hope this is the right place to discuss it.

1) Dual boot CM10 and GNU/Linux (preferrably Debian SID, but Ubuntu would be ok for starters)
2) encrypted partition that serves both as android data and GNU home.

My plan was to:
1) Unlock device
2) install CM10
3) repartition (i.e. shrink data partition "D" by 10GB + create a new ext4 partition "L" of 10GB)
4) install GNU/Linux on "L"
5) encrypt data partition "D"
6) add magic to CM10 to decrypt "D" on boot and bind mount "D"/data to data
7) add magic to GNU/Linux to decrypt "D" on boot and bind mount "D"/home to /home

I have Linux (and bsd) skills, but I don't know too mch about Android. I know how to do steps 1,2,5,7. Assuming I have regular unix tools on CM10, I also know how to do 3. Assuming I can use this thread's instructionts and the image for this setup, I also know how to do 4. The biggest issue will probably be 6, although there is supposed to by encryption support in Android beginning of 4.0, I haven't seen it work, yet...

Do you have any comments on this?

Thank you for your help!

In Android go to settings/security/encryption and there is a GUI to encrypt the phone

Sent from my SAMSUNG-SGH-I727 using xda app-developers app
 

_that

Recognized Developer / Inactive RC
Oct 2, 2012
4,821
4,211
1) Dual boot CM10 and GNU/Linux (preferrably Debian SID, but Ubuntu would be ok for starters)

This would require some way to put two kernels on the machine and choose one at boot time. The bootloader is encrypted and cryptographically signed. So the only ways for dual booting that I see are:
* you abuse the choice of recovery or Android for dual booting, but that means you lose the recovery option.
* you create some kernel chainloading implementation using kexec.


3) repartition (i.e. shrink data partition "D" by 10GB + create a new ext4 partition "L" of 10GB)

Tegra devices have a proprietary partition table, and another one that is GPT (at the end of the MMC - see the thread about the TF700's flash layout). I don't know if the two partition tables must match or not, but the Tegra proprietary partition table may not even be writable using normal means. Just to say: repartitioning will not be trivial.

Maybe using an external microSD card is an alternative?
 
  • Like
Reactions: JoinTheRealms

tpmullan

Senior Member
Jan 17, 2011
138
128
This would require some way to put two kernels on the machine and choose one at boot time. The bootloader is encrypted and cryptographically signed. So the only ways for dual booting that I see are:
* you abuse the choice of recovery or Android for dual booting, but that means you lose the recovery option.
* you create some kernel chainloading implementation using kexec.




Tegra devices have a proprietary partition table, and another one that is GPT (at the end of the MMC - see the thread about the TF700's flash layout). I don't know if the two partition tables must match or not, but the Tegra proprietary partition table may not even be writable using normal means. Just to say: repartitioning will not be trivial.

Maybe using an external microSD card is an alternative?

You could also try booting both Android and Linux with the same kernel.

Sent from my SAMSUNG-SGH-I727 using xda app-developers app
 

_that

Recognized Developer / Inactive RC
Oct 2, 2012
4,821
4,211
You could also try booting both Android and Linux with the same kernel.

Good idea. I would not count that as true "dual boot", but it makes things much easier and it has pretty much the same effect. Even this Ubuntu package is based on Android kernel source, so it should be possible but I didn't compare the configs yet to see if there are any conflicts.
 
  • Like
Reactions: dulcedosa

h?2

Member
Jul 23, 2012
34
14
This would require some way to put two kernels on the machine and choose one at boot time. The bootloader is encrypted and cryptographically signed. So the only ways for dual booting that I see are:
* you abuse the choice of recovery or Android for dual booting, but that means you lose the recovery option.
* you create some kernel chainloading implementation using kexec.
Ah, interesting, so unlocked bootloader just means I can flash a different kernel, it is not really unlocked in a general sense? I come from BSD-land so I will have to read more into Linux-Kernel stuff to know how to proceed.

Tegra devices have a proprietary partition table, and another one that is GPT (at the end of the MMC - see the thread about the TF700's flash layout). I don't know if the two partition tables must match or not, but the Tegra proprietary partition table may not even be writable using normal means. Just to say: repartitioning will not be trivial.
jeeze, they do take a extra effort to make life hard for the people that buy their products...
Maybe using an external microSD card is an alternative?
Yes, I will go with this for now.


You could also try booting both Android and Linux with the same kernel.
Also a good idea.

So, the new plan is:
1) unlock bootloader
2) go with default cm10
3) encrypt device with builtin encryption
4) get ubuntu on a microsd and try to make the system boot that with its default kernel
5) once that works think of a way to boot a kernel from the microsd
6) once that works think of a way of how to get the GNU/L on the internal disk

I will report on how things go.
 

_that

Recognized Developer / Inactive RC
Oct 2, 2012
4,821
4,211
Ah, interesting, so unlocked bootloader just means I can flash a different kernel, it is not really unlocked in a general sense?

Correct. I think it sucks, but there are too few tablets with decent screen and features to choose from.

So, the new plan is:
1) unlock bootloader
2) go with default cm10
3) encrypt device with builtin encryption
4) get ubuntu on a microsd and try to make the system boot that with its default kernel
5) once that works think of a way to boot a kernel from the microsd
6) once that works think of a way of how to get the GNU/L on the internal disk

Could work like that. For step 4 you will have to modify the ramdisk of the default kernel image to mount a different root partition, should not be too hard.
 

villankd47

Member
Nov 24, 2012
8
0
For some reason when I'm in TWRP it will not show the precise-armhf.tgz or the unity2d-rootfs.tgz in the internal sdcard. Is there something I'm needed to do with ADB to make that happen?
 

_that

Recognized Developer / Inactive RC
Oct 2, 2012
4,821
4,211
For some reason when I'm in TWRP it will not show the precise-armhf.tgz or the unity2d-rootfs.tgz in the internal sdcard. Is there something I'm needed to do with ADB to make that happen?

I think you are in the wrong thread. Read the OP, the tgz files are not for flashing in the recovery.
 

senko.exe

Member
Dec 2, 2012
5
1
Kyiv
How can I edit blob in precise-bootimg.zip?
"Blob tools" and other don't work.


I would like to upgrade to ubuntu 12.10 but after upgrade ubuntu doesn't boot up.



Sorry for my English.
 
Last edited:

gautier56

Member
Dec 18, 2012
9
3
user test report

Firstly, thank you for your work and congratulations, as an early beta, a lot of thing are well functionning !
I made some tests of your distro, as I were disapointed by the small work efficiency of android on tablet.
Please find (as joined part) my report as user point of view, with sysadmin skills.

Again, THANK YOU, and your roadmap is quite impressive !

Gautier.


PS : I posted first that report in an other thread, with an other linux distro for TF700T : http://xdaforums.com/showthread.php?t=2026919
Maybe those efforts to port ubuntu on tf700t could be fisioned ?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 40
    This is an early alpha of ubuntu precise pangolin (12.04) running on the TF700T. You can choose from openbox, LXDE, and Lubuntu configurations. It is based on Nvidia Linux 4 Tegra R16 (armhf).

    Added unity2d/gnome rootfs. 13-NOV

    THIS IS NOT A SUPPORT THREAD, THIS THREAD IS FOR DEVELOPMENT RELATED POSTS ONLY. IF YOU DON'T HAVE SOME LINUX BACKGROUND/EXPERIENCE, THIS IS PROBABLY NOT THE PLACE FOR YOU.

    There are four files on goo available for this setup:

    This configuration uses internal storage (/data/ubuntu) for the root file system. You will need to have a custom recovery (I use TWRP) and a working adb setup.To install, take the following steps:

    • Copy the bootimg and rootfs of your choice (lubuntu/lxde or unity2d/gnome) to your /sdcard folder
    • Boot into recovery
    • Bring up a root shell with ADB
    • Create the folder for file extract "mkdir /data/ubuntu"
    • Change to the folder you created "cd /data/ubuntu"
    • Extract the files "busybox tar -zxvf /sdcard/precise-armhf.tgz" OR "busybox tar -zxvf /sdcard/unity2d-rootfs.tgz"
    • Flash the boot image (precise-bootimg.zip)
    • Reboot

    To get back to your android setup (if you are running ParanoidAndroid) flash the PA boot image (pa-tf700t-bootimg.zip). If you are running a different ROM, replace the boot blob in the zip file with the one from your distribution. The naming is important, it has to match.

    Thanks to the development communities from Linux, Ubuntu, and NVidia, and to lilstevie, Jhinta, cb22, and many others who have blazed the trail that provided guidance and insight.

    This thread is intended for the use and contributions of developers who have the interest and capacity to move this along. It is not intended for spoon feeding and hand holding.

    Please use the thread HERE for general q&a, discussion, and support.
    4
    I hacked together a small shell script that can be used in Android to enter the Ubuntu installation as chroot and run console programs like apt-get in it. Maybe it is of use to someone.

    Code:
    GNU_ROOT=/data/ubuntu
    mount -o bind /dev $GNU_ROOT/dev
    mount -o bind /dev/pts $GNU_ROOT/dev/pts
    mount -o bind /sys $GNU_ROOT/sys
    mount -o bind /proc $GNU_ROOT/proc
    
    mkdir $GNU_ROOT/run/resolvconf
    rm $GNU_ROOT/run/resolvconf/resolv.conf
    for i in 1 2 3 4; do
            ns=`getprop dhcp.wlan0.dns$i`
            if [ $ns ]; then
                    echo nameserver $ns >> $GNU_ROOT/run/resolvconf/resolv.conf
            fi
    done
    
    chroot $GNU_ROOT /usr/bin/env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -l
    
    umount $GNU_ROOT/proc
    umount $GNU_ROOT/sys
    umount $GNU_ROOT/dev/pts
    umount $GNU_ROOT/dev

    Save e.g as /data/enter-ubuntu and chmod 700. Feel free to use it or to post improvements.
    3
    Do you know if your ubuntu implementation works for the tf300t?
    Thanks!

    What I meant is: Do you think it's possible to use cb22's kernel (used to boot his arch implementation) and ramdisk on the tf300 and chroot to this ubuntu's init?

    I believe that it should work with minor changes. My rootfs zips are built straight from Nvidia's Tegra3 L4T distribution, with LKM and firmware updates from the TF700T. My guess would be that if you copied the lib/modules/.... folder and put the appropriate firmware in lib/firmware (fw*.bin, nvram.txt, bcm*.hcd, etc.) it should work. You would probably want to extract into /data/linux instead of /data/ubuntu as that is what that initramfs uses. I know that I have been able to boot into that rootfs on the TF700T with those changes.
    2
    Issues & Fixes

    Issue: Onboard virtual keyboard displays all black
    Fix: apt-get install python-gi-cairo
    2
    I found that there was no button mapped to escape. The simple fix is to run the command "xmodmap -e "keycode 166 = Escape"; xmodmap -pke > ~/.Xmodmap"

    Sent from my SAMSUNG-SGH-I727 using xda app-developers app