FORUMS
Remove All Ads from XDA

[GUIDE][Dual Boot][TheEasyway] How to setup Linux RootBind Method [Updated May 16th]

3,063 posts
Thanks Meter: 1,541
 
By Kingzak34, Senior Member on 17th March 2014, 08:35 PM
Post Reply Email Thread
Hello everyone ! I made this guide for all who want to try to dualboot Android and Ubuntu using the RootBind method.
But first, what is RootBind ?

Actually, the RootBind method consist to have a Linux file system, living in a folder of our Android partition.
The default location for this linux file system is /data/linuxroot.
The way to switch between Android and Linux is to flash an Android kernel or the linux kernel. That's all.
It means you'll be able to have a linux installation, without erasing Android ( Still available, not touched at all ) and it means that you can easily manage your Linux installation.
You dont want it anymore ? Just delete a folder. You want to try another version, but you dont want to lose your current data ? Just do a zip of the folder, and extract a new version instead.

Advantages :
  • No need to repartitionate your tab.
  • It works with all TF101.
  • It doesnt touch current Android Installation.
  • It has same free space as your /data Android partition.
  • You can easily access it from within Android.
  • It has good performances
  • Kernel has everything working
  • And you only need to flash an Android or Linux Kernel to boot desired OS.
Everything is possible thanks to @jrohwer and @DjDill and @TravellingGuy.
Dont forget to thanks them : jrohwer Kernel Thread - jrohwer 14.04 Kubuntu IMG / DjDill images thread / TravellingGuy Image thread
Of course, every manipulation is risky, Me, jrohwer, DjDill, Travelling Guy, my dog, or even my math professor, can NOT be responsible for any damage on your tab, use this guide at your own risk
First Post : Dualboot setup
Second Post : How to change the linux location / How to have multiple linux installations
Third Post : FAQ & Tips


DualBoot setup. Linux installation
First of all, here is all what you'll need :
Note that all command can be done with ADB shell aswell.

If you choose to install one of DjDill img :
  1. Boot to Android as usual
  2. Copy all download files to your tab. You can rename the kernel zip to Linux_Loader.zip and Android_Loader.zip to be clearer.
  3. Now, I assume you have files in internal storage ( change sdcard0 by sdcard1 if it's on microSD )
  4. We will now ensure terminal has root permissions :
  5. Open Terminal emulator
  6. Type su then Enter
  7. SuperUser will ask terminal emulator root permission, allow it.
  8. If you have an error with this command, your device may not be properly rooted.
  9. Now we will setup installation location and extract our linux tar.gz ( Be aware it may take a while ) :
    Code:
    busybox mount -o remount,rw /
    mkdir /data/linuxroot
    chmod 755 /data/linuxroot
    cd /data/linuxroot
    tar -pxvzf /storage/sdcard0/yourubuntufilename.tar.gz
    busybox mount -o remount,ro /

If you don't choose to install one of pre configured img :
  1. Boot to Android as usual
  2. Copy all download files to your tab. You can rename the kernel zip to Linux_Loader.zip and Android_Loader.zip to be clearer.
  3. Now, I assume you have files in internal storage ( change sdcard0 by sdcard1 if it's on microSD )
  4. We will now ensure terminal has root permissions :
  5. Open Terminal emulator
  6. Type su then Enter
  7. SuperUser will ask terminal emulator root permission, allow it.
  8. If you have an error with this command, your device may not be properly rooted.
  9. Now we will setup installation location and extract our linux tar.gz ( Be aware it may take a while ) :
    Code:
    busybox mount -o remount,rw /
    mkdir /data/linuxroot
    chmod 755 /data/linuxroot
    cd /data/linuxroot
    tar -pxvzf /storage/sdcard0/yourubuntufilename.tar.gz
    cd /data/linuxroot/lib/firmware
    tar -pxvzf /storage/sdcard0/bcm4329.tar.gz
    cp nvram.txt nvram_3429.txt
    busybox mount -o remount,ro /
  • The setup is now complete.

In order to boot your linux installation, flash the linux kernel.
To get back to Android, flash the Android kernel.

The Following 13 Users Say Thank You to Kingzak34 For This Useful Post: [ View ] Gift Kingzak34 Ad-Free
 
 
17th March 2014, 08:36 PM |#2  
Kingzak34's Avatar
OP Senior Member
Flag South
Thanks Meter: 1,541
 
Donate to Me
More
How to change the linux location / How to have multiple linux installations

Here we are, so in order to have multiple linux instllations or change defaut linux installation location, you will need a Linux computer. ( Or a Virtual Machine, that's what I use, with Virtual Box for exemple.

You will need 3 tools to get it done too.

You can get it there abootimg, blobpack and blobunpack files at the end of first post ( Thanks to @shaola ).
I post the zip in attachement for mirror.

MORE INFORMATIONS ABOUT THESE TOOLS : http://forum.xda-developers.com/show...19&postcount=3

Now you have to get in the Rootbind kernel, the blob file. Blob file in Asus ROM can contain any partition of the device ( System, kernel, recovery etc ). In this kernel blob, there is only the kernel partition. Soooo, here we go for some commands.
  • Open your linux computer
  • Place all four files in same place ( better to have a folder created for this ). I'll take exemple of ~/kerneltf/ It's a exemple, so adapt in consequencies of course.
  • Now you have your four files in same place, blobunpack, blobpack, and abootimg-i686 so let's start with commands :
  • Go to the desired place :
    Code:
    cd ~/kerneltf
  • Unpack the blob containing partition imgs
    Code:
    ./blobunpack blob
    This will create partitions img. The one that interest us is the .LNX partition. ( Here blob.LNX )
  • Now unpack the kernel parition img
    Code:
    ./abootimg-i686 -x blob.LNX
    This will create 3 files, bootimg.cfg, zImage and initrd.img
  • The file we want to edit is bootimg.cfg. so open it with a text editor.
  • You'll see the last line is a cmdline. At the end we have the location of linux system place.
  • For exemple here : root=/dev/mmcblk0p7 bind=/linuxroot that means, the folder takes place in mmcblk0p7 ( /data partition of device ) and is placed in /linuxroot folder. So with Android layout it means /data/linuxroot.
  • You can now change the location of your folder, so you have some choices :

1-Change the folder location or name. ( This can be used to have multiple linux systems )

So you have this part : root=/dev/mmcblk0p7 bind=/linuxroot
If you want to change folder place/name change this part : bind=/linuxroot into whatever you want
For exemple root=/dev/mmcblk0p7 bind=/linuxroot2 or root=/dev/mmcblk0p7 bind=/linuxroot3 ( To have more linux systems )

Or root=/dev/mmcblk0p7 bind=/Linuxroot/Linux1

ATTENTION as said in rootbind thread : Make sure, however, not to put the Linux rootfs to the "internal storage" (/data/media) or any subdirectories thereof. This plays havoc with the Android media scanner when re-booting into Android and your tablet may slow down to a crawl.


2-Change the folder location in order to have it on an other partition like SDCard

For this choice, a 2nd partition on your SDcard is greatly recommended and should be in ext4. ( Must be the second partition, it is better for general use of SDcard )
So root=/dev/mmcblk0p7 bind=/linuxroot will become root=/dev/mmcblk1p2 ( can be p3 p4 or more if you have more than 2 partitions in your sdcard to have several systems on your SDcard ) the bind argument must be deleted as it will not be used.

3-Change the folder location in order to have it on first partition on SDCard

The problem here if you want your linuxroot folder in you SDcard with your other files, is that sdcard MUST be formatted in ext4 and so will not be recognized directly by Windows ( Using MTP in the TF will work but not Storage Mount ) cause Windows doesnt support ext4 partition. It's definitively the worse choice IMHO. The precedent process is definitively better choice. More than that it could make MediaScanner in Android going crazy too ( a .nomedia can maybe do the trick but not sure ).

More again, it hasnt been tested at all so you're the only responsible, but if you want to do it :

For exemple, to put folder on SDcard, you should change root=/dev/mmcblk0p7 bind=/linuxroot to root=/dev/mmcblk1p1 bind=/linuxroot
This means your folder is in sdcard ( The one in the tab ) at root in /linuxroot folder. ( /storage/sdcard1/linuxroot in android )
THIS HAS NOT BEEN TESTED YET, I CANT TELL YOU IF IT WORKS OR NOT.

Sooo, now you seted up your new location ( BE SURE TO DONT TOUCH ANYTHING ELSE ON THE CMDLINE, ONLY THIS PART ):
  • We will now repack the kernel to get it flashable.
  • Once again, be sure that you didnt make mistake with the file, and you only edited root=/dev/mmcblk0p7 bind=/linuxroot this part without deleting something or got a typo error.
  • We will now update the new bootimg :
    Code:
    abootimg-i686 -u blob.LNX -f bootimg.cfg
  • Then we will rename old blob file to create a new one with our modified kernel:
    Code:
    mv blob blobold
  • Now, we will repack our blob in order to make a new flashable zip with our kernel:
    Code:
    ./blobpack blob LNX blob.LNX
  • You're done, make a copy of the old zip, rename it as you wish ( avoid spaces in the zip title ) for exemple Linux_Loader_2.zip
  • Then open it, and replace the blob file with your new one.
  • Now you're good to flash. Be sure to install a linux system in desired location before flashing it of course. See post 1 for this !
Attached Files
File Type: zip Blobtools_abootimg_tool.zip - [Click for QR Code] (29.7 KB, 222 views)
The Following User Says Thank You to Kingzak34 For This Useful Post: [ View ] Gift Kingzak34 Ad-Free
17th March 2014, 08:37 PM |#3  
Kingzak34's Avatar
OP Senior Member
Flag South
Thanks Meter: 1,541
 
Donate to Me
More
And a last one !

Envoyé de mon Nexus 4 en utilisant Tapatalk
20th March 2014, 07:47 PM |#4  
stephane.papin's Avatar
Senior Member
Flag Crégy-Les-Meaux
Thanks Meter: 29
 
Donate to Me
More
Nice does work with TF101 G model (3G+) ?

Envoyé depuis ma TF101G-B80 with Revolution HD 4.0 (3.6g release) by Mike _1986
20th March 2014, 08:16 PM |#5  
Kingzak34's Avatar
OP Senior Member
Flag South
Thanks Meter: 1,541
 
Donate to Me
More
Quote:
Originally Posted by stephane.papin

Nice does work with TF101 G model (3G+) ?

Envoyé depuis ma TF101G-B80 with Revolution HD 4.0 (3.6g release) by Mike _1986

Yes, it works with all TF101

Si t'as besoin d'aide, hésite pas à me MP
5th May 2014, 01:24 AM |#6  
Junior Member
Thanks Meter: 0
 
More
Is a bootloader within the realm of possibility?
Thanks for the write-up.. I'm at the drinking my coffee while the untar keeps chugging stage, and it occurs to me that a bootloader would be very cool to have. Kernels flash so quickly, the recovery method isn't far off in terms of usability.. but it did motivate the question: is it possible?

So I'm just curious - is there any reason why we couldn't have the android and linux kernels both on disk to be loaded by a bootloader based on user choice?
9th May 2014, 08:10 PM |#7  
nbenm's Avatar
Member
Thanks Meter: 1
 
More
Hello,

I have tried the "DjDill img" method.
When it finishes booting, it tells me that there are networks, and yhat I have to configure wifi.
I can't find how.
ifconfig shows lo and wlan0, and wlan0 is up but of course has no address.
if I try a iwlist scan, it tells me that wlan0 is an interface that doesn't support scanning.
In "settings manager/network connections", if I try to add a connection, it doesn't see my ssid.
Do you have any idea or point me to some doc/tuto.
Thanks in advance

nbenm
10th May 2014, 12:44 AM |#8  
Kingzak34's Avatar
OP Senior Member
Flag South
Thanks Meter: 1,541
 
Donate to Me
More
Quote:
Originally Posted by nbenm

Hello,

I have tried the "DjDill img" method.
When it finishes booting, it tells me that there are networks, and yhat I have to configure wifi.
I can't find how.
ifconfig shows lo and wlan0, and wlan0 is up but of course has no address.
if I try a iwlist scan, it tells me that wlan0 is an interface that doesn't support scanning.
In "settings manager/network connections", if I try to add a connection, it doesn't see my ssid.
Do you have any idea or point me to some doc/tuto.
Thanks in advance

nbenm

What kernel and what image did you used?

Tapatalké depuis mon Nexus 4 MIUI !
10th May 2014, 05:01 AM |#9  
Junior Member
Thanks Meter: 0
 
More
Couple questions
First, BIG thx to you and all the devs for hacking the tf-101!!

I've tried several of the images and they all worked as posted (Go figure ). I will be trying to compile a kernel for some custom work.

1 - Are the kernels compiled on the TF-101 and the tarballed?

2 - Any idea if Kali Linux 1.0.6 ARMHF Image, build will work?

I'll be using an external wifi dongle and not the internal.

Again much excitement to the tf-101 world!
10th May 2014, 08:47 AM |#10  
nbenm's Avatar
Member
Thanks Meter: 1
 
More
Quote:
Originally Posted by Kingzak34

What kernel and what image did you used?

Tapatalké depuis mon Nexus 4 MIUI !


I'm using kernel:Ubuntu-3.1.10-12-rootbind-oc1.0GHz.zip from your rootbind kernel link

I use image:tf101-14.04-xubuntu-armhf.tar.gz which is a DjDill image.

Before you reply me, I wanted to try "TravellingGuy Image". On its page, it was told to create wlan0 entry in the interfaces file. I did this and it works now.

But I can't understant why:
- iwlist scan doesn't work
- network manager doesn't see any of the multiple essids tahere are here

When I try to iwconfig essid "my_ssid", it says "cannot read /proc/net/wireless". Does it need some module ?

Thanks

nbenm
10th May 2014, 01:17 PM |#11  
Kingzak34's Avatar
OP Senior Member
Flag South
Thanks Meter: 1,541
 
Donate to Me
More
Quote:
Originally Posted by nbenm

I'm using kernel:Ubuntu-3.1.10-12-rootbind-oc1.0GHz.zip from your rootbind kernel link

I use image:tf101-14.04-xubuntu-armhf.tar.gz which is a DjDill image.

Before you reply me, I wanted to try "TravellingGuy Image". On its page, it was told to create wlan0 entry in the interfaces file. I did this and it works now.

But I can't understant why:
- iwlist scan doesn't work
- network manager doesn't see any of the multiple essids tahere are here

When I try to iwconfig essid "my_ssid", it says "cannot read /proc/net/wireless". Does it need some module ?

Thanks

nbenm

Ubuntu-3.1.10-12-rootbind-oc1.0GHz.zip doesnt exist ?

It's Ubuntu-3.1.10-12-rootbind-oc1.2GHz.zip

Or Ubuntu-3.1.10-10-rootbind-1.0GHz.zip

If you choose the Ubuntu-3.1.10-12-rootbind-oc1.2GHz.zip, wifi will works by default with defaut network manager without needing any cmd config or anything on pre installed DjDill img, IDK for Travelling guy img I didnt tested it, but you can try the other method if you're on Debian img and wifi doest work.

If you choose DjDill img, choose one of the lastest, This one http://forum.xda-developers.com/show...55&postcount=1

Or the 1.1 14.04 one, end of this post : http://forum.xda-developers.com/show...74&postcount=2
Or the Lxde build from same post.

But I suggest to use the first for now, it's the newer and have a lot of fixes.
The Following User Says Thank You to Kingzak34 For This Useful Post: [ View ] Gift Kingzak34 Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes