building the android 4.0.3 image for mini210S

Reggie
Hi all, has anyone tried building the android 4.0.3 image for the mini210S
yet? If anyone has, how did it go?  Did you have any issues?

It seems that the instructions in the user manual are incomplete, they
essientially consist of:

export PATH=/path/to/your/compiler:$PATH
./build-android
./genrootfs.sh

the build-android script seems to be kind of ok (all it does is run a
makefile, which then kickstarts the whole affair, I had to fixup a couple
of things but all in all the compilation looked ok, next was the
genrootfs.sh command, it kind of works but spits out errors about
'functions' but still manages to attempt to build the rootfs_dir.

On examination, the rootfs is missing most(all?) of the 'apk' files
(android applications) for the system, it doesn't seem to build them at
all.

On investigation at android/google, it appears that the setup of the
android build system appears to be 'wrong' and the way that you build the
system also appears to be 'wrong'.

It seems that google use a command called 'lunch', which informs me that
the jdk6 is missing (it's actually untarred by the build-android stuff as
far as I can tell but no env vars are registered for it, so it seems to
fail to find it).

So, if anyone has got any pointers on how to compile the rootfs correctly,
I'd appreciate some help :-D

Dave McLaughlin
Hi Reggie

I just downloaded the latest DVD and looking to build a custom Android
4.0.3 for my Tiny210 so I will update it I get it working.

One of the issues I had with building the old Gingerbread version was that
the JDK that comes with the build is not suitable for 64 bit. I comment
that out and have a separate installation of the JDK and that works.

Just installing all the files just now so I'll be back later once I try to
build it.

Dave...

Reggie
Thanks dave, it would be neat to get a tutorial going for all of this, I'll
post that on the armworks wiki, we can add a page for the tiny210 as well. 
I'm running a 32bit debian vm atm.  but running 'lunch' fails to find the
jdk, I've never built android before but at the end of it all it feels like
things just aren't right.

Btw. here's the wiki page http://armworks.cc/

At the moment I've got a handful of tutorials up there, not a great deal
but usefulm would be nice to thrash it out with some decent tutorials for
building, I've been caught up mainly in messing around with the kernel and
other mini boards so I'd like to get some stuff done with android.

I'll keep messing with things my end and see what I can come up with.

Reggie
I seem to have managed to build myself a rootfs_dir :-)

The first thing that I looked at was the standard way of doing things on
the aosp (android open source) roms, the first issue was making sure that
java6 jdk is installed, unfortunately, java has been moved out of the main
repos and you have to hand install it these days, however you can still
grab it from the squeeze repos:

http://ddmytrenko.blogspot.co.uk/2012/02/installing-sun-java-6-jdk-on-de...

essentially add deb 'http://ftp.pl.debian.org/debian/ squeeze non-free' to
your /etc/apt/sources.list then, in a terminal, do:
apt-get update
apt-get install sun-java6-jdk
update-java-alternatives -s java-6-sun

Next, from the android-4.0.3_r1/ directory:
sudo -i
export PATH=/path/to/your/compiler/bin:$PATH
source setenv
lunch

Then choose '4' from the list, once it's finished do:
make -j4

There may also be issues with gtest, if you get those errors then edit
external/gtest/src/Android.mk and change lines g2 and 70 to look like this:
LOCAL_CFLAGS += -O0 -fpermissive

There may be another issue that you see before that though, I fixed it by
hand editing all of the src files right at the start of this journey but I
reckon it can probably be fixed by the same -fpermissive compile switch, if
you see references to SetArc, AddArc, GetState, SetState, GetFinal,
SetFinal or Final in errors then try the above fix in the associated
packages Android.mk file :-)

Then wait quite a while, the -j4 switch is for multiple core cpus, so set
that 2 once less than the number of cores in your system to make
compilation much faster.  I think it took around about an hour but I got
bored watching it :D

Once it's all done you should see this at the end of the output:
make_ext4fs -l 268435456 -a system
out/target/product/mini210/obj/PACKAGING/systemimage_intermediates/system.img
out/target/product/mini210/system
Creating filesystem with parameters:
    Size: 268435456
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8192
    Inode size: 256
    Journal blocks: 1024
    Label: 
    Blocks: 65536
    Block groups: 2
    Reserved block group size: 15
Created filesystem with 899/16384 inodes and 38524/65536 blocks
Install system fs image: out/target/product/mini210/system.img
out/target/product/mini210/system.img+ total size is 268435456

not entirely sure what we're supposed to do with those but I guess you can
use standard android tools to attempt to flash that stuff to the mini but
I'm not sure how far you'd get, so the next step is to use the friendlyarm
scripts to generate the rootfs, from the terminal do:
./genrootfs.sh

Once it's done it should make a folder called rootfs_dir which is your
completed rootfs ready to be put on an sd card or to use with mktools to
make an ext/mlc image.

you can also do:
./genrootfs-3rdapps.sh

this will do the same thing as ./genrootfs.sh and it will also add a number
of 3rd party apps. into your rootfs_dir, most of them are chinese so you
might not need them.

genrootfs.sh throws up a bunch of errors about files not being found, you
can ignore that, it just seems to be be part of some orphaned/not finished
functions in the script.

Dave McLaughlin
Hi Reggie,

The kernel was easy.

For Android 4.0.3 I had to remove the lines that extract the JDK and the
PATH setting for this in the build_android file. I already have JDK6 64 bit
installed and I have built Gingerbread for the Mini210 and Tiny210 so all I
had to to was wait (a lot of hours. Over 8) and I had a 155MB image file
for 4.0.3

I need to invest in a new machine to build Linux with. The old single core
AMD 3.2GHz machine is a little slow but it did build OK and I have a MB
image file ready to programme into the Tiny210 NAND.

Dave...

Reggie
building the kernel is super simple, that's never really been an issue
(once we had the kernel source code), this was the first time I've built
android though, I got partially setup with 2.3 then got sidetracked with
other things.

I guess we both ended up at the same destination through a different path
:D  I have a general mistrust of build systems that something *will* go
wrong, thankfully, it doesn't take 8hours to build on this machine.

I'm going to go for a fresh unpack and build at some point tomorrow, make
sure there was nothing I missed and write up the experience.

Dave McLaughlin
I am scouring the net for source code for a dialup connection now. I can
get the 3G to work using the FriendlyArm app but it won't auto connect as I
need it.

Now that the source builds I am stripping out all the Chinese stuff and
starting to include the GAPPS as part of the build so I can use GMAIL and
the Market. 

I really like this Tiny210 with the Capacitive screen so here's hoping that
the build just works when I flash it to the NAND. :)

Reggie
http://code.google.com/p/ice-cream-sandwich-sgs/downloads/list, there might
be some information and files to glean from that google code site.  check
through the issues page.  I reckon there could be good plunder there with
regard to fixes and ideas.  I there is certainly a chance to fix our wifi
issues.  I really can't wait to compile android from source and try this
ethernet patch out, it essentially grafts ethernet into the google
framework, it could be that you're missing odd bits from that, or simple
settings here and there in the build.prop file for instance.

Reggie
oh, our board is using the same cpu as the I9000 :-)

Reggie
Gapps. is pretty simple to do but you *will* need wifi for it to work, you
can connect to google play store and click install but nothing downloads
(when you look why it says 'waiting for network'), so that's what the
ethernet patch I'm going to try is for.

There's a couple of tutorials on the armworks wiki for installing gapps,
one for doing a live install, the other for doing a preinstall to a rootfs:

http://armworks.cc/index.php?title=Mini210S#Tutorials_And_how_tos

I suggest having a look at rooting it too, I know we've got access via
adb/serial/ssh but it can be useful for certain apps. to have root too.

Dave McLaughlin
Hi Reggie. WiFi works great on the Tiny210. It never shuts down like it
does on the Mini210.

Android is really only designed for 1 network access to be active at anyone
time. With WiFi active and I then enable GPRS it only goes out via WiFi. If
I disable WiFi the GPRS is still not routing. I have to disable WiFi first,
then start GPRS. I can only do this manually at present until I can do my
own PPP connection.

GAPPS is working. All I had to do was ensure that the files are put in the
right locations of the rootfs_dir and now I have a build that doesn't need
you to follow the Wiki.

Reggie
Ha, I thought you'd sort it out gapps in short order, I posted the wiki
links more as a quick reference, I wrote the tutorials when I first got the
mini210, so they're probably a little bit naive and definitely a bit kludgy
:-D

I intend to work out where the apks go in the build system to be built in
automatically, it's not going to be difficult, also adding bootanimations,
maybe even some touch screen stuff.


I'm not so sure it's only capable of connecting to 1 network at a time, it
seems like there's just a small key part missing somewhere, I just can't
put my finger on it.

I know that the ethernet stuff is just plain missing as far as android is
concerned, it's kind of partially aware of eth0 in the system as a whole
but the framework can't use it consequently, ethernet looks like it's
working properly until it comes to doing anything with gapps stuff.

Dave, do you use irc at all?  we have a channel on freenode #mini2440 if
you're interested?