Hold It – Problems

To keep everything short (I had a lot of problems from the build last time, and this is just what I’ve found thus far), to sum.

  1. You need 64 bit version of Linux, and not 32 bit.
  2. Virtual machines require a BIOS setting to run 64 bit (Part of number 1).
  3. On a virtual machine, memory is limited.  Therefore, it won’t build correctly all the time.
  4. Mint vs Ubuntu? Which to use?
  5. What do I do when it’s all downloaded and built?
  6. envsetup.sh, important, but when?
  7. I have it downloaded, I can see the img files, but it still complains when I do this.

64 bit != 32 bit

I received the following error:

/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: cannot execute binary file

So  basically, you need to use 64 bit for Jelly Bean.  And also, from what I’ve read (Not a lot, so not positive on this), also Ice Cream requires 64 bit to build also.

Virtual with 64 bit

My error:

VT-x/AMD-V hardware acceleration has been enabled, but is not operational. Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot.

Please ensure that you have enabled VT-x/AMD-V properly in the BIOS of your host computer.

Note, I do use Virtual Box, and this was a simple solution (Even though it requires a computer restart, which those who know me know I hate restarting my computer).  Basically go in to BIOS, go to advanced, and enable the Virtualization.

-j4 Is Okay, Not Too Much

So, I was under the impression that the number you put after the 4 didn’t mean much.  However, I was wrong; wrong wrong wrong.  So basically, when I tried to build/make from source with -j4, it would conflict, or otherwise, not build a system.img (It did do the ramdisk.img and userdata.img).  So, I read a bit online, and it seemed that not many people had this problem.  I did however see someone mention that one of the errors that I came across often (When I built, I would do:

make -j# 2> ERROR_LOG.txt

so I’d get all my errors that occured and I can check on it later on rather than trying to catch glimpses in the hundred thousand lines or so) was caused by not having enough RAM.  More significantly, someone wasn’t able to successfully build Android with -j4 on a machine with two gigs of RAM.  Surprise surprise, I gave my virtual two gigs of RAM.  So I changed this to -j1, and it finished, and from here, I saw that my img files were created.

Mint or Ubuntu

This isn’t about what’s better.  As you might have read previously, I decided to use Mint.  Why? It’s less bloated, it has more dependencies at the start (I understand this is a bit contradictory as bloated == more dependencies, but just ignore this flaw), and in my opinion, works better.  However, after reading a lot of posts, everyone built the source using Ubuntu, so I decided to deal with the Unity bar and everything else that’s not needed, and use it.  The reason I mention this, it could have been a factor in why it wasn’t working.

Now What?

So now the source was good, I have my .img’s, and everything is going all well and dandy.  Hard to actually find much on what to do once you’re done, and a likely reason, if we look at the pages, we see three lines on starting the emulator, of which, only one word in those lines is what you really need, emulator.

I start up my emulator (But I can’t, look at next section for that), and I get an error, surprise.

emulator: ERROR: You did not specify a virtual device name, and the system
directory could not be found.

If you are an Android SDK user, please use '@<name>' or '-avd <name>'
to start a given virtual device (see -help-avd for details).

Otherwise, follow the instructions in -help-disk-images to start the emulator

So, can’t be that easy.  I look around, and see that I need to specify the .img files.  So I try it:

out/host/linux-x86/bin/emulator -sysdir out/target/product/generic/ -system out/target/product/generic/system.img -ramdisk out/target/product/generic/ramdisk.img -data out/target/product/generic/userdata.img -kernel prebuilt/android-arm/kernel/kernel-qemu -sdcard sdcard.img -skindir sdk/emulator/skins -skin WVGA800 -scale 0.7 -memory 512 -partition-size 1024

And my kernel doesn’t work, it’s not there, doesn’t exist.  So I decide to build it separately, but first…

Envsetup

So, I feel this file is a bit misunderstood.  In that, I run it at the begining of the build, then I do the make, and all good.  I then do ./emulator, doesn’t work.  Doesn’t exist.  Then I have to rerun the envsetup line:

source build/envsetup.sh


Now it works, good.  So remember, do this before and after!  Also, a possible problem.  If you have the SDK downloaded and set up, when doing ./emulator, it could be running the SDK, and NOT the built version.  I didn't have this problem, but thought of it while working.

Still Complaining – Kernel Panic

So, finally, the kernel.  It won’t work. I don’t know why.  I just want to do my weekly posts.  Also, I have some ideas:

  1. Build it seprately
  2. Try a pre-made kernel
  3. Build Generic
  4. Build Goldfish
  5. Re-make whole thing from scratch using -j1

And Alas I Am Done

So that’s it for now.  Outside of this project, I’ve gotten some done with my other project.  I’ll hopefully have something to show for it in two weeks.  Going to be a busy weekend, so might not be able to work on my side projects too much.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s