[Updated with download]Ubuntu Touch Preview for the SGH-T889 Note II - T-Mobile Samsung Galaxy Note II

Ubuntu Touch Preview for the SGH-T889 Note II​
I am posting this so others that are interested in building Ubuntu Touch for the SGH-T889 can have a better starting point.. As of right now this will not build a booting ROM as it is still a work in progress, but it should build. I have some edititng I need to do to the guide but knot able to do just yet, I will get this done as soon as possible.
Edit: For download link, instructions on how to flash and what is working go to the second post.
Thanks!
Thanks to CyanogenMod, Canonical Ltd, drapalyuk, chasmodo, Gerrett,codeworkx, GhostOfTheNet, mgale88, and a special thanks to my friend DragunKorr. Sorry if I missed anyone, if I find I have I will update the thanks section.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Official Porting guide
How to build​
To start with we you should be running Ubuntu 10.04 or higher. You might be able to use another Linux distro, but I have not seen anyone posting they were running a different Linux distro and building for the Preview. You also need to have a android build environment already set up. Now start by getting the additional packages you will need. Open a terminal by holding ctrl+Alt+t and paste the below command into the terminal.
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 schedtool
Next you need to get the phablet-tools package.
Code:
$ sudo add-apt-repository ppa:phablet-team/tools
$ sudo apt-get update
$ sudo apt-get install phablet-tools android-tools-adb android-tools-fastboot
Next you need to create a folder to sync your Android source tree too. You can name this folder anything you like. But for the purpose of this guide it will be named UPP (UbuntuPhonePort).
Code:
$ mkdir UPP
Now you need to set up the .repo in your UPP folder. To do this you need to cd to your UPP folder and run the following command in terminal.
Code:
$ phablet-dev-bootstrap UPP
Enter your name and email when pronpted for them then answer yes and press enter. This will set up your repo and start your sync. Be prepared this will take a good while. If you stop for some reason you can resume your sync by using the following command. (You probably will have to)
Code:
$ phablet-dev-bootstrap -c UPP
When your sync is done you need to set up your device tree for this you can either use CyanogenMod repositories on github or you can use my github repositories. I forked all of my repositories straight from CM and have made edits to allow it to compile.
You will have to be in your UPP folder in your file explorer and press ctrl+h to see the .repo folder. You will need to add the following lines to the manifest.xml in the .repo folder by opening the manifest.xml with a text editor. For this guide I am using my repositories but you can easily see how to use any other repositories here. Doing this will let the repositories you use sync if you do a resync of your work tree.
Code:
<project path="device/samsung/t0lte" name="T-Macgnolia/android_device_samsung_t0lte" remote="github" revision="cm-10.1" />
<project path="kernel/samsung/smdk4412" name="T-Macgnolia/android_kernel_samsung_smdk4412" remote="github" revision="cm-10.1" />
<project path="hardware/samsung" name="T-Macgnolia/android_hardware_samsung" remote="github" revision="cm-10.1" />
<project path="device/samsung/smdk4412-common" name="T-Macgnolia/android_device_samsung_smdk4412-common" remote="github" revision="cm-10.1" />
Alternatively you can clone your device repositories. For each folder you need to cd to where the folder needs to go. For example if you was cloning the device folder you would type in the following to get to the correct directory.
Code:
$ cd UPP/device/samsung
Here is the clone commands for all for of my repositories.
Code:
git clone git://github.com/T-Macgnolia/android_device_samsung_t0lte.git -b cm-10.1 t0lte
git clone git://github.com/T-Macgnolia/android_device_samsung_smdk4412-common.git -b cm-10.1 smdk4412-common
git clone git://github.com/T-Macgnolia/android_kernel_samsung_smdk4412.git -b cm-10.1 smdk4412
git clone git://github.com/T-Macgnolia/android_hardware_samsung.git -b cm-10.1 samsung
Last step before building is to flash a CM nightly to your device so you can pull your proprietary files from your device. You can pull them from a stock ROM but stock ROMs do not have all the files where as CM or others source built ROMs will. Because of a problem with the new mali driver r3p1I suggest you use this CM nightly build as it is the only official CM build before the 22nd of Febuary. Now you need to cd to your device folder like so.
Code:
$ cd UPP/device/samsung/t0lte
Now connect your device via USB to your computer, make sure you have ADB Debugging on in settings and that you allow the device to communicate with your computer. Now run the following command.
Code:
$ ./extract-files.sh
Now if you used my repositories you can jump ahead to the bottom of this post for the build commands. If you did not you may want to keep reading..
These changes are per the official guide.
Go to device/samsung/t0lte/rootdir/fstab.smdk4x12 and remove the "nosuid" from the following line.
Code:
/dev/block/mmcblk0p16 /data ext4 noatime,nosuid,nodev,discard,noauto_da_alloc,journal_async_commit,errors=panic
Go to kernel/samsung/smdk4412/arch/arm/configs/ cyanogenmod_t0lte_defconfig and add the following to the file in the "# Userspace binary formats" section of the file at line 750.
Code:
CONFIG_SYSVIPC=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_DEVTMPFS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_FSNOTIFY=y
CONFIG_SWAP=y
# CONFIG_ANDROID_PARANOID_NETWORK is not set
Go to device/samsung/t0lte/init.smdk4x12.rc and add the following beneath line 185.
Code:
chmod 0666 /sys/class/backlight/panel/brightness
Changes I made to get to build.
In device/samsung/t0lte/t0lte.mk I commited line 50 like below.
Code:
#PRODUCT_PACKAGES += \
GalaxyNote2Settings
Also in device/samsung/t0lte/t0lte.mk removed below line from PRODUCT_COPY_FILES += \
Code:
packages/apps/Nfc/migrate_nfc.txt:system/etc/updatecmds/migrate_nfc.txt \
Remove libandroid_runtime \ from the line 33 of hardware/samsung/exynos/multimedia/openmax/osal/Android.mk.
Last remove lines 2671 and 2674 in device/samsung/t0lte/audio/audio_hw.c. below is what it should look like before and after.
Before:
Code:
// Wideband AMR
ret = str_parms_get_str(parms, "wb_amr", value, sizeof(value));
if (ret >= 0) {
if (csd_wide_voice == NULL) {
ALOGE("dlsym: Error:%s Loading csd_wide_voice", dlerror());
} else {
if (strcmp(value, "on") == 0) {
ALOGE("%s: enabling csd_wide_voice", __func__);
csd_wide_voice(VX_WB_SAMPLING_RATE);
} else {
ALOGE("%s: disabling csd_wide_voice", __func__);
csd_wide_voice(VX_NB_SAMPLING_RATE);
After:
Code:
// Wideband AMR
ret = str_parms_get_str(parms, "wb_amr", value, sizeof(value));
if (ret >= 0) {
if (csd_wide_voice == NULL) {
ALOGE("dlsym: Error:%s Loading csd_wide_voice", dlerror());
} else {
if (strcmp(value, "on") == 0) {
ALOGE("%s: enabling csd_wide_voice", __func__);
} else {
ALOGE("%s: disabling csd_wide_voice", __func__);
Missing Lib Files
This is a list of the missing lib files, where to get them, and where to pit them.
Code:
After pulling proprietary files from my device I went to system/lib of the CM ROM and copied and pasted the following lib files to vendor/samsung/t0lte/proprietary/system/lib of my work tree.
libandroid_runtime.so
libdvm.so
libharfbuzz.so
libhwui.so
libnativehelper.so
libmali.so
libUMP.so
libfimc.so
In system/lib/hw in the CM ROM copied and pasted the following lib files to vendor/samsung/t0lte/proprietary/system/lib/hw of my work tree.
camera.exynos4.so
gps.goldfish.so
In /system/lib/ of a stock ROM copied and pasted the following lib file to vendor/samsung/t0lte/proprietary/system/lib of my work tree.
libfactoryutil.so
In systemlib/egl of the CM ROM copied of and pasted the following lib files to vendor/samsung/t0lte/proprietary/system/lib/egl of my work tree.
libEGL_mali.so
libGLESv1_CM_mali.so
libGLESv2_mali.so
In system/vendor/lib of the CM ROM copied and pasted the following lib files to vendor/samsung/t0lte/proprietary/system/vendor/lib of my work tree.
libpn544_fw.so
mfc_fw.bin
In system/cameradata of the CM ROM copied and pasted the following files to vendor/samsung/t0lte/proprietary/system/cameradata of my work tree.
datapattern_420sp.yuv
datapattern_front_420sp.yuv
In system/bin of the CM ROM copied and pasted the following files to vendor/samsung/t0lte/proprietary/system/bin of myr work tree.
bcm4334.hcd
bcm4334_murata.hcd
bcm4334_semcosh.hcd
How to make to make the compiler use the added lib files. The lines highlighted are the ones I added.
Code:
# Copyright (C) 2013 The CyanogenMod Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
LOCAL_PATH := vendor/samsung/t0lte
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/proprietary/system/bin/at_distributor:system/bin/at_distributor \
$(LOCAL_PATH)/proprietary/system/bin/efsks:system/bin/efsks \
$(LOCAL_PATH)/proprietary/system/bin/gsiff_daemon:system/bin/gsiff_daemon \
$(LOCAL_PATH)/proprietary/system/bin/ks:system/bin/ks \
$(LOCAL_PATH)/proprietary/system/bin/netmgrd:system/bin/netmgrd \
$(LOCAL_PATH)/proprietary/system/bin/qcks:system/bin/qcks \
$(LOCAL_PATH)/proprietary/system/bin/qmiproxy:system/bin/qmiproxy \
$(LOCAL_PATH)/proprietary/system/bin/qmuxd:system/bin/qmuxd \
$(LOCAL_PATH)/proprietary/system/bin/rild:system/bin/rild \
$(LOCAL_PATH)/proprietary/system/bin/sec-ril:system/bin/sec-ril \
$(LOCAL_PATH)/proprietary/system/bin/sensorhubservice:system/bin/sensorhubservice \
$(LOCAL_PATH)/proprietary/system/bin/smdexe:system/bin/smdexe \
$(LOCAL_PATH)/proprietary/system/etc/Diag.cfg:system/etc/Diag.cfg \
$(LOCAL_PATH)/proprietary/system/etc/Diag_zero.cfg:system/etc/Diag_zero.cfg \
$(LOCAL_PATH)/proprietary/system/lib/libakm.so:system/lib/libakm.so \
$(LOCAL_PATH)/proprietary/system/lib/libatparser.so:system/lib/libatparser.so \
$(LOCAL_PATH)/proprietary/system/lib/libcsd-client.so:system/lib/libcsd-client.so \
$(LOCAL_PATH)/proprietary/system/lib/libdiag.so:system/lib/libdiag.so \
$(LOCAL_PATH)/proprietary/system/lib/libdsi_netctrl.so:system/lib/libdsi_netctrl.so \
$(LOCAL_PATH)/proprietary/system/lib/libdsutils.so:system/lib/libdsutils.so \
$(LOCAL_PATH)/proprietary/system/lib/libfactoryutil.so:system/lib/libfactoryutil.so \
$(LOCAL_PATH)/proprietary/system/lib/libgps.so:system/lib/libgps.so \
$(LOCAL_PATH)/proprietary/system/lib/libgps.utils.so:system/lib/libgps.utils.so \
$(LOCAL_PATH)/proprietary/system/lib/libidl.so:system/lib/libidl.so \
$(LOCAL_PATH)/proprietary/system/lib/libloc_adapter.so:system/lib/libloc_adapter.so \
$(LOCAL_PATH)/proprietary/system/lib/libloc_api_v02.so:system/lib/libloc_api_v02.so \
$(LOCAL_PATH)/proprietary/system/lib/libloc_eng.so:system/lib/libloc_eng.so \
$(LOCAL_PATH)/proprietary/system/lib/libnetmgr.so:system/lib/libnetmgr.so \
$(LOCAL_PATH)/proprietary/system/lib/libomission_avoidance.so:system/lib/libomission_avoidance.so \
$(LOCAL_PATH)/proprietary/system/lib/libqcci_legacy.so:system/lib/libqcci_legacy.so \
$(LOCAL_PATH)/proprietary/system/lib/libqdi.so:system/lib/libqdi.so \
$(LOCAL_PATH)/proprietary/system/lib/libqdp.so:system/lib/libqdp.so \
$(LOCAL_PATH)/proprietary/system/lib/libqmi.so:system/lib/libqmi.so \
$(LOCAL_PATH)/proprietary/system/lib/libqmi_cci.so:system/lib/libqmi_cci.so \
$(LOCAL_PATH)/proprietary/system/lib/libqmi_client_qmux.so:system/lib/libqmi_client_qmux.so \
$(LOCAL_PATH)/proprietary/system/lib/libqmi_common_so.so:system/lib/libqmi_common_so.so \
$(LOCAL_PATH)/proprietary/system/lib/libqmi_csi.so:system/lib/libqmi_csi.so \
$(LOCAL_PATH)/proprietary/system/lib/libqmi_encdec.so:system/lib/libqmi_encdec.so \
$(LOCAL_PATH)/proprietary/system/lib/libqmiservices.so:system/lib/libqmiservices.so \
$(LOCAL_PATH)/proprietary/system/lib/libril.so:system/lib/libril.so \
$(LOCAL_PATH)/proprietary/system/lib/libril-qc-qmi-1.so:system/lib/libril-qc-qmi-1.so \
$(LOCAL_PATH)/proprietary/system/lib/libril-qcril-hook-oem.so:system/lib/libril-qcril-hook-oem.so \
$(LOCAL_PATH)/proprietary/system/lib/libsecnativefeature.so:system/lib/libsecnativefeature.so \
$(LOCAL_PATH)/proprietary/system/lib/libsecril-client.so:system/lib/libsecril-client.so \
$(LOCAL_PATH)/proprietary/system/lib/libsensorhubservice.so:system/lib/libsensorhubservice.so \
$(LOCAL_PATH)/proprietary/system/lib/hw/vendor-camera.exynos4.so:system/lib/hw/vendor-camera.exynos4.so \
$(LOCAL_PATH)/proprietary/system/lib/hw/gps.default.so:system/lib/hw/gps.default.so \
$(LOCAL_PATH)/proprietary/system/lib/hw/sensorhubs.smdk4x12.so:system/lib/hw/sensorhubs.smdk4x12.so \
$(LOCAL_PATH)/proprietary/system/lib/hw/sensors.smdk4x12.so:system/lib/hw/sensors.smdk4x12.so \
$(LOCAL_PATH)/proprietary/system/usr/idc/sec_e-pen.idc:system/usr/idc/sec_e-pen.idc \
$(LOCAL_PATH)/proprietary/system/usr/keylayout/sec_e-pen.kl:system/usr/keylayout/sec_e-pen.kl \
$(LOCAL_PATH)/proprietary/system/usr/keylayout/sec_touchkey.kl:system/usr/keylayout/sec_touchkey.kl \
$(LOCAL_PATH)/proprietary/system/vendor/firmware/SlimISP_GK.bin:system/vendor/firmware/SlimISP_GK.bin \
$(LOCAL_PATH)/proprietary/system/vendor/firmware/SlimISP_ZK.bin:system/vendor/firmware/SlimISP_ZK.bin[COLOR="Red"] \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/proprietary/system/lib/libandroid_runtime.so:system/lib/libandroid_runtime.so \
$(LOCAL_PATH)/proprietary/system/lib/libdvm.so:system/lib/libdvm.so \
$(LOCAL_PATH)/proprietary/system/lib/libharfbuzz.so:system/lib/libharfbuzz.so \
$(LOCAL_PATH)/proprietary/system/lib/libhwui.so:system/lib/libhwui.so \
$(LOCAL_PATH)/proprietary/system/lib/libnativehelper.so:system/lib/libnativehelper.so \
$(LOCAL_PATH)/proprietary/system/lib/libMali.so:system/lib/libMali.so \
$(LOCAL_PATH)/proprietary/system/lib/libUMP.so:system/lib/libUMP.so \
$(LOCAL_PATH)/proprietary/system/lib/lib/libfimc.so:system/lib/libfimc.so \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/proprietary/system/lib/hw/camera.exynos4.so:system/lib/hw/camera.exynos4.so \
$(LOCAL_PATH)/proprietary/system/lib/hw/gps.goldfish.so:system/lib/hw/gps.goldfish.so \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/proprietary/system/lib/egl/libEGL_mali.so:system/lib/egl/libEGL_mali.so \
$(LOCAL_PATH)/proprietary/system/lib/egl/libGLESv1_CM_mali.so:system/lib/egl/libGLESv1_CM_mali.so \
$(LOCAL_PATH)/proprietary/system/lib/egl/libGLESv2_mali.so:system/lib/egl/libGLESv_mali.so \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/proprietary/system/vendor/firmware/libpn544_fw.so:system/vendor/firmware/libpn544_fw.so \
$(LOCAL_PATH)/proprietary/system/vendor/firmware/mfc_fw.bin:system/vendor/firmware/mfc_fw.bin \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/proprietary/system/cameradata/datapattern_420sp.yuv:system/cameradata/datapattern_420sp.yuv \
$(LOCAL_PATH)/proprietary/system/cameradata/datapattern_front_420sp.yuv:system/cameradata/datapattern_front_420sp.yuv \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/proprietary/system/bin/bcm4334.hcd:system/bin/bcm4334.hcd \
$(LOCAL_PATH)/proprietary/system/bin/bcm4334_murata.hcd:system/bin/bcm4334_murata.hcd \
$(LOCAL_PATH)/proprietary/system/bin/bcm4334_semcosh.hcd:system/bin/bcm4334_semcosh.hcd
[/COLOR]
BUILD COMMANDS
Code:
$ . build/envsetup.sh
$ brunch full_t0lte-userdebug
It will make a cm.zip and a full_t0lte-ota-eng. username.zip in UPP/out/target/product/t0lt. You can use either one, I was told that the full_t0lte zip is not optimized but to be honest I do not know why it makes two zip files.

Thanks to mgale88 we now have a build that will boot, it is still very rough and very much pre alpha but it does boot.Here is a link to his github.​
What is working:
It boots that is pretty much it. (still has graphics issues)
What does not work:
No cellular service
No WiFi
No Bluetooth
The list goes on and on
Downloads​
cm-10.1-20130317-UTOUCH2-t0lte.zip
quantal-preinstalled-phablet-armhf.zip​
How to install​
To install you need to download the cm-10.1-20130317-UTOUCH2-t0lte.zip latest quantal-preinstalled-phablet-armhf.zip. Then preforme a full wipe of cache, delvik cache, factory reset, and system. Then flash the two files in the order given below.
1.cm-10.1-20130317-UTOUCH2-t0lte.zip
2.quantal-preinstalled-phablet-armhf.zip
3.Reboot

Reserved 2

Looks absolutely sickkk!

Re: Ubuntu Touch Preview for the SGH-T889 Note II
I will test it when it is bootable
Sent from my SGH-T889 using xda premium

Re: Ubuntu Touch Preview for the SGH-T889 Note II
Does anyone know how often the ubuntu touch source is going to be updated and when it is will that mean having to rebuild everything from scratch to port it over?
Sent from my T889V on WIND Mobile using xda app-developers app

tppickles said:
Does anyone know how often the ubuntu touch source is going to be updated and when it is will that mean having to rebuild everything from scratch to port it over?
Sent from my T889V on WIND Mobile using xda app-developers app
Click to expand...
Click to collapse
Going by what I know unless Canonical makes some changes to the .mk and config files for the parts of Android that it uses you should not have to make any changes to the device tree when they start rolling out updates because you get the actual Ubuntu part comes from them, you do not compile. It. See the Ubu tu Touch runs in a container in Android right now. The Android parts you have to compile is just there to make it easier to port to Android devices right now at least that is my opinion. But Canonical has put hints in the Android source and the official porting giude they have that they do have plans on changing things up some in the future.

id probably try this out but it looks too much like miui to me.

fix-this! said:
id probably try this out but it looks too much like miui to me.
Click to expand...
Click to collapse
Updated the op with more details on what changes to make per the official guide and per what I did to get it to build.

Re: Ubuntu Touch Preview for the SGH-T889 Note II
Following with interest...
Sent from my GT-N7105 using xda app-developers app

Re: Ubuntu Touch Preview for the SGH-T889 Note II
Definitely following this but not 100% sure about switching to it yet looks like alot to switch over to and switching back?
Sent from my SGH-T889 using xda premium

Building a brand new build from a new sync. Took 9 hours for a fresh sync, a little over 8 hours of getting my working folder set up to build. XDA Senior Member Gerrett made a great post today about the work that is going on for the n7000 Note II. I went through his updated get hub and made all the changes I needed to match his git hub. The two devices are very close to the same so this should work. It is still building right now. I hope to post back later with a booting build. Wish me luck.

Re: Ubuntu Touch Preview for the SGH-T889 Note II
T-Macgnolia said:
Building a brand new build from a new sync. Took 9 hours for a fresh sync, a little over 8 hours of getting my working folder set up to build. XDA Senior Member Gerrett made a great post today about the work that is going on for the n7000 Note II. I went through his updated get hub and made all the changes I needed to match his git hub. The two devices are very close to the same so this should work. It is still building right now. I hope to post back later with a booting build. Wish me luck.
Click to expand...
Click to collapse
I hope it works
Sent from my SGH-T889 using xda premium

Bummer it stopped compiling right after I had posted my last post but I got that error fixred and started building again. It compiled for a good while very close to the end and stopped again. Only this time I do not know why because it is calling for a file in prebuilt/gcc in my build folder but I do not have a prebuilt/gcc, not even in my old work folder that will still compile. I will have to come back tomorrow and see if I can get it figured out. Thought for sure I had it this go around.
I am going to bed tonight no all nighter for me tonight. I will work on it some more tomorroow.

maaany questions
T-Macgnolia said:
Bummer it stopped compiling right after I had posted my last post but I got that error fixred and started building again. It compiled for a good while very close to the end and stopped again. Only this time I do not know why because it is calling for a file in prebuilt/gcc in my build folder but I do not have a prebuilt/gcc, not even in my old work folder that will still compile. I will have to come back tomorrow and see if I can get it figured out. Thought for sure I had it this go around.
I am going to bed tonight no all nighter for me tonight. I will work on it some more tomorroow.
Click to expand...
Click to collapse
oh man that sucks, for some reasons mine still doesn't want to work... I guess its because I trying it on a VM, but it should work the same. I will post my output from terminal tomorrow...
---------- Post added at 08:30 AM ---------- Previous post was at 08:06 AM ----------
Code:
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp: In function 'char* camera_fixup_setparams(int, const char*)':
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp:130:16: error: 'KEY_CITYID' is not a member of 'android::CameraParameters'
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp: In function 'int camera_device_open(const hw_module_t*, const char*, hw_device_t**)':
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp:514:134: warning:
suggest parentheses around assignment used as truth value [-Wparentheses]
make: *** [/home/petruv/UPP/out/target/product/t0lte/obj/SHARED_LIBRARIES/camera .exynos4_intermediates/CameraWrapper.o] Error 1
make: *** Waiting for unfinished jobs....
external/sqlite/dist/sqlite3.c: In function 'fts3SnippetFunc':
external/sqlite/dist/sqlite3.c:129881:11: warning: 'iS' may be used uninitialized in this function [-Wmaybe-uninitialized]
external/sqlite/dist/sqlite3.c:129873:13: note: 'iS' was declared here
make: *** wait: No child processes. Stop.
[email protected]:~/UPP$
That is what I get when I try to make the built. I followed this guide
I had to do this:
Code:
$ cd device/samsung/t0lte
$ cp t0lte.mk full_t0lte.mk
so I can get passed the error where it says its missing "full_t0lte.mk".
Also, I did:
Code:
$ brunch t0lte
instead of
Code:
$ brunch full_t0lte-userdebug
because it was saying it couldn't find this device and was trying to get them from CyanogenMod github.
I don't know if this actually helped anyone or if anyone had the same problem, but I'd love to have some feedback from you guys. Thanks. :good:

pettrel said:
oh man that sucks, for some reasons mine still doesn't want to work... I guess its because I trying it on a VM, but it should work the same. I will post my output from terminal tomorrow...
---------- Post added at 08:30 AM ---------- Previous post was at 08:06 AM ----------
Code:
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp: In function 'char* camera_fixup_setparams(int, const char*)':
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp:130:16: error: 'KEY_CITYID' is not a member of 'android::CameraParameters'
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp: In function 'int camera_device_open(const hw_module_t*, const char*, hw_device_t**)':
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp:514:134: warning:
suggest parentheses around assignment used as truth value [-Wparentheses]
make: *** [/home/petruv/UPP/out/target/product/t0lte/obj/SHARED_LIBRARIES/camera .exynos4_intermediates/CameraWrapper.o] Error 1
make: *** Waiting for unfinished jobs....
external/sqlite/dist/sqlite3.c: In function 'fts3SnippetFunc':
external/sqlite/dist/sqlite3.c:129881:11: warning: 'iS' may be used uninitialized in this function [-Wmaybe-uninitialized]
external/sqlite/dist/sqlite3.c:129873:13: note: 'iS' was declared here
make: *** wait: No child processes. Stop.
[email protected]:~/UPP$
That is what I get when I try to make the built. I followed this guide
I had to do this:
Code:
$ cd device/samsung/t0lte
$ cp t0lte.mk full_t0lte.mk
so I can get passed the error where it says its missing "full_t0lte.mk".
Also, I did:
Code:
$ brunch t0lte
instead of
Code:
$ brunch full_t0lte-userdebug
because it was saying it couldn't find this device and was trying to get them from CyanogenMod github.
I don't know if this actually helped anyone or if anyone had the same problem, but I'd love to have some feedback from you guys. Thanks. :good:
Click to expand...
Click to collapse
I will come back and look at your problem more later I am going to bed. I should have went earlier like I saiad I was. Cause now I have a device that will not go into recovery. I think it is soft bricked
I can not even bott to recovery via "adb reboot recovery". :crying:

T-Macgnolia said:
I will come back and look at your problem more later I am going to bed. I should have went earlier like I saiad I was. Cause now I have a device that will not go into recovery. I think it is soft bricked
I can not even bott to recovery via "adb reboot recovery". :crying:
Click to expand...
Click to collapse
As long as you can get in "Download Mode", you're good to go.

So... I went in different folders and edited some .mk files (commented out any line that have to do with camera), I don't remember which ones, but I got it to build... now I am transferring my files to my phone and will give it a try to see if it boots.

If Ubuntu is being ported to android phones, does that mean other linux distros will be able to be ported as well? Like Linux Mint for example. I think that would look super sexy on a phone.

pettrel said:
oh man that sucks, for some reasons mine still doesn't want to work... I guess its because I trying it on a VM, but it should work the same. I will post my output from terminal tomorrow...
---------- Post added at 08:30 AM ---------- Previous post was at 08:06 AM ----------
Code:
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp: In function 'char* camera_fixup_setparams(int, const char*)':
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp:130:16: error: 'KEY_CITYID' is not a member of 'android::CameraParameters'
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp: In function 'int camera_device_open(const hw_module_t*, const char*, hw_device_t**)':
device/samsung/smdk4412-common/camerawrapper/CameraWrapper.cpp:514:134: warning:
suggest parentheses around assignment used as truth value [-Wparentheses]
make: *** [/home/petruv/UPP/out/target/product/t0lte/obj/SHARED_LIBRARIES/camera .exynos4_intermediates/CameraWrapper.o] Error 1
make: *** Waiting for unfinished jobs....
external/sqlite/dist/sqlite3.c: In function 'fts3SnippetFunc':
external/sqlite/dist/sqlite3.c:129881:11: warning: 'iS' may be used uninitialized in this function [-Wmaybe-uninitialized]
external/sqlite/dist/sqlite3.c:129873:13: note: 'iS' was declared here
make: *** wait: No child processes. Stop.
[email protected]:~/UPP$
That is what I get when I try to make the built. I followed this guide
I had to do this:
Code:
$ cd device/samsung/t0lte
$ cp t0lte.mk full_t0lte.mk
so I can get passed the error where it says its missing "full_t0lte.mk".
Also, I did:
Code:
$ brunch t0lte
instead of
Code:
$ brunch full_t0lte-userdebug
because it was saying it couldn't find this device and was trying to get them from CyanogenMod github.
I don't know if this actually helped anyone or if anyone had the same problem, but I'd love to have some feedback from you guys. Thanks. :good:
Click to expand...
Click to collapse
It looks like you did not clone your device folder because that is where the t0lte.mk and the full_t0lte.mk is located in device/samsung/t0lte.
Go to device/samsung and delete the tolte folder you have if it is one there and open a terminal and do the following .
Code:
cd UPP/device/samsung
git clone git://github.com/T-Macgnolia/android_device_samsung_t0lte.git -b cm-10.1 t0lte
pettrel said:
As long as you can get in "Download Mode", you're good to go.
Click to expand...
Click to collapse
That is the problem it will not go to download mode either. I just ordered a JIG from MobileTechVideos.com. Hopefully when I get it in a couple of days I will be able to get to download mode and flash via Odin.
pettrel said:
So... I went in different folders and edited some .mk files (commented out any line that have to do with camera), I don't remember which ones, but I got it to build... now I am transferring my files to my phone and will give it a try to see if it boots.
Click to expand...
Click to collapse
Glad you got it to build man, did you get it to boot. Also as a good rulle of thumb always document what changes you make when trying to get a build to complete or any added mods you add to your work tree.
acideater said:
If Ubuntu is being ported to android phones, does that mean other linux distros will be able to be ported as well? Like Linux Mint for example. I think that would look super sexy on a phone.
Click to expand...
Click to collapse
Canonical Ltd made put together this mobile version of Ubuntu. From what they (Canonical Ltd) have said about it they have plans to do nothing but improve on this platform if it gains popularity. They mentioned such features as having a full desktop Ubuntu if you dock your device. But as far as other linux distros coming out with a mobile version i can not say yes or no. But I can say it will probably depend on how popular this first Ubuntu phone OS becomes.

Related

[TUTORIAL]Setting up and compiling CM9/CM10 from source

Since I’ve seen many questions on how to build cyanogenmod 9 (CM9) from source for the Galaxy Nexus, but there isn’t a proper guide, I will attempt to write a small how-to. There already is a very good guide how to build ICS from source, but there are a few extra things you’ll have to do for CM9. I hope it will be useful, and if not, well, at least I’ve tried
LATEST UPDATE: August 20th - also added CM10
SETTING UP THE BUILD ENVIRONMENT
I highly recommend Ubuntu 12.04 64 bit for development or Linux Mint 13. It is possible to build on different linux distro’s, but I cannot cover all exceptions. (If you don’t have linux installed or are afraid to set up a dual boot, it is possible to build in a virtual environment –e.g. virtualbox-. Building in a virtual environment however, can be very slow. Also, 64 bit is recommended.)
Make sure java is installed! At the end of this post, I have written a small guide how to install java.
Set up adb and create proper udev rules
I will not write these steps down, but rather point you to some very nice and easy guides. It would be best to do this first, however, it is not completely necessary if you just want to build a fully functioning rom.
1) set up adb (follow this excellent guide)
2) set up udev rules which allow you to start adb without having to use sudo (follow this terrific tutorial)
Installing all necessary packages and set up repo (source)
Open a terminal and copy the following code:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev:i386 \
g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown \
libxml2-utils xsltproc zlib1g-dev:i386
WARNING: run the following commands as user (NOT as root) unless stated otherwise (e.g., when it explicitly shows ‘sudo’ before a command)!!!
Next, you’ll have to install repo to download the source. First we’re going to create a bin folder (1) in our home directory and include it in our path (2). Also, download the repo script (3) and make it executable (4). All from the command line:
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
Okay, we’re done with the first part. So far it’s been similar to building pure AOSP.For CM, there will be some additional things you’ll have to do.
DOWNLOADING THE CM SOURCE
Create a directory (CM9 -or CM10-) for your working files:
Code:
mkdir CM9
cd CM9
and then initialize the main CM repo (For CM10, just replace ics with jellybean):
Code:
repo init -u git://github.com/CyanogenMod/android.git -b ics
Good, now you’re ready to download the source. This can take a couple of hours!! Run the following command from the terminal (Run the following commands in the terminal from the root of the directory that contains the source, e.g., ~/CM9/):
Code:
repo sync
Okay, the majority of the files needed to build CM are now on your computer. However, device specific files are needed. To get them, issue the following command in your terminal:
Code:
source build/envsetup.sh
lunch
After the lunch command, choose your device. If you have a GSM version, choose cm_maguro, if you have the CDMA version, choose cm_toro. Additional files needed for your device are being downloaded right now.
Before you can actually build the rom, you’ll need to run two more commands to get some proprietary files.
1) Open a terminal and go to CM9/vendor/cm/. Run the following command:
Code:
./get-prebuilts
This will download term.apk and rommanager.apk. You will need these files otherwise you’ll get an error while building.
2) Now we need to grab some files from your phone. Make sure you have a working build cyanogenmod version (just install a nightly) on your phone. Make sure adb is setup properly (see beginning of this post)!
Connect your phone to the pc. Open a terminal and go to CM9/device/samsung/(Maguro OR Toro)/. Run the following command:
Code:
sh extract-files.sh
BUILDING CM9/CM10
The building part is very easy. It just requires two simple commands:
Code:
source build/envsetup.sh
brunch
After the brunch command, choose your device. Again, if you have a GSM version, choose cm_maguro, if you have the CDMA version, choose cm_toro. Depending on your computer, hopefully you’ll have a fully functioning CM9 or CM10 in 30minutes-2hours (or even longer) . You can find the rom in: /out/target/product/(Maguro OR Toro)/
Next time you build, first clean your working directory. Enter the following command in the terminal:
Code:
make clobber
This will completely remove your output directory!
To update the source, before each build just run:
Code:
repo sync
ADDITIONAL INFO
Install Java
Installing java is very easy in Ubuntu 12.04. Java 6 is recommended. To install it in Ubuntu 12.04 or Linux Mint 13, download the most recent Java 6 SDK from HERE. To install, open a terminal and run the following commands:
Code:
$ chmod +x jdk-6u34-linux-x64.bin
$ sudo ./jdk-6u34-linux-x64.bin
$ sudo mv jdk1.6.0_34 /usr/lib/jvm/
$sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_34/bin/java 1
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_34/bin/javac 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_34/bin/javaws 1
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config javaws
NOTE: after each 'update-alternative'-command, choose the correct (new) java version!
To check if you have the correct java version, type in a terminal:
Code:
java –version
I also added JAVA_HOME to my path; I don’t know if it is still necessary, but it doesn’t hurt either. First, check where java is located. In a terminal type:
Code:
which java
In my case the output shows /usr/bin/java, but it could be located somewhere else. Write down the path minus '/java'. Then open /home/USERNAME/.bashrc and add the following line to the bottom of the file:
Code:
export JAVA_HOME=/usr/bin
Of course replace /usr/bin with your path. Then save and close, and in a terminal run:
Code:
source ~/.bashrc
Odexed version
Some people like their rom to be odexed. There are multiple ways to achieve this (special thanks to Planet X for helping me with this):
1)Instead of ‘brunch’ do the following (if you are building for toro, replace maguro with toro):
Code:
source /build/envsetup.sh
lunch cm_maguro-user
make –j4
(Note:
taken from source.android.com: GNU make can handle parallel tasks with a -jN argument, and it's common to use a number of tasks N that's between 1 and 2 times the number of hardware threads on the computer being used for the build. E.g. on a dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands between make -j16 and make -j32.)
2)If you want to build an odexed version every time and just want to use the brunch command, do the following:
-Open build/core/main.mk
-Comment out (place a # at the beginning of the line) lines 240, 241, 245, and 246. Thus, replace:
ifneq (true,$(DISABLE_DEXPREOPT))
ifeq ($(user_variant),user)
Ifeq ($(HOST_OS),linux)
WITH_DEXPREOPT := true
Endif
endif
endif
Click to expand...
Click to collapse
# ifneq (true,$(DISABLE_DEXPREOPT))
# ifeq ($(user_variant),user)
Ifeq ($(HOST_OS),linux)
WITH_DEXPREOPT := true
Endif
# endif
# endif
Click to expand...
Click to collapse
Now you can use the brunch command to build an odexed version with insecure boot image.
Hopefully this guide will benefit some people, if not, it kept me busy for a while. Enjoy building!!
(btw, I'm not a native english speaker, so excuse me if I made errors in grammar )
Wow great work. These tutorials keep getting better making it so easy to compile your own rom!
So what does that "brunch" command actually do?
Is it just a script that does the make otapackage commands and stuff?
Infra said:
So what does that "brunch" command actually do?
Is it just a script that does the make otapackage commands and stuff?
Click to expand...
Click to collapse
Indeed! Brunch is actually a combination of 'lunch' and 'make'. Using the 'lunch-part' you choose your build (in our case the maguro or toro). Next, the 'make-part' actually gets things going. The nice thing using brunch is that it automatically detects the maximum number of threads it can use so that it will run at maximum speed.
Finally set my computer up to compile CM9 last night for the first time and after a few tries I finally got it going. The only problem is that I am now getting an error very close to this one.
http://forum.xda-developers.com/showpost.php?p=25452343&postcount=3093
That poster says that it has been happening for a few days now. Is this a known issue with compiling CM9 or is this just user error? I have tried twice compiling now and have had no luck. Is it working for anyone else?
---------- Post added at 02:05 PM ---------- Previous post was at 01:19 PM ----------
Here is the exact error that Im getting. I tried it again today just to see if it anything had changed.
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/mark/CM9/kernel/samsung/tuna'
make: *** [TARGET_KERNEL_BINARIES] Error 2
make: *** Waiting for unfinished jobs....
Thanks for this guide. I just built my first CM9 kang. Getting ready to flash it. Now to find a guide on what I can and can't change and recompile or do I just remove stuff and use 7-zip to zip it back up?
housry23 said:
Thanks for this guide. I just built my first CM9 kang. Getting ready to flash it. Now to find a guide on what I can and can't change and recompile or do I just remove stuff and use 7-zip to zip it back up?
Click to expand...
Click to collapse
Glad to hear you succeeded building your first kang. I don't really understand what you want to do next? If you want to remove stuff from the zip, you can. I for instance always remove stk.apk. But you can also modify the build files so that only things you want will be built. You can play around with the source code and things like that. Anyway, most of the answers you will find using google. I also very much like the development board on Rootzwiki; people are really helpful and friendly there. So if you have any specific questions, i recommend that forum as well!
mbroeders said:
Glad to hear you succeeded building your first kang. I don't really understand what you want to do next? If you want to remove stuff from the zip, you can. I for instance always remove stk.apk. But you can also modify the build files so that only things you want will be built. You can play around with the source code and things like that. Anyway, most of the answers you will find using google. I also very much like the development board on Rootzwiki; people are really helpful and friendly there. So if you have any specific questions, i recommend that forum as well!
Click to expand...
Click to collapse
Okay thanks. I was asking just what you answered. I want to be able to remove and/or add stuff to the zip for starters. I found the answer through Google, but I do appreciate you taking the time to answer. I'll definitely be visiting the Rootzwiki dev board. Thanks for the suggestion.
I have successfully compiled cm9 from source but have never tried to cherry pick or Kang anything yet. Could you quickly explain how you cherry pick with cm9?
Sent from my Galaxy Nexus using Tapatalk 2
SupWiz17 said:
I have successfully compiled cm9 from source but have never tried to cherry pick or Kang anything yet. Could you quickly explain how you cherry pick with cm9?
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
Check out this link it may be helpful
http://rootzwiki.com/index.php?/topic/13189-[TUTORIAL]-Everything-you-ever-wanted-to-know-about-GIT#entry322735
Sent from my GT-S5360 using Tapatalk 2
That's a very useful link, thanks! In addition, if you want to cherry pick commits that haven't been merged yet -specific CM commits, such as navbar customization-, have a look here: http://review.cyanogenmod.com/#/q/branch:ics,n,z
Now let's say you see something interesting that you want to add. Then look at that commit and you'll see a 'download' command, such as "git fetch http://review.cyanogenmod.com/CyanogenMod/android_frameworks_base refs/changes/06/13306/15 && git checkout FETCH_HEAD". Just run that command and if everything works, you have succesfully cherry picked a commit. -of course, because these are not yet merged, there is the chance that no everything will work as it should-
There are also some GUI programs to manage git. I'm just about to try gitgui by all accounts it is very good.
Sent from my GT-S5360 using Tapatalk 2
Maybe it is a noobish question, but does this line:
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > /bin/repo
miss a ~?
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
UncleDan said:
Maybe it is a noobish question, but does this line:
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > /bin/repo
miss a ~?
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Click to expand...
Click to collapse
Not noobish at all! You're absolutely right. It's not necessary when you're already in your home folder, but to be sure I've changed it in the guide. Thanks for letting me know!
Sticky!!!!!
Thanks dude
Sent from my Galaxy Nexus using Tapatalk 2
im sorry for noobish...at this step
1) Create an empty file in ~/CM9/.repo
in home i have dir CM9 but its empty...i havent a folder call .repo
java its installed and adb work perfectly
this is my terminal output:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 20774 100 20774 0 0 35679 0 --:--:-- --:--:-- --:--:-- 56604
[email protected]:~$ chmod a+x ~/bin/repo
[email protected]:~$ cd CM9
[email protected]:~/CM9$ repo init -u git://github.com/CyanogenMod/android.git -b ics
Your Name [loris]: loris
Your Email : my email
Your identity is: loris
is this correct [y/N]? y
repo initialized in /home/llo/CM9
[email protected]:~/CM9$
and nothing...
SOLVED
Hey mate any idea why my camera never works after a build... I know I'm missing something but I'm not sure what. I have all the proprietary files for my maguro etc but I just can't get camera to work... everytime
Sent from my Galaxy Nexus using Tapatalk 2
CdTDroiD said:
Hey mate any idea why my camera never works after a build... I know I'm missing something but I'm not sure what. I have all the proprietary files for my maguro etc but I just can't get camera to work... everytime
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
And you flash gapps everytime?
Sent from my GT-I9300 using Tapatalk 2
Infra said:
And you flash gapps everytime?
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Sorted it out was just missing a few important files under /system/vendor thanks
Sent from my Galaxy Nexus using Tapatalk 2
CdTDroiD said:
Sorted it out was just missing a few important files under /system/vendor thanks
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
Glad it worked out! Seems there have been a few changes lately, so I will add some more info soon.
Sent from my SGS3

[Guide] How to compile and install CM10 for Samsung i9000

This guide is an adaptation/update of the following guides to CM10:
http://wiki.cyanogenmod.com/wiki/Samsung_Galaxy_S:_Compile_CyanogenMod_(Linux)
http://forum.xda-developers.com/showthread.php?t=1505006
http://forum.xda-developers.com/showthread.php?t=1533711
DISCLAMER
Although the procedures in this guide were tested on 2012-08-03 and produced a working build on the i9000, I take no responsibility for any consequences derived from their use.
Thanks:
stbenz
rycus86
kasper_h
gmhafiz
Requirements:
Linux - Ubuntu 12.04 - 64bit (AFAIK, a 64 bit host is needed to compile JB)
An i9000 with cm10 already installed - Get the latest nightly here: http://get.cm/?device=galaxysmtd
About 14GB of storage for the repository plus about 15GB for building
If you're using Windows or another OS, grab Virtual Box and install Ubuntu on a VM. It makes a nice development environment.
(Give the VM enough resources - A few cores and 2-4GB of RAM)
Building in other Linux distributions?
Here are some contibutions from fellow members:
Arch Linux: Replace steps 1 to 3 with gmhafiz's instructions
________________________________________________________________________________________________________
1 - Install Ubuntu Packages
1.1 - In terminal:
Code:
sudo apt-get install git-core gnupg flex bison python rar original-awk gawk p7zip-full gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool
sudo apt-get install libc6-dev x11proto-core-dev libx11-dev libgl1-mesa-dev mingw32 tofrodos python-markdown libxml2-utils
sudo apt-get install g++-multilib lib32z1-dev ia32-libs lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib g++-multilib xsltproc
2 - Install JAVA
NOTE: Must be JDK 1.6 - Don't use other versions.
2.1 - Download Java JDK for Linux 64-bit from Java site: (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
Correct file will be something like: jdk-6u##-linux-x64.bin , where ## is the version number and will change with updates.​
2.2 - Move jdk-6u##-linux-x64.bin to your home directory
2.3 - Remove any other java packages from system:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
2.4 - Install Java JDK:
Code:
sudo mkdir -p /opt/java/64/
sudo cp jdk-6u##-linux-x64.bin /opt/java/64
sudo su -
cd /opt/java/64
chmod +x jdk-6u##-linux-x64.bin
./jdk-6u##-linux-x64.bin
exit
2.5 - Add JDK PATH to .bashrc:
Code:
vi ~/.bashrc
Add these lines to .bashrc:​
Code:
# Java PATHs
export JAVA_HOME=/opt/java/64/jdk1.6.0_##
export PATH=$PATH:$JAVA_HOME/bin
3 - Install Android SDK
3.1 - Setup directories:
Code:
cd ~
mkdir android
cd android
mkdir sdk
3.2 - Download Android SDK from http://developer.android.com/sdk/index.html
3.3 - Extract SDK contents to ~/android/sdk
3.4 - Add Android SDK Path:
Code:
vi ~/.bashrc
Enter the Following:​
Code:
#Android PATH
export PATH=$PATH:~/android/sdk
export PATH=$PATH:~/android/sdk/platform-tools
export PATH=$PATH:~/android/sdk/tools
3.5 - Add Extra Path For Device:
Code:
sudo vi /etc/udev/rules.d/99-android.rules
Enter this:​
Code:
#Samsung
SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666
SUBSYSTEM=="usb", ATTRS{idVendor}=="####:####", SYMLINK+="android_adb", MODE="0666" GROUP="plugdev"
TEST=="/var/run/ConsoleKit/database", \
RUN+="udev-acl --action=$env{action} --device=$env{DEVNAME}"
Save/close file and run:​
Code:
sudo chmod +x /etc/udev/rules.d/99-android.rules
3.6 - Close and open new terminal.
3.7 - Install Android SDK Tools
Code:
android
Check Android SDK Tools and Android SDK platform-tools and Install them​
4 - Install Repository
4.1 - Download Repo:
Code:
mkdir -p ~/bin
mkdir -p ~/android/system
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
4.2 - Add Repo Path:
Code:
vi ~/.bashrc
Enter the following:​
Code:
export PATH=$PATH:~/bin
4.3 - Close and open new terminal.
4.4 - Initialize Repository & Sync:
Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
repo sync -j16
NOTE: If you have trouble syncing due to connection issues, try repo sync -j1. It's slower but some ISPs have issues with -j16
Want to make sure you didn't get any connection errors and have the complete repository? Just run the repo sync command again. It can't give you ANY errors.​Go get a beer. And another. And another...​
4.5 - Get Device Specific Repos:
Code:
. build/envsetup.sh && breakfast galaxysmtd
Get more beer...​
4.6 - Extract files from phone:
NOTE: You need to have cm10 installed on the phone.
Connect phone to pc and in terminal type:​
Code:
adb root
cd ~/android/system/device/samsung/galaxysmtd/
./extract-files.sh
4.7 - Download Extra Files:
Code:
~/android/system/vendor/cm/get-prebuilts
4.8 - Add Toolchain PATH:
Code:
vi ~/.bashrc
Enter the following:​
Code:
#Android Toolchain PATH
export ARCH=arm
export CCOMPILE=$CROSS_COMPILE
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:/home/YOUR-USERNAME/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin
4.9 - Close and open new terminal.
5 - Building Android
Code:
cd ~/android/system
. build/envsetup.sh && brunch galaxysmtd
Go get a beer. And another. And another...​
6 - Install on Phone
6.1 - Copy your .zip file from ~/android/system/out/target/product/galaxysmtd/cm-10-XXXXXXXXX-UNOFFICIAL-galaxysmtd.zip to the root of the SD card.
6.2 - Optional: Download Google Apps for Jelly Bean from http://goo.im/gapps and place it on the root of the SD card.
6.3 - Flash both of these .zip files from recovery.
Call your mother. She misses you.​
...and that's it.
________________________________________________________________________________________________________
How to update?
Code:
cd ~/android/system
repo sync -j16
make installclean
find ./out/ -name 'build.prop' | xargs rm
find ./out/ -name 'cm_galaxysmtd-target_files-eng.*.zip' | xargs rm
NOTE: If you have trouble syncing due to connection issues, try repo sync -j1. It's slower but some ISPs have issues with -j16​
...get beer, build and install.
Want to go "Steve Jobs" on the Android build? (Warning: Will take a gazillion years to re-build everything again)
Run:
Code:
make clobber
________________________________________________________________________________________________________
Want to customize the kernel?
Look here: [Guide] How to customize the CM10 i9000 kernel
.
will try this soon... thankx
Can you also write a small paragraph where you explain how compile a single application like Mms, Phone...
Thank you
a0a0 said:
Can you also write a small paragraph where you explain how compile a single application like Mms, Phone...
Thank you
Click to expand...
Click to collapse
You get all the application apks in the produced build.
From there you can extract any single one you want...
Sent from my GT-I9000 using Tapatalk 2
Yes but if i will try a small change in a code i must compile every time all the rom
a0a0 said:
Yes but if i will try a small change in a code i must compile every time all the rom
Click to expand...
Click to collapse
Not really.
Only changed files are compiled (and affected dependencies)
Sent from my GT-I9000 using Tapatalk 2
With mmm you can build single apk files, see the cm9 compile thread for details...
Verstuurd van mijn GT-I9000
Thanks man
Verstuurd van mijn GT-I9000
Requirements:
Linux - Ubuntu 12.04...
Click to expand...
Click to collapse
Does it have to be Ubuntu, provided I can find all listed packages for CentOS, for example?
Also, do you recommend the desktop or the server version?
elitevet said:
Does it have to be Ubuntu, provided I can find all listed packages for CentOS, for example?
Also, do you recommend the desktop or the server version?
Click to expand...
Click to collapse
Doesn't have to be Ubuntu, as long as you can find the equivalent packages.
It can be the desktop or server version, as long as you have X in it.
The android SDK setup uses a GUI. (but perhaps there's a way to run it from the CLI)
Sent from my GT-I9000 using Tapatalk 2
Thanks!
Already built it from the info from the CM9 thread, but this is always welcome
and very useful! Great +++++
Is step 4.5 (Setup Manifest) really required? Can't test it at the moment, but I know, it isn't required for building CM9 anymore, despite it is mentioned in the guide for building CM9. As I understand it, its a relict from when the Galaxy S specific sources weren't yet merged to the CyanogenMod repository.
stbenz said:
Is step 4.5 (Setup Manifest) really required? Can't test it at the moment, but I know, it isn't required for building CM9 anymore, despite it is mentioned in the guide for building CM9. As I understand it, its a relict from when the Galaxy S specific sources weren't yet merged to the CyanogenMod repository.
Click to expand...
Click to collapse
It's not needed.
Gesendet von meinem GT-I9000 mit Tapatalk 2
stbenz said:
Is step 4.5 (Setup Manifest) really required? Can't test it at the moment, but I know, it isn't required for building CM9 anymore, despite it is mentioned in the guide for building CM9. As I understand it, its a relict from when the Galaxy S specific sources weren't yet merged to the CyanogenMod repository.
Click to expand...
Click to collapse
The local manifest is still needed to download the device specific files & kernel source (also for CM9).
The thing not needed for CM9 after some time was using the teamhacksung buildscript.
---------- Post added at 05:27 PM ---------- Previous post was at 05:27 PM ----------
DerTeufel1980 said:
It's not needed.
Gesendet von meinem GT-I9000 mit Tapatalk 2
Click to expand...
Click to collapse
Sure? I don't see the device-files in the default.xml manifest file...
DerTeufel1980 said:
It's not needed.
Gesendet von meinem GT-I9000 mit Tapatalk 2
Click to expand...
Click to collapse
It shouldn't be, if it is like that, but I didn't get those sources until I added the manifest.
Perhaps a quirk, but that's how it worked.
The thing is, I had to put in the guide, as it was the way it worked, starting from a fresh, completely clean system.
Sent from my GT-I9000 using Tapatalk 2
Thanks again!
I was looking for something like this for quite a while now. Now I can finally compile my own builds
I compiled a build using this exact method 2 days ago, flashed the build to the phone and it went into constant pre-recovery bootloops. I had to flash GB with Odin to get back.
One thing was that I compile on a seperate box at home and transferred the file using scp. Maybe that corrupted, so I'm gonna try again tomorrow.
Could it be possible that the codebase itself was broken when I compiled? :-/
Did anybody have anythign similar? :S
K****iz_Indian said:
Could it be possible that the codebase itself was broken when I compiled? :-/
Did anybody have anythign similar? :S
Click to expand...
Click to collapse
Don't think so. The repo is not left with a broken code base.
The thing is, sometimes users get into the boot loop state even when installing the (un)official cm10 builds, so other factors cause them.
Sent from my GT-I9000 using Tapatalk 2
Could anyone refer me to a good guide about commit picking, please?
elitevet said:
Could anyone refer me to a good guide about commit picking, please?
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=23715982&postcount=64

Compiling CM9 Guide.

Thought I'd share this - and I need to help a friend with this
CallMeVentus said:
Alright, now you've built AOSP and CM7 and you love it, what next?
Ice Cream Sandwich *insert holy choir here*
Requirements (they are much more different now):
A computer that's capable of 64-bit
A dual-core processor of a speed of at least 2.2Ghz (Intel Xeon/Core i7 recommended)
Either Ubuntu 10.04 LTS 64-bit (later versions have experimental support) but if you're using a later version that's fine.
Or Mac OSX 10.6
At least 8GB of RAM and 10~GB swap maybe? (Otherwise you could have 4Gb of RAM and ~20GB swap this time)
At least a 70GB partition for Ubuntu (to make sure there is space for compiling + installing required stuff)
Well, here are the steps to build it:
Instructions (Taken from http://source.android.com/source/initializing.html & http://wiki.cyanogenmod.com/wiki/Android_SDK_Emulator:_Compile_CyanogenMod_(Linux)):
---------ONLY FOR UBUNTU 10.10--12.04---------
Chapter 1: Initializing a Build Environment
This section describes how to set up your local work environment, how to use Repo to get the Android files, and how to build the files on your machine. To build the Android source files, you will need to use Linux or Mac OS. Building under Windows is not currently supported.
Note: The source download is approximately 6GB in size. You will need 25GB free to complete a single build, and up to 90GB (or more) for a full set of builds.
Section 1 (Linux/Ubuntu): Setting up a Linux build environment
The Android build is routinely tested in house on recent versions of Ubuntu LTS (10.04), but most distributions should have the required build tools available. Reports of successes or failures on other distributions are welcome.
Note: It is also possible to build Android in a virtual machine. If you are running Linux in a virtual machine, you will need at least 16GB of RAM/swap and 30GB or more of disk space in order to build the Android tree.
In general you will need:
Python 2.5 -- 2.7.
GNU Make 3.81 -- 3.82.
JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older.
Git 1.7 or newer.
Detailed instructions for Ubuntu 10.04+ follow.
Step 1: Installing the JDK
The Sun JDK is no longer in Ubuntu's main package repository. In order to download it, you need to add the appropriate repository and indicate to the system which JDK should be used.
To download Java 6, do this:
Code:
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
Note: The lunch command in the build step will ensure that the Sun JDK is used instead of any previously installed JDK.
Alternatively you can follow eoghan2t7's instructions:
Or bs828's instructions:
Step 2: Installing required packages (Ubuntu 10.04 -- 11.10)
You will need a 64-bit version of Ubuntu. Ubuntu 10.04 is recommended. Building using a newer version of Ubuntu is currently only experimentally supported and is not guaranteed to work on Git branches other than master (http://github.com/android).
To install the required packages, do this:
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 lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils xsltproc
---------ONLY FOR UBUNTU 10.10--11.10---------
For Ubuntu 10.10 users, do this as well:
Code:
$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
Note: This is used to avoid a compile error with libGL later on.
For Ubuntu 11.10 users, do this:
Code:
$ sudo apt-get install libx11-dev:i386
---------END FOR UBUNTU 10.10--11.10---------
----------ONLY FOR UBUNTU 12.04----------
Step 2: Installing required packages (Ubuntu 12.04)
Building on Ubuntu 12.04 is currently only experimentally supported and is not guaranteed to work on branches other than master.
To install the required packages, do this:
Code:
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev:i386 \
g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown \
libxml2-utils xsltproc zlib1g-dev:i386
---------END FOR UBUNTU 10.10--12.04---------
I won't do MacOSX for ICS, mainly because it has a very unstable success chance of compilation.
Your build environment is good to go! Proceed to
Chapter 2: Downloading the Source Tree
Section 1: Repo
Repo is a tool that makes it easier to work with Git in the context of Android.
It is also a tool that allows you to download source files from Android easily.
Step 1: Installing Repo
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
$ chmod a+x ~/bin/repo
For version 1.15, the SHA-1 checksum for repo is 8eb56d98b36d615c3efec51868e87bebe757feb1
For version 1.16, the SHA-1 checksum for repo is f3bfa7fd2d0a44aa40579bb0242cc20df37b5e17
Step 2: Initializing a Repo client
After installing Repo, set up your client to access the android source repository:
Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like:
Code:
$ mkdir I_HATE_STEVE
$ cd I_HATE_STEVE
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.
For AOSP:
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r1
or
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r2
or
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r3
or even
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b ics-plus-aosp
For CM9:
Code:
$ repo init -u git://github.com/CyanogenMod/android.git -b ics
When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.
A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.
Step 3: Getting the files
To pull down files to your working directory from the repositories as specified in the default manifest, run
Code:
$ repo sync
The Android source files will be located in your working directory under their project names. The initial sync operation will take an hour or more to complete, depending on your Internet bandwidth.
Note: If you initialize your repo on your root area for all projects, the time for downloading will decrease
If you haven't set up ccache now, now is a good time to set it up.
Chapter 2.5 (AOSP only): Downloading the various device specific configurations from GitHub
Now that you have a full copy of AOSP, you will realise that inside your working directory/device you will only see only a few device configurations. That's because AOSP only supports those devices and you will need to manually download other devices for use with AOSP.
You will have to find the device configs yourself as I do not know where every device config in the world is.
Chapter 3: Building the System
The basic sequence of build commands is as follows:
Step 1: Initialize
Initialize the environment with the envsetup.sh script. Note that replacing "source" with a single dot saves a few characters, and the short form is more commonly used in documentation.
Either:
Code:
$ source build/envsetup.sh
or
Code:
$ . build/envsetup.sh
Step 2: Choose a target
Choose which target to build with lunch. The exact configuration can be passed as an argument, e.g.
Code:
$ lunch full-eng
The example above refers to a complete build for the emulator, with all debugging enabled.
If run with no arguments lunch will prompt you to choose a target from the menu.
Step 3: Build the Code
Build everything with make. GNU make can handle parallel tasks with a -jN argument, and it's common to use a number of tasks N that's between 1 and 2 times the number of hardware threads on the computer being used for the build. E.g. on a dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands between make -j16 and make -j32.
If you are using a dual-core computer do either of these:
Code:
make -j2
or
Code:
make -j4
It is usually recommended that you make the -jN amount twice the number of cores your processor has.
Therefore if you have a quad-core processor do this:
Code:
make -j4
or
Code:
make -j8
There are different ways to run make:
Code:
$ make clean
or
Code:
$ make clobber
Cleans the compile directory and deletes all compiled files.
Code:
$ make update-api
Makes part of the framework, usually used to update the API.
Code:
make otapackage
Makes a flashable .zip file, as otapackage = Over The Air package.
Code:
make (app name, like framework-res)
Makes the specified app and the .apk will be compiled in the output directory.
Once you finish make, you are done! Congratulations!
Chapter 4: Troubleshooting Common Build Errors
Sometimes, things don't go as planned such as unexpected build errors. Here are some solutions to common problems:
Section 1: Wrong Java Version
If you are attempting to build froyo or earlier with Java 1.6, or gingerbread or later with Java 1.5, make will abort with a message such as
Code:
************************************************************
You are attempting to build with the incorrect version
of java.
Your version is: WRONG_VERSION.
The correct version is: RIGHT_VERSION.
Please follow the machine setup instructions at
https://source.android.com/source/download.html
************************************************************
This may be caused by:
failing to install the correct JDK as specified on the Initializing chapter. Building Android requires Sun JDK 5 or 6 depending on which release you are building.
another JDK that you previously installed appearing in your path. You can remove the offending JDK from your path with:
Code:
$ export PATH=${PATH/\/path\/to\/jdk\/dir:/}
Section 2: Python Version 3
Repo is built on particular functionality from Python 2.x and is unfortunately incompatible with Python 3. In order to use repo, please install Python 2.x:
Code:
$ apt-get install python
Optional Step: Setting up ccache
You can optionally tell the build to use the ccache compilation tool. Ccache acts as a compiler cache that can be used to speed-up rebuilds. This works very well if you do "make clean" often, or if you frequently switch between different build products.
Put the following in your .bashrc or equivalent.
Code:
$ export USE_CCACHE=1
By default the cache will be stored in ~/.ccache. If your home directory is on NFS or some other non-local filesystem, you will want to specify the directory in your .bashrc as well.
Code:
$ export CCACHE_DIR=
The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code, if you use CCache.
Code:
$ prebuilt/linux-x86/ccache/ccache -M 50G
Optional Step: Using a separate output directory
By default, the output of each build is stored in the out/ subdirectory of the matching source tree.
On some machines with multiple storage devices, builds are faster when storing the source files and the output on separate volumes. For additional performance, the output can be stored on a filesystem optimized for speed instead of crash robustness, since all files can be re-generated in case of filesystem corruption.
To set this up, export the OUT_DIR_COMMON_BASE variable to point to the location where your output directories will be stored.
Code:
export OUT_DIR_COMMON_BASE=
The output directory for each separate source tree will be named after the directory holding the source tree.
For instance, if you have source trees as /source/master1 and /source/master2 and OUT_DIR_COMMON_BASE is set to /output, the output directories will be /output/master1 and /output/master2.
It's important in that case to not have multiple source trees stored in directories that have the same name, as those would end up sharing an output directory, with unpredictable results.
This is only supported on branches newer than 4.0.x (IceCreamSandwich).
Click to expand...
Click to collapse

[HOW-TO] Sync Xylons source, build with GCC 4.9, Linaro, enable -O3, & use CCACHE

cd to your Desktop
command time: (copy/paste em)
Code:
mkdir ~/bin
export PATH=~/bin:$PATH
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
then:
Code:
sudo gedit ~/.bashrc
put export PATH=~/bin:$PATH at the bottom, of it
to enable CCACHE, put this code at the bottom of your bash.rc
Code:
EXPORT USE_CCACHE=1
export CCACHE_DIR=/path/to/your/ccache/folder (mine is /home/mbq/Desktop/ccache
export CCACHE_LOGFILE=/path/to/your/ccache/ccache.log
save it
then:
Code:
mkdir ~/XYAOSP
cd ~/XYAOSP
repo init -u [url]https://github.com/XYAOSP/platform_manifest[/url] -b jb4.2
repo sync -j16 (or -j8, or -j32.. whichever you want)
then:
when youre synced up..
if you want to watch CCACHE to make sure it's working, cd to:
Code:
/path/to/your/XYAOSP/prebuilts/misc/linux-x86/cache
then:
Code:
ccache -s
to change the size of your CCACHE, cd to:
Code:
/path/to/your/XYAOSP/prebuilts/misc/linux-x86
then:
Code:
ccache -M 20
(20=20GB, you can set it all the way to 100)
make sure ccache is getting hits. (The first build will take way longer than usual, so be patient).
to call linaro out correctly, open your xylon folder, go to build, and edit envsetup.sh (if you see a lock on the file(s), enter this:
Code:
sudo chmod -R 777 /path/to/your/XYAOSP/build
then, find:
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-4.6/bin
;;
arm) toolchaindir=arm/arm-linux-androideabi-$targetgccversion/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-4.6/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
and change:
Code:
arm) toolchaindir=arm/arm-linux-androideabi-$targetgccversion/bin
to:
Code:
arm) toolchaindir=linaro/bin
and:
Code:
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/arm-eabi-$targetgccversion/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
;;
mips) toolchaindir=mips/mips-eabi-4.4.3/bin
;;
*)
# No need to set ARM_EABI_TOOLCHAIN for other ARCHs
;;
change:
Code:
case $ARCH in
arm)
toolchaindir=arm/arm-eabi-$targetgccversion/bin
to:
Code:
case $ARCH in
arm)
toolchaindir=linaro/bin
(Make sure linaro is in
Code:
/path/to/your/XYAOSP/prebuilts/gcc/linux-x86/linaro
)
to enable -O3 optimizations, go to:
Code:
/path/to/your/XYAOSP/build/core/combo
open: select.mk
edit:
Code:
ifneq ($(TARGET_USE_02),true)
$(combo_target)GLOBAL_CFLAGS := -fno-exceptions -Wno-multichar
$(combo_target)RELEASE_CFLAGS := -O2 -g -fno-strict-aliasing
else
$(combo_target)GLOBAL_CFLAGS := -O3 -g -Wstrict-aliasing=2
ifneq ($(combo_target),HOST_)
(combo_target)RELEASE_CFLAGS += -Werror=strict-aliasing
endif
endif
$(combo_target)GLOBAL_LDFLAGS := -Wl,-O3
$(combo_target)GLOBAL_ARFLAGS := crsP
change anything -O2 to -O3
save it
then: go to the build/core/combo
then: TARGET_linux-arm.mk
change:
Code:
ifeq ($(TARGET_USE_O3),true)
TARGET_arm_CFLAGS := -Os \
-fomit-frame-pointer \
-fstrict-aliasing \
-fno-tree-vectorize
else
TARGET_arm_CFLAGS := -O3 \
-fomit-frame-pointer \
-fstrict-aliasing \
-funswitch-loops
endif
to:
Code:
ifeq ($(TARGET_USE_O2),true)
TARGET_arm_CFLAGS := -Os \
-fomit-frame-pointer \
-fstrict-aliasing \
-fno-tree-vectorize
else
TARGET_arm_CFLAGS := -O3 \
-fomit-frame-pointer \
-fstrict-aliasing \
-funswitch-loops
endif
and:
Code:
ifeq ($(ARCH_ARM_HAVE_THUMB_SUPPORT),true)
ifeq ($(TARGET_USE_O2),true)
TARGET_thumb_CFLAGS := -mthumb \
-O2 \
-fomit-frame-pointer \
-fno-strict-aliasing \
-fno-tree-vectorize
else
TARGET_thumb_CFLAGS := -mthumb \
-O3 \
-fomit-frame-pointer \
-fno-strict-aliasing \
-fno-tree-vectorize
endif
else
TARGET_thumb_CFLAGS := $(TARGET_arm_CFLAGS)
endif
to:
Code:
ifeq ($(ARCH_ARM_HAVE_THUMB_SUPPORT),true)
ifeq ($(TARGET_USE_O3),true)
TARGET_thumb_CFLAGS := -mthumb \
-O3 \
-fomit-frame-pointer \
-fno-strict-aliasing \
-fno-tree-vectorize
else
TARGET_thumb_CFLAGS := -mthumb \
-O3 \
-fomit-frame-pointer \
-fno-strict-aliasing \
-fno-tree-vectorize
endif
else
TARGET_thumb_CFLAGS := $(TARGET_arm_CFLAGS)
endif
^^ Make any of these changes prior to building
to build with GCC 4.9, go to build/core/config.mk and find TARGET_GCC_VERSION := 4.7, change it to 4.9
to get linaro, download this: http://releases.linaro.org/13.04/co...13.04-2-2013-04-13_12-08-43-linux-x86.tar.bz2
then change the folders name to 'linaro'
move it to prebuilts/gcc/linux-x86
then, to build..
Code:
. build/envsetup.sh
croot
brunch device -j(2, 4, 8, 16, or 32, your choice)
*Note: Because CCACHE is enabled, it will take a while for your first build to complete. ~2-5 hours
Hope this helps!
Reserved! Just in case
repo sync -j16 (or -j8, or -j32.. whichever you want)
What's the difference between them. Trying to build for toro wondering which one I should use, thanks
RoyJ said:
repo sync -j16 (or -j8, or -j32.. whichever you want)
What's the difference between them. Trying to build for toro wondering which one I should use, thanks
Click to expand...
Click to collapse
How many threads of each core is used
Sent from my Galaxy Nexus using xda premium
if you have a 4x cpu you can go for -j8\-k16 and so on.i always used -j16 in the past,now it's big time i don't anything.
Great 3ad kyler,you explain all very well,especially the toolchain part rather that other guides out there.I stopped build for myself some months ago,but definetly a good howto for who have time and effort to try.
^__^
If you change TARGET_GCC_VERSION to 4.9... You'll need to wget Linaro 4.9.. No?
Sent from my Nexus
bk201doesntexist said:
If you change TARGET_GCC_VERSION to 4.9... You'll need to wget Linaro 4.9.. No?
Sent from my Nexus
Click to expand...
Click to collapse
Not to my knowledge. Xylon uses Sabermods toolchain
Great guide! Thanks!!
MisterSprinkles said:
Great guide! Thanks!!
Click to expand...
Click to collapse
Thank you!
Sent from my Galaxy Nexus using xda premium
should I dl the CCATCH separately? and what about ccatch.log? how to address that?
frost866 said:
should I dl the CCATCH separately? and what about ccatch.log? how to address that?
Click to expand...
Click to collapse
Yeah, and just call it in your bashrc
Sent from my Galaxy Nexus using xda premium
Awesome guide!!!! It helped me a lot!
Thanks!!!
pguizeline said:
Awesome guide!!!! It helped me a lot!
Thanks!!!
Click to expand...
Click to collapse
:good:
Sent from my Galaxy Nexus using xda premium
quick question why dont we use full 4.9 like what Daxx done in his maguro UKG build ?
-Jesco- said:
quick question why dont we use full 4.9 like what Daxx done in his maguro UKG build ?
Click to expand...
Click to collapse
I do
Sent from my Galaxy Nexus using xda premium
Nice guide thanks!
Can you pls. tell me how much space will the "sources" occupy during/after the first sync-up? Although am on unlimited broadband, would like to know this. I read in one of the threads (about CM 10.1 sources sync-up) that it is about 40GB. Is this right?
pmbabu said:
Nice guide thanks!
Can you pls. tell me how much space will the "sources" occupy during/after the first sync-up? Although am on unlimited broadband, would like to know this. I read in one of the threads (about CM 10.1 sources sync-up) that it is about 40GB. Is this right?
Click to expand...
Click to collapse
20-40GB
Sent from my Galaxy Nexus using xda premium
I just tried to self-compile a xyUltimatum build and I used the SaberMod GCC 4.9 toolchain since there's not a 4.9 of Linaro out yet and got an error related to the compiler itself.
Code:
external/aac/libAACenc/src/aacenc_tns.cpp: In function 'INT FDKaacEnc_TnsEncode(TNS_INFO*, TNS_DATA*, INT, const TNS_CONFIG*, INT, FIXP_DBL*, INT, INT)':
external/aac/libAACenc/src/aacenc_tns.cpp:1004:5: error: definition in block 48 follows the use
INT FDKaacEnc_TnsEncode(
^
for SSA_NAME: value_155 in statement:
# DEBUG D#405 => MAX_EXPR <value_155, _111>
external/aac/libAACenc/src/aacenc_tns.cpp:1004:5: internal compiler error: verify_ssa failed
0xc2358c verify_ssa(bool)
../.././../gcc/gcc-SaberMod/gcc/tree-ssa.c:1046
0x9f66e2 execute_function_todo
../.././../gcc/gcc-SaberMod/gcc/passes.c:1970
0x9f704d execute_todo
../.././../gcc/gcc-SaberMod/gcc/passes.c:2002
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [/home/kemikalelite/android/out/target/product/maguro/obj/STATIC_LIBRARIES/libFraunhoferAAC_intermediates/libAACenc/src/aacenc_tns.o] Error 1
Since the ROM and toolchain are from two different sources I'm not sure if it was caused by something with the ROM's source or if its just caused from a bug in the toolchain and whether or not it should be reported to the Saber dev.
KemikalElite said:
I just tried to self-compile a xyUltimatum build and I used the SaberMod GCC 4.9 toolchain since there's not a 4.9 of Linaro out yet and got an error related to the compiler itself.
Code:
external/aac/libAACenc/src/aacenc_tns.cpp: In function 'INT FDKaacEnc_TnsEncode(TNS_INFO*, TNS_DATA*, INT, const TNS_CONFIG*, INT, FIXP_DBL*, INT, INT)':
external/aac/libAACenc/src/aacenc_tns.cpp:1004:5: error: definition in block 48 follows the use
INT FDKaacEnc_TnsEncode(
^
for SSA_NAME: value_155 in statement:
# DEBUG D#405 => MAX_EXPR <value_155, _111>
external/aac/libAACenc/src/aacenc_tns.cpp:1004:5: internal compiler error: verify_ssa failed
0xc2358c verify_ssa(bool)
../.././../gcc/gcc-SaberMod/gcc/tree-ssa.c:1046
0x9f66e2 execute_function_todo
../.././../gcc/gcc-SaberMod/gcc/passes.c:1970
0x9f704d execute_todo
../.././../gcc/gcc-SaberMod/gcc/passes.c:2002
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [/home/kemikalelite/android/out/target/product/maguro/obj/STATIC_LIBRARIES/libFraunhoferAAC_intermediates/libAACenc/src/aacenc_tns.o] Error 1
Since the ROM and toolchain are from two different sources I'm not sure if it was caused by something with the ROM's source or if its just caused from a bug in the toolchain and whether or not it should be reported to the Saber dev.
Click to expand...
Click to collapse
I'd submit a bug report
Sent from my Galaxy Nexus using xda premium
Wow Tapatalk must really be messing up. Every time I post in the other thread the reply automatically redirects here. Enough Fail Posting for one day.
Error Post Please Delete.

[Guide] Step by step instructions for building AOKP 6.0 for the T-Mobile Galaxy S4!

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Step by step instructions for building AOKP 6.0 for the T-Mobile variant of the Samsung Galaxy S4
I have noticed that the build instructions on the AOKP website are a bit outdated. They date back to JellyBean. I would like to encourage other users to build more custom roms, and I thought that it would help if I show how to build one of the roms wich compiled successfully for me (Praise God!). It is my hope that these instructions are clear and easy to follow. Hey, if I can do it, anybody can do it!
<<<<< Step 1: Setup your system. >>>>>​
To be honest, this can be the most daunting part, because if you do not set this up properly, it just will not work. I use Ubuntu 14.04 on a HP Compaq 6715b laptop. I know, not a very ideal compiler, but it is what I've got. Here are the suggested packages, just open a terminal and paste this in:
Code:
$ sudo apt-get install bison build-essential bzip2 curl dpkg-dev flex g++-multilib git git-review gnupg gperf lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev openjdk-7-jdk libbz2-1.0 libbz2-dev libc6-dev libghc-bzlib-dev libgl1-mesa-dev libgl1-mesa-glx:i386 libncurses5-dev libreadline6-dev libreadline6-dev:i386 libx11-dev:i386 libxml2-utils lzop maven pngcrush pngquant python-markdown schedtool squashfs-tools tofrodos x11proto-core-dev xsltproc zip zlib1g-dev zlib1g-dev:i386
This will take a while. Once it is done, do this:
Code:
$ mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
$ gedit ~/.bashrc
Now you should see gedit open up your .bashrc file, to which you should add this at the very end, and save it:
Code:
export PATH=~/bin:$PATH
Now you need to close your terminal and open a new one to get the PATH variables to stick. Actually, it wouldn't hurt to reboot your system after installing all of those programs we just installed. Your computer should now be primed and ready to go.
<<<<< Step 2: Download the source. >>>>>​
Here is a very short project for you that takes the computer a long time to complete. Open a terminal and start typing:
Code:
$ cd ~
$ mkdir aokp6
$ cd aokp6
$ repo init -u https://github.com/AOKP/platform_manifest.git -b mm
$ repo sync
You can now go outside, play with the kids, phone a friend, and then go to bed. When you awake the next morning, this might be done, depending on your internet connection!
<<<<< Step 3: Adding the device, kernel, and vendor trees. >>>>>​
In some cases, you can simply type the command
Code:
$ breakfast
and just choose your device, but at this time, the AOKP repository did not include a current device tree for the JFLTETMO phone, so we need to download one. I chose to test out the Dirty Unicorn JFLTETMO devices trees, by going here and choosing to download the zips. Later, perhaps we can learn about adding them as dependencies, but here are the links, be sure to choose the 6.0 branches and click the download button to download the zips:
https://github.com/DirtyUnicorns/android_device_samsung_jfltetmo
https://github.com/DirtyUnicorns/android_kernel_samsung_jf
https://github.com/DirtyUnicorns/android_device_samsung_jf-common
https://github.com/DirtyUnicorns/android_device_samsung_jflte
https://github.com/DirtyUnicorns/android_device_samsung_msm8960-common
https://github.com/DirtyUnicorns/android_device_samsung_qcom-common
https://github.com/TheMuppets/proprietary_vendor_samsung/tree/cm-13.0
Once you have downloaded them, unzip each one and rename them:
android_device_samsung_jfltetmo - jfltetmo
android_device_samsung_jf-common - jf-common
android_device_samsung_jflte - jflte
android_device_samsung_msm8960-common - msm8960-common
android_device_samsung_qcom-common - qcom-common
Go to you aokp6/device folder and create a folder called "samsung". Now put the above folders into it.
Then unzip the kernel_samsung_jf folder and rename it "jf". Go to the aokp6 folder and create a folder called "kernel", go into the kernel folder and make a new folder called "samsung", enter that folder, and put your "jf" folder here. Don't worry, we are almost done.
Now go to your aokp6/vendor folder. Create a new folder called "samsung". Enter the samsung folder and copy the contents of your unzipped proprietary_vendor_samsung folder. This should be a bunch of folders like jf-gsm-common, jf-common, etc. You actually don't need all of these folders right now, but it will not hurt to have them, and there are two folders in there that you need.
Now you should probably take a break before going on to the next step!
<<<<< Step 4: Editing the device, kernel, and vendor trees. >>>>>​
Now, go to the device/samsung/jfltetmo folder and rename du.mk to aokp.mk and edit it as follows:
Code:
$(call inherit-product, device/samsung/jfltetmo/full_jfltetmo.mk)
# Enhanced NFC
$(call inherit-product, vendor/aokp/configs/nfc_enhanced.mk)
# Inherit some common DU stuff.
$(call inherit-product, vendor/aokp/configs/common_full_phone.mk)
PRODUCT_BUILD_PROP_OVERRIDES += \
PRODUCT_NAME=jfltetmo \
TARGET_DEVICE=jfltetmo \
BUILD_FINGERPRINT="samsung/jfltetmo/jfltetmo:4.4.4/KTU84P/M919UVUFNK2:user/release-keys" \
PRIVATE_BUILD_DESC="jfltetmo-user 4.4.4 KTU84P M919UVUFNK2 release-keys"
PRODUCT_NAME := aokp_jfltetmo
PRODUCT_DEVICE := jfltetmo
NOTE: the original file said "vendor/du/config/*" you must change it to "configs" or there will be an error!
Then, in the jfltetmo folder, delete the cm.dependencies file. Do the same deletion in all of the device/samsung/* directories. You don't want to download CM dependencies, because you already have them here.
Note: Because repositories are constantly updated, I can only garuntee that this will work based on the files as they were the day of this writing. However, with all of this in place, if you follow this guide, it should work realatively the same as what happened for me.
You can actually just run the compiler right now, however, you will have several stop errors that we plan to address here before you do that. All of these edits are due to errors that cropped up when running the compiler.
The first error was relating to libhealthd. Android and AOKP source already has a built in libhealthd for the qcom motherboards, and it is a duplication of efforts (which causes an error) to have both the device tree libhealthd and the source libhealthd. So here is how we fix it. Now, go to the device/samsung/qcom-common/libhealthd folder, and make the following changes to the Android.mk file:
Code:
# WJH LOCAL_PATH := $(call my-dir)
# WJH include $(CLEAR_VARS)
# WJH LOCAL_SRC_FILES := healthd_board_default.cpp
# WJH LOCAL_MODULE := libhealthd.qcom
# WJH LOCAL_C_INCLUDES := system/core/healthd bootable/recovery
# WJH include $(BUILD_STATIC_LIBRARY)
Another error that will crop up if you run the compiler now, is that your multi-media video will have a problem setting the picture order, and the compiler will get confused and stop with an error. So we can fix that here before we begin. We need to edit one of the hardware files. Go to hardware/qcom/media-caf/msm8960/mm-video/vidc/venc/src, and edit the video_encoder_device.cpp file as follows (this is the last few lines of the file):
Code:
bool venc_dev::venc_set_picture_order_count_type(OMX_U32 type)
{
// WJH venc_poctype temp;
// WJH venc_ioctl_msg ioctl_msg = {&temp, NULL};
// WJH temp.poc_type = type;
// WJH DEBUG_PRINT_HIGH("Setting poc type: %d", type);
// WJH if(ioctl(m_nDriver_fd, VEN_IOCTL_SET_PIC_ORDER_CNT_TYPE, (void *)&ioctl_msg) < 0)
// WJH {
// WJH DEBUG_PRINT_ERROR("Request for setting poc type failed");
// WJH return false;
// WJH }
return true;
}
And finaly, there is an error that will pop up and stop your compiler because of a conflict over the "ambientIsAvailable" portion of this file: packages/apps/InCallUI/src/com/android/incallui/ModButtonPresenter.java at line 404. So we will just go ahead and edit it here before we begin.
Code:
final boolean showNote = isProvisioned &&
// WJH DeepLinkIntegrationManager.getInstance().ambientIsAvailable(getUi().getContext()) &&
mNoteDeepLink != null;
Now that all of the hard work is done, it is time to actually build something!
<<<<< Step 5: Start your build! >>>>>​
Phew! You have invested a lot of hours into this project, now it is time to actually put those files and time to use! Open up a terminal in your aokp6 folder and start typing:
Code:
aokp6$ . build/envsetup.sh
Which will output something like this:
Code:
including vendor/aokp/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/aokp/bash_completion/git.bash
including vendor/aokp/bash_completion/repo.bash
Now type:
Code:
aokp6$ brunch jfltetmo
Which will start the long build process, it will output this:
Code:
including vendor/aokp/vendorsetup.sh
Got local manifest
Got local manifest
Checked dependency tree over :
NO_DEPS: device/*/jfltetmo
============================================
PLATFORM_VERSION_CODENAME = REL
PLATFORM_VERSION = 6.0.1
AOKP_VERSION = aokp_jfltetmo_mm_unofficial_2016-06-20_1015
TARGET_PRODUCT = aokp_jfltetmo
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-73-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE = release
BUILD_ID = MOB30J
OUT_DIR = /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out
============================================
And this:
Code:
.....edited for space.....
Import includes file: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/import_includes
host C: libhost <= build/libs/host/CopyFile.c
build/libs/host/CopyFile.c:86:43: warning: unused parameter 'pSrcStat' [-Wunused-parameter]
static bool isSameFile(const struct stat* pSrcStat, const struct stat* pDstStat)
^
build/libs/host/CopyFile.c:86:72: warning: unused parameter 'pDstStat' [-Wunused-parameter]
static bool isSameFile(const struct stat* pSrcStat, const struct stat* pDstStat)
^
build/libs/host/CopyFile.c:104:42: warning: unused parameter 'src' [-Wunused-parameter]
static void printNotNewerMsg(const char* src, const char* dst, unsigned int options)
^
build/libs/host/CopyFile.c:531:69: warning: unused parameter 'isCmdLine' [-Wunused-parameter]
static int copyFileRecursive(const char* src, const char* dst, bool isCmdLine, unsigned int options)
.....edited for space..... Stuff like this will scroll by .....
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/jfltetmo/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_LOG.c
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/jfltetmo/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_MASQUERADE.c
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/jfltetmo/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_MIRROR.c
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/jfltetmo/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_NETMAP.c
target StaticLib: libip4tc (/home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/jfltetmo/obj/STATIC_LIBRARIES/libip4tc_intermediates/libip4tc.a)
target thumb C++: keystore <= system/security/keystore/keystore.cpp
target thumb C++: keystore <= system/security/keystore/keyblob_utils.cpp
target thumb C++: keystore <= system/security/keystore/operation.cpp
.....edited for space.....
Notice that there were some "warning" flags in there. Warnings are not all bad, but they can be. In this case it works out okay. Hopefully, after many hours, you should see this:
Code:
______ _____ __ __ _____
/\ _ \/\ __`\/\ \/\ \ /\ _ `\
\ \ \L\ \ \ \/\ \ \ \/'/'\ \ \L\ \
\ \ __ \ \ \ \ \ \ , < \ \ ,__/
\ \ \/\ \ \ \_\ \ \ \\`\ \ \ \/
\ \_\ \_\ \_____\ \_\ \_\\ \_\
\/_/\/_/\/_____/\/_/\/_/ \/_/
===========-Package complete-===========
zip: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/jfltetmo/aokp_jfltetmo_mm_unofficial_2016-06-19_0149.zip
md5: 46bc18249c61988e75aba813464692a3
size: 320M
========================================
Success! Praise God! Now you can put this on your phone and test it out! Hopefully everything will be working! For future use, now you can start making changes or edits, from backgrounds to kernels! Have fun and make lots of backups. Remember, sometimes it is really hard to undo a change that you make.
Hopefully we learned how to set up our system, get the source, add devices and kernels that are not in the source, make proper edits, and run the compiler. Like I said, this works on my machine, as of this writing. You may notice, that if you make this build, it will not be identical to the one that I have posted on XDA. That is because I have made a few edits, additions, and/or subtractions here and there. That is the great thing about Android and open source! It is now up to you to make it better, to make it unique, or to make it you. Good luck with those builds, and be sure to share and help the next guy or gal with their projects too!
Linux - keep it simple.

Categories

Resources