[GUIDE] Building independent system apps from Lollipop source for OnePlusOne - ONE General

#This is a simple guide to download, modify and build system apps on CM12.0 based Blisspop fork for bacon device (OnePlusOne)
#Last edited: 2015-01-23
Was trying to modify some system app functionalities and it turns out the methods of decompiling - modify smali - recompiling did not work well. So had to try building from source. After three days of trials and errors, I succeeded in building the desired system apps without having to compile the entire rom. There is a similar guide on XDA-University, and also the same guide I went to for answers first. But that is largely out-dated, so I'm not going to cover it here. Most of the readings I did was on XDA and CM Wiki, so I thought I'd post my findings here as a way of appreciation, and hopefully will reduce the amount of research for folks with similar needs.
For people who want to build entire Lollipop rom from source, GRMrGecko wrote an excellent guide here:
http://forum.xda-developers.com/oneplus-one/general/guide-building-lollipop-oneplus-one-t2947949
And to make things easier, I'm going to use bits from GRMrGeCko's guide so readers of this thread won't need to jump to other links to figure out exactly how.
So, how do you build system apps without having to build the entire rom?
1. Establishing android develop environment. Install 64bit version of Unbutu, I used the iso with 'AMD64" in it, and the version is 14.04. Make sure you allocate more than 60G for source code and building - those tend to take significant storage. In my case, I was using an Asus 1215T laptop, with an ancient single core AMD CPU, and 2G memory, plus 500G hard disk.
Once installed, ctrl+alt+T to open the terminal and Install the following items via apt-get:
sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
As per the instructions on the wiki for building CM, if you use a 32bit system, do not install g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev.
#Install the latest version of Java's development kit using the following:
sudo apt-get install openjdk-7-jdk
#Install the Android Development Kit using the following.
sudo apt-get install android androidsdk-uiautomatorviewer android-copyright android-src-vendor android-emulator android-tools-adb android-headers android-tools-adbd androidsdk-ddms android-tools-fastboot androidsdk-hierarchyviewer android-tools-fsutils androidsdk-traceview
#Then, install repo:
mkdir -p ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
reboot your system or use the following in terminal to load the .profile file again:
. ~/.profile
2. make a folder (any name would do) to store the code. Go into the folder (i.e. cd /home/uersername/BlissPop) and get the source codeyou'll only get the latest main branch this way - I suppose. All commands in terminal console have assumed that the source code root folder is current folder)
repo init -u https://github.com/TeamBliss-LP/android.git -b lp5.0
repo sync
#Note: this will download the specified branch lp5.0 (lollipop 5.0 of Blisspop) onto your local drive. The source as of Jan. 23, 2015 is 10+GB, so be patient and try different vpn connections to get the most desirable speed. It took me overnight to download the source code.
3. Build
#Note: This is the tricky part. The existing documentation of Blisspop or other similar open source project does not explicitly explain whether you need to sync full project tree to be able to just compile specific modules (i.e. Source Folder/packages/apps/Email). After experimentation, the answer is a most definite yes. The reason is that system apps usually have many framework-level dependencies, which means downloading the entire source code is the safest way to ensure a successful build. However, you don't need to build the entire rom, or firmware, which takes hours on a single core Asus 1215T.
#To compile specific system apps. After repo sync
a) initiate build environment
. build/envsetup.sh
breakfast bacon
#Note, if you encounter device tree related errors in build steps below, try repeating the above two steps, and run repo sync after breakfast bacon. This, according to CM documentation, will download the specific device tree into the local repository.
b) build the specific app and all its dependencies
#go into the app folder (i.e. cd /home/username/Blisspop/packages/apps/Email)
mma
# Wait until the compilation is over, this on a single core AMD Asus 1215T takes about 2-3 minutes.
#The compiled and signed app should be in out/product/bacon/Email folder. Ready to be copied and flashed using root explorer in your OnePlus's system/app folder.
#When rebuild an app after mma has been executed at least once, no need to build all dependencies, hence:
#go into the app folder (i.e. cd /home/username/Blisspop/packages/apps/Email)
mm

FC's
I did everything as per ur guide and build settings.apk for tomato(YU Yureka) but i am getting FC

Rohan459 said:
I did everything as per ur guide and build settings.apk for tomato(YU Yureka) but i am getting FC
Click to expand...
Click to collapse
That's because there're many dependencies... this settings.apk most likely won't work on other roms than blisspop...
Gesendet von meinem A0001 mit Tapatalk

Aavion said:
That's because there're many dependencies... this settings.apk most likely won't work on other roms than blisspop...
Gesendet von meinem A0001 mit Tapatalk
Click to expand...
Click to collapse
I downloaded CM sources and flashed it on CM ROM then to didnt worked

Related

cyanogenmod development

I want to port cyanogenmod to archos
Are there any developers who know how to download the source of cnm and archos firmware
I'm a game developer and I have no experience with drivers but we can compare are achos devices with other cnm supported devices, the nexus s has the same processor, so we don't have to create a driver for that
Compare list (Update 24 June)
processor is the same as in the droid 2
touchscreen = ?
sound hardware =
screen hardware =
You should take a look at the [DEVELOPEMENT] Cyanogen thread on the Dev subforum - think they'll be pretty happy to see you over there!
fisha21 said:
You should take a look at the [DEVELOPEMENT] Cyanogen thread on the Dev subforum - think they'll be pretty happy to see you over there!
Click to expand...
Click to collapse
Yes, but I'm a newcomer and I can't post a replay there
coen22 said:
Yes, but I'm a newcomer and I can't post a replay there
Click to expand...
Click to collapse
im the thread starter at the post above
Just post 6 posts and you can post at dev section
Lennb said:
im the thread starter at the post above
Just post 6 posts and you can post at dev section
Click to expand...
Click to collapse
Thx, but what do think of my idea
coen22 said:
Thx, but what do think from my idea
Click to expand...
Click to collapse
Im happy, if anyone want to help, but
we need a guy who really have android developement knowledge
Anyone?
I still can't reply to the main thread of cyanogenmod [DEV]
The first thing we have to do is a hardware research
the archos gen8 devices have a
First
Processor: Arm cortex-A8 <-- same as galaxy s, and nexus s
Screen: <--- ?
Then
Touchscreen: <--- ?
Later
Camera: <--- ?
Camera A43: <--- ?
WiFi: <--- ?
Sound: <--- ?
Software buttons
I think we should first make the processor and the screen working, then we are able to debug the device using adb
And we are able to view debug codes on archos
Because all drivers are included in the kernel, what would be the outcome of running say AOSP gingerbread on top of the current kernel?
Archos didn't make much changes to the kernel and the system compared to other manufactures like HTC and it's Sense ROM.
Sorry for this rant, but I cant help myself.
Guys, stop the nonsense regarding not being an android dev and thusnot being able to get anything done. Are you not capable of learning? Please dont reply with negative until you ve tried.
I'm a linuxadmin. It took me 2 hours to get a CM build just by following the instructions. How much longer would it take to rip the drivers ad add them to the image? My guess is that if you start with CM 6 (froyo?) you ll be done in a few days.
So please stop begging for an android dev and all the idle talk of how you think you might get things to work. Just get started with the cyanogenmod build guide already!
Again sorry for the rant
wvl0 said:
Sorry for this rant, but I cant help myself.
Guys, stop the nonsense regarding not being an android dev and thusnot being able to get anything done. Are you not capable of learning? Please dont reply with negative until you ve tried.
I'm a linuxadmin. It took me 2 hours to get a CM build just by following the instructions. How much longer would it take to rip the drivers ad add them to the image? My guess is that if you start with CM 6 (froyo?) you ll be done in a few days.
So please stop begging for an android dev and all the idle talk of how you think you might get things to work. Just get started with the cyanogenmod build guide already!
Again sorry for the rant
Click to expand...
Click to collapse
Ho year sure, downloading sources for a supported device and building the entire thing is not rocket science and can be easily done by following the wiki.
But building one for an unsupported device is an other story.
It requires a good knowledge and a lot of spare time.
The knowledge can be learned online but it requires a lot more spare time too and many of us don't have that spare time, unfortunately.
do you?
I'm not here to lecture people on how they spend their time. I simply want to point out that waiting for a dev to come along to fix your woes isn't the right way to get a project started. Besides, all the time spent on forum posts will nicely accumulate into a plentiful amount of time that can be spent on learning.
If there is an dev interested in building a rom, they will. No need to create some kind of placeholder containing information you think someone might want.
The open source way is to scratch your own itch.
Just on the technical side of things. If you port the cyanogen froyo version, you should simply be able to use the same drivers archos uses. So there isn't going to be any development involved, just compiling stuff.
As to your last question, I surely don't have to reply.
wvl0 said:
I'm not here to lecture people on how they spend their time.
Click to expand...
Click to collapse
I see , what are you here for ?
I simply want to point out that waiting for a dev to come along to fix your woes isn't the right way to get a project started. Besides, all the time spent on forum posts will nicely accumulate into a plentiful amount of time that can be spent on learning.
If there is an dev interested in building a rom, they will. No need to create some kind of placeholder containing information you think someone might want.
The open source way is to scratch your own itch.
Just on the technical side of things. If you port the cyanogen froyo version, you should simply be able to use the same drivers archos uses. So there isn't going to be any development involved, just compiling stuff.
As to your last question, I surely don't have to reply.
Click to expand...
Click to collapse
Well that was one of the useless posts found on this thread. Thank you for adding yours to the list
Hey guys, please join us at the Developer Thread.]
Its better to have only one thread
sibere said:
I see , what are you here for ?
Well that was one of the useless posts found on this thread. Thank you for adding yours to the list
Click to expand...
Click to collapse
Touché. I guess I'll just add what I learned then.
How to get your buildsystem up and running on Ubuntu Oneiric 64bit.
Before following this guide: http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Sholes
Do this first, just to avoid having to install individual packages later on:
Code:
add-apt-repository "deb http://archive.canonical.com/ maverick partner"
Code:
apt-get install bison build-essential curl flex g++-4.3-multilib gcc-4.3-multilib git-core g++-multilib gnupg gperf lib32ncurses5-dev lib32readline5-dev lib32z1-dev libc6-dev-i386 libesd0-dev libncurses5-dev libsdl1.2-dev libsdl-dev libwxgtk2.6-dev ncurses-dev pngcrush schedtool squashfs-tools sun-java6-jdk zip zlib1g-dev
I think I ran into compile issues with gcc-4.6, so I switched over to 4.4
Code:
rm /usr/bin/gcc
ln -s /usr/bin/gcc-4.4 /usr/bin/gcc
rm /usr/bin/g++
ln -s /usr/bin/g++-4.4 /usr/bin/g++
Then following this guide to get ADB running with your tablet:
http://forum.xda-developers.com/archive/index.php/t-892847.html
Now you can follow the Sholes build guide.
You might run into compile issues. This bug report includes a fix:
http://code.google.com/p/cyanogenmod/issues/detail?id=2455
and in case you run into this one:
frameworks/base/core/java/android/widget/ListView.java:3631: warning 13: Method android.widget.ListView.getCheckItemIds: (at)Deprecated annotation and (at)deprecated doc tag do not match
Checking API: checkapi-last
(unknown): error 17: Field org.apache.http.protocol.HTTP.EXPECT_CONTINUE has changed value from "100-Continue" to "100-continue"​
Solve it by:
The error here is that someone needs to change the "100-continue" line on line 63 of file external/apache-http/src/org/apache/http/protocol/HTTP.java to "100-Continue"​
And there's this one too:
Code:
host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
host SharedLib: libneo_cs (out/host/linux-x86/obj/lib/libneo_cs.so)
host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1
make: *** Waiting for unfinished jobs....
Which can be fixed by edditing frameworks/base/libs/utils/Android.mk
Change the line:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
To:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
This should give you a few files that possibly can be flashed to our tablets:
Code:
Install system fs image: out/target/product/generic/system.img
Target ram disk: out/target/product/generic/ramdisk.img
Target userdata fs image: out/target/product/generic/userdata.img
Happy Hacking.
[edit]
Here's the result, just in case anyone is brave enough to flash it.
http://www.megaupload.com/?d=7PCNF69Z
[/edit]
[edit 2]
I guess the next step would be editing the img files to order to add the necessary drivers.
You need YAFFS2 support to mount these files. YAFFS2 isn't included in this version of ubuntu however.
So get yaffs2:
Code:
git clone ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
..and get a nice old kernel, considering the current version in git doesn't support 2.6.39 cleanly.
Code:
wget http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.35/linux-2.6.35.13.tar.bz2
untar your kernel sources.
then follow the instructions included with YAFFS:
Code:
cd yaffs-dir
./patch-ker.sh c m linux-tree
complains that linux-tree/fs/yaffs2 already exists
rm -rf linuux-tree/fs/yaffs2
./patch-ker.sh c m linux-tree
Copy your /boot/config-XXX to the directory you unpacked your kernel tarball.
run a:
Code:
make oldconfig
Now add YAFFS to your config using
Code:
make menuconfig
(Filesystems->Miscellaneous filesystems->yaffs)
..compile and reboot ubuntu into your own kernel containing yaffs2 support
mount your img files with
Code:
mount -o loop -t yaffs2 filename mountpoint
[/edit 2]
[edit 3]
So apparently building cyanogenmod doesn't mean you're building a full rom, you have to do the kernel seperately (as far as I can tell ATM):
http://wiki.cyanogenmod.com/index.php?title=Building_Kernel_from_source
there was no /proc/config.gz, so i ripped the urkdroid kernel .config file instead
also getting an arm toolchain working seemed tedious, so I followed the advice in on the wiki and got one from:
http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3053
Had to tell the compile process where to find the arm compiler. Think I'm actually using one I downloaded from Ubuntu's repository instead of the one from the above link - oh well.
Code:
[email protected]:~/android/kernel/cm-kernel# make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- -j`grep 'processor' /proc/cpuinfo | wc -l`
[/edit 3]
wvl0 said:
Touché. I guess I'll just add what I learned then.
How to get your buildsystem up and running on Ubuntu Oneiric 64bit.
Before following this guide: http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Sholes
Do this first, just to avoid having to install individual packages later on:
Code:
add-apt-repository "deb http://archive.canonical.com/ maverick partner"
Code:
apt-get install bison build-essential curl flex g++-4.3-multilib gcc-4.3-multilib git-core g++-multilib gnupg gperf lib32ncurses5-dev lib32readline5-dev lib32z1-dev libc6-dev-i386 libesd0-dev libncurses5-dev libsdl1.2-dev libsdl-dev libwxgtk2.6-dev ncurses-dev pngcrush schedtool squashfs-tools sun-java6-jdk zip zlib1g-dev
I think I ran into compile issues with gcc-4.6, so I switched over to 4.4
Code:
rm /usr/bin/gcc
ln -s /usr/bin/gcc-4.4 /usr/bin/gcc
rm /usr/bin/g++
ln -s /usr/bin/g++-4.4 /usr/bin/g++
Then following this guide to get ADB running with your tablet:
http://forum.xda-developers.com/archive/index.php/t-892847.html
Now you can follow the Sholes build guide.
You might run into compile issues. This bug report includes a fix:
http://code.google.com/p/cyanogenmod/issues/detail?id=2455
and in case you run into this one:
frameworks/base/core/java/android/widget/ListView.java:3631: warning 13: Method android.widget.ListView.getCheckItemIds: (at)Deprecated annotation and (at)deprecated doc tag do not match
Checking API: checkapi-last
(unknown): error 17: Field org.apache.http.protocol.HTTP.EXPECT_CONTINUE has changed value from "100-Continue" to "100-continue"​
Solve it by:
The error here is that someone needs to change the "100-continue" line on line 63 of file external/apache-http/src/org/apache/http/protocol/HTTP.java to "100-Continue"​
And there's this one too:
Code:
host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
host SharedLib: libneo_cs (out/host/linux-x86/obj/lib/libneo_cs.so)
host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1
make: *** Waiting for unfinished jobs....
Which can be fixed by edditing frameworks/base/libs/utils/Android.mk
Change the line:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
To:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
This should give you a few files that possibly can be flashed to our tablets:
Code:
Install system fs image: out/target/product/generic/system.img
Target ram disk: out/target/product/generic/ramdisk.img
Target userdata fs image: out/target/product/generic/userdata.img
Happy Hacking.
[edit]
Here's the result, just in case anyone is brave enough to flash it.
http://www.megaupload.com/?d=7PCNF69Z
[/edit]
[edit 2]
I guess the next step would be editing the img files to order to add the necessary drivers.
You need YAFFS2 support to mount these files. YAFFS2 isn't included in this version of ubuntu however.
So get yaffs2:
Code:
git clone ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
..and get a nice old kernel, considering the current version in git doesn't support 2.6.39 cleanly.
Code:
wget http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.35/linux-2.6.35.13.tar.bz2
untar your kernel sources.
then follow the instructions included with YAFFS:
Code:
cd yaffs-dir
./patch-ker.sh c m linux-tree
complains that linux-tree/fs/yaffs2 already exists
rm -rf linuux-tree/fs/yaffs2
./patch-ker.sh c m linux-tree
Copy your /boot/config-XXX to the directory you unpacked your kernel tarball.
run a:
Code:
make oldconfig
Now add YAFFS to your config using
Code:
make menuconfig
(Filesystems->Miscellaneous filesystems->yaffs)
..compile and reboot ubuntu into your own kernel containing yaffs2 support
mount your img files with
Code:
mount -o loop -t yaffs2 filename mountpoint
[/edit 2]
[edit 3]
So apparently building cyanogenmod doesn't mean you're building a full rom, you have to do the kernel seperately (as far as I can tell ATM):
http://wiki.cyanogenmod.com/index.php?title=Building_Kernel_from_source
there was no /proc/config.gz, so i ripped the urkdroid kernel .config file instead
also getting an arm toolchain working seemed tedious, so I followed the advice in on the wiki and got one from:
http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3053
Had to tell the compile process where to find the arm compiler. Think I'm actually using one I downloaded from Ubuntu's repository instead of the one from the above link - oh well.
Code:
[email protected]:~/android/kernel/cm-kernel# make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- -j`grep 'processor' /proc/cpuinfo | wc -l`
[/edit 3]
Click to expand...
Click to collapse
That looks very good
wvl0 said:
Touché. I guess I'll just add what I learned then.
How to get your buildsystem up and running on Ubuntu Oneiric 64bit.
Before following this guide: http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Sholes
Click to expand...
Click to collapse
This may be my misunderstanding but I thought this guide only teaches you how to compile your own cyanogen build for the Motorola Sholes. It even states that you need a sholes with a working copy of cyanogenmod installed. This guide will only work for devices which are already supported by the cyanogenmod team, and is not a guide to build for unsupported devices. At least, that was my understanding from spending most of a day crawling around the cyanogenmod wiki.
Part of the build process involves pulling proprietary system files from the device. I guess one starting point would be to work out which files these are, then obtain the files from the archos. However, this stuff takes time to learn and I have very little to spare, like most. But then, neither am I asking someone else to do it, or sitting waiting for it.
If it comes, it comes...
Building for a compatible CPU architecture should at least give you a semi bootable ROM, after that you have to get the drivers in.
Considering we have the source and are using the same kernel versions, we can just recompile the drivers for our kernel.
wvl0 said:
Building for a compatible CPU architecture should at least give you a semi bootable ROM, after that you have to get the drivers in.
Considering we have the source and are using the same kernel versions, we can just recompile the drivers for our kernel.
Click to expand...
Click to collapse
Thank, you guys!
Could you please joyn my Thread for CM Developement, so other guys could help?
One thread is better than two
Finally, guys with Knowledge work on a CM, how can i help?
You could help by completely taking over, 'cause I don't want a cyanogen rom per se, I just want to show people that you don't have to be a developer to compile a rom.
wvl0 said:
You could help by completely taking over, 'cause I don't want a cyanogen rom per se, I just want to show people that you don't have to be a developer to compile a rom.
Click to expand...
Click to collapse
Okey, i understand^^
Could you tell me a few steps to compile the CM ?, i think the drivers we'll do later

Building Android 5 for n7000

I want to compile Android 5 for the Galaxy Note.
Set up Linux build environment:
1. Download http://elementaryos.org/ and install
2. sudo apt-get install openjdk-7-jdk 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:i38 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386; sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so; echo "export USE_CCACHE=1" >> ~/.bashrc; mkdir ~/bin; mkdir ~/android/distroname; curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo; chmod a+x ~/bin/repo; cd ~/android/distroname
3. repo init -u https://android.googlesource.com/platform/manifest -b android-5.0.0_r1
4. repo sync; source build/envsetup.sh
Copy n7000 files from a working distro:
export rs="rsync -av --delete"
export distro="~/android/distro"
$rs $distro/device/samsung device/
$rs $distro/hardware/samsung hardware/
$rs $distro/vendor/samsung vendor/
$rs $distro/kernel/samsung kernel/
$rs $distro/hardware/ril hardware/
# $rs $distro/hardware/ril/libril/Android.mk hardware/ril/libril/ #(for the BOARD_PROVIDES_LIBRIL)
$rs $distro/device/samsung/galaxys2-common/selinux/uevent.te device/samsung/galaxys2-common/selinux/ueventd.te
# $rs distro/frameworks/opt/telephony/src/java/com/android/internal/telephony/Samsung* frameworks/opt/telephony/src/java/com/android/internal/telephony/
$rs $distro/hardware/libhardware_legacy hardware/
add 'system/media/camera/include' to device/samsung/galaxys2-common/camera/Android.mk in LOCAL_C_INCLUDES
edit device/{n7000,galaxys2-common}/overlay/frameworks/base/core/res/res/values/{config,arrays}.xml and comment out the options added by the distro that it complains about. For me that's "shutdown_reboot_options, shutdown_reboot_actions, config_forceDisableHardwareKeyboard, config_enableTorch, config_deviceHardwareKeys, config_stylusGestures, config_samsung_stk"
lunch full_n7000-userdebug
time make -j8
The source is online. Here's the command:
Code:
repo init -u https://android.googlesource.com/platform/manifest -b android-5.0.0_r1
repo sync
Mine is syncing now.
Yes. Let me test once ready....
jjamain said:
Yes. Let me test once ready....
Click to expand...
Click to collapse
Me too..
Meeee tooooooooo...
Sent from my GT-N7000 using Tapatalk
raoabdullah said:
Meeee tooooooooo...
Sent from my GT-N7000 using Tapatalk
Click to expand...
Click to collapse
how to much time to take for building android l for n7000
rvkumar said:
how to much time to take for building android l for n7000
Click to expand...
Click to collapse
SAME AS TIME TAKES TO CATCH FISH
Mine still isn't done syncing.
I think maybe the servers are being overloaded from too many people syncing, because I'm getting errors that say "the remote end hung up unexpectedly", and I have to restart the sync.
hey guys i heard google released native android l just yesterday, is this true?
is it possible to port it to n7000 then?
It's true. I'm going to try to compile it for n7000. If you want to try too, just install Linux in a virtual machine if you don't run it, and use repo to sync the source code. Then we'll go over the steps to get it to work.
Mine is done syncing. I'm trying to compile.
noterio said:
Mine is done syncing. I'm trying to compile.
Click to expand...
Click to collapse
I am waiting...
I copied the n7000 files into the tree. When compiling it complains that libril is already defined. There's a libril in hardware/ril, which is the one that comes with Android, and one in hardware/samsung/ril. I removed the stock one, to use the Samsung one. It's still compiling, so I don't know if that worked yet.
noterio said:
It's true. I'm going to try to compile it for n7000. If you want to try too, just install Linux in a virtual machine if you don't run it, and use repo to sync the source code. Then we'll go over the steps to get it to work.
Click to expand...
Click to collapse
thanks for you answer
but that's an additionnal work with no touchscreen and Amoled screen experience so i think i will wait for your rom bro
Who said I was giving you a ROM? It's better to teach someone to fish than give them what you catch. Plus why do you trust random strangers with your operating system? I'll load it with a backdoor so I can steal all your bank accounts.
It choked on: tinyalsa_audio/audio_ril_interface
Then I redid the make, and it had a problem with tinyalsa_audio/mixer AUDIO_CHANNEL_OUT_SURROUND
Hmm.
noterio said:
Who said I was giving you a ROM? It's better to teach someone to fish than give them what you catch. Plus why do you trust random strangers with your operating system? I'll load it with a backdoor so I can steal all your bank accounts.
It choked on: tinyalsa_audio/audio_ril_interface
Then I redid the make, and it had a problem with tinyalsa_audio/mixer AUDIO_CHANNEL_OUT_SURROUND
Hmm.
Click to expand...
Click to collapse
Will this work https://github.com/JijonHyuni/galaxys2-common/tree/master/tinyalsa_audio? I need to get a Linux vm working.
Maybe. I have source trees from CyanogenMod, SlimKat, and LiquidSmooth set up, and I successfully compiled SlimKat and LiquidSmooth, so I am trying files from those. We should have everything we need, just need to find the right combo or edit some files to make it fit with the original AOSP code. I don't know enough about Android yet to know exactly what's going on, but I think just having the Samsung specific files should be enough to get it to build, as long as it's configured correctly.
I edited the first post with some basic steps to get the virtual machine ready to compile. Once we figure out the next steps to get it to build I'll add those. Also need to add the busybox and custom recovery files I think, which I haven't done yet. I just wanted to get it to compile with the basic stuff first.
noterio said:
Who said I was giving you a ROM? It's better to teach someone to fish than give them what you catch. Plus why do you trust random strangers with your operating system? I'll load it with a backdoor so I can steal all your bank accounts.
It choked on: tinyalsa_audio/audio_ril_interface
Then I redid the make, and it had a problem with tinyalsa_audio/mixer AUDIO_CHANNEL_OUT_SURROUND
Hmm.
Click to expand...
Click to collapse
Well i am not an android geek to port or compile roms and builds. i know it's easy to learn but it's hard to master so that will require too much time which i don't have at the moment that's why i will wait for you do all the work LOL
and concerning the bank account details theft, well i don't have a bank account
Is anyone else trying to build this? The latest error is about there being no system/camera_vendor_tags.h

[GUIDE][CM12] Compiling CM12 for Moto G and cherry picking features.

Here's a little something for the guys (and flashaholics) who don't like to wait for devs to release new CM12 builds.
AFAIK ROMS CAN'T BE COMPILED ON 32 BIT SYSTEMS. ONLY 64 BIT.
YOU CAN USE ANY DISTRO YOU WANT. I USE UBUNTU 14.10 DUAL BOOTED, BUT THAT'S JUST A PERSONAL PREFERENCE.
We start with setting up the build environment:
First, start with installing this:
Code:
sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
Once that is done, we go about installing JDK-7 since that's the one that works for lollipop
Code:
sudo apt-get install openjdk-7-jdk
Then we install the Android SDK for some useful stuff:
Code:
sudo apt-get install android androidsdk-uiautomatorviewer android-copyright android-src-vendor android-emulator android-tools-adb android-headers android-tools-adbd androidsdk-ddms android-tools-fastboot androidsdk-hierarchyviewer android-tools-fsutils androidsdk-traceview
Once all that is dealt with, we can move on to the repo tool. That's what will get your CM repos syncing:
Code:
mkdir -p ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
and then, reboot to apply the changes.
Now for the interesting part
Not really, actually.
Time to yank the CM source code.
Create a working directory where you're going to sync all the sources and do the dirty stuff.
For this guide, we'll call the working directory "cm12"
Create the directory by running
Code:
mkdir cm12
enter your working directory by typing
Code:
cd cm12
Inititialize the repo by throwing in:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-12.0
Wait for all the activity in the terminal to cease. And then type in:
Code:
repo sync
while the stuff is downloading, grab a ginger ale, or a cup of coffee and admire your handiwork. If you're the impatient type, find a generous dose of your favourite sedative, and knock yourself out for a few hours. When you're up again, you'll be faced with one of two things. Either your repos have synced successfully (yay!), or you get some nasty fetch errors. If it's the latter, then, Voila! You've just faced your first ever compiling frustration. Take some time out and break a few things, drive the neighbours crazy and then return to the PC and knock in:
Code:
repo sync -j1
This should (hopefully) work perfectly as long as you have an internet connection worth paying for. If not, then compiling probably isn't for you anyway.
Once all that stuff's over, create a folder called
Code:
local_manifests
in the .repo folder, and then make a new file in that folder called
Code:
roomservice.xml
open roomservice.xml using gedit, and add the following:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_motorola_falcon" path="device/motorola/falcon" remote="github" revision="cm-12.0"/>
<project name="CyanogenMod/android_device_motorola_msm8226-common" path="device/motorola/msm8226-common" remote="github" revision="cm-12.0"/>
<project name="CyanogenMod/android_device_qcom_common" path="device/qcom/common" remote="github" revision="cm-12.0"/>
<project name="CyanogenMod/android_kernel_motorola_msm8226" path="kernel/motorola/msm8226" remote="github" revision="cm-12.0"/>
<project name="TheMuppets/proprietary_vendor_motorola" path="vendor/motorola" remote="github" revision="cm-12.0"/>
<project name="CyanogenMod/android_hardware_qcom_fm" path="hardware/qcom/fm" remote="github" />
</manifest>
Then cd back to your working directory
Code:
cd ~/cm12
YOU'RE READY TO ROLL!
Finally, to build, type in:
Code:
. build/envsetup.sh && brunch falcon
If you have a really powerful PC, then use:
Code:
. build/envsetup.sh && brunch cm_falcon-userdebug -j8
And if you have a really really powerful PC, then use:
Code:
. build/envsetup.sh && brunch cm_falcon-userdebug -j16
Wait for the build to compile. Usually takes about 2-3 hours on an okay PC. You'll find your completed build in cm12/out/target/product/falcon.
The next time you want to build, run:
Code:
make clean
repo sync
. build/envsetup.sh
brunch falcon
.. and so on.
Happy Building!
What're you looking at? This is mine!
One more. Just in case.
Thought I'd add to this
Instead of breakfast and editing room service
U can manually create a folder in .repo folder name it local_manifests make a file say falcon.xml
Add contents required Im on phone now will share the code in a while
Oh and brunch falcon is enough no need adding cm_falcon-userdebug part
Thank you for the guide! (I am limited to 8 thanks per day so ill hit the thanls button tomorrow xD ) You might want to add a few more details on why we use linux distros as our compiling OSes and what toolchains, etc. are. After all those 2 reserved posts do need to be put to use.
bharat_goku said:
Thought I'd add to this
Instead of breakfast and editing room service
U can manually create a folder in .repo folder name it local_manifests make a file say falcon.xml
Add contents required Im on phone now will share the code in a while
Oh and brunch falcon is enough no need adding cm_falcon-userdebug part
Click to expand...
Click to collapse
I know. But for the time being, brunch falcon -j8 doesn't work. It requires cm_falcon..... And, yeah. I was going to add that when I logged on to Ubuntu next.
Where is cherrypicking?
fabus said:
Where is cherrypicking?
Click to expand...
Click to collapse
I'll be typing out a guide for that once my hands get over this long post.
rudi_j7 said:
I know. But for the time being, brunch falcon -j8 doesn't work. It requires cm_falcon..... And, yeah. I was going to add that when I logged on to Ubuntu next.
Click to expand...
Click to collapse
I don't normally use -j8 so not sure
Add the ccache step for users I get my build ready within about 50minutes roughly by assigning 25gb find it more efficient this way,gimme a bit I'm making a new build I'll test the -j8 part then
bharat_goku said:
I don't normally use -j8 so not sure
Add the ccache step for users I get my build ready within about 50minutes roughly by assigning 25gb find it more efficient this way,gimme a bit I'm making a new build I'll test the -j8 part then
Click to expand...
Click to collapse
I use -j8 and -j16 when I'm in a hurry... and it does work. And, right now i was just focusing on adding the most basic stuff. It takes some time and effort to type out so much.
First of all,thanks for the tutorial.
But i have a question,wich distro you use? Linux? Ubuntu? And wich number? And do you use dualboot or native? Or you have an Virtual Machine? Please,i want to know wich should i use
DeHuMaNiZeD said:
First of all,thanks for the tutorial.
But i have a question,wich distro you use? Linux? Ubuntu? And wich number? And do you use dualboot or native? Or you have an Virtual Machine? Please,i want to know wich should i use
Click to expand...
Click to collapse
Personally, I dualboot Ubuntu 14.10 on a 1TB HDD and 128 GB SSD. Virtual machines are usually much much slower, but more convenient. It all depends on whether you want to take the trouble to set up a dual boot or not.
rudi_j7 said:
Personally, I dualboot Ubuntu 14.10 on a 1TB HDD and 128 GB SSD. Virtual machines are usually much much slower, but more convenient. It all depends on whether you want to take the trouble to set up a dual boot or not.
Click to expand...
Click to collapse
Well,i'll try to configure it,but i did this a long time ago and i'm not shure do i remember. Thanks man
I built this for a friend of mine, but he says CDMA doesn't work. Any fix?
topias123 said:
I built this for a friend of mine, but he says CDMA doesn't work. Any fix?
Click to expand...
Click to collapse
So far CDMA isn't working on CM12, but there's another thread in the general section where I think CDMA works.
Sent from my OnePlus One using XDA Premium 4 mobile app
Nice tutorial,and will it be same for if we compile paranoid 5.0 ? and i learned somewhere that there are patches also to fix some basic things ?
Bhavy123 said:
Nice tutorial,and will it be same for if we compile paranoid 5.0 ? and i learned somewhere that there are patches also to fix some basic things ?
Click to expand...
Click to collapse
Generally I suppose it would be the same except for the local_manifest entries. Dunno about the patches. I haven't gone about building PA 5.0.
Sent from my OnePlus One using XDA Premium 4 mobile app
You r such a big developer and even wrote such a wonderful guide but plz write for porting latest multirom for Falcon also ,I didnt understood tassador's guide as i am a newbie,sorry if i went offtopic
Bhavy123 said:
You r such a big developer and even wrote such a wonderful guide but plz write for porting latest multirom for Falcon also ,I didnt understood tassador's guide as i am a newbie,sorry if i went offtopic
Click to expand...
Click to collapse
I'm no big dev. Always learning. About multiROM, my friend is already porting it. If he's stopped work, I'll PM you a guide.
Sent from my OnePlus One using XDA Premium 4 mobile app
Thaaank you man for that guide!
It absolutely worked for me, awesome! So glad to know how to compile my own rom now

[Guide][9/3/2015] Building CM12 for the Nexus 6 Shamu

Building CM12 from source for the Nexus 6 Shamu!
Thanks goes to @scrosler and @GROGG88 and @sykopompos for their amazing guide
[Guide][1/19/2015] Buulding AOSP for the Nexus 6!​
This guide will walk you through, how to build CM12 for the Nexus 6 from source. To complete this, you will need a PC with either virtual box setup and Ubuntu or duel boot Windows and Ubuntu. I recommend duel booting as it gets better results.​
Ideally your PC will need a minimum of an I5 processor and 8GB of ram. I won't go into too much detail on how to setup Ubuntu on your PC. For this guide, you do need to know the basic commands and how to use Ubuntu.
This guide is very similar in process to @scrosler and @GROGG88 and @sykopompos amazing guide here: [Guide][1/19/2015] Building AOSP for the Nexus 6! Through the use of their guide and asking a lot of questions on their thread, I was able to learn how to build AOSP from source. My guide is to complement their guide and show you how to build CM12, I found switching from AOSP to CM12 fairly easy, but there were a few changes in the process.
For my guide I will be using CM12 build guide as reference for the commands. How To Build CyanogenMod Android for Google Nexus 6 ("shamu") Even their guide is not 100% up to date, so I had to make a few changes.
Disclaimer:
I am not responsible for any damage done to your device, thermal nuclear war etc. Please use at your own risk. Your warranty may be affected if you install a custom rom. I am also not responsible if you go over your payment plan when downloading the source code. It is large over 16gb so be careful!
Click to expand...
Click to collapse
So assuming you have Ubuntu 14.* set up, you will need to now set up your build environment:
First on their guide it talks about installing the SDK tools. You do not need these to build the ROM. You only really need ADB commands. I installed fastboot as well.
Install ADB command
Code:
sudo apt-get install android-tools-adb
Install Fastboot command
Code:
sudo apt-get install android-tools-fastboot
Install Java
Code:
sudo apt-get install openjdk-7-jdk
Setting up the build enviroment
Code:
bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev
If you have a 64bit PC install the following:
Code:
g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
Setting your build directory - This can be any folder you want. for my example I will use android as my root folder. Remember that Ubuntu is case sensitive when switching folders.
Code:
mkdir -p ~/bin
mkdir -p ~/android
Install Repo
Code:
curl [URL]https://storage.googleapis.com/git-repo-downloads/repo[/URL] > ~/bin/repo
chmod a+x ~/bin/repo
Put the ~/bin directory in your path of execution - In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Now for the good bit! We are about to download the source for cm12. Warning: The download is large and will take a long time to download. I have a 38mb fiber connection and unlimited data plan, so it is ok for me to download. I believe the download is 16gb+ in size, so you will have to take this into consideration. Note: I will not be held responsible if you go over your payment plan with your service provider. This is were I have had to start changing the guide a bit as CM's document is for building CM11. It has not been updated to CM12 yet.
Identify Yourself to the Repo
Code:
git config --global user.email "[email protected]"
git config --global user.name "yourpreferredusername"
Initialize the CyanogenMod source repository
Code:
cd ~/android [B]- this is your root folder[/B]
repo init -u [URL]https://github.com/CyanogenMod/android.git[/URL] -b cm-12.0
Download the source code - Note this will take a while, as mentioned it is over 16gb in size. Even with my connection it takes about an hour and a half to download, so time for coffee!
Code:
repo sync
If repo sync errors and stops during download, don't worry you can simply run the command again and it will pick up were it left off. If you get a lot of errors during download, I recommend using
Code:
repo sync -j1
This seems to download the source better. When you have completed the download run it again, to make sure it completes with out any errors. This way you know you have downloaded the full source code.
Backup your home directory
Also at this point, what I do is make a backup using the inbuilt backup software in ubuntu. This backs up my entire home directory to a secondary hard drive I have set up in my PC. This way if I have any issues and need to start from scratch, I can simply delete my android directory, then restore from backup. I then have a fresh working copy and don't have to spend time downloading source from CM12 again. I would also recommend this as part of scrosler's guide as well, when you have finished downloading AOSP source.
Vendor and device specific files
Now this is were the cm12 guide starts to differ a bit from AOSP. AOSP you have to download the vendor files and extract them and then add in missing ones as well. CM12 differs here. At this point I would recommend having CM12 on your Nexus 6. It uses ADB to pull files from your phone and set up the device specific files and the vendor files. I found having CM12 on the phone made life easier at this point. You can use my ROM as an example here: [ROM][5.0.2][CM12 - Android L][LRX22G] Version 1.0.0 - [8/03/2015] - Native LED's
Code:
cd ~/android
source build/envsetup.sh
breakfast shamu
Extract proprietary blobs
Now ensure that your Nexus 6 is connected to your computer via the USB cable and that you are in the ~/android/device/moto/shamu directory, then run the extract-files.sh script
Code:
cd ~/android/device/moto/shamu
./extract-files.sh
Turn on caching to speed up build
You can speed up subsequent builds by adding: the following command to your to your .bashrc file To do this close your terminal window and then reopen and type ./.bashrc - A text editor will open. Add this line to the bottom of the page.
Code:
export USE_CCACHE=1
Close the text editor and save the file
Then in the command window type the following. CM12 recommend 50GB, but you can change to what ever you want.
Code:
prebuilts/misc/linux-x86/ccache/ccache -M 50G
Building CM12!!!!
Now you are all set to start building CM12. You have everything you need. So run the following commands:
Code:
cd ~\android
source build/envsetup.sh
brunch shamu
Thats it! CM12 is now building. This will take some time to build. I do recommend a duel boot PC as it works better than in Virtual Box. Even in my PC it takes about an hour and a half to do a fresh build and about 15 minutes to do a dirty build.
So once the build finishes you now have a flash-able version of CM12 from their latest source that you can flash on your Nexus 6 - Congratulations - you are now among the elite who can build their own ROM from source
The zip file is stored in the following directory:
Code:
cd ~/android/out/target/product/shamu/cm-12-20150308-UNOFFICIAL-shamu.zip
The file name will depend on the day you build the ROM, so it may be slightly different.
Here is an example output of a successful build of CM12!
{
"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"
}
​ Note of caution here:
Now that you have built CM12 as in AOSP I would not recommend flashing at this stage, it will make the following changes to your phone:
Install stock recovery
Encrypt your phone
To get around these we will need to make the following changes. See post 2 on how to make the changes.
As mentioned in post 1, after building CM12 you dont really want to flash it yet. It will:
Install stock recovery
Encrypt your phone - This is optional you can leave it to encrypt, but it is best to give the user the choice to do so or not.
In this post, I will also show you how to make other changes, eg: changing default wallpaper etc. I have a GitHub setup for this and all you need to do, is cherry-pick the commands into your folder, then compile the rom. My main source for all my changes are located here: https://github.com/StephenRJ - you are free to use these changes, but please give credit if you do.
Disable recovery.
Code:
cd ~/android/system/core/rootdir
git init
git fetch https://github.com/StephenRJ/cm12_system_core_rootdir.git
git cherry-pick f413ac907961c07f07f767ceb568deb4881e9f57
This next cherry-pick command will all the user the option of setting encryption on the phone, rather than it being automaticly encrypted.
Disable encryption
Code:
cd ~/android/device/moto/shamu
git init
git fetch https://github.com/StephenRJ/cm12_device_moto_shamu.git
git cherry-pick 7459b0d54102fbee27f363e7612b83f614a0f8c4
Now you have both of these disabled, you will need to do a fresh build again. To do this, I simply delete the out folder. Open file manager and go to android - then delete the folder out. This will let you make a full build again.
Close your terminal window and reopen.
Start a fresh build
Code:
cd ~/android
source build/envsetup.sh
brunch shamu
Now you can flash CM12 on your Nexus 6 Shamu Congratulations!!!!!
I will continue to add more fixes here has I find them.
Here are a couple of video tutorials I have found on setting up a basic Ubuntu enviroment.
Virtual Box: https://www.virtualbox.org/wiki/Downloads
Ubuntu ISO: http://www.ubuntu.com/download/desktop
Tutorial on setting up Virtual box on Windows 7 / 8
Duel boot Windows 8 and Ubuntu - Prefered method
Disclaimer
I am not responsable for anything that happens to your PC during the install of Ubuntu. I recommend taking a full backup first before installing a second operating system. Do this at your own risk. If your are not sure about installing different oprating systems, use the first method as it is safer
Click to expand...
Click to collapse
Change Log
Version 1.0.0
- Initial release
Please feel free to share here and help each other. I hope this guide is as useful to users as scrosler's has been. With out his help and guide, I would have never have been able to learn how to build AOSP for this amazing phone. I hope this guide gives more users the chance to build CM12 as well.
Using this guide, I have built and released a ROM. Please have a look here: [ROM][5.0.2][CM12 - Android L][LRX22G] Version 1.0.0 - [8/03/2015] - Native LED's
Please feel free to try it and report back!
I would suggest using a local manifest and getting your vendor files from TheMuppets repo. That way you stay up to date on any changes that are made.
Thanks for the tip. Could you explain a bit more on how to do that? I had installed an existing stock CM12 rom on the phone and then used the commands to remotely pull the files from it.
Stephen said:
Thanks for the tip. Could you explain a bit more on how to do that? I had installed an existing stock CM12 rom on the phone and then used the commands to remotely pull the files from it.
Click to expand...
Click to collapse
CM's wiki has a pretty good guide.
http://wiki.cyanogenmod.org/w/Doc:_Using_manifests#The_local_manifest
Also, not sure the recovery thing mentioned is an issue. I've been building CM for this device for nearly 2 months and have had no issues with TWRP being replaced.
Excellent guide! Now I just need a Nexus 6... :silly:
I love seeing useful tutorials being posted. That's why I got involved in @scrosler's thread. Nice job!!
akellar said:
Also, not sure the recovery thing mentioned is an issue. I've been building CM for this device for nearly 2 months and have had no issues with TWRP being replaced.
Click to expand...
Click to collapse
Agreed. I was just about to post that too. Most custom ROMs remove the stock recovery so custom recoveries don't get overwritten.
Very cool ill try this tomorrow! Can you maybe add a section on how to find and add nice cherrypicks?
Regarding the recovery I added that in on the safe side. I know if you download the full stock cm12 from their website it does change the recovery and encrypt the device.
I will be adding a few more cherry picks at some stage, I am working on something rather cool at the minute.
Thanks for doing this. I've followed a few guides but every one wasn't quite correct. I can't wait to test this out soon.
- Aaron
Very well done Stephen! I read as many of these as I can and always learn something new. This is very well written and I hope all of us can add and help each other as we progress with the N6!:good:
Hey,
I have built AOSP for Nexus devices for a long time, but have yet to run into this issue.
When I run "brunch shamu", it fails, referancing generic "goldfish"? is that just a generic device name?
Here is the build process:
[email protected]:~/android$ source build/envsetup.sh
including device/moto/shamu/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/cm/bash_completion/git.bash
including vendor/cm/bash_completion/repo.bash
[email protected]:~/android$ brunch shamu
including vendor/cm/vendorsetup.sh
Looking for dependencies
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.0.2
CM_VERSION=12-20150315-UNOFFICIAL-shamu
TARGET_PRODUCT=cm_shamu
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-31-generic-x86_64-with-Ubuntu-14.10-utopic
HOST_BUILD_TYPE=release
BUILD_ID=LRX22G
OUT_DIR=/home/npjohnson/android/out
============================================
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.0.2
CM_VERSION=12-20150315-UNOFFICIAL-shamu
TARGET_PRODUCT=cm_shamu
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-31-generic-x86_64-with-Ubuntu-14.10-utopic
HOST_BUILD_TYPE=release
BUILD_ID=LRX22G
OUT_DIR=/home/npjohnson/android/out
============================================
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
find: `src': No such file or directory
"ebtables is disabled on this build"
find: `dummy': No such file or directory
build/core/base_rules.mk:154: *** system/device/generic/goldfish/audio: MODULE.TARGET.SHARED_LIBRARIES.audio.primary.goldfish already defined by device/generic/goldfish/audio. Stop.
Not sure, haven't seen that error before. Have you added any extra mods into the rom? One of those could be causing the issue. It could also be an issue with CM12 its self. Some times they do add code in and it can cause errors.
I would try downloading source again and see if there is any difference.
Stephen said:
Not sure, haven't seen that error before. Have you added any extra mods into the rom? One of those could be causing the issue. It could also be an issue with CM12 its self. Some times they do add code in and it can cause errors.
I would try downloading source again and see if there is any difference.
Click to expand...
Click to collapse
Will do. I am building on Ubuntu 14.10. That should be OK to use correct? Fresh install, then followed steps in the OP.
npjohnson said:
Will do. I am building on Ubuntu 14.10. That should be OK to use correct? Fresh install, then followed steps in the OP.
Click to expand...
Click to collapse
Yes. Oh what setup are you using. Virtual Box or duel boot. I did have problems with Virtual box and switched to duel boot. Found it to be more stable.
Stephen said:
Yes. Oh what setup are you using. Virtual Box or duel boot. I did have problems with Virtual box and switched to duel boot. Found it to be more stable.
Click to expand...
Click to collapse
Dual boot.
Any idea why my builds come in at around 387MB but the official nightlies are ~443MB?

[Guide]How To Compile Kernel (Especially for Redmi Note 5A)

Hi guys , it is a common fact that kernel runs linux. Without kernel, linux won't be usable. One of linux family is Android. Okay, so after that preamble, i just want to share to you "How To Compile Kernel (Especially for Redmi Note 5A)"​
So, Let's start !​Prerequisites :
1. Laptop/PC with Linux installed (i prefer Ubuntu based distro, for other distributions i'll update if i have tested​2. Already installed needed package (you'll see list below)​3. Internet connection (Optional if you have prepared all)​
Stages :
1. Install all needed packages by typing this command in terminal (if you encounter any error just delete the package that causes error)
Code:
sudo apt-get install git –core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib adb
2. Get the compiler(gcc) by typing this command in terminal
Code:
git clone <url> gcc
3. Get the kernel source from github or gitlab or whatever the service is by typing this command in terminal
Code:
git clone –b <branch name> https://github.com/xxx/xxx
Compile :
After all required components are ready, now let's start compiling our kernel. Run terminal in your kernel folder and type commands below :
1. First, we have to export(to tell the computer) the path of our compiler(gcc) by typing this command :
Code:
export CROSS_COMPILE=/home/<your host>/<gcc folder>/bin/<toolchain prefix>
Example :
Code:
export CROSS_COMPILE=/home/nayef/gcc/bin/aarch64-linux-android-
2. Second, we have to export(to tell the computer) the architecture for our devices. Fortunately Redmi Note 5A has ARM 64 bit architecture, so it should be "arm64".
Code:
export ARCH=arm64 && export SUBARCH=arm64
3. Third, before compiling, let's configure our devices configuration by using available defconfig, usually our devs name it "ugglite_defconfig", but from official Xiaomi source it is "ugglite_msm8937_defconfig" . There are many sources of Redmi Note 5A Kernel. PM me if you want the list.
Code:
make O=out <defconfig name>
Example:
Code:
make O=out ugglite_defconfig
4. Now, let's compile it by typing this commands below
Code:
make O=out -j4
Reference :
nathanchance thread
Android Google Source
Hey man, does the wifi work after compiling the kernel?
I am trying to compile redmi 5a kernel from source.
Even though device boots with new kernel , the wifi doesn't work.
The guid at https://github.com/MiCode/Xiaomi_Kernel_OpenSource/wiki/How-to-compile-kernel-standalone
talks about non-dtbo and include-dtbo. What are those? Can you give me some idea.
Partha Dip said:
Hey man, does the wifi work after compiling the kernel?
I am trying to compile redmi 5a kernel from source.
Even though device boots with new kernel , the wifi doesn't work.
The guid at https://github.com/MiCode/Xiaomi_Kernel_OpenSource/wiki/How-to-compile-kernel-standalone
talks about non-dtbo and include-dtbo. What are those? Can you give me some idea.
Click to expand...
Click to collapse
you have to add prima wlan drivers to get wifi working correctly
Bro plz help me .tell me the source and toolchain you use plz bro reply plz I request
Bro plz tell me toolchain and source you use
Mind sending me the guide that you use to root your Redmi 5A? I'm not so interested into building my own kernel from source, as I don't really see any benefits of doing so unless I'm changing compilation flags which, at least right now, is not my intention.
I have experience with Linux, but I'm having a few questions that I cannot come up with the answer and some technical issues which I'm still trying to overcome, and I've seen several guides from several people each doing different stuff to achieve the same goal and I'm lost on which one to follow and why, as most of them are oversimplified and are merely a set of instructions without further explanation, and I would hate to brick my phone because of it (although it's a old phone so that's not that bad).
Also the github page you mentioned has an outdated version of the Linux kernel.
Also since the Redmi 5A runs armv8 (aarch64) you could run any Linux distribution you like, right? Obviously it has to have support out of the box in the iso for touch screen otherwise you can't do anything, but I should be fine installing a generic distribution that ships with aarch64 and touch input, right? Worst case scenario it doesn't ship with the drivers required for some components to works, as you mentioned with wi-fi, but that's a matter of installing it on the system.

Categories

Resources