Nexus4 - successful build of JellyBean on Snow Leopard - now what?

59 views
Skip to first unread message

James Short

unread,
Apr 11, 2014, 2:58:31 PM4/11/14
to android-...@googlegroups.com
Very new here.  I have successfully downloaded the android source code for JellyBean (4.3_r1.1) and the native drivers from Google for the Nexus4 which I extracted into the top of the source tree (/vendor).

I ran the following commands:
1)  . build/envsetup.sh
2)  lunch 12 (full_mako-userdebug)
3)  make -j2

This ran for about 3 hours and the final output is. . .

Install system fs image: out/target/product/mako/system.img
out/target/product/mako/system.img+out/target/product/mako/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p maxsize=899137536 blocksize=135168 total=241445820 reserve=9191424

My question is. . .now what?

Is the system.img what I want to flash my Nexus4 with?  Or do I need to download, compile, and install the kernel as well?

I can't afford to brick my (only) smartphone, so any guidance would be greatly appreciated before I move on to the google instructions for flashing my device with my own Android ROM.

Very excited, but a little trepidation.

_Jim

shridutt kothari

unread,
Apr 13, 2014, 2:54:05 AM4/13/14
to android-...@googlegroups.com
Hi James Short,


Now as you can see you need to flash the system.img image on System partition, boot.img on boot partition.

so the steps to flash your build are:

. build/envsetup.sh
lunch 12
fastboot oem unlock
fastboot flashall -w

Note: here in last command -w is for if you want to wipe your old data from all partitions(recommended if you don't bother about loosing sd card data)

And about bricking the device: Unless your erase your bootloader partition your device is safe, so never erase your bootloader partition, and if you have to flash new bootloader, just flash the new one without erase bootloader partition.


Thanks,
Shridutt Kothari
Impetus Infotech Ltd.




--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Thanks & Regards,
Shridutt Kothari.

Shaul Yermol

unread,
Apr 13, 2014, 3:00:10 AM4/13/14
to android-...@googlegroups.com
Hi Jim,

First, you do not need to build the kernel on your own, until you are a kernel developer yourself.

Second, if you are flashing SYSTEM.IMG (system partition), or even the boot and recovery too with "flashall" command, you always can go back and re-flash factory image from the fastboot.
What you loose for sure is all applications data saved to internal memory (which is usually located at /data/data). However the /sdcard will remain untouched.
Just carefully follow the instructions from official page here: http://source.android.com/source/building-devices.html.

Being in your shoes 3 years ago, I have started with backing up everything on the phone, then trying to flash the new built image with "flashall" command (from my experience it's almost 1000% safe procedure) and if it can not boot up, just do not panic! It's reversible, the phone can reboot up to "fastboot" and give you an opportunity to flash the factory image.

Another tip, for advanced use, is to get custom recovery, for example from clockworkmod (https://www.clockworkmod.com/rommanager) - it will let you backup all your partitions and application data to the sdcard. Actually, I used it several times, when I wanted to switch to/from development system image and the factory image (however it takes some time, it's not something immediate to back-up or restore ~2Gb of data).


Shaul

James Short

unread,
Apr 14, 2014, 1:05:02 PM4/14/14
to android-...@googlegroups.com
Thanks Kothari and Yermol, appreciate the reply.   I flashed and am now running my own build of JellyBean.



For those of you trying to build JellyBean on OSX SnowLeopard, there were a couple of gotchas I ran into:

1)  The provided version of Bison in the AOSP project will not work as it was compiled against a newer version of OSX.  The error I had was "dyld: lazy symbol binding failed: Symbol not found: _strndup"

The work around, edit the build/core/config.mk file to use your version of bison on OSX.  Set "BISON :=bison"

See code.google.com/p/android/issues/detail?id=68421

2)  After the bison workaround, I ran into this error:
"Generating HTMLEntityTable.cpp Can't locate Switch.pm in @INC. . ."

This error is caused by Switch.pm being deprecated in Perl 5.11.0 and removed in Perl 5.16.3

To solve this on my box, Switch.pm needed to be installed in /usr/local/lib/perl5/5.16.3.  I used MacPorts (sudo port install perl). 

3)  ccache isn't used?
Add the following to both .bash_profile and a new file .profile (my understanding is .bash_profile is used when running terminal, .profile is used for a non-interactive bash session)
export USE_CCACHE=1
export CCACHE_DIR=<some directory>

Close all terminals and relaunch.  Settings should now be good for use. . .not sure if the CCACHE_DIR needs to be on a case-sensitive volume or not.  I put mine on one since the source code requires case-sensitive.

4)  watch doesn't work?  Google provides this command, and it errors on my box:
watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s

Solution, provide the -x switch:

watch -n1 -d -x prebuilts/misc/linux-x86/ccache/ccache -s


Reply all
Reply to author
Forward
0 new messages