[Toybox] chroot command

Dave toybox at overbearing.org
Fri Aug 2 16:12:28 PDT 2013


Hi guys,

Many thanks for the terrific work on toybox.  I just saw the video by 
Mr. Landley on the toybox home page, and I was blown away by the vision 
of the future of the phone, and the trenchant analysis of the state of 
the GPL ecosystem.

Usually when I have a software problem I will write a pointed email to a 
list like this detailing exactly what went wrong and asking for help.  
This is a bit more broad and you might decide it doesn't belong in your 
forum.

I decided the other day to install Debian on my Motorola Milestone 2 
phone.  The typical way to do this is with a loopback mounted file that 
contains  a prepackaged distribution that is almost always Ubuntu.  Here 
is one here:
http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-android/
If you surf the web you will find a dozen web sites like this.

I rapidly determined that my phone has a locked bootloader and I could 
not replace the kernel with one that supported loop file systems. ( I 
have since learned that I can ,theoretically at least, compile loop 
support as a loadable module.  Incidentally, what is the point of 
locking the bootloader if you let people load modules?).  I partitioned 
3GB of an SDcard as ext3 and found debootstrap in a .deb and tried to 
run it.  I wish I had kept a log of all the problems I had because there 
where dozens of them. I eventually gave up and dded the partition to a 
redhat machine and debootstraped it with the aid of qemu. Now I have a 
Debian install, so I put it back on the phone and fired it up.  Or tried 
to.  Chroot didn't work. It says:

bash-4.1# chroot .
chroot .
Segmentation fault

Not terribly informative.  It struck me that it was looking for 
/bin/sh.  I ran strings on busybox and it looks like it is hardcoded in 
there.  So I setup a symlink in /bin ( this will be erased on reboot by 
the way). No dice.  Normally my next move would be to run strace on 
chroot to find the issue, but it looks like I don't have strace.  Not 
having any diagnostic tools to work with, I tried replacing busybox with 
toybox. Still no dice.

So, long story short, Debian is not working on my phone.

In the course of doing all this I got to thinking about what problem I 
was setting out to solve in the first place.  Putting Debian on your 
phone has some cool factor, but isn't the phone running Linux already?  
What do I hope to get out of it?  More to the point, the inconvenience  
of running in a chroot takes away from some of the enjoyment of running 
desktop apps on my phone. What applications exactly did I hope to run on 
the phone?  Well, there's octave, wireshark, gimp, ssh server and maybe 
eclipse. Just checking the google store, it looks like octave and 
wireshark are already there, gimp is in progress and ssh was one of the 
first apps ported.   Eclipse is not likely to be ported to android any 
time soon, but doing development on eclipse an a 3.5 inch screen is 
going to get old in a hurry. This brings up another point. The entire 
thing with the phone is that it benefits from a symbiotic relationship 
with servers.  The client server paradigm was practically invented for 
the phone.  I have had the phone for several years and I have been happy 
with just using the ssh client and using a web browser, because every 
single thing that I want to see or use is available from one or the 
other.  I don't even get my mail on the phone.  The web-mail works 
fine.  Denninger wrote a piece the other day about cell phones as 
desktop replacements :
http://market-ticker.org/akcs-www?post=222877
It looks OK as far as it goes, but I think it ignores the reality of 
ubiquitous computing. Cell phones, or tablets ( or even laptops) don't 
need to be self hosting if they are always connected to the network and 
there are servers available. Moreover, look at the relative sizes of 
these partitions:



Filesystem 	Size 	Used 	Free 	Blksize
/dev 	237M 	44K 	237M 	4096
/mnt/asec 	237M 	0K 	237M 	4096
/mnt/obb 	237M 	0K 	237M 	4096
/system 	325M 	296M 	28M 	1024
/data 	6G 	594M 	5G 	4096
/cache 	193M 	5M 	188M 	1024
/data/tmp 	2M 	28K 	1M 	4096
/pds 	3M 	1M 	2M 	1024
/preinstall 	254M 	12M 	242M 	1024
/mnt/sdcard 	26G 	2G 	23G 	16384
/mnt/secure/asec 	26G 	2G 	23G 	16384
/mnt/sdcard/debian 	2G 	283M 	2G 	4096


/system                     296M
/mnt/sdcard/debian 283M

A full featured Debian is the same size as Android! What is the point of 
reinventing the wheel?  Isn't this the problem space that netbsd was 
invented to solve?  Is the entire exercise just about making something 
palatable to Google?  Denninger is pushing the blackberry hard. I'm 
inclined to agree in principle.  The only reason I don't change is that 
I don't like the blackberry keyboard. Think about it, you are throwing 
over the C library, the guts of the /etc directory, the entire 
user-land, why cling to the kernel?  What is it you like about it? Is it 
the license? You just made a powerful case that the license was dead.  
Why are you helping the same people that would be perfectly happy to 
waterboard Snowden for the rest of his natural?


Yours, -dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20130803/7dd42c35/attachment-0005.htm>


More information about the Toybox mailing list