[Q] Compiling and extract_files.sh assistance needed - Verizon Samsung Galaxy S 4

I'm having quite a difficult time getting a final product actually compiled, and have a question about modifying extract_files.sh.
The primary guide (in addition to many hours of setups, searches and additional reading) I've been using is Cyanogenmod's for JFLTEVZW, and the unified builds have officially confused the hell out of me. I know it went from non-unified, to unified, back to non-unified, but my attempts at compiling a build continue to fail or the OS completely freezes--I've recreated my build environment multiple times and am now using someone else's pre-configured, downloadable Cyanogenmod build environment image, which I've imported into VirtualBox...but something inevitably goes wrong, and I guess I'll ask about that if and when it fails/freezes during the "brunch" process again.
Does linux or however this whole git/repo/sync system is configured "remember" in some configuration file somewhere when I've done a breakfast jflte (not jfltevzw) once before, and despite deleting all contents of the android/system folder and starting fresh, if I do it for jfltevzw again, it will still grab files for jflte, or is that normal?
Code:
[email protected]:~/android/system$ source build/envsetup.sh && breakfast jfltevzw
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/samsung/jflte/vendorsetup.sh
including device/samsung/jfltevzw/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/cm/bash_completion/git.bash
including vendor/cm/bash_completion/repo.bash
including vendor/cm/vendorsetup.sh
Looking for dependencies
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.0.2
CM_VERSION=12-20150417-UNOFFICIAL-jfltevzw
TARGET_PRODUCT=cm_jfltevzw
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.16.0-28-generic-x86_64-with-Ubuntu-14.10-utopic
HOST_BUILD_TYPE=release
BUILD_ID=LRX22G
OUT_DIR=/home/android/android/system/out
============================================
Is it supposed to be doing this, or have I messed up somewhere since I'm not a linux guru and I know the concept of "I deleted the folder" is not the same as in Windows? I'm wondering if something was written to a file somewhere when I FIRST ran breakfast jflte without knowing exactly which one I should be doing, or if this is normal, despite the s4 being unique by having unified CM builds for a while. I may need to have this build/compile process explained to me as if I'm new to computers, apparently.
My goal is to make various compiled builds so that I can attempt to fix the broken compass. The problem may be that the code worked before the unified builds, and so the other part of my question is, how do I modify extract_files.sh so that I can have it pull the files from a cyanogenmod .zip file? I've read this, and looked at the file and don't understand which of the four lines to edit. Also, within android/system/device/samsung there are jf-common, jflte, jfltevzw, qcom-common folders, and both the jflte and jfltevzw (again, I don't know if both should even be there since I'm doing a sync when the builds are no longer unified) have an extract_files.sh which points to the file in jf-common (again, I don't know if I should/can be doing breakfast/brunch jflte or jfltevzw because of the lack of acknowledgement to prior and vestigial unified components remaining in the CM code in the "how to build CM" documentation):
Code:
#!/bin/sh
set -e
export DEVICE=jfltevzw
export VENDOR=samsung
./../jf-common/extract-files.sh [email protected]
Code:
#!/bin/bash
function extract() {
for FILE in `egrep -v '(^#|^$)' $1`; do
OLDIFS=$IFS IFS=":" PARSING_ARRAY=($FILE) IFS=$OLDIFS
FILE=`echo ${PARSING_ARRAY[0]} | sed -e "s/^-//g"`
DEST=${PARSING_ARRAY[1]}
if [ -z $DEST ]; then
DEST=$FILE
fi
DIR=`dirname $FILE`
if [ ! -d $2/$DIR ]; then
mkdir -p $2/$DIR
fi
if [ "$SRC" = "adb" ]; then
# Try CM target first
adb pull /system/$DEST $2/$DEST
# if file does not exist try OEM target
if [ "$?" != "0" ]; then
adb pull /system/$FILE $2/$DEST
fi
else
cp $SRC/system/$FILE $2/$DEST
# if file dot not exist try destination
if [ "$?" != "0" ]
then
cp $SRC/system/$DEST $2/$DEST
fi
fi
done
}
if [ $# -eq 0 ]; then
SRC=adb
else
if [ $# -eq 1 ]; then
SRC=$1
else
echo "$0: bad number of arguments"
echo ""
echo "usage: $0 [PATH_TO_EXPANDED_ROM]"
echo ""
echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from"
echo "the device using adb pull."
exit 1
fi
fi
BASE=../../../vendor/$VENDOR/jf-common/proprietary
rm -rf $BASE/*
DEVBASE=../../../vendor/$VENDOR/$DEVICE/proprietary
rm -rf $DEVBASE/*
extract ../../$VENDOR/jf-common/common-proprietary-files.txt $BASE
extract ../../$VENDOR/$DEVICE/device-proprietary-files.txt $DEVBASE
../jf-common/setup-makefiles.sh
So what exactly do I need to change, per these instructions so that I can pull the proprietary files from, say, cm-11-20140210-SNAPSHOT-M3-jfltevzw.zip (pre-unified) or cm-11-20140504-SNAPSHOT-M6-jflte.zip (post-unified) instead of from my phone? I saw the PATH_TO_EXPANDED_ROM part, but I don't know where that's referenced, so I don't know how to make use of that instead.
I'll be grateful for any help, because I'd really like to take a shot at reviving the compass since it used to work correctly. Thanks =)
Unless someone can guarantee to me that if I were to recompile the very first CM10 build for the S4, I could just do a normal pull of the proprietary files from my CM12 nightly phone and end up with a compiled zip identical to the first CM10 and would have zero changes compared to the original CM10, then I won't bother with trying to pull the proprietary files from an older CM zip instead of my current nightly, which I presume are related to hardware functionality--something I want to fix.

Jon8RFC said:
I'm having quite a difficult time getting a final product actually compiled, and have a question about modifying extract_files.sh.
The primary guide (in addition to many hours of setups, searches and additional reading) I've been using is Cyanogenmod's for JFLTEVZW, and the unified builds have officially confused the hell out of me. I know it went from non-unified, to unified, back to non-unified, but my attempts at compiling a build continue to fail or the OS completely freezes--I've recreated my build environment multiple times and am now using someone else's pre-configured, downloadable Cyanogenmod build environment image, which I've imported into VirtualBox...but something inevitably goes wrong, and I guess I'll ask about that if and when it fails/freezes during the "brunch" process again.
Does linux or however this whole git/repo/sync system is configured "remember" in some configuration file somewhere when I've done a breakfast jflte (not jfltevzw) once before, and despite deleting all contents of the android/system folder and starting fresh, if I do it for jfltevzw again, it will still grab files for jflte, or is that normal?
Code:
[email protected]:~/android/system$ source build/envsetup.sh && breakfast jfltevzw
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/samsung/jflte/vendorsetup.sh
including device/samsung/jfltevzw/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/cm/bash_completion/git.bash
including vendor/cm/bash_completion/repo.bash
including vendor/cm/vendorsetup.sh
Looking for dependencies
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.0.2
CM_VERSION=12-20150417-UNOFFICIAL-jfltevzw
TARGET_PRODUCT=cm_jfltevzw
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.16.0-28-generic-x86_64-with-Ubuntu-14.10-utopic
HOST_BUILD_TYPE=release
BUILD_ID=LRX22G
OUT_DIR=/home/android/android/system/out
============================================
Is it supposed to be doing this, or have I messed up somewhere since I'm not a linux guru and I know the concept of "I deleted the folder" is not the same as in Windows? I'm wondering if something was written to a file somewhere when I FIRST ran breakfast jflte without knowing exactly which one I should be doing, or if this is normal, despite the s4 being unique by having unified CM builds for a while. I may need to have this build/compile process explained to me as if I'm new to computers, apparently.
My goal is to make various compiled builds so that I can attempt to fix the broken compass. The problem may be that the code worked before the unified builds, and so the other part of my question is, how do I modify extract_files.sh so that I can have it pull the files from a cyanogenmod .zip file? I've read this, and looked at the file and don't understand which of the four lines to edit. Also, within android/system/device/samsung there are jf-common, jflte, jfltevzw, qcom-common folders, and both the jflte and jfltevzw (again, I don't know if both should even be there since I'm doing a sync when the builds are no longer unified) have an extract_files.sh which points to the file in jf-common (again, I don't know if I should/can be doing breakfast/brunch jflte or jfltevzw because of the lack of acknowledgement to prior and vestigial unified components remaining in the CM code in the "how to build CM" documentation):
Code:
#!/bin/sh
set -e
export DEVICE=jfltevzw
export VENDOR=samsung
./../jf-common/extract-files.sh [email protected]
Code:
#!/bin/bash
function extract() {
for FILE in `egrep -v '(^#|^$)' $1`; do
OLDIFS=$IFS IFS=":" PARSING_ARRAY=($FILE) IFS=$OLDIFS
FILE=`echo ${PARSING_ARRAY[0]} | sed -e "s/^-//g"`
DEST=${PARSING_ARRAY[1]}
if [ -z $DEST ]; then
DEST=$FILE
fi
DIR=`dirname $FILE`
if [ ! -d $2/$DIR ]; then
mkdir -p $2/$DIR
fi
if [ "$SRC" = "adb" ]; then
# Try CM target first
adb pull /system/$DEST $2/$DEST
# if file does not exist try OEM target
if [ "$?" != "0" ]; then
adb pull /system/$FILE $2/$DEST
fi
else
cp $SRC/system/$FILE $2/$DEST
# if file dot not exist try destination
if [ "$?" != "0" ]
then
cp $SRC/system/$DEST $2/$DEST
fi
fi
done
}
if [ $# -eq 0 ]; then
SRC=adb
else
if [ $# -eq 1 ]; then
SRC=$1
else
echo "$0: bad number of arguments"
echo ""
echo "usage: $0 [PATH_TO_EXPANDED_ROM]"
echo ""
echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from"
echo "the device using adb pull."
exit 1
fi
fi
BASE=../../../vendor/$VENDOR/jf-common/proprietary
rm -rf $BASE/*
DEVBASE=../../../vendor/$VENDOR/$DEVICE/proprietary
rm -rf $DEVBASE/*
extract ../../$VENDOR/jf-common/common-proprietary-files.txt $BASE
extract ../../$VENDOR/$DEVICE/device-proprietary-files.txt $DEVBASE
../jf-common/setup-makefiles.sh
So what exactly do I need to change, per these instructions so that I can pull the proprietary files from, say, cm-11-20140210-SNAPSHOT-M3-jfltevzw.zip (pre-unified) or cm-11-20140504-SNAPSHOT-M6-jflte.zip (post-unified) instead of from my phone? I saw the PATH_TO_EXPANDED_ROM part, but I don't know where that's referenced, so I don't know how to make use of that instead.
I'll be grateful for any help, because I'd really like to take a shot at reviving the compass since it used to work correctly. Thanks =)
Unless someone can guarantee to me that if I were to recompile the very first CM10 build for the S4, I could just do a normal pull of the proprietary files from my CM12 nightly phone and end up with a compiled zip identical to the first CM10 and would have zero changes compared to the original CM10, then I won't bother with trying to pull the proprietary files from an older CM zip instead of my current nightly, which I presume are related to hardware functionality--something I want to fix.
Click to expand...
Click to collapse
Once you breakfast/lunch jfltevzw instead of jflte, that will override the last breakfast/lunch option you chose. So essentially whatever the last thing you selected for the breakfast/lunch is what it will use. You can just edit the script to pull the files from a zip after extracting it, I assume if your building from source you know how bash scripts work.
Cm documentation is horrible and their build system typically is more complicated (seemingly for no reason) than that of aosp. Use jfltevzw and if it doesn't work use jflte, unless you know how to build a device tree for jfltevzw yourself in which case you could do that.

Thanks, Surge! Hope the bootloader unlock progress is still coming along!
I think my remaining problem with the freezing was the fact that I was running it as a VM. I did a real Ubuntu installation (and combined a few how-to guides to actually get things working) and instead of me watching the paint dry for over ten hours, and then it freezing, the build compiled in 1 hour 53 minutes (I guess that puts my poor, overclocked Q9550 into perspective ), and booted up on my phone after a full wipe. I don't know what all I installed that may not have been necessary, so setting up this new environment may have been overkill, but maybe it's worth it for me to make a more updated how-to.
For what it's worth, I still saw warnings during the build and at the beginning of brunch, it still did the src not found string of errors, but CM12 built just fine. I initially thought something was wrong with the build functionality because I saw "make -j4 bacon" in the task manager, so I tried manually building with make jfltevzw, thinking that something was wrong and it was building for the One Plus One...that was very misleading and confusing. That was on the VM, and I wasted HOURS doing two additional pointless builds because I thought the brunch process was FUBAR. Nope, if you see "make -jX bacon", apparently that's a misnomer and it's NOT building CM for the One Plus One.
Also, the repo sync actually maxed out my internet connection and I didn't have to wait a couple of hours for it to sync, when I used the following (8 and 16 didn't cut it):
Code:
repo sync -j32 -c
The -c may have been redundant, according to CM's documentation, but I did it anyway just to play it safe. Also, I didn't officially read it anywhere, but the -j (jobs) switch is frequently referred to as something which should be equal to or less than your processor's core/thread capability. That doesn't apply to the repo sync at all...I had to raise a lot it to actually make use my bandwidth.
The bandwidth usage for the sync was usually pegged at 215mbit downstream and ranged between 4 and 12mbit upstream (my cap is 22) so substantial upstream bandwidth is necessary to keep up with downstream, it seems.
I'm rambling so that if others wander over here, they'll see my experiences. I guess I should make more of a "CM compiling for idiots who are sys admins with Windows, but apparently suck with linux" guide. Step 1 is VirtualBox freezes at some point over 10 hours of compiling, even with 250gigs of space on a dedicated drive, 4gigs of ram, and 4 cpus at 100% allocation...just dual boot instead.

Related

[GUIDE][DEV][DISCONTINUED] How I build my own CM10.1 test builds

This is still unofficial. This thread is intended for devs & advanced users only.
Guide how I build CM10.1 for my smultron.
For the first time you try to build CM10.1
Follow this guide up to "Initialize the CyanogenMod source repository" step (don't execute this step).
http://wiki.cyanogenmod.org/w/Build_for_smultron
Download & install lzop compression tool
Code:
sudo apt-get install lzop
Initialize the CyanogenMod source repository
Enter the following to initialize the repository:
Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
Get the required local manifest
Code:
mkdir -p ~/android/system/.repo/local_manifests
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
Download the source code
Code:
repo sync
Download some commits from CyanogenMod gerrit which are not accepted yet
Code:
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/updates.sh > ~/android/system/updates.sh
chmod a+x updates.sh
./updates.sh
Get the prebuilts
Code:
cd ~/android/system/vendor/cm
./get-prebuilts
Setup the environment & prepare the device-specific code.
Code:
cd ~/android/system
. build/envsetup.sh
breakfast smultron
Build the ROM (takes long time)
Code:
brunch smultron
If the build finishes successfully, you will find the build here (change DATE into the date):
~/android/system/out/target/product/smultron/cm-10.1-DATE-UNOFFICIAL-smultron.zip
The next times you want to build, you only need to do the following:
Sync the repositories & make sure you are using the latest local_manifest.
Code:
cd ~/android/system/
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
repo sync
Download some commits from CyanogenMod gerrit which are not accepted yet
Code:
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/updates.sh > ~/android/system/updates.sh
chmod a+x updates.sh
./updates.sh
Setup the environment
Code:
. build/envsetup.sh
Build the ROM
Code:
brunch smultron
If the build finishes successfully, you will find the build here (change DATE into the date):
~/android/system/out/target/product/smultron/cm-10.1-DATE-UNOFFICIAL-smultron.zip
Steps to build only the kernel:
Sync the repositories.
Code:
cd ~/android/system/
repo sync
Setup the environment
Code:
. build/envsetup.sh
Build the kernel
Code:
breakfast smultron
make -j4 bootimage
If the build finishes successfully, you will find the boot image here:
~/android/system/out/target/product/smultron/boot.img
Credits: Thanks to hnl_dk for the initial CM9 & CM10 guides.
Build is successful using this guide now. You can build for all xperia 2011 phones by replacing "smultron" with your device's name in the guide.
More info can be found here: https://github.com/LegacyXperia/local_manifests/wiki
Re: [GUIDE][WIP] How I build my own CM10.1 test builds
Wew good guide! :thumbup: hope can get the stable version of the CM10.1with this guide here
Sent from my SK17i using xda premium
After 'repo init' there should be a
Code:
mkdir -p ~/android/system/.repo/local_manifests
Script to apply not yet merged changes:
Code:
#!/bin/sh
android=~/android/system
#http://review.cyanogenmod.org/#/c/32906/
cd ${android}/frameworks/av/
git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_av refs/changes/06/32906/2 && git format-patch -1 --stdout FETCH_HEAD | patch -p1
#http://review.cyanogenmod.org/#/c/28336/
cd ${android}/packages/apps/LegacyCamera/
git fetch http://review.cyanogenmod.org/CyanogenMod/android_packages_apps_LegacyCamera refs/changes/36/28336/1 && git format-patch -1 --stdout FETCH_HEAD | patch -p1
#http://review.cyanogenmod.org/#/c/34989/
cd ${android}/hardware/qcom/audio-caf
git fetch http://review.cyanogenmod.org/CyanogenMod/android_hardware_qcom_audio-caf refs/changes/89/34989/5 && git format-patch -1 --stdout FETCH_HEAD | patch -p1
From http://forum.xda-developers.com/showthread.php?t=1358547
Code:
repo sync -f
May fix error: Exited sync due to fetch errors
hi,
I want to build CM 10.1 for my mango, guide is perfectly explain, just one question :
does i need to add the script part explain by M66B two post above or it's outdated and i just need to follow the first post ?
Thanks
Edit : sorry for the noob question, i have read the reviews and have my answer
kosmo666 said:
hi,
I want to build CM 10.1 for my mango, guide is perfectly explain, just one question :
does i need to add the script part explain by M66B two post above or it's outdated and i just need to follow the first post ?
Thanks
Edit : sorry for the noob question, i have read the reviews and have my answer
Click to expand...
Click to collapse
The scrip parts from above are outdated, we maintain this script now.
How to merge in this nAa 3.4.45 kernel sources? Is it connected with kernel sources?
mastero9017 said:
How to merge in this nAa 3.4.45 kernel sources? Is it connected with kernel sources?
Click to expand...
Click to collapse
If you look at Mike's github (https://github.com/LegacyXperia)
you'll see that he maintains his own branch of the nAa kernel (https://github.com/LegacyXperia/msm7x30-3.4.x-nAa).
They are not the same, but similar (Mike currently has more changes, since nAa hasn't updated anything for two weeks).
-> If you build Mike's sources, you'll also get a 3.4.45 kernel.
What am I doing wrong? Did everything, checked all libs 10 times..
EDIT: It's a KDE error,aghhr. Delete/clean /root/.config directory fixes it
Code:
[email protected]:~/android/system# brunch haida
including vendor/cm/vendorsetup.sh
Trying dependencies-only mode on a non-existing device tree?
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
CM_VERSION=10.1-20130603-UNOFFICIAL-haida
TARGET_PRODUCT=cm_haida
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.2.0-41-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39E
OUT_DIR=/root/android/system/out
============================================
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
CM_VERSION=10.1-20130603-UNOFFICIAL-haida
TARGET_PRODUCT=cm_haida
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.2.0-41-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39E
OUT_DIR=/root/android/system/out
============================================
make: *** /.config: is a directory. Stop.
Guys,
For your info Windows Host NTFS file system is case insensitive and will break android compilation!!!
Workaround: Create a new virtual hdd with ext3 format and mount it to your ubuntu guest! Sad that ntfs cannot be used.
So, below is for your info if u came across this post. It is useful for sharing folders between Linux guest and Windows host.
IF you are using Virtualbox on a Win7/8 host system,
To use Shared Folder feature and add automount (note, VirtualBox needs to be run as Administrator so that os.symlink works!!!!
In Windows:
1. Go to your VirtualMachine Folder and look for MyVM.vbox,
2. Open with notepad++
3. Look for <ExtraData>
4. Add this inside the <ExtraData></ExtraData>
Code:
<ExtraDataItem name="VBoxInternal2/SharedFoldersEnableSymlinksCreate/android" value="1"/>
where "android" is my shared folder!!! =)
In terminal:
Code:
sudo nano /etc/fstab
Add this line:
Code:
/android /home/myName/android vboxsf rw,uid=1000,gid=1000 0 0
where android is the folder I give when sharing in SharedFolder of the VirtualBox and /home/myName/android is the folder I created in Ubuntu.
Ctrl+O and hit Enter to save. Ctrl+X to quit. and Reboot and you are done.
Also, if you encounter error or Virtualbox/ubuntu hung on repo sync, add -j2 or -j3 to prevent race condition!!!
Code:
repo sync -j3
Syncing work tree error!!!
If you encounter syn error
Code:
Fetching projects: 100% (204/224), done.
Syncing work tree: 90% (204/224) error: manifest required for this command -- please run init
1. Go to "android\system\.repo\"
2. Open "project.list" with notepad or notepad++
3. Go to the line of error. In this case, line 204 as above.
4. E.g. Ling 204 shows: external/wpa_supplicant_6, So, go to the folder "android\system\external\wpa_supplicant_6" and delete ".git" folder
5. Go back to Terminal and "repo sync"
=)
You need the lz4 compression tool from now on to be able to build the kernel. First post is updated with instructions on how to get it.
Code:
sudo apt-get install subversion
cd ~/Downloads
svn checkout -r 91 http://lz4.googlecode.com/svn/trunk/ lz4
cd lz4 && make && cp lz4demo ~/bin/lz4demo
Can any body please tell me,what's the exact size of full cm10.1. Source repo
I had set my laptop to download repo from last 32 hours
And till now more than 8gb data was downloaded ....
And how to know how much data left for download...?
Can anybody give me the exact size of the gits which are to be download so that I can compare that sizes with the files which I had downloaded....?
Sent from my Xperia Mini Pro
Hey @mikeioannina,
Do you have any guide on repo branch? In windows, git gui is easy to do. But I'm not familiar with ubuntu.
How do you branch out the project without error?
I tried in ~/android/system:
Code:
repo start kernel-patch .
it says . project not found. What the hell. Needa branch and test some codes!!! =)
Also, is there a private directory for us to put binary to system/apps or scripts which will not be affected by "repo sync" during compilation?
---------- Post added at 06:42 PM ---------- Previous post was at 06:40 PM ----------
hijagdeep said:
Can any body please tell me,what's the exact size of full cm10.1. Source repo
I had set my laptop to download repo from last 32 hours
And till now more than 8gb data was downloaded ....
And how to know how much data left for download...?
Can anybody give me the exact size of the gits which are to be download so that I can compare that sizes with the files which I had downloaded....?
Sent from my Xperia Mini Pro
Click to expand...
Click to collapse
It's around ~25GB. Maybe less due to compression. ^_^
shenlong85 said:
It's around ~25GB. Maybe less due to compression. ^_^
Click to expand...
Click to collapse
Someone told me that its around 8 gb
Sent from my Xperia Mini Pro
hijagdeep said:
Someone told me that its around 8 gb
Sent from my Xperia Mini Pro
Click to expand...
Click to collapse
If you initiated with the CM10.1 branch, it will be 14Gig, if you initiated with no branch, 25Gig
Langes said:
If you initiated with the CM10.1 branch, it will be 14Gig, if you initiated with no branch, 25Gig
Click to expand...
Click to collapse
I have initiated with this repo command
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
and also used this local manifests
mkdir -p ~/android/system/.repo/local_manifests
curl https://raw.github.com/LegacyXperia/local_manifests/master/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
and now 25 hours are passed and it downloaded 9.5gb data ..
hijagdeep said:
I have initiated with this repo command
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
and also used this local manifests
mkdir -p ~/android/system/.repo/local_manifests
curl https://raw.github.com/LegacyXperia/local_manifests/master/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
and now 25 hours are passed and it downloaded 9.5gb data ..
Click to expand...
Click to collapse
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1 is for the whole cm10.1 sources. Be patient. Are you using full blown linux host or just a virtual machine? IF you are using virtual machine, it may be slow and have race condition during repo which results in errors. Try using
Code:
repo sync -j3
For 3 simultaneous thread or j2 depending on the number of core in your processor and whether there is hyperthreading. It'll make it more stable.

[Q] Errors Building AOKP [CM Builds Fine, AOKP Does Not]

Hello All,
(Let me first say that I can successfully repo sync and build CM 10.1 on my Ubuntu 12.10 64bit PC without any issues)
I have forked AOKP's (and PipelinerArd) AOKP build - to build on my phone. I have successfully built it ONLY ONCE. I am currently running that build on my phone, and it's awesome and smooth. But now, I cannot build at all, as I always get this at the end of the build (looks like it's just echoing the build script), which just stops the build and drops me to the terminal prompt:
Code:
make[1]: Leaving directory `/home/martin/SchutzhundAOKP/kernel/htc/KangBanged-7x30'
make -C kernel/htc/KangBanged-7x30 O=/home/martin/SchutzhundAOKP/out/target/product/ace/obj/KERNEL_OBJ INSTALL_MOD_PATH=../../system ARCH=arm CROSS_COMPILE="/home/martin/SchutzhundAOKP/prebuilts/misc/linux-x86/ccache/ccache /home/martin/SchutzhundAOKP/prebuilt/linux-x86/toolchain/arm-eabi-4.7/bin/arm-eabi-" modules_install
make[1]: Entering directory `/home/martin/SchutzhundAOKP/kernel/htc/KangBanged-7x30'
INSTALL drivers/net/wireless/bcmdhd/bcmdhd.ko
INSTALL drivers/scsi/scsi_wait_scan.ko
DEPMOD 3.0.69KangBang-Kernel-gc5eb57d
make[1]: Leaving directory `/home/martin/SchutzhundAOKP/kernel/htc/KangBanged-7x30'
mdpath=`find /home/martin/SchutzhundAOKP/out/target/product/ace/system/lib/modules -type f -name modules.order`; if [ "$mdpath" != "" ];then mpath=`dirname $mdpath`; ko=`find $mpath/kernel -type f -name *.ko`; for i in $ko; do /home/martin/SchutzhundAOKP/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-strip --strip-unneeded $i; mv $i /home/martin/SchutzhundAOKP/out/target/product/ace/system/lib/modules/; done; fi
mdpath=`find /home/martin/SchutzhundAOKP/out/target/product/ace/system/lib/modules -type f -name modules.order`; if [ "$mdpath" != "" ];then mpath=`dirname $mdpath`; rm -rf $mpath; fi
[email protected]:~/SchutzhundAOKP$
I've tried multiple changes to my repo with suggestions from Pipelinerard and Google Groups - and even just repo sync'd the AOKP git to verify it's not anything I did on my repo, but same issue still.
Again - I can build CM 10.1 fine (I've tried multiple times to build CM to see if it was my build environment that was at fault, and CM builds every time, so that's not the issue.)
So I've tried to make this work by adding the kernel_manifest (and support file "manual_add_kernel_manifest.sh") per AOKP's git repo's readme, and that "repo sync" is fine. Everything syncs perfect, but again, I get that "error" at the end of every "mka bacon".
History:
Anyway - after my first and only time building AOKP successfully, I tried to pull some Cyanogenmod's MMS repos (just as tests to see if I could, as I want to learn all I can about building ROMs), as well as try to add in Proximity Recalibrater as a Prebuilt, into my build. And since then, I haven't been able to build at all anymore. I've even "rm -rf" my aokp folder, and started fresh, but I still get that same issue that happens, no build and that kernel stuff dumped to terminal before it ends.
Here are my terminal commands:
Code:
repo init -u git://github.com/espmartin/platform_manifest.git -b jb-mr1
repo sync -j8
. ./platform_manifest/manual_add_kernel_manifest.sh [COLOR="Red"]<-- added when I forked AOKP repo, using their readme as a guide.[/COLOR]
make clean
source build/envsetup.sh
lunch aokp_ace-userdebug
mka bacon -j4
So - since I still can build CM every time (and they boot up on my phone lol), it has to be something really stupid I'm doing with my aokp stuff... So, what's your thoughts?
First off, I want to thank PipelinerArd and Mustaavalkosta for their help in my building issues! They are TOP DEVs and Awesome People!!!
I've made major modifications to my AOKP repo (again - 1,000 thanks to PipelinerArd and Mustaavalkosta for their guidance!), and have even gone as far as reformat my computer's HDD, and install Ubuntu 12.10 64bit fresh. I can successfully repo sync and build CM, but I STILL cannot build AOKP......
Anyway, I'll post the most recent build errors soon, but I wanted to just take the time to thank, once again, xda and its awesome devs!
LATEST BUILD ERROR:
Code:
Export includes file: hardware/qcom/media/mm-core/Android.mk -- /home/martin/SchutzhundAOKP/out/target/product/ace/obj/SHARED_LIBRARIES/libOmxCore_intermediates/export_includes
make: *** No rule to make target `/home/martin/SchutzhundAOKP/out/target/product/ace/obj/SHARED_LIBRARIES/libgenlock_intermediates/export_includes', needed by `/home/martin/SchutzhundAOKP/out/target/product/ace/obj/SHARED_LIBRARIES/libOmxVdec_intermediates/import_includes'. Stop.
make: *** Waiting for unfinished jobs....
Trying to troubleshoot it now...
More of the same :-/
Code:
/home/espmartin/SchutzhundAOKP/out/host/linux-x86/bin/acp -fp /home/espmartin/SchutzhundAOKP/out/target/product/ace/obj/lib/libOmxCore.so /home/espmartin/SchutzhundAOKP/out/target/product/ace/system/lib/libOmxCore.so
make: *** No rule to make target `/home/espmartin/SchutzhundAOKP/out/target/product/ace/obj/SHARED_LIBRARIES/libgenlock_intermediates/export_includes', needed by `/home/espmartin/SchutzhundAOKP/out/target/product/ace/obj/SHARED_LIBRARIES/libOmxVdec_intermediates/import_includes'. Stop.
Any thoughts?
I'm runnig into the same problems, i have a d-tree built for cm 10.1 and i fatal error on everything.
What changes did you make to your device tree initially?

[HOWTO][STEPBYSTEP] Build Rom From Source

I put this tutorial together in an attempt to create the most complete and easy to follow guide for building a ROM from source. Including steps for adding apps to your build, changing toolchains and more... The entire guide uses a single Linux terminal window from start to finish in an attempt to keep everything as user friendly as possible. Please feel free to PM me suggestions on where changes need be made.
If you find this guide helpful please press the Thanks button on my posts and rate the thread a 5.​
Prerequisites​1. This guide is for 64-bit, 32-bit machines will not work for building newer android versions, Ubuntu 12+ based machine, I run Linux Mint 15. Follow links at end of OP for alternate directions
Windows Users: Setup Ubuntu in Virtualbox Instructions
2. You need to know the location for your device, vendor, and kernel repos. This can be found fairly easily in the forum for your phone. Also take note of your phones codename.
For example the Optimus G is the e970 and its device repo can be found here https://github.com/CyanogenMod/android_device_lge_e970
Note*All terminal commands will be in Code boxes*
Part 1 - Setting Up The Build Environment​
Install Java JDK
Code:
sudo add-apt-repository ppa:webupd8team/java
Code:
sudo apt-get update
Lollipop Roms:
Code:
sudo apt-get install oracle-java7-installer
Kit-Kat Roms:
Code:
sudo apt-get install oracle-java6-installer
Installing required packages
Ubuntu 14 based:
Code:
sudo apt-get install bison g++-multilib git gperf libxml2-utils
Ubuntu 12 based:
Code:
sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Set-up ccache This Is Optional
Code:
nano ~/.bashrc
Add these two lines
export USE_CCACHE=1
export CCACHE_DIR=<path-to-your-cache-directory>
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Install ADB & Fastboot This is optional, as you may already have them working. If not, they're a good thing to have.
Code:
sudo add-apt-repository ppa:nilarimogard/webupd8
Code:
sudo apt-get update
Code:
sudo apt-get install android-tools-adb android-tools-fastboot
Setup Repo
Code:
mkdir ~/bin
Code:
PATH=~/bin:$PATH
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Create working directory
Code:
mkdir [I][B]working-dir[/B][/I]
(Replace working-dir with whatever you'd like to call it, ie. aokp)
Code:
cd working-dir
Part 2 - Get Source​ROM Source
Choose which custom rom you are going to build and initialize the repo for it
Code:
repo init -u [I][B]chosen-manifest[/B][/I]
(Replace chosen-manifest appropriately from the list below)
AOKP: https://github.com/AOKP/platform_manifest.git -b Branch
Cyanogenmod: https://github.com/CyanogenMod/android.git -b Branch
CarbonDev: https://github.com/CarbonDev/android.git -b Branch
Liquid Smooth: https://github.com/LiquidSmooth/android.git -b Branch
Replace Branch with appropriate branch from github repo ie cm-10.2 or jb3
If unsure which branch click the link above to locate appropriate branch
Click to expand...
Click to collapse
Device Source
Go HERE and follow instructions on obtaining your device specific repos.
Sync the repo
Code:
repo sync
This will take a while as it downloads all the required source
Part 3 - Preparing Source​Before you're ready to build your source needs to be configured to include your device. This preparation varies slightly for different custom Roms.
Go HERE and follow instructions for your ROM choice
Part 4 - Edit Source​This Is Optional​This is where you can make edits to the source before building to suit your needs.
Go HERE and follow the instructions to tweak source
Part 5 - Building ROM​
Code:
. build/envsetup.sh
Code:
lunch
Locate your device on the list and enter appropriate number
Code:
make -j[B][I]# [/I][/B]otapackage
Replace # with the number of cores in your system (Is the number of jobs that will be done at once, more cores means more jobs)
Build Errors​
This can be hard, especially if you're new to programming languages and building. Meet Google your new best friend.
Here is a basic overview to get you started, and if no more at least googling in the right direction.
Finished​When it's done you're rom will be in working-dir/out/target/product/codename/
Enjoy.
I used these sites while making this guide
http://source.android.com/source/initializing.html
http://www.webupd8.org/2012/11/oracle-sun-java-6-installer-available.html
http://www.webupd8.org/2012/08/install-adb-and-fastboot-android-tools.html
Device Source​ As stated in the prerequisites you will need a device specific Device repo, Vendor repo, and Kernel repo. You can find links to them in the threads for your devices. Also take note of your device codename ie Nexus 4 is mako, Optimus G is gee.
There are two options for adding in device specific source, local manifest and git clone.
Local manifest syncs the device repos each time a repo sync is run. This is probably the better choice if you don't make edits and rely on the repo's maintainer for changes.
Git clone is a one time download of a specific repo to the directory indicated and is not affected by repo sync. This is probably the better choice if you make edits to the device source as they won't be over written or cause conflicts when syncing.
The local path for your phone's repos be device/manufacturer/codename, vendor/manufacturer/codename, kernel/manufacturer/codename regardless of method chosen.
Git Clone
Code:
git clone [B][COLOR="DarkOrange"]repo[/COLOR][/B] -b [B][COLOR="Magenta"]branch[/COLOR][/B] [B][COLOR=Lime]destination-path[/COLOR][/B]
here is and example for the vendor repo for the E973 from TeamPlaceHolder
git clone https://github.com/TeamPlaceholder/proprietary_vendor_lge_gee -b cm-10.2 vendor/lge/gee
Click to expand...
Click to collapse
Local Manifest
Code:
mkdir .repo/local_manifests
Code:
touch .repo/local_manifests/local_manifest.xml
Code:
nano .repo/local_manifests/local_manifest.xml
Add these lines replacing path, name and revision according to the repo's you are using.
This example is for E973 using TeamPlaceHolder repos, adding all device/vendor/kernel repos.
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="gh"
fetch="git://github.com/" />
<project path="kernel/lge/gee" name="TeamPlaceholder/android_kernel_lge_gee" remote="gh" revision="cm-10.2-merge" />
<project path="device/lge/geeb" name="TeamPlaceholder/android_device_lge_geeb" remote="gh" revision="cm-10.2" />
<project path="device/lge/gee-common" name="TeamPlaceholder/android_device_lge_gee-common" remote="gh" revision="cm-10.2" />
<project path="vendor/lge/gee" name="TeamPlaceholder/proprietary_vendor_lge_gee" remote="gh" revision="cm-10.2" />
</manifest>
Click to expand...
Click to collapse
Preparing Source​ROM specific setup instructions prior to building. All source should be downloaded already.
Manufacturer and codename MUST be updated to reflect your device.
Cyanogenmod
Add this line to vendor/cm/vendorsetup.sh
cm_device-userdebug
Click to expand...
Click to collapse
device - The codename for your device. ie. mako for the Nexus 4
Code:
touch [COLOR="Purple"]path-to-device-tree[/COLOR]/cm.mk
path-to-device-tree - Example device/lge/mako for the Nexus 4
Code:
nano [COLOR="Purple"]path-to-device-tree[/COLOR]/cm.mk
Add these lines **This example is for the Nexus 4 Mako, change mako references to reflect your device**
## Specify phone tech before including full_phone
$(call inherit-product, vendor/cm/config/gsm.mk)
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
# Enhanced NFC
$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)
# Inherit device configuration
$(call inherit-product, device/lge/mako/full_mako.mk)
## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := mako
PRODUCT_NAME := cm_mako
PRODUCT_BRAND := google
PRODUCT_MODEL := Nexus 4
PRODUCT_MANUFACTURER := LGE
# Enable Torch
PRODUCT_PACKAGES += Torch
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Now you're ready to build! Go back to the OP and complete the guide from where you left off.
AOSP
AOSP requires a prebuilt kernel for your device. HERE is a guide for building a kernel if you do not have a prebuilt kernel for your device
The rest coming soon...
Liquid Smooth
Coming soon...
AOKP
Code:
nano vendor/aokp/vendorsetup.sh
Add this line
add_lunch_combo aokp_geeb-userdebug
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Code:
touch vendor/aokp/products/geeb.mk
Code:
nano vendor/aokp/products/geeb.mk
Add these lines
If building for CDMA network change gsm.mk to cdma.mk
# Inherit AOSP device configuration for geeb
$(call inherit-product, device/lge/geeb/full_geeb.mk)
# Inherit AOKP common bits
$(call inherit-product, vendor/aokp/configs/common.mk)
# Inherit GSM common stuff
$(call inherit-product, vendor/aokp/configs/gsm.mk)
# Setup device specific product configuration
PRODUCT_NAME := aokp_geeb
PRODUCT_BRAND := google
PRODUCT_DEVICE := geeb
PRODUCT_MODEL := Optimus G
PRODUCT_MANUFACTURER := LGE
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Code:
nano vendor/aokp/products/AndroidProducts.mk
Add this line
$(LOCAL_DIR)/geeb.mk \
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Now you're ready to build! Go back to the OP and complete the guide from where you left off.
CarbonDev
Coming soon...
Now you're ready to build! Go back to the OP and complete the guide from where you left off.
Edit Source​
If you plan to edit the device/kernel repos for your phone you should either have used git clone to obtain your repos, or created forks of the repos to your own Github account to use in your local manifest. This way you can still do a repo sync to update the source without overwriting your changes or creating conflicts.
That being said these are the items disscused so far:
Adding Prebuilt APK's to Build
Adding Apps Via Source Code
Changing Toolchain
Cherry Picking Commits
Fixing Conflicts From Cherry Picks
Syncing Repo with Upstream Repo
Syncing Your Local Changes to Your Github Repo
Click to expand...
Click to collapse
Adding Prebuilt APK's to Build
Open the device folder for your phone. ie device/lge/geeb
Add these lines to android.mk
include $(CLEAR_VARS)
LOCAL_MODULE := Name
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := .apk
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := PRESIGNED
include $(BUILD_PREBUILT)
Click to expand...
Click to collapse
Name - Any name you want to asign to this apk to call for it in the build process
**NOTE** LOCAL_SRC_FILES is the location of the apk file. Above assumes it is in the root of your device folder**
Then edit your device.mk to call for your newly assigned apk
PRODUCT_PACKAGES += \
name
Click to expand...
Click to collapse
If the apk you want to add requires additional files to be added along with it, also add this
PRODUCT_COPY_FILES += \
Path-to-additional-file:Destination-path-in-finished-build
Click to expand...
Click to collapse
Path-to-additional-file - Where the file is located in your device tree that you need to add to your build
Destination-path-in-finished-build - Where in the final rom structure this file needs to be
Here is an example for adding required libs for Terminal Emulator to the geeb device tree:
PRODUCT_COPY_FILES += \
device/lge/geeb/libjackpal-androidterm3.so:system/lib/libjackpal-androidterm3.so \
device/lge/geeb/libjackpal-androidterm4.so:system/lib/libjackpal-androidterm4.so
Click to expand...
Click to collapse
Adding Apps Via Source Code
Adding apps to your build using source code is easier then adding prebuilt apks.
Example given is using Gallery2(I realize this is included with builds by default, just using it as an example)
Copy or clone your app's source code to working-dir/packages/apps in its own folder. ie. aokp/packages/Gallery2
Go into the source code folder for your app and open Android.mk
Look for this line LOCAL_PACKAGE_NAME , This will tell you what the call name for your app is
LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_PACKAGE_NAME := Gallery2
LOCAL_OVERRIDES_PACKAGES := Gallery Gallery3D GalleryNew3D
Click to expand...
Click to collapse
Then open device.mk from your phones device tree and add the call name for the app.
Add these lines:
PRODUCT_PACKAGES += \
Gallery2
Click to expand...
Click to collapse
Changing Toolchain
Download a new prebuilt toolchain that you wish to use
Example: Linaro 4.7 toolchain
Copy unziped prebuilt toolchain folder to working-folder/prebuilt/gcc/linux-x86/arm
Open build/envsetup.sh
Find this block of code:
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/android-toolchain-eabi/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/android-toolchain-eabi/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Click to expand...
Click to collapse
Replace bold text with your toolchain folder name
The following group of instructions are for making edits to your own repo. Before using any of the info below PLEASE create your own GitHub account and Fork the repo you'd like to edit. Then clone YOUR forked repo from YOUR github account and make edits to it.
If that didn't make sence then you may want to refrain from using this for the time being.
Cherry Picking Commits
Move to the directory for the git repo you wish to add the commit to. ie kernel/lge/geeb
Code:
cd path-to-git-repo
Add the remote repo that holds the commit - This only needs to be done the first time
Code:
git remote add [COLOR="Red"]name[/COLOR] [COLOR="SeaGreen"]url[/COLOR]
name - a name you choose to identify that remote repo
url - the location of the repo ie. https://github.com/TeamPlaceholder/android_kernel_lge_gee.git
Fetch the repo
Code:
git fetch [COLOR="Red"]name[/COLOR]
Cherry pick commit
Code:
git cherry-pick [COLOR="DarkOrange"]commit-id[/COLOR]
commit-id - An unique id given to every commit. It's a long alphanumeric id shown on the commit page of your repo. ie. cc3581ff8692b517ddda8baad73a5d110568f0da
Fixing Conflicts From Cherry Picks
Somtimes when you cherry pick a commit to your repo you'll have a conflict. This is just saying that it did not see what it expected to see when adding the commit to a certain file. To fix a conflict and commit the cherry pick do as follows:
Determine which file(s) contain conflicts.
Code:
git status
This will show you edits waiting to be commited from the cherry-pick. The files shown in green accepted the changes without conflict, the files listed in red contain conflicts that need to be addressed.
Open the file in red
Code:
gedit [COLOR="DarkOrange"]Path-To-File-In-Red[/COLOR]
Press crtl+f to bring up a find window and search for head. Conflicts will be shown in the file using the following structure
<<<<<Head
<Original Code>
=======
<Code from Cherry-pick>
>>>>>Name Of Cherry Pick Commit
Click to expand...
Click to collapse
Compare the original code to the code from the cherry pick and see if anything needs to be saved. If so, merge what needs to be saved into the code from the cherry pick. Then delete the original code and the <<<< ===== >>>>> lines(everything shown in red above). In the end you should be left only with the code from the cherry pick, plus anything you may have merged to it.
Search again for 'head' to see if there are any further conflicts within that file. If there is use the same method to resolve them, if there is not save and exit the file.
Add the newly edited file to the pending commit
Code:
git add [COLOR="DarkOrange"]Path-To-File-In-Red[/COLOR]
Check for any more files that need to be addressed
Code:
git status
If you still have files in red, repeat the process above for those files.
Once all files from git status are shown in green you are ready to commit the cherry pick.
Code:
git commit
Save and exit the commit log by pressing ctrl+x
Done. That cherry pick is now commited to your repo, you can move on to the next cherry pick you wish to add.
Sync Forked Repo with Upstream(Parent) Repo
If you would like to commit to your forked repo all the commits made upstream since you forked(or previously sync'd)
Add the upstream repo - This only needs to be done the first time
Code:
git remote add [COLOR="Red"]name[/COLOR] [COLOR="SeaGreen"]url[/COLOR]
name - a name you choose to identify that remote repo
url - the location of the repo ie. https://github.com/TeamPlaceholder/android_kernel_lge_gee.git
Fetch the upstream repo
Code:
git fetch [COLOR="Red"]name[/COLOR]
Merge upstream commits
Code:
git merge [COLOR="Red"]name[/COLOR]/[COLOR="DarkOrange"]branch[/COLOR]
branch - The branch from the upstream repo you are syncing up
Syncing Your Local Changes to Your Github Repo
Check to ensure you have everything in order to push your changes
Code:
git status
If there are no conflicts/changes that need to be commited you are ready to push. If everything is good it will simply state your are x number of commits ahead
Push your commits to your GitHub account
Code:
git push
Enter your github user name then password. All your local commits will then be applied to your github repo.
More to Come...
Build Errors
Build Errors​
This is way to broad a subject to cover in a post, but here are some steps to take to help get you building again.
When your build output stops without clearly saying it's finished or directing you to the created zip file, it Failed.
Sometimes it will stop with the error right at the end of the output, but not very often. Most of the time you must look up through the build output in order to locate the actual error. Sometimes they can be buried very far up, depending on the number of jobs being built.
Here is an example of what you are looking for:
hardware/qcom/display-caf/libgralloc/framebuffer.cpp:116:39: error: 'MSMFB_DISPLAY_COMMIT' was not declared in this scope
Click to expand...
Click to collapse
File having the error
Line in the file where the error occurs
Error that has occured
The quickest way to locate the errors in the build output is the search 'ctrl+shfit+F' for ': error:'
Once you have located your error(s), you can begin troubleshooting to get past them. Start by opening the File having the error and going to the Line in the file where the error occurs. Though without programing knowledge you may not make much sense of it, it's always good to start familiarizing yourself with the code. If you're not able to correct the issue this is where google will come in very handy.
Quite often if you search simply for the Error that has occured exactly as it appears, you'll find its an error that has been encountered many times over and solutions are availible within the first couple of results in a google search.
Should all else fail Post a question and see what suggestions come up.
Here are a few common build errors that I have come across and some solutions for them, again this is by no means a one stop for build erros. Google...Google...Then try to post your error and see who can help if your still stuck. The more you fix by yourself the more it feels like YOUR build.
make: *** No rule to make target `Example_File'. Stop.
Click to expand...
Click to collapse
It can't find the file in question. This can be a incorrect path in a makefile, a missing file or a typo.
last one
Finally usefull guide! not only theory. Thank you very much!
Nice job. Just one thing: when using our sources, the cm-10.2-merge is the best kernel branch. Msm-3.10 is our bleeding edge and hopefully will be fully working soon (just got it to build today, so we'll see). The update branch is broken though. Let me know if you want to contribute to our Git so I can add you to the team, or if you have any suggestions on how to make our rom and kernel better.
Sent from my LG-LS970 using xda app-developers app
xboxfanj said:
Nice job. Just one thing: when using our sources, the cm-10.2-merge is the best kernel branch. Msm-3.10 is our bleeding edge and hopefully will be fully working soon (just got it to build today, so we'll see). The update branch is broken though. Let me know if you want to contribute to our Git so I can add you to the team, or if you have any suggestions on how to make our rom and kernel better.
Sent from my LG-LS970 using xda app-developers app
Click to expand...
Click to collapse
Thanks for the info, updated quide to reflect.
i have a cherry mobile burst phone its running ics,i a generic phone a clone i dont know where it came from i mean the build i cant find a source or a build repo , i really want to build a rom for my phone cause it seems ics is not compatible for the phone..it only has 512 ram and 1ghz dualcore processor..it could run smoothly i think with gingerbread but i cant find a tutorial to donwgrade it to gingerbread it seems impossible because of lack of support for the device and it came up with ics..i just dont know what to do any more my computer is linux mint 13 2gb ram 1ghz amd anthlon 2 ,70gb hd..i cant build a rom to this computer..
Changing Toolchain
Download a new prebuilt toolchain that you wish to use
Example: Linaro 4.7 toolchain
Copy unziped prebuilt toolchain folder to working-folder/prebuilt/gcc/linux-x86/arm
Open build/envsetup.sh
Find this block of code:
Quote:
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/android-toolchain-eabi/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/android-toolchain-eabi/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Replace bold text with your toolchain folder name
Click to expand...
Click to collapse
Click to expand...
Click to collapse
I did what you said and i keep getting this error
"/arm-eabi-gcc: No such file or directory
make[4]: *** [scripts/mod/empty.o] Error 1
make[3]: *** [scripts/mod] Error 2
make[2]: *** [scripts] Error 2
make[2]: *** Waiting for unfinished jobs...."
Here's what my envsetup.sh looks like
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/arm-eabi-linaro-4.6.2/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/arm-eabi-linaro-4.6.2/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Click to expand...
Click to collapse
my linaro folder is called "arm-eabi-linaro-4.6.2" and it is placed under "/prebuilts/gcc/linux-x86/arm/arm-eabi-linaro-4.6.2"
what am i doing wrong?
thanks!
ryukiri said:
I did what you said and i keep getting this error
"/arm-eabi-gcc: No such file or directory
make[4]: *** [scripts/mod/empty.o] Error 1
make[3]: *** [scripts/mod] Error 2
make[2]: *** [scripts] Error 2
make[2]: *** Waiting for unfinished jobs...."
Click to expand...
Click to collapse
Where did you get your linaro toolchain from?
go into your linaro directory/bin do you see arm-eabi**** files?
Sounds like it's only the arm-linux-androideabi*** files in there.
Get the prebuilt toolchains right from Linaro It will take a little looking around to find the 4.6. The prebuilt toolchains for each release are in Components>Android>Toolchain Most of them are 4.7 and 4.8 so like I said, it may take some looking around.
I believe(though not 100%) the arm-eabi are used for the kernel, the arm-linux-androideabi for the rom.
The top line you change in envsetup.sh is for the rom toolchain, second place you change is for the kernel toolchain. You can use two different toolchains here. I use sabermod 4.9 for my rom and linaro 4.7 for the kernel
Haze028 said:
Where did you get your linaro toolchain from?
go into your linaro directory/bin do you see arm-eabi**** files?
Sounds like it's only the arm-linux-androideabi*** files in there.
Get the prebuilt toolchains right from Linaro It will take a little looking around to find the 4.6. The prebuilt toolchains for each release are in Components>Android>Toolchain Most of them are 4.7 and 4.8 so like I said, it may take some looking around.
I believe(though not 100%) the arm-eabi are used for the kernel, the arm-linux-androideabi for the rom.
The top line you change in envsetup.sh is for the rom toolchain, second place you change is for the kernel toolchain. You can use two different toolchains here. I use sabermod 4.9 for my rom and linaro 4.7 for the kernel
Click to expand...
Click to collapse
hmm, i forgot where i got it from, i might have gotten it by following this http://forum.xda-developers.com/showthread.php?t=1988315
Can I use 4.7 or 4.8 though?
Ok so inside my linaro directory/bin, i see many arm-eabi**** files (attached screenshot)
Do you think you can link to me the exact toolchains you used so I can start with something that works and then start trying different ones later?
ryukiri said:
Can I use 4.7 or 4.8 though?
Do you think you can link to me the exact toolchains you used so I can start with something that works and then start trying different ones later?
Click to expand...
Click to collapse
I would stick with 4.7 toolchain. 4.6 is quite old, and 4.8 doesn't seem to play very nice. (i'm probably too noob to get it working)
This is the linaro 4.7 toolchain I use.
Hopefully that'll help ya get going.
Haze028 said:
I would stick with 4.7 toolchain. 4.6 is quite old, and 4.8 doesn't seem to play very nice. (i'm probably too noob to get it working)
This is the linaro 4.7 toolchain I use.
Hopefully that'll help ya get going.
Click to expand...
Click to collapse
alright thanks. Ill test it out and report back later
I got the same error.. D:
"/arm-eabi-gcc: No such file or directory
make[4]: *** [scripts/mod/empty.o] Error 1
make[3]: *** [scripts/mod] Error 2
make[2]: *** [scripts] Error 2
make[2]: *** Waiting for unfinished jobs...."
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/android-toolchain-eabi/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/android-toolchain-eabi/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Click to expand...
Click to collapse
EDIT: after some research, i found out that all the files in my bin folder are 32 bit executable files. So i believe i need a 64 bit toolchain. Do you know where I could find one?
EDIT2: I found that for linux they need to install "ia32-libs" to run 32bit executables source. But the thing is, I'm using a mac...
EDIT3: nevermind, i got it to work. thanks anyway
aokp build error
Can you point me in the right direction to fix this error http://pastebin.com/GZmteWUu.
Recon Freak said:
Can you point me in the right direction to fix this error http://pastebin.com/GZmteWUu.
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=47947423&postcount=175
Try this....
CarbonDev
Coming soon...
.
Click to expand...
Click to collapse
Thanks for the guide so far. Is there an eta for Carbon roms as I'm struggling to get my to build. Or AOSP?
Haze, to change tool chains, you can also set TARGET_TOOLS_PREFIX ?= prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8-linaro/bin/arm-linux-androideabi- in boardconfig (sub in the right path obviously).
Sent from my Optimus G using xda app-developers app

Compiling PA for jflteatt

if anyone knows what's going on with this ...
PLEASE give me a point in the right direction here..
i've tried replacing all device specific repos with CyanogenMod ones and Ayysir's ones, and i'm still running into build errors..
this build was started after doing a make clobber, sudo rm -rf out, and a repo sync.. i have not touched the manifest.xml or roomservice.xml (except to change the ParanoidAndroid/android_devices_samsung_jflteatt to Ayysir/android_devices_samsung_jflteatt) so it actually gets the device files.
Here's a pastebin of my entire terminal output after ./rom-build.sh jflteatt
http://pastebin.com/QKQtW06b

How to make APK packages?

I'm trying to find a solution for some WiFi roaming issues on my Neffos C5/C5 MAX smartfones running Android 5.1 Lollipop, because the roaming is disabled in the wpa_supplicant config. Basically my laptop (running Debian Sid) is able to switch between different access points in the same or different networks without any problems. According to this thread[1] and my linux setup, I have to add one line to the Android WiFi config file, which is /data/misc/wifi/wpa_supplicant.conf . When the roaming settings in wpad_supplicant configuration are disabled, the following line does nothing no matter whether you add it to the global section or to the network one:
Code:
bgscan="simple:20:-30:20"
It's not removed when you edit the file when WiFi is off. When you turn it on, the file is rewritten, but the parameter stays untouched. So the only option to make it work on my smartphones is to compile wpa_supplicant with roaming enabled. How to do it?
Basically I downloaded the Android 5.1 repo in the following way:
Code:
# curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo
# chmod a+x /usr/local/bin/repo
# chown root:staff /usr/local/bin/repo
$ mkdir /mnt/Lollipop-5.1/
$ cd /mnt/Lollipop-5.1/
$ repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r38 --depth=1
$ repo sync --current-branch --jobs=4
The wpa_supplicant tool is in the external/wpa_supplicant_8/wpa_supplicant/ directory. In this dir, there's some config files, and here is my first question. The two files defconfig and android.config have almost the same configuration. So why are they two, and which one is the one I should edit? I assume that the changes should go to android.config because it has an obvious name. But I just want to make sure.
I've edited the android.config file and changed the following lines in it:
Code:
#CONFIG_NO_ROAMING=y
CONFIG_AUTOSCAN_EXPONENTIAL=y
CONFIG_AUTOSCAN_PERIODIC=y
Instead of adding new stuff to the file, I created another file called android_config_bgscan.inc . I just read something about this way of doing things, so I followed this pattern. I placed the line below in that file:
Code:
CONFIG_BGSCAN_SIMPLE=y
And this is actually what I need to make the bgscan="simple:20:-30:20" line work. And now is the second question: how to build the wpa_supplicant tool? I was reading something about typing the following commands:
Code:
$ make clobber
$ . build/envsetup.sh
$ lunch aosp_arm64-eng
I don't really know what to use in the lunch command. My smartphones have SoC MT6735 and MT6753 (64bit ARM), and when I typed just the lunch command there was only one option that had ARM and 64 in its name, so that's why I used it. I don't know whether it's right because I don't know much about the Android building process yet. Anyways in the terminal I could see the following output:
Code:
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=aosp_arm64
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a15
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.8.0-1-amd64-x86_64-with-debian-stretch-sid
HOST_BUILD_TYPE=release
BUILD_ID=LMY49M
OUT_DIR=out
===========================================
So the third question is: Is something wrong with this configuration in the case of the two SoCs?
The next thing I did was running the make command:
Code:
$ make -j2
I have a weak PC, only 2 GiB of RAM, but I've managed to build the source. Here's the fouth question: do I have to build the whole source, or can I build only a part of it when I want to build a specific project like wpa_supplicant? I know about mm and mmm commands, but I wasn't able to build the wpa_suplicant tool in this way without typing make first. There was some problems with dependencies, and that's why I've built the whole source. And that helped, and wpa_supplicant was successfully compiled.
A few other questions concerning mm/mmm/make.
Is there any difference between mm and mmm commands? I mean something else than just switching the dir.
Is there any difference between mm/mmm and simply make dir/ command?
Should I prefer one over the other, I mean mm/mmm/make?
Another question: how to clean the source after building something. For now I've build the whole source and also I compiled the wpa_supplicant. How to clean only the files that wpa_supplicant added? I was using the following command while building it:
Code:
$ mmmm external/wpa_supplicant_8/wpa_supplicant/
Another question: are the android-sdk tools required in the building process? Can I build the source without setting them first? I always set the following variables:
Code:
$ export ANDROID_HOME=/mnt/android-sdk-linux
$ export PATH=$ANDROID_HOME/tools:$PATH
$ export PATH=$ANDROID_HOME/platform-tools:$PATH
Is this necessary?
And the final question is how to build a package from the compiled wpa_supplicant tool so I could install it on my smartfones in the same way I was installing, for instance, F-Droid app?
If anyone knows some answers to the questions, please post them here. If you don't know, but you can point me in the right direction where I can find some info on the subject (and the asked questions), please do it. I would really appreciate that because I'm new to this things, and I want to know more and maybe in near future I start building custom packages/roms.
[1] hxxp://forum.xda-developers.com/showpost.php?p=46134045

Categories

Resources