Page 1 of 8 123 ... LastLast
Results 1 to 10 of 73
Like Tree2Likes

Thread: Building Android 4.0.X for ADAM [WIP][AOSP/CM] in Linux WIP

  1. #1
    Member
    Join Date
    May 2011
    Posts
    87
    Thanks
    5
    Thanked 41 Times in 15 Posts

    Building Android 4.0.X for ADAM [WIP][AOSP/CM] in Linux WIP

    Building Android 4.0.X for ADAM [WIP][AOSP/CM] in Linux WIP


    I am using Linux Mint 12 64-bit. For this walkthrough I used a VirtualBox virtual machine with a virtual drive of ~100G. I used Mint 12 for this because that is what I am using in the non virtual world

    Here are some numbers from my system to help with deciding if you have enough room to do this.
    WORKING_DIRECTORY before building anything: ~4.5 GB
    WORKING_DIRECTORY after building ICS: ~16 GB
    VirtualBox Ubuntu 10.4 Virtual Machine after build: ~35 GB
    VirtualBox Mint 12 Virtual Machine after build: ~32 GB

    When I first started with the Mint Virtual Machine I had made a 30 GB virtual disk that I later expanded to 100 GB. The virtual disks are dynamic so if their space is not used it is not an impact on your real world system.

    Note: I used a new virtual machine with a newly installed copy of Linux Mint 12 64-bit for the walkthrough. The errors that I worked through to get the zip file will be different if you are not using the same setup I did.

    From Initializing a Build Environment | Android Open Source

    Installing the JDK

    Code:
    sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
    You should be returned to prompt after entering your password

    Code:
    sudo apt-get update
    Should end with something like Fetched some amount in time (speed)
    Reading package lists... Done

    Code:
    sudo apt-get install sun-java6-jdk
    This installs the JDK should download then install with no errors


    Code:
    sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc
    Will ask if you want to continue hit enter (capital Y is the default) should get a bunch of stuff then install them and end with no errors
    note: I changed the lib32readline5-dev to lib32readline-gplv2-dev as this is what apt-get asked for. I used an Ubuntu 10.04 64 bit virtual machine for testing for problems and it was ok with lib32readline5-dev.


    Since Mint 12 is based off of Ubuntu 11.10

    Code:
    sudo apt-get install libx11-dev:i386
    Asks if you want to continue so hit enter for default Y
    Hopefully no errors and back at prompt


    Configure ADB
    Add the following to /etc/udev/rules.d/51-android.rules (as the root user) file may need to be created

    Code:
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0995", MODE="0666"
    SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
    set up ccache
    Put the following in your .bashrc or equivalent. Note: I put it at the end of .profile in my home directory on Mint 12

    Code:
    export USE_CCACHE=1

    Note for later: The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code.

    Code:
    prebuilt/linux-x86/ccache/ccache -M 50G


    From Downloading the Source Tree | Android Open Source

    To install, initialize, and configure Repo, follow these steps:

    Make sure you have a bin/ directory in your home directory, and that it is included in your path:

    Code:
    mkdir ~/bin
    PATH=~/bin:$PATH
    Download the Repo script and ensure it is executable:

    Code:
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    This will print some some stuff to the screen then bring you back to the prompt

    Code:
    chmod a+x ~/bin/repo
    Hopefully no errors with that stuff

    After installing Repo, set up your client to access the android source repository:

    Create an empty directory to hold your working files. Give it any name you like but we are doing it this way here:

    Code:
    mkdir ~/WORKING_DIRECTORY
    cd WORKING_DIRECTORY
    Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.
    To check out a branch other than "master", specify it with -b
    We want what the devs are using so the following will get 4.0.3 source.

    Code:
    repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.3_r1
    This will prompt for your name and email, you should hit 'y' then enter. It will then ask about enabling color display I just hit the default for this.

    It should end with: repo initialized in /home/yourID/WORKING_DIRECTORY

    Next get the files
    type at the prompt

    Code:
    repo sync
    This will take awhile
    For this walk-through the above command stopped a few times so after checking the google page I did the following:

    More rarely, Linux clients experience connectivity issues, getting stuck in the middle of downloads (typically during "Receiving objects"). It has been reported that tweaking the settings of the TCP/IP stack and using non-parallel commands can improve the situation. You need root access to modify the TCP setting. If the above command does not get stuck you do not need to do this next bit.

    Code:
    sudo sysctl -w net.ipv4.tcp_window_scaling=0
    repo sync -j1
    Note: I later found out (googling) that the repo command stopping in my VirtualBox could be caused by my using a NAT network interface. The fix is to use a bridged interface.

    Should finally end with: Syncing work tree 100% (228/228), done.
    Then drop you at the prompt

    As noted above: The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code.

    Code:
    prebuilt/linux-x86/ccache/ccache -M 50G


    Next: Load the following public key into your GnuPG key database. The key is used to sign annotated tags that represent releases.

    Code:
    gpg --import
    Copy and paste the key(s) from the google page, then enter EOF (Ctrl-D) to end the input and process the keys. The keys are the whole code area starting with -----BEGIN PGP PUBLIC KEY BLOCK----- and ending with -----END PGP PUBLIC KEY BLOCK----- not just what is in between.
    You should get something that says the key was created, processed and imported. Then returned to the prompt.




    Correct build errors here before we have them. These particular errors popped up in Linux Mint 12 64 bit. They most likely would also pop up in Ubuntu 11.10. They are not needed in Ubuntu 10.04. Other distros may have them or have different errors or no errors.

    First error will be about _FORTIFY_SOURCE so we do this
    From here: Issue 20795 - android - AOSP build fails in HOST_linux-x86 with _FORTIFY_SOURCE redefined. - Android - An Open Handset Alliance Project - Google Project Hosting
    The fix is to apply a patch from Jim Huang (jserv) found on CyanogenMod's android_build from Sep 6, 2011. Simply change build/core/combo/HOST_linux-x86.mk line 61

    find:
    Code:
    HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
    Change it to:
    Code:
    HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

    The next error will have to do with llvm-rs-cc_intermediates/slang_rs so we do this
    from here: [Q] 4.0.3 Compile problems - xda-developers

    In file: frameworks/compile/slang/Android.mk
    Find:
    Code:
    local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
    Change it to:
    Code:
    local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter

    Next we get the device tree and proprietary files
    Download the zip files from:

    https://github.com/rrathi/adamICS
    https://github.com/mrdeadlocked/vendor_notionink_adam

    Now we create the device tree directory

    Code:
    cd ~/WORKING_DIRECTORY/device
    mkdir notionink
    mkdir notionink/adam
    I used the GUI to do the next section. It was easier to move stuff out of the zip files to the proper directories.

    unzip the rrathi-adamICS zip and copy the contents of the rrathi-adamICS folder to WORKING_DIRECTORY/device/notionink/adam

    unzip mrdeadlocked-vendor_notionink_adam zip file and copy the proprietary directory to WORKING_DIRECTORY/device/notionink/adam Leave the other files in the mrdeadlocked zip in there they get created by the copy-files.sh script later on.



    Not sure why but 4 files are missing from the proprietary directory they are:
    proprietary/lib/libnvrm_channel.so
    proprietary/bin/nvtest
    proprietary/bin/tegrastats
    proprietary/lib/libnvmm_videorenderer.so

    We can get these from the ics_alpha2_3G_wifi.zip
    Goto the /system/lib and /system/bin directories to copy those files, make sure to put them in the proper directories you will have to create the bin directory in the ..notionink/adam/proprietary directory since it is not there.

    From the terminal type the following to create the vendor directory and copy the proprietary files
    Code:
    ./copy-files.sh proprietary
    This should come back to the prompt with no files missing.

    From Building the System | Android Open Source
    Now we Initialize the build

    Code:
    cd ~/WORKING_DIRECTORY
    source build/envsetup.sh
    Gives you a bunch of including stuff.

    Now type:

    Code:
    lunch
    Select 6 full_adam-userdebug
    It shows you what you selected and drops you at the prompt

    Now we build
    Type:

    Code:
    time make otapackage -j4
    If it fails with a kill 9 statement it needs more space or memory run it and don't have anything else open.
    On older machines the -j4 might need to be lowered to -j2. On faster machines the number can be increased. In the real world I use -j4 on an i5 2500k and build in 21 minutes after the initial build.

    After awhile you should have a zip file in /WORKING_DIRECTORY/out/target/product/adam
    Last edited by jl7854; 02-13-2012 at 03:27 PM.
    Justin Moore likes this.

  2. The Following 14 Users Say Thank You to jl7854 For This Useful Post:

    anc_k (02-10-2012), angelus (02-10-2012), atultiwari (02-10-2012), dubbelklik (04-11-2012), FordPrefect (02-10-2012), harvey186 (02-10-2012), Justin Moore (02-11-2012), mbmad (02-12-2012), mikus (02-10-2012), paronnax (02-14-2012), Ramana (02-11-2012), vt220 (02-10-2012), widget985 (02-11-2012), will765 (02-10-2012)

  3. #2
    Member
    Join Date
    May 2011
    Posts
    45
    Thanks
    27
    Thanked 5 Times in 4 Posts
    Wow thanks lot

    Lot of people asking how to compil will be glad to see that post!

    Great post!

  4. #3
    Regular
    Join Date
    Apr 2011
    Posts
    212
    Thanks
    17
    Thanked 22 Times in 11 Posts
    Koolness!

  5. #4
    Regular
    Join Date
    Jun 2011
    Posts
    138
    Thanks
    8
    Thanked 9 Times in 8 Posts
    Wonderful! Thank you so much ... will try some time soon to follow this instructions and then report back how it worked for me.
    ---------------------------------------
    Nook Color: CyanogenMod-7.2
    NotionInk Adam: [JB-ROM] Android 4.1.X - CM10 - Beta 2

  6. #5
    Resident harvey186's Avatar
    Join Date
    Apr 2011
    Location
    Hamburg, Germany
    Posts
    514
    Thanks
    37
    Thanked 55 Times in 42 Posts
    Attention: On my Ubuntu 10.04 I have to put the Repo script into the /bin folder not in the ~/bin folder. !!!!!!!!!!!

    Make sure you have a bin/ directory in your home directory, and that it is included in your path:

    Download the Repo script and ensure it is executable:

    Code:
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > /bin/repo
    This will print some some stuff to the screen then bring you back to the prompt

    Code:
    chmod a+x /bin/repo
    Hopefully no errors with that stuff

    AND:
    The folder /bin does not exist in proprietary:

    Not sure why but 4 files are missing from the proprietary directory they are:
    proprietary/lib/libnvrm_channel.so
    proprietary/bin/nvtest
    proprietary/bin/tegrastats
    proprietary/lib/libnvmm_videorenderer.so
    Last edited by harvey186; 02-11-2012 at 04:12 AM.
    shit happens

  7. #6
    Resident harvey186's Avatar
    Join Date
    Apr 2011
    Location
    Hamburg, Germany
    Posts
    514
    Thanks
    37
    Thanked 55 Times in 42 Posts
    OK, after a while my first try stops......

    make: *** [out/target/product/adam/obj/STATIC_LIBRARIES/libLLVMScalarOpts_intermediates/LoopStrengthReduce.o] Error 1
    make: *** Waiting for unfinished jobs....

    real 39m50.368s
    user 64m16.141s
    sys 5m47.154s


    and no zip :-(
    Last edited by harvey186; 02-11-2012 at 05:06 AM.
    shit happens

  8. The Following User Says Thank You to harvey186 For This Useful Post:

    dbk007 (04-19-2012)

  9. #7
    Member
    Join Date
    May 2011
    Posts
    87
    Thanks
    5
    Thanked 41 Times in 15 Posts
    Quote Originally Posted by harvey186 View Post
    Attention: On my Ubuntu 10.04 I have to put the Repo script into the /bin folder not in the ~/bin folder. !!!!!!!!!!!

    Make sure you have a bin/ directory in your home directory, and that it is included in your path:

    Download the Repo script and ensure it is executable:

    Code:
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > /bin/repo
    This will print some some stuff to the screen then bring you back to the prompt

    Code:
    chmod a+x /bin/repo
    Hopefully no errors with that stuff
    I am not sure why you would not be able to use a bin directory in your home folder. This PATH=~/bin:$PATH should make the bin directory that you made in your home directory the first directory checked for the repo command. But as long as you were able to use the repo command to get the source it should not matter.

    Quote Originally Posted by harvey186 View Post
    AND:
    The folder /bin does not exist in proprietary:

    Not sure why but 4 files are missing from the proprietary directory they are:
    proprietary/lib/libnvrm_channel.so
    proprietary/bin/nvtest
    proprietary/bin/tegrastats
    proprietary/lib/libnvmm_videorenderer.so
    I kind of skimmed over that stuff because I used the GUI to do it. But, instead of just saying to "make sure to put them in the proper directory", I should add to make the proprietary/bin directory as well.
    Justin Moore likes this.

  10. The Following User Says Thank You to jl7854 For This Useful Post:

    Justin Moore (02-11-2012)

  11. #8
    Resident harvey186's Avatar
    Join Date
    Apr 2011
    Location
    Hamburg, Germany
    Posts
    514
    Thanks
    37
    Thanked 55 Times in 42 Posts
    Quote Originally Posted by jl7854 View Post
    I am not sure why you would not be able to use a bin directory in your home folder. This PATH=~/bin:$PATH should make the bin directory that you made in your home directory the first directory checked for the repo command. But as long as you were able to use the repo command to get the source it should not matter.
    l.
    It wasn't working and I have googled a lot and I found a lot of posts where it was descriped that you have to use the /bin instead of ~/bin
    shit happens

  12. #9
    Member
    Join Date
    May 2011
    Posts
    87
    Thanks
    5
    Thanked 41 Times in 15 Posts
    Quote Originally Posted by harvey186 View Post
    OK, after a while my first try stops......

    make: *** [out/target/product/adam/obj/STATIC_LIBRARIES/libLLVMScalarOpts_intermediates/LoopStrengthReduce.o] Error 1
    make: *** Waiting for unfinished jobs....
    That is the sort of mistake that I have made in the past. That last error is often not the actual error that caused the build to stop. When ever you are compiling anything you always want to go back to the first error and correct that one. The problems propagate from there. With multi-threaded builds you sometimes have to go back quite far in the listing to find it. Sometimes, depending on the build it may be a warning that ultimately causes the build to fail. Starting the build again (do not clean, just run the make command used again) can help find the problem spot. If you can find the error, we maybe able to find the fix. I am no guru, I just use google a lot.

    I should point out that I used a new virtual machine with a newly installed copy of Linux Mint 12 x64 for the walkthrough above. The errors that I worked through to get the zip file will be different if you are not using the same setup I did.
    Last edited by jl7854; 02-11-2012 at 09:43 AM.

  13. #10
    Resident
    Join Date
    May 2011
    Location
    Austin, TX
    Posts
    509
    Thanks
    115
    Thanked 50 Times in 34 Posts

    make-hash-tools.pl


Page 1 of 8 123 ... LastLast

Remove Ads

Similar Threads

  1. [WIP][AOSP][ICS]ICS-Android 4.0 AOSP BUILD
    By Jon2555 in forum Folio ROM Development
    Replies: 15
    Last Post: 01-19-2012, 03:00 PM
  2. Porting of Ubuntu Linux on Adam
    By TechGeek in forum Adam ROM Development
    Replies: 84
    Last Post: 11-09-2011, 12:22 PM
  3. Replies: 14
    Last Post: 10-23-2011, 05:30 PM
  4. GPL source code for Android 3.2 available in AOSP
    By edouardkleinhans in forum Adam General Discussion
    Replies: 1
    Last Post: 07-13-2011, 05:07 AM

Search tags for this page

build/core/main.mk:43: * you are using version 3.82 of make
,

building cm in mint

,

compile android linux mint

,

linux boot double dash

,

linux mint compiling android cm10 missing package packages

,
mint aosp
,

prebuilt/linux-x86/ccache/ccache

,

prebuilt/linux-x86/ccache/ccache -m 50g

,

repo sync opensuse net.ipv4.tcp window scaling=0

,

sudo apt-get install libx11-dev:i386

Click on a term to search for related topics.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •