You are on page 1of 4

Android2.

1(Froyo)BuildforMini6410
HostSystemInformation: IntelPCwithUbuntu11.10(32bit) TargetSystemInformation: Mini6410ARM11with128MBRAM

Crosscompiletoolsandbuildenvironment
InCDB,wehavebuildtoolsplacedinfolderCDB/linux/.Copyarmlinuxgcc,mktoolsandlogomaker tarzips # mkdir ~/mini6410 # cd ~/mini6410 # cp /media/cdrom/linux/arm-linux-gcc-4.x.x.tgz ~/mini6410 # cp /media/cdrom/linux/mktools.tar.tgz ~/mini6410 # cp /media/cdrom/linux/logomaker.tgz ~/mini6410 Uncompressthesewiththefollowingcommand: # cd ~/mini6410 # sudo tar xvzf arm-linux-gcc-4.x.x-xx-xxx-20xxxxxx.tgz # sudo tar xvzf mktools.tar.gz # sudo tar xvzf logomaker.tgz AddPathinyourenvironmentfile.Open~/.bashrcfiletoaddanewpathwitheditor(gedit) PATH=$PATH:/mini6410/opt/FriendlyARM/toolschain/4.x.x/bin Toapplythischange,loginagainorrestartthe.bashrc # source .bashrc Checkthetoolchainpathtoseeifitissetupcorrectlyornot,whetheritshowgccversion4.5.1 # arm-linux-gcc v

Createaworkingfolder CopytheandroidfolderfromCDAtoPCmini6410folder # cp -fr /media/cdrom/android/ # cd android linux2.x.xx.xandroid,uncompressthelinuxkernelforandroidfile, #tar xvzf android-kernel-2.x.xx-20xxxxxx.tar.gz Android2.1,Androidsystemsourcecode # tar xvzf android-2.1-fs-20xxxxxx.tar.gz rootfs_android,Rootfilesystemfolder # tar xvzf rootfs_android-20xxxxxx.tar.gz

Configureandcompilelinuxkernel
Nowtheconfigurationandcompilecanstart.Goto # cd linux-2.x.xx.x-android Nextstepistocreate.configfileusingnextcommand(specifictoattacheddisplayinthiscase config_android_a70) # cp config_android_xxx .config Createkernel # make zImage ifthekernelbuildissuccessful,theremustbeinarch/arm/boot/filezImage

ConfigureandcompileAndroidsystem
Beforewedothebuild,weneedtohavefollowinglibrariesinstalled.Runthefollowingcommand sudo apt-get install libc6-dev-i386, g++-multilib, zlib1g-dev, lib32z1-dev, bison, flex, lib32ncurses5-dev, libncurses5-dev, libx11-dev, gperf

Inanylibraryismissing,youcanlookforalternativedebianlibrariesonline.Forinstancelib32ncurses5 devcanbereplacedbylibncurses5dev # cd android-2.1 # ./build-android Therewerethreemajorissuesduringbuild.Youcantakefollowingactionsdependingonthetypeof issuefacedduringbuild. Error1:


make: *** [out/host/linuxx86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1 make: *** Waiting for unfinished jobs....

Makefollowingchanges
diff frameworks/base/libs/utils/Android.mk

- LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) + LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive

Error2:
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] error 1

Makefollowingchanges
diff frameworks/base/tools/appt/Android.mk ifeq ($(HOST_OS),linux) -LOCAL_LDLIBS += -lrt +LOCAL_LDLIBS += -lrt -lpthread endif

Error3:
make: *** [out/host/linuxx86/obj/EXECUTABLES/localize_intermediates/localize] error 1

Makefollowingchanges
diff frameworks/base/tools/localize/Android.mk ifeq ($(HOST_OS),linux) -LOCAL_LDLIBS += -lrt +LOCAL_LDLIBS += -lrt -lpthread endif

Attheendcreatearootfilesystem. # ./genrootfs.sh IfyoucanbuildAndroidsystemsuccessfully,youwillhaverootfs_dirfolder.

MakeFilesystem
Makeyaffsfilesystem # cd ~/mini6410/android/Android-2.1 # mkyaffs2image-128M rootfs_dir rootfs_android.img Ifyoucandoitsuccessfully,youwillhaverootfs_android.imginthesamefolder. MakeUBIFSfilesystem # cd ~/mini6410/android/Android-2.1 # mkubimage rootfs_dir rootfs_android.ubi Ifyoucandoitsuccessfully,youwillhaverootfs_android.ubiinthesamefolder. MakeExt3filesystem # cd ~/mini6410/android/Android-2.1 # mkext3image rootfs_dir rootfs_android.ext3 Ifyoucandoitsuccessfully,youwillhaverootfs_android.ext3inthesamefolder.