Recommendations on setting up a build environment for android development among multiple developers?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Recommendations on setting up a build environment for android development among multiple developers?

2,319 Views
abraham_v
Contributor IV

I'm setting up a team for android development based on the iMX6 quad processor. We have the sabresd reference board with us. Following the instructions in the file "Android_User_Guide.pdf" I was able to build (from scratch) the u-boot image, the linux kernel, the android system and successfully load it on our reference board. For version control, the team will be using GIT. My plan is to divide the team into different types - u-boot developers, kernel developers and android developers.

The u-boot developers need only have access to the source code under /u-boot. The output of their work will be the "u-boot.bin" file.

The kernel developers should have access to the /kernel-imx source directory. The output of their work will be the "boot.img" file.

The android developers should only have access to the android sources. They should NOT have access to either the sources in /u-boot or /kernel-imx. Instead, they should have pre-built binaries for whatever u-boot or kernel files they need. Their output will be the "system.img" and "recovery.img" files.

Then the testing team will take these 4 files, use the MFG Tool to load the images to the eMMC area of the board and do whatever is needed.

My problem is that I have no idea how to split the source code into separate stand-alone sections. The "Android_User_Guide.pdf" documentation assumes that every developer has access to the top-level "myandroid" folder. The reason why I want to split the code is because if a developer is ONLY working in /u-boot or /kernel-imx and they try running "git status", it takes too long to respond. That and the fact that its overly cumbersome for a u-boot developer to be lugging around 10+GB of android source code he/she will NOT be working on.

Any suggestions on how this can be accomplished?

I *think* the /u-boot folder can be made into a repository of its own and the cross-compiler tools distributed with it. Running "make" generates the 'u-boot.img' file, so it should work (in theory). But I'm not sure how to do the same with the /kernel-imx folder. Even if that is spun out, all I can do stand-alone is generate the "uImage" file. I'm not sure how to convert this into the "boot.img" file without using "source build/envsetup.sh" and "lunch sabresd_6dq-user". And then there is Freescale's android build system. Assuming that I have the 'u-boot.img' and 'boot.img' files pre-built, how do I configure it to work with them? By default, it seems to be compiling u-boot and linux kernel.

Labels (2)
7 Replies

1,138 Views
abraham_v
Contributor IV

I think my earlier post explained how I spun out the u-boot developers. It took me some debugging (mostly stepping over the Makefile outputs) but I *think* I have a script (or an idea) of how the kernel folks can be split off as well.

First off - they will have to build the entire android system at least once. This will create the top-level /out directory. Then, if they move into the "kernel-imx" folder and run,

../out/host/linux-x86/bin/mkbootimg --kernel arch/arm/boot/zImage --ramdisk ../out/target/product/sabresd_6dq/ramdisk.img --cmdline "console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=10M fb0base=0x27b00000 vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale maxcpus=2" --base 0x10800000  --output boot.img

It should generate the boot.img file. The nice part of using this is that it hardly takes 10 seconds to generate 'boot.img'. The other approach I was using took about 10 mins (it was based on running the source and lunch commands).

Overall, I think the process can be refined further. Possibly by copying over the mkbootimg utility somewhere and having a pre-packaged binary of 'ramdisk.img' as part of the source. It should be possible to automate the creation of ramdisk.img as well, but I'm not sure I have time to spare investigating it.

I hope no real android system developer comes here and sees this. They'll probably be horrified at my (current) non-understanding of the build process. ;P

-Abraham V.

1,138 Views
tootzoe
Contributor III

Great work! Abraham , using your script, save me lots of time to generate boot.img,  your script let me debug imx6's kernel just like imx53, thanks ~:smileywink:

0 Kudos

1,138 Views
abraham_v
Contributor IV

You are welcome Huang. It's nice to know that the threads I create around here are useful to others as well. :smileyhappy:

Smiling,

Abraham V.

0 Kudos

1,138 Views
LeonardoSandova
Specialist I

This is a possible scenario:

Have local repos on your server, and every developer should 'git remote add local <url>' where the <url> are the repos located on your servers (repos are cloned from the original ones, and these will diverge locally). U-boot and kernel developers should only on the corresponding folders (myandroid/bootable/bootloader/uboot-imx and  myandroid/kernel_imx), typing git commands should be fast. Developers should send patches to a mailing list (git format-patch && git send-email). The maintainer of the corresponding repo should merge those patches and then everyone can 'git fetch local' again. This is the best scenario I can see.

Leo

1,138 Views
abraham_v
Contributor IV

Thanks for your reply LeonardoSandovalGonzalez.

I considered that. It might work for the u-boot developers, but do you have any idea how the kernel developers would be able to generate the "boot.bin" image file from just the /kernel-imx directory? Here's the scenario as I see it,

For u-boot developers,

The cross-compiler toolchain is located in ~/arm-eabi-4.6/bin/*

The u-boot source is located in ~/u-boot

The android sources are NOT anywhere on the system.

To generate the "u-boot.bin" file for the sabresd reference board they need to do the following steps,

>cd ~/u-boot

>export ARCH=arm

>export CROSS_COMPILE=~/arm-eabi-4.6/bin/arm-eabi-

>make mx6q_sabresd_android_config

>make

That should work without problems.

Now for the kernel developers here is how their system would look like,

The cross-compiler toolchain is located in ~/arm-eabi-4.6/bin/*

The linux kernel (for android) is located in ~/kernel_imx

The u-boot source is located in ~/u-boot

The android sources are NOT anywhere on the system.

The build instructions would go like this (basing this off the "Android_User_Guide.pdf" file),

>cd ~/u-boot

>export ARCH=arm

>export CROSS_COMPILE=~/arm-eabi-4.6/bin/arm-eabi-

>make mx6q_sabresd_android_config

>make

>cd ~/kernel_imx

>export PATH=~/u-boot/tools:$PATH

>make imx6_android_defconfig

>make uImage

When this is over, they will have "uImage" file located in "~/kernel_imx/arch/arm/boot/". But how do I generate the "boot.img" file at this point? According to "Android_User_Guide.pdf" I need to do this,

>cd ~/myandroid                            #### A non-existent directory on the system

>source build/envsetup.sh               #### Again; it does NOT exist on the kernel developers system

>lunch sabresd_6dq-user                 #### Not sure how this would even run

>make bootimage                            #### How do I do this WITHOUT the above steps?

Any suggestions?

1,138 Views
LeonardoSandova
Specialist I

No idea. Kernel developers may need the whole android folder. I am not an Android expert, so I may be wrong.

Leo

0 Kudos

1,138 Views
abraham_v
Contributor IV

I was worried about that. If I weren't time constrained, I would try digging through the build files but for now, at least I've spun off the u-boot folks. Thanks Leo!