[TUTORIAL]Compile Xperia Z ROM with Linaro including O3 strict-aliasing optimizations - Xperia Z Android Development

First of all, many thanks to @trailblazerz11 for bringing full Linaro ROM to our fellow S4 Pro devices like Nexus 4 with resourceful build guide. This guide is based on his repository with my own fixes that needed to be done outside his repository. This works fine on CM10.1 and should also work on AOSP as well with manual fixes applied. As current AOSP being incompetent, I'll leave that until it actually works without relying on CM10.1 patches.
Features
1. Replace stock kernel and recovery with @jeroenqui's MEOW-kernel and TWRP recovery. (Optional)
2. Replace Google toolchains for arm/linux with Linaro 4.8 ones from Mustaavalkosta's github
3. Apply build configuration with Linaro suggested optimizations “-O3 -pipe -Wl,--hash-style=gnu -fno-tree-vectorize -fstrict-aliasing -Wstrict-aliasing=2 -Werror=strict-aliasing”
4. Fix codes breaking strict aliasing rules
5. Comes in form of automate shell script, the easiest Linaro build guide EVER
Requirements:
1. CM10.2 build environment - You can check on Build for yuga wiki for detailed instructions.
2. Oracle Java - Skip OpenJDK in wiki and install better ones from this link including adb and fastboot.
3. You need to install additional packages for compiling kernel. Type "sudo apt-get install lzop ccache" so that build kernel won't break mid-way.
4. Make sure your default compiled ROM works without trouble as I got boot problems before and thought Linaro messed it.
Instructions:
1. Open terminal and go to your Android git repository.
2. Modify local manifests for jeroenqui’s kernel and TWRP by typing “gedit .repo/local_manifests/roomservice.xml” and hit enter. Added the following lines before '</manifest>'.
Code:
<project name="Mustaavalkosta/android_prebuilts_gcc_linux-x86_arm_arm-eabi-4.8.git" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" remote="github" revision="master"/>
<project name="Mustaavalkosta/android_prebuilts_gcc_linux-x86_arm_arm-linux-androideabi-4.8.git" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" remote="github" revision="master"/>
#Add this if you want to use MEOW-kernel (You can use others if you want at your own risk)
<remove-project name="CyanogenMod/android_kernel_sony_apq8064" />
<project name="MEOW-kernel/android_kernel_sony_apq8064" path="kernel/sony/apq8064" remote="github" />
#Add this if you want to use TWRP
<remove-project name="CyanogenMod/android_bootable_recovery" />
<project name="TeamWin/Team-Win-Recovery-Project.git" path="bootable/recovery" remote="github" revision="twrp2.7"/>
3. Download Linaro NDK package in tar.gz format and place in Android git repository
3. Make linaro patch script by typing "gedit linaro_patch.sh" and hit enter. Put contents inside with this ones and save then exit.
Code:
#!/bin/bash
#Windows X's CM10.2 Linaro patch for Xperia Z
DIR=$(pwd)
#Linaro NDK files extraction (change 'android-ndk-r9-linaro-linux-x86_64.tar.bz2' and 'android-ndk-r9-linaro' to match what you place before)
cd $DIR
tar -vxf android-ndk-r9-linaro-linux-x86_64.tar.bz2
rm android-ndk-r9-linaro-linux-x86_64.tar.bz2
cp -f ndk/Android.mk android-ndk-r9-linaro/
cp -f ndk/CleanSpec.mk android-ndk-r9-linaro/
rm -r -f ndk
mv android-ndk-r9-linaro ndk
cd $DIR/build
git fetch https://github.com/WindowsX/android_build.git cm-10.2 && git cherry-pick ec9e3eea9cb1dc1929e45736f0608a888f97eb0f
git fetch https://github.com/WindowsX/android_build.git cm-10.2 && git cherry-pick 43ee5fdfaa404e474372072a8bd85ea613646861
git fetch https://github.com/Mustaavalkosta/android_build.git && git cherry-pick ffcaf82831783a420a5490e9894c016644e79743
cd $DIR/kernel/sony/apq8064
git fetch https://github.com/WindowsX/android_kernel_sony_apq8064.git cm-10.2 && git cherry-pick 71a48e15f0066e72b401d92afca7dd8b45efac1b
git fetch https://github.com/WindowsX/android_kernel_sony_apq8064.git cm-10.2 && git cherry-pick e748106f0ffcad5376e76b336dea287c493977dc
git fetch https://github.com/WindowsX/android_kernel_sony_apq8064.git cm-10.2 && git cherry-pick 7beb0a0de015a204745a46d03d7a1ca36775c5e8
git fetch https://github.com/WindowsX/android_kernel_sony_apq8064.git cm-10.2 && git cherry-pick bf46e6bc58141778af27bd49f0093a52df141aba
#Uncomment the following commit if you use original CM kernel
#git fetch https://github.com/WindowsX/android_kernel_sony_apq8064.git cm-10.2 && git cherry-pick 3c8432deaaf673b3dfd0673d8000a3d068001926
#TWRP Recovery Linaro fix (Comment these out if you stick with default CWM Recovery)
cd $DIR/bootable/recovery/
git fetch https://github.com/WindowsX/Team-Win-Recovery-Project.git && git cherry-pick fc866246fe05d743ac5917ee44dbdffe1f620714
git fetch https://github.com/WindowsX/Team-Win-Recovery-Project.git && git cherry-pick 4e0cc5ba0b883413834a81d32d9501a802022053
cd $DIR/device/sony/fusion3-common
git fetch https://github.com/jeroenqui/android_device_sony_fusion3-common.git && git cherry-pick fab74e8c2faa8e2afc405b44c7233d7e32ba96dd
cd $DIR/bionic
git fetch https://github.com/WindowsX/android_bionic.git cm-10.2 && git cherry-pick f607f6c8129eb41c602451b6bfe39be6d734d799
cd $DIR/device/generic/goldfish
git fetch https://github.com/WindowsX/android_device_generic_goldfish.git cm-10.2 && git cherry-pick f21fa86fcea62580a7d1ea3e32df168628517a82
cd $DIR/external/bash
git fetch https://github.com/SaberMod/android_external_bash.git && git cherry-pick d746365ea911c73ede17ed65933237875e29d9c3
cd $DIR/external/clang
git fetch https://github.com/WindowsX/android_external_clang.git && git cherry-pick 81d67da93bd3afa9ce7f5064562ddb0c91ba0a0c
cd $DIR/external/dnsmasq/
git fetch https://github.com/trailblazerz/android_external_dnsmasq.git && git cherry-pick 446fceadb803f8c28de809907d55dfab82e9827f
cd $DIR/external/e2fsprogs/
git fetch https://github.com/trailblazerz/android_external_e2fsprogs.git && git cherry-pick 0e540a3cf8c4dd22205ef39a6f9d6edfa0d1183a
cd $DIR/external/openssh/
git fetch https://github.com/WindowsX/android_external_openssh.git cm-10.2 && git cherry-pick bddb1dd7b9d594913061cdb6b2cd8bf77d047186
cd $DIR/external/openssl/
git fetch https://github.com/trailblazerz/android_external_openssl.git && git cherry-pick b43b3c2935e8f27b74c53be2f67fe49f3a515228
cd $DIR/external/ping/
git fetch https://github.com/WindowsX/android_external_ping.git cm-10.2 && git cherry-pick 46fb65c7a1c4b8b95b7b4b78fa10a1d4139f8339
cd $DIR/external/ping6/
git fetch https://github.com/WindowsX/android_external_ping6.git cm-10.2 && git cherry-pick 5f093083b78433b6056a532b39dc7e3d83330690
cd $DIR/external/skia
git fetch https://github.com/WindowsX/android_external_skia.git cm-10.2 && git cherry-pick 8000ce63239c673aacc905aeb48e357d07aca533
cd $DIR/external/stlport/
git fetch https://github.com/trailblazerz/android_external_stlport.git && git cherry-pick 05c206e22eddf9d09b3c497721a94aa23b922811
cd $DIR/frameworks/av/
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick 8e10843ad4902943e50a7f4d23194319a78668ef
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick 5735647d6c70660d20cf16ee5346159c345ad648
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick d67b1fa60b2680e731a6683968856ef91362b1b3
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick b5973bd61fa55ec7693103036fd618234e1ae4f7
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick 2b7cd9fa973e829cc8a4842376280d01b3e9a487
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick f1a15bce88881376c6f88546b9e698cdcd19732b
cd $DIR/frameworks/base/
git fetch https://github.com/WindowsX/android_frameworks_base.git cm-10.2 && git cherry-pick 937e6f24e503ca9fa203044a584b158edcc7840f
cd $DIR/frameworks/ex/
git fetch https://github.com/trailblazerz/android_frameworks_ex.git && git cherry-pick aa5da9c8956f09072bb9e783dee2a67798663bb6
cd $DIR/frameworks/native/
git fetch https://github.com/WindowsX/android_frameworks_native.git cm-10.2 && git cherry-pick 8b555aaaceee3ff422d239596c2f132329e80d7d
cd $DIR/frameworks/opt/net/voip
git fetch https://github.com/WindowsX/android_frameworks_opt_net_voip.git cm-10.2 && git cherry-pick 33f09279eaf8577753fc855611290acd29852b94
cd $DIR/frameworks/wilhelm/
git fetch https://github.com/trailblazerz/android_frameworks_wilhelm.git && git cherry-pick 07251f657bb21080ab96093dc5275b37589bbf37
git fetch https://github.com/trailblazerz/android_frameworks_wilhelm.git && git cherry-pick 48cc6405503668dc38b4713a98e08d1174b2340c
cd $DIR/hardware/qcom/media-caf
git fetch https://github.com/WindowsX/android_hardware_qcom_media-caf.git && git cherry-pick 4d64d4a65f4c04bce4ef3e373681337b967d4fb9
cd $DIR/external/chromium
git fetch https://github.com/WindowsX/android_external_chromium.git cm-10.2 && git cherry-pick 9631db924123e44ae0170aa4c52c122928a26b3b
cd $DIR/libcore
git fetch https://github.com/trailblazerz/android_libcore.git && git cherry-pick 40617f103bf38e61c43edee4c4ecbc2ea4aaedea
cd $DIR/external/webkit/
git fetch https://github.com/trailblazerz/android_external_webkit.git && git cherry-pick bb873522bc0ed7a4aaa3552527872ece198db104
cd $DIR/external/lsof/
git fetch https://github.com/trailblazerz/android_external_lsof.git && git cherry-pick 8a0665c786f53019acbcd28dfed8a5781bc3471e
cd $DIR/external/openvpn/
git fetch https://github.com/trailblazerz/android_external_openvpn.git && git cherry-pick b2cec9e8bd24ce3340fd23473b14258d063d580d
cd $DIR/system/qcom
git fetch https://github.com/WindowsX/android_system_qcom.git cm-10.2 && git cherry-pick ea84d6aab1b5011e6ae4f9ad938733c8af3d5c5e
This will replace Google NDK with Linaro ones and patch build configuration and codes that break strict aliasing rules.
4. Make Linaro patch executable by typing "chmod a+x linaro_patch.sh" and enter.
5. Re-sync again by typing "repo sync" and enter. It will take a while for downloading new toolchains.
6. Apply Linaro patches by typing "./linaro_patch.sh" and enter. All should goes well but keep your eyes on each patch and see if there's anything failed to cherry-pick or not. Fix those failed to cherry-pick yourself and move on.
7. Reload build configuration by typing "source build/envsetup.sh" and enter.
8. Your ROM is ready be cooked with Linaro now. Build it with whatever method you prefer and enjoy.
Credits
trailblazerz11 - For his Linaro ROM for Nexus 4 and resourceful guide making Linaro Yuga implementations a lot easier.
DooMLorD - for his awesome DooMKernel tweaks. My Xperia Z won't be so lovely as today without his tweaks, seriously.
jeroenqui - for his helpful effort to port DooMKernel tweaks into CM10.1.
TeamWin - for awesome recovery system.
Mustaavalkosta - For his 4.8 toolchains and commits
And don't forget to press thanks if you find this tutorial helpful

Hey mate, awesome to see that you made it eventually! Respect, nice job done!
Thanks a lot for the guide!

UPDATE #1: CM10.1 has changed build configuration to use qcom_media-caf instead so I fixed instructions and change stuff for default CM10.1 environment.

Updated #2: Added Linaro cortex string handling routines optimizations and fuse fix and change twrp to version 2.6.

Updated #3: Fixed TWRP's duplicated fuse model with CM10.1.2 and cherry-pick failed in linux-perf-tools with OS X 10.9 fixes. You can use this to on CM10.1.2 without trouble now.

Updated #4: Fixed TWRP 2.6 being gone and cherry picking cortex string optimizations from different branch.

It took me a while as things keep changing back and forth with CM10.2. Since CM10.2 has tons of bionic optimizations, I decided to leave cortex string optimizations for time being and added latest 4.8 toolchains for arm/linux and its own NDK. TWRP and jeroenqui's kernel are included as usual.

JESUS
Windows X said:
First of all, many thanks to @trailblazerz11 for bringing full Linaro ROM to our fellow S4 Pro devices like Nexus 4 with resourceful build guide. This guide is based on his repository with my own fixes that needed to be done outside his repository. This works fine on CM10.1 and should also work on AOSP as well with manual fixes applied. As current AOSP being incompetent, I'll leave that until it actually works without relying on CM10.1 patches.
Features
1. Replace stock kernel and recovery with @jeroenqui's MEOW-kernel and TWRP recovery. (Optional)
2. Replace Google toolchains for arm/linux with Linaro 4.8 ones from Mustaavalkosta's github
3. Apply build configuration with Linaro suggested optimizations “-O3 -pipe -Wl,--hash-style=gnu -fno-tree-vectorize -fstrict-aliasing -Wstrict-aliasing=2 -Werror=strict-aliasing”
4. Fix codes breaking strict aliasing rules
5. Comes in form of automate shell script, the easiest Linaro build guide EVER
Requirements:
1. CM10.2 build environment - You can check on Build for yuga wiki for detailed instructions.
2. Oracle Java - Skip OpenJDK in wiki and install better ones from this link including adb and fastboot.
3. You need to install additional packages for compiling kernel. Type "sudo apt-get install lzop ccache" so that build kernel won't break mid-way.
4. Make sure your default compiled ROM works without trouble as I got boot problems before and thought Linaro messed it.
Instructions:
1. Open terminal and go to your Android git repository.
2. Modify local manifests for jeroenqui’s kernel and TWRP by typing “gedit .repo/local_manifests/roomservice.xml” and hit enter. Added the following lines before '</manifest>'.
Code:
<project name="Mustaavalkosta/android_prebuilts_gcc_linux-x86_arm_arm-eabi-4.8.git" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" remote="github" revision="master"/>
<project name="Mustaavalkosta/android_prebuilts_gcc_linux-x86_arm_arm-linux-androideabi-4.8.git" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" remote="github" revision="master"/>
#Add this if you want to use MEOW-kernel (You can use others if you want at your own risk)
<remove-project name="CyanogenMod/android_kernel_sony_apq8064" />
<project name="MEOW-kernel/android_kernel_sony_apq8064" path="kernel/sony/apq8064" remote="github" />
#Add this if you want to use TWRP
<remove-project name="CyanogenMod/android_bootable_recovery" />
<project name="TeamWin/Team-Win-Recovery-Project.git" path="bootable/recovery" remote="github" revision="twrp2.7"/>
3. Download Linaro NDK package in tar.gz format and place in Android git repository
3. Make linaro patch script by typing "gedit linaro_patch.sh" and hit enter. Put contents inside with this ones and save then exit.
Code:
#!/bin/bash
#Windows X's CM10.2 Linaro patch for Xperia Z
DIR=$(pwd)
#Linaro NDK files extraction (change 'android-ndk-r9-linaro-linux-x86_64.tar.bz2' and 'android-ndk-r9-linaro' to match what you place before)
cd $DIR
tar -vxf android-ndk-r9-linaro-linux-x86_64.tar.bz2
rm android-ndk-r9-linaro-linux-x86_64.tar.bz2
cp -f ndk/Android.mk android-ndk-r9-linaro/
cp -f ndk/CleanSpec.mk android-ndk-r9-linaro/
rm -r -f ndk
mv android-ndk-r9-linaro ndk
cd $DIR/build
git fetch https://github.com/WindowsX/android_build.git cm-10.2 && git cherry-pick ec9e3eea9cb1dc1929e45736f0608a888f97eb0f
git fetch https://github.com/WindowsX/android_build.git cm-10.2 && git cherry-pick 43ee5fdfaa404e474372072a8bd85ea613646861
git fetch https://github.com/Mustaavalkosta/android_build.git && git cherry-pick ffcaf82831783a420a5490e9894c016644e79743
cd $DIR/kernel/sony/apq8064
git fetch https://github.com/WindowsX/android_kernel_sony_apq8064.git cm-10.2 && git cherry-pick 71a48e15f0066e72b401d92afca7dd8b45efac1b
git fetch https://github.com/WindowsX/android_kernel_sony_apq8064.git cm-10.2 && git cherry-pick e748106f0ffcad5376e76b336dea287c493977dc
git fetch https://github.com/WindowsX/android_kernel_sony_apq8064.git cm-10.2 && git cherry-pick 7beb0a0de015a204745a46d03d7a1ca36775c5e8
git fetch https://github.com/WindowsX/android_kernel_sony_apq8064.git cm-10.2 && git cherry-pick bf46e6bc58141778af27bd49f0093a52df141aba
#Uncomment the following commit if you use original CM kernel
#git fetch https://github.com/WindowsX/android_kernel_sony_apq8064.git cm-10.2 && git cherry-pick 3c8432deaaf673b3dfd0673d8000a3d068001926
#TWRP Recovery Linaro fix (Comment these out if you stick with default CWM Recovery)
cd $DIR/bootable/recovery/
git fetch https://github.com/WindowsX/Team-Win-Recovery-Project.git && git cherry-pick fc866246fe05d743ac5917ee44dbdffe1f620714
git fetch https://github.com/WindowsX/Team-Win-Recovery-Project.git && git cherry-pick 4e0cc5ba0b883413834a81d32d9501a802022053
cd $DIR/device/sony/fusion3-common
git fetch https://github.com/jeroenqui/android_device_sony_fusion3-common.git && git cherry-pick fab74e8c2faa8e2afc405b44c7233d7e32ba96dd
cd $DIR/bionic
git fetch https://github.com/WindowsX/android_bionic.git cm-10.2 && git cherry-pick f607f6c8129eb41c602451b6bfe39be6d734d799
cd $DIR/device/generic/goldfish
git fetch https://github.com/WindowsX/android_device_generic_goldfish.git cm-10.2 && git cherry-pick f21fa86fcea62580a7d1ea3e32df168628517a82
cd $DIR/external/bash
git fetch https://github.com/SaberMod/android_external_bash.git && git cherry-pick d746365ea911c73ede17ed65933237875e29d9c3
cd $DIR/external/clang
git fetch https://github.com/WindowsX/android_external_clang.git && git cherry-pick 81d67da93bd3afa9ce7f5064562ddb0c91ba0a0c
cd $DIR/external/dnsmasq/
git fetch https://github.com/trailblazerz/android_external_dnsmasq.git && git cherry-pick 446fceadb803f8c28de809907d55dfab82e9827f
cd $DIR/external/e2fsprogs/
git fetch https://github.com/trailblazerz/android_external_e2fsprogs.git && git cherry-pick 0e540a3cf8c4dd22205ef39a6f9d6edfa0d1183a
cd $DIR/external/openssh/
git fetch https://github.com/WindowsX/android_external_openssh.git cm-10.2 && git cherry-pick bddb1dd7b9d594913061cdb6b2cd8bf77d047186
cd $DIR/external/openssl/
git fetch https://github.com/trailblazerz/android_external_openssl.git && git cherry-pick b43b3c2935e8f27b74c53be2f67fe49f3a515228
cd $DIR/external/ping/
git fetch https://github.com/WindowsX/android_external_ping.git cm-10.2 && git cherry-pick 46fb65c7a1c4b8b95b7b4b78fa10a1d4139f8339
cd $DIR/external/ping6/
git fetch https://github.com/WindowsX/android_external_ping6.git cm-10.2 && git cherry-pick 5f093083b78433b6056a532b39dc7e3d83330690
cd $DIR/external/skia
git fetch https://github.com/WindowsX/android_external_skia.git cm-10.2 && git cherry-pick 8000ce63239c673aacc905aeb48e357d07aca533
cd $DIR/external/stlport/
git fetch https://github.com/trailblazerz/android_external_stlport.git && git cherry-pick 05c206e22eddf9d09b3c497721a94aa23b922811
cd $DIR/frameworks/av/
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick 8e10843ad4902943e50a7f4d23194319a78668ef
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick 5735647d6c70660d20cf16ee5346159c345ad648
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick d67b1fa60b2680e731a6683968856ef91362b1b3
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick b5973bd61fa55ec7693103036fd618234e1ae4f7
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick 2b7cd9fa973e829cc8a4842376280d01b3e9a487
git fetch https://github.com/WindowsX/android_frameworks_av.git cm-10.2 && git cherry-pick f1a15bce88881376c6f88546b9e698cdcd19732b
cd $DIR/frameworks/base/
git fetch https://github.com/WindowsX/android_frameworks_base.git cm-10.2 && git cherry-pick 937e6f24e503ca9fa203044a584b158edcc7840f
cd $DIR/frameworks/ex/
git fetch https://github.com/trailblazerz/android_frameworks_ex.git && git cherry-pick aa5da9c8956f09072bb9e783dee2a67798663bb6
cd $DIR/frameworks/native/
git fetch https://github.com/WindowsX/android_frameworks_native.git cm-10.2 && git cherry-pick 8b555aaaceee3ff422d239596c2f132329e80d7d
cd $DIR/frameworks/opt/net/voip
git fetch https://github.com/WindowsX/android_frameworks_opt_net_voip.git cm-10.2 && git cherry-pick 33f09279eaf8577753fc855611290acd29852b94
cd $DIR/frameworks/wilhelm/
git fetch https://github.com/trailblazerz/android_frameworks_wilhelm.git && git cherry-pick 07251f657bb21080ab96093dc5275b37589bbf37
git fetch https://github.com/trailblazerz/android_frameworks_wilhelm.git && git cherry-pick 48cc6405503668dc38b4713a98e08d1174b2340c
cd $DIR/hardware/qcom/media-caf
git fetch https://github.com/WindowsX/android_hardware_qcom_media-caf.git && git cherry-pick 4d64d4a65f4c04bce4ef3e373681337b967d4fb9
cd $DIR/external/chromium
git fetch https://github.com/WindowsX/android_external_chromium.git cm-10.2 && git cherry-pick 9631db924123e44ae0170aa4c52c122928a26b3b
cd $DIR/libcore
git fetch https://github.com/trailblazerz/android_libcore.git && git cherry-pick 40617f103bf38e61c43edee4c4ecbc2ea4aaedea
cd $DIR/external/webkit/
git fetch https://github.com/trailblazerz/android_external_webkit.git && git cherry-pick bb873522bc0ed7a4aaa3552527872ece198db104
cd $DIR/external/lsof/
git fetch https://github.com/trailblazerz/android_external_lsof.git && git cherry-pick 8a0665c786f53019acbcd28dfed8a5781bc3471e
cd $DIR/external/openvpn/
git fetch https://github.com/trailblazerz/android_external_openvpn.git && git cherry-pick b2cec9e8bd24ce3340fd23473b14258d063d580d
cd $DIR/system/qcom
git fetch https://github.com/WindowsX/android_system_qcom.git cm-10.2 && git cherry-pick ea84d6aab1b5011e6ae4f9ad938733c8af3d5c5e
This will replace Google NDK with Linaro ones and patch build configuration and codes that break strict aliasing rules.
4. Make Linaro patch executable by typing "chmod a+x linaro_patch.sh" and enter.
5. Re-sync again by typing "repo sync" and enter. It will take a while for downloading new toolchains.
6. Apply Linaro patches by typing "./linaro_patch.sh" and enter. All should goes well but keep your eyes on each patch and see if there's anything failed to cherry-pick or not. Fix those failed to cherry-pick yourself and move on.
7. Reload build configuration by typing "source build/envsetup.sh" and enter.
8. Your ROM is ready be cooked with Linaro now. Build it with whatever method you prefer and enjoy.
Credits
trailblazerz11 - For his Linaro ROM for Nexus 4 and resourceful guide making Linaro Yuga implementations a lot easier.
DooMLorD - for his awesome DooMKernel tweaks. My Xperia Z won't be so lovely as today without his tweaks, seriously.
jeroenqui - for his helpful effort to port DooMKernel tweaks into CM10.1.
TeamWin - for awesome recovery system.
Mustaavalkosta - For his 4.8 toolchains and commits
And don't forget to press thanks if you find this tutorial helpful
Click to expand...
Click to collapse
I was surfing around Google and accidentally found this tutorial.
YOU ROCK!!!
I was looking to enable strict-aliasing to my custom ROM!
Although my device is using Exynos processor, I'll let you know how it all goes
NICE WORK
Btw, your kernel seems to NOT using strict-aliasing. In Makefile, the -fno-strict-aliasing option is given, resulting in strict-aliasing disabled completely.
Ps2. please give a flto option a try and... please write down the tutorial similar to this one...

You're right. I forgot to remove it. How silly of me

@Windows X will there be a cm11 guide for this, looking forward for it =D

CM11 is yet to be stable enough to make this guide. Maybe sometimes after Sony releasing 4.4 ROM and CM kernel gets 4.4 blobs updated.

Windows X said:
CM11 is yet to be stable enough to make this guide. Maybe sometimes after Sony releasing 4.4 ROM and CM kernel gets 4.4 blobs updated.
Click to expand...
Click to collapse
Alright, thank you so much for replying!

Related

[ROM][4.3.1] AOKP :: jb-mr2 :: nightlies | test builds :: yuga {Z}

DISCLAIMER
You need to have an unlocked bootloader to use this ROM & kernel. Also I or any contributor in the software DOES NOT take responsibility of damages caused to your phone due to this ROM.
{
"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"
}
1. Copy ROM zip and gapps zip to sdcard
2. Flash any kernel which has recovery (if you do not have any recovery yet)
3. Reboot device and go to recovery by pressing Vol-UP when LED is pink
4. If coming from 4.2 or 4.1 ROM wipedata/factory reset your phone
5. Flash ROM zip
6. Flash Gapps zip
7. Reboot and enjoy.
Official Nightlies (automatically built every 3 days on AOKP buildbox) :
http://aokp.co/devices/yuga
Unofficial Test Builds (will contain experimental changes for testing) :
http://aokp.co/unofficial-builds#odin
Gapps :
http://goo.im/gapps/gapps-jb-20130813-signed.zip
We spend countless of hours doing this for next to nothing. Posts, views, and donations encourage me, and everyone else who helps out.
Donate to AOKP
Donate to CyanogenMod
Every donation is cherished and loved.
If you'd like to help contribute by writing code, feel free to stop by IRC and talk to us!
Latest merges on Gerrit
http://gerrit.aokp.co/#/q/sony+status:merged,n,z
Check out the ROM source on github. Open source, in the spirit of community kangage.
CREDITS
I cannot thank more for the hard work of FreeXperia Team (Jerpelea ( @FXP ), @Bin4ry, @Kali-, @Entropy512, @codeworkx and others) for working on Xperia devices.
Also huge thanks to Sony Mobile AB for having been very developer-friendly and helping us in all sorts of ways.
XDA:DevDB Information
[ROM][4.3.1] AOKP :: jb-mr2 :: nightlies | test builds :: yuga {Z}, a ROM for the Sony Xperia Z
Contributors
championswimmer, @FXP, @Bin4ry, @Kali-, @Entropy512, @cdesai, @codeworkx
ROM OS Version: 4.3.x Jellybean
ROM Kernel: Linux 3.4.x
Based On: AOSP
Version Information
Status: Alpha
Created 2013-09-18
Last Updated 2013-10-12
Reserved
Reserved
AWESOME!
Sent from my C6603 using xda premium
Very Very Good!
For the first build divine
With the build 2013-09-16 I found three bugs:
* Android Keyboard crashes after use the swype function
* the battery indicator updated first at 70%. Previously the indicator shows ever 100%. It's just the indicator in the status bar.
* If I start the Settings => Device Options the Settings will crashed
I will test the new build and will give you then feedback if the bugs are fix or not.
Can I make a mirror for the new build by uploaded and or or Google Drive?
Any feedback on this early version? It may make me think about unlocking my BL...
Yes, read my post!
@championswimmer:
How do you build the build?
When I type:
.build/envsetup.sh && brunch yuga
I become the follow erorr:
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/armv7-a/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
including device/samsung/maguro/vendorsetup.sh
including device/samsung/quincyatt/vendorsetup.sh
including device/samsung/toroplus/vendorsetup.sh
including device/samsung/vibrantmtd/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including vendor/aokp/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/aokp/vendorsetup.sh
build/core/product_config.mk:205: *** No matches for product "aokp_yuga". Stop.
** Don't have a product spec for: 'aokp_yuga'
** Do you have the right repo manifest?
No such item in brunch menu. Try 'breakfast'
Can you help me?
heubergen said:
@championswimmer:
How do you build the build?
When I type:
.build/envsetup.sh && brunch yuga
I become the follow erorr:
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/armv7-a/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
including device/samsung/maguro/vendorsetup.sh
including device/samsung/quincyatt/vendorsetup.sh
including device/samsung/toroplus/vendorsetup.sh
including device/samsung/vibrantmtd/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including vendor/aokp/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/aokp/vendorsetup.sh
build/core/product_config.mk:205: *** No matches for product "aokp_yuga". Stop.
** Don't have a product spec for: 'aokp_yuga'
** Do you have the right repo manifest?
No such item in brunch menu. Try 'breakfast'
Can you help me?
Click to expand...
Click to collapse
repo init -g all,-notdefault,yuga,sony
Thanks for the answer, but I become the same error
After 3 hours or something I destroy my aokp/.repo
When I do report sync it gives me the error
warning: local_manifest.xml is deprecated; put local manifests in `/Volumes/android/aokp/.repo/local_manifests` instead
warning: local_manifest.xml is deprecated; put local manifests in `/Volumes/android/aokp/.repo/local_manifests` instead
fatal: no revision for project AOKP/device_sony_common within /Volumes/android/aokp/.repo/manifest.xml
Can you help me, please?
heubergen said:
Thanks for the answer, but I become the same error
After 3 hours or something I destroy my aokp/.repo
When I do report sync it gives me the error
warning: local_manifest.xml is deprecated; put local manifests in `/Volumes/android/aokp/.repo/local_manifests` instead
warning: local_manifest.xml is deprecated; put local manifests in `/Volumes/android/aokp/.repo/local_manifests` instead
fatal: no revision for project AOKP/device_sony_common within /Volumes/android/aokp/.repo/manifest.xml
Can you help me, please?
Click to expand...
Click to collapse
you need to remove your local_manifest.xml file
new build up
camera fixed
I've successfully built my own version . Thanks for your work.
But my recovery seems not working right. I only get an black screen but I can adb into it and see it booted up. Any idea what could be the problem?
Update:
I found the problem. Recovery is missing "/sbin/minivold" because the AOKPs vold does not provide it.
The missing commit is here:
https://github.com/CyanogenMod/android_system_vold/commit/aa564abda8315ea523180785d0f7e9bf552f8583
@djselbeck:
Do you use for the build the command:
. build/envsetup.sh && brunch yuga?
@championswimmer:
Thanks.
heubergen said:
@djselbeck:
Do you use for the build the command:
. build/envsetup.sh && brunch yuga?
@championswimmer:
Thanks.
Click to expand...
Click to collapse
Code:
source build/envsetup.sh
brunch yuga
is my build command.
Thanks!
Have you never see the follow error or you now what are the mistake?
build/core/product_config.mk:205: *** No matches for product "aokp_yuga". Stop.
** Don't have a product spec for: 'aokp_yuga'
** Do you have the right repo manifest?
I try allways a never found a solution.
Which repo init commond do you use?
I use the repo init a few posts above.
Do you use:
repo init -u git://github.com/AOKP/platform_manifest.git -g all,-notdefault,yuga,sony
Because, by me that command gives me a error called:
...
* [new tag] jb-mr1_milestone-2 -> jb-mr1_milestone-2
error: revision refs/heads/master in manifests not found
First I did
Code:
repo init -u https://github.com/AOKP/platform_manifest.git -b jb-mr2
repo sync -j4
after it finished I did:
Code:
repo init -g all,-notdefault,yuga,sony
repo sync -j4
I think I start new and give then a new feedback.

[ROM] [4.3] AOKP // Nightlies // 26 September [TARGET_PRODUCT=aokp_mako]

{
"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"
}
Device: mako (Nexus 4)
Why AOKP?
Well, if you are looking for super fast, buttery fluid and stable ROM with bunch of truly useful features, you are in the right place. Believe me, I wouldn't recommend you laggy and choppy ROM as smoothness is everything for me. Just download latest build and turn on The Swagger, right? Let's make that roll. :highfive:
Build description:
Code:
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.3
TARGET_PRODUCT=aokp_mako
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.8.0-30-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JLS36G
OUT_DIR=/home/max/aokp/out
============================================
Screenshot:
» Installation is simple:
If coming from another ROM or another major AOKP version, wipe data in recovery
Make sure you're using the latest CWM or TWRP
Flash ROM
Flash Google Apps (GAPPS)
Reboot
» Check merged commits on AOKP's Gerrit
» 2013-09-26
» 2013-09-25
» 2013-09-23
» Google Apps
» AOKP Gerrit
» AOKP on Github
» SOURCE on AOKP.co
Open your wallet and donate to AOKP Crew!
» Donation options on AOKP.co
Enjoy!
NOTE
The ROM is an unofficial version of AOKP, 100% built from OFFICIAL AOKP source.
I am going to keep on with nightlies 'till AOKP Crew decides to roll out their official builds (it will last for a while)
The whole code is untouched, so you can enjoy pure AOKP (MR-2) based on Android 4.3 :highfive:
ROM is stable, fast, fluid and what's the most important - ready for daily use
USE JSS KERNELS AS THIS ROM IS NOT JWR BASED!
---
Any questions?
Catch ME on Google+ as I don't really reply to xda PMs! :silly:
Build AOKP MR-2 from source yourself!
To build any ROM from source you have to get yourself Ubuntu (12.04 currently as it's latest stable release) Personally, I use it as virtual machine via VIRTUALBOX from Oracle
If you already have Ubuntu, let's set up build environment. Open Terminal and punch some lines:
Code:
$ sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
Python-markdown libxml2-utils xsltproc zlib1g-dev: i386
Code:
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
This installed required packages to your PC
Let's grab JDK (Java Development Kit) now:
Code:
$ sudo apt-get install sun-java6-jdk
And we're ready to set up things for the build! :highfive:
Code:
$ mkdir ~/bin
Let's check now if the bin directory which our repo file will stay in exists
Code:
$ PATH=~/bin:$PATH
Now we have to download repo tool:
Code:
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
...and give it proper permissions
Code:
$ chmod a+x ~/bin/repo
Let's download source code now! Create a new directory! :cyclops:
Code:
mkdir RANDOMNAME
Navigate to it!
Code:
cd RANDOMNAME
And now it comes to the tricky part when you have to decide what will be downloaded.
If you want core trees without any device vendor or kernel:
Code:
$ repo init -u https://github.com/AOKP/platform_manifest.git -b jb-mr2
If you want ALL vendors and kernels supported by AOKP:
Code:
$ repo init -u https://github.com/AOKP/platform_manifest.git -b jb-mr2 -g all,kernel,device,vendor
If you want to build for particular device:
Code:
$ repo init -u https://github.com/AOKP/platform_manifest.git -b jb-mr2 -g all,-notdefault,<devicename>,<vendorname>
(example: if you want to build mako, type "mako" instead of <devicename> and "lge" instead of <vendorname> without "" of course )
If you want to build more than 1 device:
Code:
$ repo init -u https://github.com/AOKP/platform_manifest.git -b jb-mr2 -g all,-notdefault,<devicename1>,<devicename2>,<devicename3>,<vendorname1>,<vendorname2>,<vendorname3>
Click to expand...
Click to collapse
Ok and when repo is initialized:
Code:
$ repo sync
Personally, I use "repo sync -j4" as I gave my virtual machine 2 cores from host PC so 2 jobs are written for each core (2 cores * 2 jobs = 4 jobs generally). It really shortens sync time.
And finally when the repo is synced (it lasts a while and depends on your connection) type:
Code:
$ . build/envsetup.sh && brunch mako
And hopefully you will end up with a flashable zip in ~/RANDOMNAME/out/target/product/mako as well as /system/ dump and some flashable images
Build time depends on your machine efficiency (on my virtual machine (2 cores, 4 GB RAM) it takes about 1,5-2 hours so be patient)
downloading now, thankyou,,steve
mongonexus said:
downloading now, thankyou,,steve
Click to expand...
Click to collapse
Thats cool ?
Give feedback after playing around ?
== Sent from my Carbon Mako ? ==
Good work,
Sorry to ask but does this suffer from deadlocks?
Sent from my Nexus 4 using Tapatalk 4
ben_pyett said:
Good work,
Sorry to ask but does this suffer from deadlocks?
Sent from my Nexus 4 using Tapatalk 4
Click to expand...
Click to collapse
Teoretically it does as it is JLS based
But in fact it happens really really rarely so no worries
== Sent from my Carbon Mako ? ==
Thanks, are you rocking this or Carbon? as that's what your Sig still says? trying not to be a smart arse, just pointing it out
Sent from my Nexus 4 using Tapatalk 4
ben_pyett said:
Thanks, are you rocking this or Carbon? as that's what your Sig still says? trying not to be a smart arse, just pointing it out
Sent from my Nexus 4 using Tapatalk 4
Click to expand...
Click to collapse
Haha
Forgot to change it in xda app settings
Already done ?
== Sent from my Kanged Mako ? ==
I'm downloading. I'm AOKP starved. Hope this suits me. Someone showing AOKP love.
Sent from my Nexus 4 using xda app-developers app
Added compile guide to OP
== Sent from my Kanged Mako ? ==
That's pretty cool. Thanks. Would you know how to go about "cherry picking" (as they call it) features and such that's not merged yet?
Sent from my Nexus 4 using xda app-developers app
PJcastaldo said:
That's pretty cool. Thanks. Would you know how to go about "cherry picking" (as they call it) features and such that's not merged yet?
Sent from my Nexus 4 using xda app-developers app
Click to expand...
Click to collapse
You say, you get it
Code:
git remote add upstream https://github.com/xxx/yyy.git
git fetch upstream
git cherry-pick <commit number>
== Sent from my Kanged Mako ? ==
maxio1998 said:
You say, you get it
Code:
git remote add upstream https://github.com/xxx/yyy.git
git fetch upstream
git cherry-pick <commit number>
== Sent from my Kanged Mako ? ==
Click to expand...
Click to collapse
Thanks for this, are you the guy who used to cook roms for xperia 2011 phones?
Rom installed this night... Seems good ! Really smooth
Let's see for the battery consumption now ^^
TheDarkDefender said:
Thanks for this, are you the guy who used to cook roms for xperia 2011 phones?
Click to expand...
Click to collapse
Exactly
== Sent from my Kanged Mako ? ==
Does this ROM have the freezing issues like all the other AOSP roms?
Edit nevermind!!! No-longer in the Mood To FLAME!
nerotix said:
Does this ROM have the freezing issues like all the other AOSP roms?
Click to expand...
Click to collapse
Its been a while, going through a couple of JSS based roms since i experienced a deadlock, although, i think i didnt suffer from em quite as much as pepole reported on forums...so take it with a grain of salt, experience varies between handsets...
nerotix said:
Does this ROM have the freezing issues like all the other AOSP roms?
Click to expand...
Click to collapse
Max says
http://forum.xda-developers.com/showpost.php?p=45860850&postcount=7

[STABLE][LAST-KNOWN]CyanogenMod[MARSHMALLOW]

CyanogenMod is a free, community built, aftermarket firmware distribution of Android 6.0 (Marshmallow), which is designed to increase performance and reliability over stock Android for your device.
Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* We are not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you.
*
*/
All the source code for CyanogenMod is available in the CyanogenMod Github repo. And if you would like to contribute to CyanogenMod, please visit our Gerrit Code Review.
These are last known stable builds from work done by qsnc. Latest commits do not work, so I have reverted them to last working point.
Download link : Blog
XDA:DevDB Information
[STABLE]CyanogenMod, ROM for the Sony Xperia ZR
Contributors
Daedroza, qsnc
Source Code: https://github.com/daedroza
ROM OS Version: 6.0.x Marshmallow
ROM Kernel: Linux 3.4.x
Based On: CyanogenMod
Version Information
Status: Testing
Created 2016-06-29
Last Updated 2016-06-28
Reserved
Screen Shot?
Sent from my C6603 using Tapatalk
Yaaaa!!! I love you so much :3
Is it stable .any bug ???
Anyone help me
GApps?
Can anyone tell me , which GApps version would go with the ROM?
Up to now, I dont see any big issue in this rom and i think that may be more stable than RR 5.7
Eragon_Z said:
Can anyone tell me , which GApps version would go with the ROM?
Click to expand...
Click to collapse
Gapps 6.0 of course.
---------- Post added at 09:46 PM ---------- Previous post was at 09:44 PM ----------
This rom is stable.I don't see any bugs or issues.But the main disadvantage is I can't use any sony apps.
---------- Post added at 09:51 PM ---------- Previous post was at 09:46 PM ----------
So there won't be any official nightly release?
Thank you 2 friends
---------- Post added at 12:26 AM ---------- Previous post was at 12:22 AM ----------
So sad if can not use camera sony @@
max26292 said:
Up to now, I dont see any big issue in this rom and i think that may be more stable than RR 5.7
Click to expand...
Click to collapse
Hi you.which recovery i can use to flash this rom ???
New Developmental kernel :
*Fixes cpu/vfp_bounce
*Added a lot of new features using qsnc commits
*Under progress.
Flash over using TWRP. This requires heavy testing. Let me know of any issues!
---EDIT---
New kernel available : merging_july_04_dogo
Please don't use kernel_july_04_2016 it is outdated
*Added new cherry-picked commits
*Fixed alarm bug!
Did not try the updated kernel yet, but the kernel from the Jun 29 build (Linux version 3.4.112-cm-g6392ba2 ([email protected]) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Wed Jun 29 23:05:25 IST 2016) has some significant memory leak — the KernelStack value in /proc/meminfo increases until the system becomes completely unresponsive due to kernel running out of low memory.
Some logs taken just before the hang: View attachment 20160705-KernelStack-leak-hang.7z
shell.log is the output of some commands executed in adb shell — see "KernelStack: 393008 kB" there.
After pulling the battery I noticed that KernelStack slowly increases even when not doing anything with the phone, and pressing the power button to turn the screen on and back off eats 150-250 kB of KernelStack. Logs taken when doing this: View attachment 20160705-KernelStack-leak-2.7z
Going to flash the development kernel now.
Update: Flashed merging_july_4_dogo.zip, and apparently there is no KernelStack memory leak issue there — after some minutes KernelStack stabilized around 7336 kB, and its value does not keep increasing when turning the screen on and back off.
sigprof said:
Did not try the updated kernel yet, but the kernel from the Jun 29 build (Linux version 3.4.112-cm-g6392ba2 ([email protected]) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Wed Jun 29 23:05:25 IST 2016) has some significant memory leak — the KernelStack value in /proc/meminfo increases until the system becomes completely unresponsive due to kernel running out of low memory.
Some logs taken just before the hang: View attachment 3803646
shell.log is the output of some commands executed in adb shell — see "KernelStack: 393008 kB" there.
After pulling the battery I noticed that KernelStack slowly increases even when not doing anything with the phone, and pressing the power button to turn the screen on and back off eats 150-250 kB of KernelStack. Logs taken when doing this: View attachment 3803647
Going to flash the development kernel now.
Update: Flashed merging_july_4_dogo.zip, and apparently there is no KernelStack memory leak issue there — after some minutes KernelStack stabilized around 7336 kB, and its value does not keep increasing when turning the screen on and back off.
Click to expand...
Click to collapse
That's the problem with my stable branch. But it is the only point where my kernel and ROM boots up. I had merged all my new commits into a very fresh build along with qsnc's latest updates. The problem with this newly baked build is that never goes beyond "Starting Apps" logo.
I wasn't able to get logs or any such stuff and not to mention adb wasn't started even after kernel booted when I attempted this. Perhaps, I can again make a fresh build and with your expertise you could possibly get me logs in any way I could follow up the matter, try a little fix by myself or run it against other developers.
Let me know if you're up for testing @sigprof, Personally message/report if interested we could do a hangout on G+
My current kernel branch already includes qsnc's work + some additional commits and is way ahead of CM's original apq8064! All thanks to qnsc!
Daedroza said:
I wasn't able to get logs or any such stuff and not to mention adb wasn't started even after kernel booted when I attempted this.
Click to expand...
Click to collapse
Enabling adb during boot requires setting these properties in default.prop inside the ramdisk:
Code:
ro.adb.secure=0
persist.sys.usb.config=mtp,adb
You can patch boot.img as follows:
Code:
abootimg -x boot.img
mkdir -p initrd && zcat initrd.img | ( cd initrd && cpio -idm --no-absolute-filenames; )
mkdir -p ramdisk && cat initrd/sbin/ramdisk.cpio | ( cd ramdisk && cpio -idm --no-absolute-filenames; )
sed -e 's/^\(ro\.adb\.secure\)=.*$/\1=0/' -e 's/^\(persist\.sys\.usb\.config\)=.*$/\1=mtp,adb/' -i ramdisk/default.prop
( cd ramdisk && find -mindepth 1 -print0 | cpio -o0 -H newc -R 0:0 ) > initrd/sbin/ramdisk.cpio
( cd initrd && find -mindepth 1 -print0 | cpio -o0 -H newc -R 0:0 ) | gzip -9 > initrd-new.img
abootimg --create boot-new.img -f bootimg.cfg -k zImage -r initrd-new.img
Then use fastboot flash boot boot-new.img to flash the patched image. Most adb commands (including "adb logcat") should be available immediately after the SONY logo disappears (if you are rebooting from recovery, do not start "adb logcat" too early, because the recovery also includes adbd).
New update (July 09, 2016) :
*Switch to audio: switch to new msm8960 HAL
*Lots of init updates, mpdecision updates from qsnc
*Additional Commits for kernel including Alarm fix
*Remove some bloated software
*July 05 Security Patch
Download link in OP
I've been using this ROM with included kernel for a day already. So far without any problems.
However, I have noticed a small bug - there are no any indicators for WiFi or mobile data activity in the status bar. I'm not sure if this is a normal behavior or a bug?
Thanks @Daedroza and @sigprof!
LaudaDev said:
I've been using this ROM with included kernel for a day already. So far without any problems.
However, I have noticed a small bug - there are no any indicators for WiFi or mobile data activity in the status bar. I'm not sure if this is a normal behavior or a bug?
Click to expand...
Click to collapse
It happend to me too.
Solution: Flash gapps (latest pico opengapps) without factory reset.
Sent from my Xperia ZR using XDA-Developers mobile app
vanbroekhoven.wim said:
It happend to me too.
Solution: Flash gapps (latest pico opengapps) without factory reset.
Sent from my Xperia ZR using XDA-Developers mobile app
Click to expand...
Click to collapse
I have already flashed gapps pico after flashing CM13 ROM.
Should I do it again?

Please remove as this now resolved.

Please remove as this now resolved.
I know that this source is not Lineage but I would think the basic principles for building for an supported device under Lineage would also be applicable to any other source repository.
All of the guides I have found only tell you how to build for a supported device and not any help for an unsupported one. I figured out how to sync a suitable device tree and kernel etc but since the rom source repository does not support my device I can't go any further. I can't get it to build from my sync'd local sources it keeps trying to pull stuff from the original source repository so builds fail at the start.
I have setup a local manifest for this project that sync's the device tree and a kernel and the proprietary blobs and this sync completes without error. next I ran - source build/envsetup.sh and then brunch hlte (not a supported device I know) but that throws up this error -
build/core/product_config.mk:248: * Can not locate config makefile for product "gzosp_hlte". Stop.
Device hlte not found. Attempting to retrieve device repository from GZOSP-Devices Github (http://github.com/GZOSP-Devices).
Repository for hlte not found in the GZOSP-Devices Github repository list.
If this is in error, you may need to manually add it to your .repo/local_manifests/gzosp_manifest.xml
build/core/product_config.mk:248: * Can not locate config makefile for product "gzosp_hlte". Stop.
So I think that the error basically means that github.com/GZOSP-Devices does not have the hlte device listed so can anyone tell me how to make the build point to my local repository after I have sync'd so that it at least starts to build ?
I am a newbie to rom building and have much to learn but I would really appreciate any help you guys could give.
Thanks in advance for any an all help offered.

[GUIDE] Using Gerrit code review

Purposes of this guide​This guide want to be a how-to use Gerrit, allowing everyone to contribute on AOSP like projects.
Divided in 3 parts:
Now few important stuff needs to be setup before proceeding- -> Minimal setup to use Gerrit.
How to setup & submit for recurent contributes
How to submit patches one time
Here we will setup clones, outside of the build tree. See faq for commit testing.
This mean you do not need build environement to contribute
Important: for projects using Gerrit, Github pull request will never be merged! This also mean you do not need to create a Github fork for every changed projects :victory:
So firstly, I'll explain few terms that are important for you to learn before going towards a bit tricky side. ​
Git - To be precise, git is a code-sharing website/software that allows you to share your project resources you can 'Make Software, better, together'(That's what the tag line says )!
Now, before I go to gerrit, read this: Major Open Source Projects, like, CyanogenMod, AOKP, OmniROM etc. don't directly accept pull requests and in case you want to make a change in their source for a fix/feature or anything, you need to send them patches over gerrit which are then reviewed by the trusted members of the community and if they find it valuable enough, gets merged into the git repository!
Gerrit(Copying the definition from Wiki) - Gerrit is a free, web-based team software code review tool. Software developers in a team can review each other's modifications on their source code using a Web browser and approve or reject those changes. It integrates closely with Git, a distributed version control system.
So, now, git and gerrit are so closely related, that a patch verified over gerrit can directly be merged on git without much hassel, also please note that your gerrit and git username must be same.
Pull Requests - Pull requests are sent over Git after you fork a repository, make some changes into it and then want the owner to merge those changes into his repository, and that's how community development and Open Source works.
Patches - In simple terms, any changes you make to repos of Open Source Projects like LineageOS, OmniRom or AOKP and send them over gerrit for code review are called Patches.
You can find the Gerrit URL of the project you are working on, on the contribute webpage of the project. Example: OmniRom gerrit is https://gerrit.omnirom.org/ , LineageOS is https://review.lineageos.org/
How GERRIT works?! ​Now, Gerrit is deployed in place of this central repository and adds an additional concept, a store of pending changes. Everyone still fetches from the authoritative repository but instead of pushing back to it, they push to this pending changes location. A change can only be submitted into the authoritative repository and become an accepted part of the project once the change has been reviewed and approved.
I found a nice diagram explaining this over the internet that will clear your doubts(if any ) -
{
"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"
}
There is two different way to use gerrit:
With git , on your computer (useful for recurrent contribute)
Using the Gerrit WebUI (useful for punctual contribute)
Now few important stuff needs to be setup before proceeding-​
Install up Git:
Debian/Ubuntu:
Code:
sudo apt-get install git
Fedora:
Code:
yum install git
ArchLinux:
Code:
pacman -S git
openSUSE:
Code:
zypper install git
Configuring git:
This step is very very important as those ID will be the one which identify you and you cannot change them later!
WARNING: You need to setup the same email as on github.com !
WARNING: email is case sensitive!
(For username I highly recommend to use the same as on your computer, but you could use any username you want)
Code:
git config --global user.email "[email protected]"
Code:
git config --global user.name "your-username"
Setting up SSH Keys(Skip this if you have already set them up) -
Code:
ssh-keygen -t rsa -C "[email protected]"
Now this will create 2 files in ~/.ssh directory as follows:
Adding SSH Keys to your Account :
Code:
cat /home/username_on_pc/.ssh/id_rsa.pub
This will show up few lines over terminal, copy those and add them into your Gerrit profile (Will not be detailed, there is a lot of guides on internet for this part)
Important: you need to setup your username into gerrit UI, otherwise you will never be able to push changes (on the screenshot there is no option to modify username as it is already setup but you should see one):
Test ssh is correctly working :
Code:
ssh -p 29418 <username>@<gerrit address>
If you see this message, then everything is setup and ready to propose changes :
If you get any errors, reread the howto to ensure you are not missing something.
You can also contact your team (there is probably an IRC channel for this) and ask for help.
Setting up the hook Change-ID :
WARNING: this need to be done in every repository or upload will fail!
Code:
gitdir=$(git rev-parse --git-dir); scp -p -P 29418 <username>@<gerrit address>:hooks/commit-msg ${gitdir}/hooks/
Making Changes and Submitting Patches -​Way 1. (for recurrent contribute) :
If you have a full build environment setup, the best practice say to not use your build trees for change & submit patches. If you do not have build environment setup, just don't care about this warning
Create a folder (like ~/clones/) where your clones with your changes will reside:
Code:
mkdir ~/clones
cd ~/clones
Go to git where you would make the change and copy the Clone link:
Code:
https://github.com/omnirom/android_device_sony_shinano-common.git
Go back into your terminal and clone the repo (optional: you can specify the branch name with -b <branch name>), then get into clone folder:
Now you can make the change using your favorite text editor (<escape> then ':q<enter>' to exit vim ):
Code:
git status
It tells you what files you modified(In Red color ) and shows on which branch you're currently on.
Now, the committing part,
Run:
Code:
git add -A
Run git status again, and it'll show the files in green color, telling you that the changes have been added.
Now:
Code:
git commit -s
This will commit the changes and open up a Text Editor called NANO. Here you need to edit the commit message that appears at the side of the gerrit window to describe what the patch does.
After writing the commit message, press Ctrl+O and then Enter key to save the commit message and then Ctrl+X to exit the editor. This is the committing part done. :good:
Optional (but better ): you can control what your commit changed, then rework if necessary (see last part of the guide):
Code:
git diff HEAD^
Now submitting the patch -
You need to catch the project path from the Gerrit interface. Go into project, list, and find the repository you changed:
Here the path is android_device_sony_shinano-common. It could include a 'sub-folder' like LineageOS do. For example, same repo on Lineage will be LineageOS/android_device_sony_shinano-common.
WARNING: path is case sensitive.
Go back to your shell and type:
Code:
git push ssh://<username>@<gerrit address>:29418/<repo path> HEAD:refs/for/<branch name>
Way 2. (for punctual contribute) :
Log-in into the Gerrit instance you want to commit into. Go into 'Projects', list, then choose the repo you want to make the change in:
Hit the 'Create Change' button:
This open a popup asking for some information:
Select branch for new change: the branch you want to commit in,
Enter topic for new change: leave empty
Description: Enter commit message
Finally hit Create
Now your change page is open, you can start editing files with the Edit button on the right:
then Add the file you want change:
The file open in an editor, make the needed changes and save with Save button, then Close:
(Redo the step if you need to change multiples files.)
When all your changes are present, hit the Done Editing button to validate your changes.
Your changes are pending and you can display it while clicking on file name:
The changed section is highlighted. If you made a mistake you can use the
icon:
Use the
button to get back on the summary page.
WARNING: your change is only a draft for now, you need to publish it:
Ask for review :
Once your commit is on Gerrit you need to setup a reviewer. This person will comment, reject or submit your patch.
Hardest part is to find the reviewer. You can ask in the dedicated IRC chan of your rom, or use some tricks like check who merged the commits into the repo.
Once you find who will be the reviewer, add it on the dedicated gerrit field:
Once your commit is ok and you want the reviewer take care of it, set-it 'Code-Review +1' and add a comment (will stay on gerrit) about why this change should be merged:
Guess what?! Done!
Congratulations, you just learned gerrit and know how you use it. I hope you'll send some nice patches and respect the Open Source. :victory:
Credits -
v_superuser said:
> Original kanged thread
Click to expand...
Click to collapse
FAQ​
Ensure your clone is up to date
Before picking and before writing patch you need to ensure your clone is up-to-date with the remote repository.
Go into the needed folder, then check the remote name:
Here the remote is named 'origin'.
We need to fetch the remote, on the right branch, then switch to that branch:
Code:
git fetch <remote name> <branch>
Code:
git checkout <remote name>/<branch>
(You can notice in my right prompt the current HEAD changed for remote/<remote name>/<branch name> . It is now up to date. )
Warning: Only the checkout command switch your local tree
Warning: git fetch use space between remote name & branch name but git checkout use slash (/) !
How to test pending changes
To test a change pending on Gerrit you need a working build environment for your rom. This guide will not explain how to set it up.
Once you have located the change you want to test,
go into the corresponding folder. Use the project path for hints:
here folder will be device/sony/msm8974-common.
Next use the download button into Gerrit interface
and copy paste the command in your terminal:
If you have merge conflict you will need to solve (with git mergetool, internet search and brain).
Now you can do this step again to merge other commits, or trigger the build for testing.
Update a pending change
You made a commit but notice some problem and it need to be reworked, without creating another one.
You need to follow the Ensure your clone is up to date then How to test pending changes with the commit who need reworking.
Once the commit is fetched locally you can make your changes:
Trigger the amend of the commit:
Code:
git commit [B]--amend[/B]
The git editor open and allow you to change the existing commit message:
Once your change is done, upload it:
The commit is updated (new Patch Set) on Gerrit (no new one was created):
Setup Gerrit as remote for easy reuse
Typing the push command each times could be painful if you upload patches often.
You can add Gerrit as a remote for easy reuse:
git remote add <local name> ssh://<username>@<gerrit url>:29418/<repo name>
Now you can simply use git push command:
Warning: need to be done in each repos!
Warning: This tip do not prevent typing HEAD:refs/for/<branch> each time !
reserved
This is absolutely wonderful guide , thank you for your contribution
git init
Click to expand...
Click to collapse
command should be passed before the below command! otherwise it willl show some error!
gitdir=$(git rev-parse --git-dir); scp -p -P 29418 <username>@<gerrit address>:hooks/commit-msg ${gitdir}/hooks/
Click to expand...
Click to collapse
Thanks for your guide, however, on the 3.4 or more version has a little change, can you update the article?
In addition, your article has a defective attachment (in "Adding SSH Keys to Your Account"), please fix it!
I was looking for it from so long
Thanks man

Categories

Resources