CM9 Compile Issues [SOLVED] DELETE THREAD - Android Q&A, Help & Troubleshooting

Trying to build cm9 for an unsupported device, the LG Spectrum for Verizon Wireless. It starts building and then i get:
make: *** No rule to make target `out/target/product/vs920/obj/lib/libaudio.so', needed by `out/target/product/vs920/obj/SHARED_LIBRARIES/audio.primary.vs920_intermediates/LINKED/audio.primary.vs920.so'. Stop.
I'm not entirely sure why its naming it audio.primary.vs920.so as on the leaked ics rom its audio.primary.msm8660.so
also there is no libaudio.so file.
How can I fix this?
Thanks!
heres my device tree: https://github.com/death2all110/android_device_lge_vs920
and the vendor tree: https://github.com/death2all110/android_vendor_lge_vs920

Related

[ROM][SGH-I777][4.0.4] CyanogenMod 9 nightly builds | DEVELOPMENT THREAD

DEVELOPMENT THREAD
FOR DEVELOPERS ONLY​
DISCUSSION THREAD FOR USERS:
http://forum.xda-developers.com/showthread.php?t=1568848​
CyanogenMod is a free, community built, aftermarket firmware distribution of Android 4.0 (ICS), which is designed to increase performance and reliability over stock Android for your device.
Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* I am 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 me for messing up your device, I will laugh at you.
*
* Submitting bug reports on nightly builds is the leading
* cause of male impotence.
*/
CyanogenMod is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. CyanogenMod does still include various hardware-specific code, which is also slowly being open-sourced anyway.
All the source code for CyanogenMod is available in the CyanogenMod Github repo. And if you would like to contribute to CyanogenMod, please visit out Gerrit Code Review. You can also view the Changelog for a full list of changes & features.
General:
http://github.com/CyanogenMod
Device (you need both):
http://github.com/CyanogenMod/android_device_samsung_galaxys2
http://github.com/CyanogenMod/android_device_samsung_i777
Kernel:
https://github.com/teamhacksung/android_kernel_samsung_smdk4210
Build:
http://teamhacksung.org/wiki/index.php/CyanogenMod9:SGH-I777:How_to_build
Getting Started:
http://wiki.cyanogenmod.com/wiki/Howto:_Gerrit
Example:
- cd ~/android/system
- repo start branchname CyanogenMod/android_device_samsung_i777 (or android_device_galaxys2 depending on whether your work is in common galaxys2 or i777)
-- Make your changes at device/samsung/i777 (or galaxys2)
- cd device/samsung/i777 (or galaxys2)
- git add -A
- git commit -a
- cd ~/android/system
- repo upload CyanogenMod/android_device_samsung_i777 (or android_device_samsung_galaxys2 if your changes are to galaxys2)
Many of your changes will actually be in the android_device_samsung_galaxys2 repo as well as the code is shared between the galaxys2 and i777 so you will also need to work in that repo.
Navigate to http://review.cyanogenmod.com , click your commit and add atinm for i777, atinm, codeworkx and xplodwild for galaxys2, as reviewers.
Saved for later.
Alright, this thread has been cleaned up to here. All other non-dev members can discuss this here in the designated discussion thread in the General forum.
atinm - don't know if you saw, but there's a pending gerrit submission for an updated kernel.
The current set of kernels has ondemand as default but interactive governor enabled - this combo can cause hung task freezes in LPM and recovery.
http://review.cyanogenmod.com/#change,14072
(I tried to add you as a reviewer but I'm not sure if that's the correct atinm. The system is full of "use the other atinm" users. )
Entropy512 said:
atinm - don't know if you saw, but there's a pending gerrit submission for an updated kernel.
The current set of kernels has ondemand as default but interactive governor enabled - this combo can cause hung task freezes in LPM and recovery.
http://review.cyanogenmod.com/#change,14072
(I tried to add you as a reviewer but I'm not sure if that's the correct atinm. The system is full of "use the other atinm" users. )
Click to expand...
Click to collapse
Saw this too late - I pushed the same kernel plus an added assert for galaxys2 so people using the bad ported galaxys2 builds can get to i777. I'll take out the galaxys2 assert in a couple of days after people are on i777. Building a new nightly.
Will look at the GPS you have on gerrit in a little bit - have to be out for a few hours.
Building from source
I am trying to build it locally with following error:
Code:
[email protected]:~/android/system$ brunch i777
---//some skipped output///---
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/i777/cm.mk]]: "vendor/samsung/i777/i777-vendor-blobs.mk" does not exist. Stop.
** Don't have a product spec for: 'cm_i777'
** Do you have the right repo manifest?
My manifest:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_samsung_galaxys2" path="device/samsung/galaxys2" remote="github" />
<project name="CyanogenMod/android_device_samsung_i777" path="device/samsung/i777" remote="github" />
<project name="teamhacksung/android_kernel_samsung_smdk4210" path="kernel/samsung/smdk4210" remote="github" revision="ics" />
<project name="teamhacksung/buildscripts" path="buildscripts" remote="github" revision="ics">
<copyfile dest="build.sh" src="samsung/build.sh" />
</project>
<project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" />
</manifest>
Any help is greatly appreciated!
you didn't do extract-files
Not sure if looking for galaxys2 will cut it... Most likely a bunch of people are coming from Touchwiz-based firmwares.
I admit I am partially at fault - I didn't implement sed scripts in Hellraiser to change the model, partly to minimize the chances that something would break. (The rule was to change as little as possible to make things work in order to maximize compatibility.)
sam3000 said:
I had that too (link). As a workaround, edit device/samsung/i777/extract-files.sh and change DEVICE=galaxys2 to DEVICE=i777 and it should build. I'm not sure what the correct fix should be though..
The other stuff I mention in the linked post has since been fixed.
Click to expand...
Click to collapse
The issue is that the proprietary files that the i777 is using are from the galaxys2 and it just pulls them from there. But the .mk files that are generated need to go into the i777 directory. I've updated extract-files.sh to try to get around it, but need someone to test.
atinm said:
The issue is that the proprietary files that the i777 is using are from the galaxys2 and it just pulls them from there. But the .mk files that are generated need to go into the i777 directory. I've updated extract-files.sh to try to get around it, but need someone to test.
Click to expand...
Click to collapse
I tried to run extract-files.sh and got:
Code:
remote object '/system/lib/libGLESv2_dbg.so' does not exist
Which gave me this during compile:
Code:
make: *** No rule to make target `vendor/samsung/galaxys2-common/proprietary/libGLESv2_dbg.so', needed by `out/target/product/i777/system/lib/libGLESv2_dbg.so'. Stop.
I have the latest repo as describe in the op. Anyone else run into this issue? Ran the extract on cm7.
5942marine said:
I tried to run extract-files.sh and got:
Code:
remote object '/system/lib/libGLESv2_dbg.so' does not exist
Which gave me this during compile:
Code:
make: *** No rule to make target `vendor/samsung/galaxys2-common/proprietary/libGLESv2_dbg.so', needed by `out/target/product/i777/system/lib/libGLESv2_dbg.so'. Stop.
I have the latest repo as describe in the op. Anyone else run into this issue? Ran the extract on cm7.
Click to expand...
Click to collapse
Did you enable root for adb before running extract-files.sh? And what ROM do you have now?
I had cm7 on it when I ran the extract, I just did it on that phone bricker build as well, only ended up missing one *.so, cant remember which exact file it was, had to step away. Will get back in the am.
Sent from my SGH-I777 using XDA
Update: Just flashed atinm's nightly of CM9, ran extract_files.sh and no errors at all.
5942marine said:
I tried to run extract-files.sh and got:
Code:
remote object '/system/lib/libGLESv2_dbg.so' does not exist
Which gave me this during compile:
Code:
make: *** No rule to make target `vendor/samsung/galaxys2-common/proprietary/libGLESv2_dbg.so', needed by `out/target/product/i777/system/lib/libGLESv2_dbg.so'. Stop.
I have the latest repo as describe in the op. Anyone else run into this issue? Ran the extract on cm7.
Click to expand...
Click to collapse
5942marine said:
I had cm7 on it when I ran the extract, I just did it on that phone bricker build as well, only ended up missing one *.so, cant remember which exact file it was, had to step away. Will get back in the am.
Sent from my SGH-I777 using XDA
Update: Just flashed atinm's nightly of CM9, ran extract_files.sh and no errors at all.
Click to expand...
Click to collapse
Confirmed, /system/lib/libGLESv2_dbg.so does not exist in CM7 so of course it can't be extracted. Screencap of partial file list from my last nandroid on CM7 before upgrading attached.
All non-dev related posts have been moved over to the General CM9 thread.
I guess the giant red bolded DEV tag at the top isnt obvious enough.
Just an update... I was compiling the latest build, and got the following error:
Code:
make: *** No rule to make target `vendor/samsung/galaxys2-common/proprietary/hwcomposer/lib/libfimc.so', needed by `out/target/product/i777/obj/lib/libfimc.so'. Stop.
Now, when i ran ./extract-files, I didn't recieve any errors while it was pulling the files.
I can see that the file is in the galaxy2-common directory, under the proprietary folder.
There is not folder under proprietary /hwcomposer/lib
5942marine said:
Just an update... I was compiling the latest build, and got the following error:
Code:
make: *** No rule to make target `vendor/samsung/galaxys2-common/proprietary/hwcomposer/lib/libfimc.so', needed by `out/target/product/i777/obj/lib/libfimc.so'. Stop.
Now, when i ran ./extract-files, I didn't recieve any errors while it was pulling the files.
I can see that the file is in the galaxy2-common directory, under the proprietary folder.
There is not folder under proprietary /hwcomposer/lib
Click to expand...
Click to collapse
This is the fix for the same issue that was present in galaxys2:
http://review.cyanogenmod.com/#change,13935
Posts cleaned out again. Im only going to say this one last time...
THIS THREAD IS FOR DEVELOPMENT ONLY. IF YOU ARE NOT HELPING DEVELOP FOR CM9 THEN YOU SHOULD POST IN THE GENERAL THREAD, NOT THIS THREAD. ANY FURTHER NON-DEV RELATED POSTS WILL RECEIVE AN AUTOMATIC INFRACTION AND THEIR POST WILL BE DELETED.
sam3000 said:
This is the fix for the same issue that was present in galaxys2:
http://review.cyanogenmod.com/#change,13935
Click to expand...
Click to collapse
Thanks, got it working.
sam3000 said:
This is the fix for the same issue that was present in galaxys2:
http://review.cyanogenmod.com/#change,13935
Click to expand...
Click to collapse
http://review.cyanogenmod.com/#change,14155 fixes the same thing for i777.
5942marine said:
Thanks, got it working.
Click to expand...
Click to collapse
Any extract-files.sh fixes you make - please gerrit them, or just send them to me directly via email if you don't know gerrit (learn Gerrit if you intend to develop for CM!).
Red5 said:
All non-dev related posts have been moved over to the General CM9 thread.
I guess the giant red bolded DEV tag at the top isnt obvious enough.
Click to expand...
Click to collapse
Can you clarify - I take it discussion about build issues that are because script fixups are necessary in github sources is also off-limits ? ie where the root issue is in the repo not the person trying to compile. (Previous post removal implies this.)
If someone can't massage whatever comes out of github in order to get it to compile then it's unlikely they would be posting patches even if the build worked. However, on the other hand, I would argue it's also useful to identify, discuss and fix any build related issues for the benefit of all (separate thread perhaps?)

[Q] Build Paranoid Android unofficially from source on HTC Desire?

Hey guys. I have a HTC Desire which is unsupported by Paranoid Android on it's list of supported devices.
Seeing as I've only got my feet wet in the world of android development by building CM from source.
I now want to build Paranoid Android from source on my HTC Desire. Seeing as it is unsupported from PA I have downloaded the PA source and I now need to merge it with the Evervolv source as the Evervolv source is the one built for Jellybean to work on the Desire!
Thanks for your help guys!
topgeardave said:
Hey guys. I have a HTC Desire which is unsupported by Paranoid Android on it's list of supported devices.
Seeing as I've only got my feet wet in the world of android development by building CM from source.
I now want to build Paranoid Android from source on my HTC Desire. Seeing as it is unsupported from PA I have downloaded the PA source and I now need to merge it with the Evervolv source as the Evervolv source is the one built for Jellybean to work on the Desire!
Thanks for your help guys!
Click to expand...
Click to collapse
There's instructions on paranooid androids website or github...I don't remember which one....
Basically you sync paranoid android source then you add your device tree/proprietary/kernel
Then you build
It's the same process as cyanogenmod except you use PA source instead of CM source
Sent from my HTC PH39100 using Tapatalk 2
mg2195 said:
There's instructions on paranooid androids website or github...I don't remember which one....
Basically you sync paranoid android source then you add your device tree/proprietary/kernel
Then you build
It's the same process as cyanogenmod except you use PA source instead of CM source
Sent from my HTC PH39100 using Tapatalk 2
Click to expand...
Click to collapse
This. Assuming they are setup like most other Android distros, you just pull their source, grab a device/proprietary folder for you device and you are good to go. You will of course need to fix any issues that arise while compiling but that is where you should start.
Thanks guys! You're the best! I'll try it and if I have any problems compiling I'll let you know
What would I do once I've cloned all necessary device files?
Hey guys, I've merged the cm10 files needed to get it compiling. When I tried compiling I've got this error whilst building. Any help would be much appreciated
find: ‘src’: No such file or directory
*** Overlay change detected, clean shared intermediate files...
*** rm -rf out/target/common/obj/APPS/Settings_intermediates out/target/common/obj/APPS/framework-res_intermediates out/target/common/obj/APPS/Mms_intermediates out/target/common/obj/APPS/Phone_intermediates out/target/common/obj/APPS/Gallery2_intermediates out/target/common/obj/APPS/LatinIME_intermediates out/target/common/obj/APPS/SettingsProvider_intermediates out/target/common/obj/APPS/SystemUI_intermediates
PRODUCT_COPY_FILES vendor/pa/prebuilt/common/bin/backuptool.sh:system/bin/backuptool.sh ignored.
PRODUCT_COPY_FILES vendor/pa/prebuilt/common/apk/GooManager.apk:system/app/GooManager.apk ignored.
PRODUCT_COPY_FILES vendor/pa/prebuilt/common/bootanimation/HDPI.zip:system/media/bootanimation.zip ignored.
PRODUCT_COPY_FILES vendor/pa/prebuilt/pa_bravo.conf:system/etc/paranoid/properties.conf ignored.
PRODUCT_COPY_FILES vendor/pa/prebuilt/pa_bravo.conf:system/etc/paranoid/backup.conf ignored.
No private recovery resources for TARGET_DEVICE bravo
build/core/tasks/kernel.mk:44: ***************************************************************
build/core/tasks/kernel.mk:45: * Using prebuilt kernel binary instead of source *
build/core/tasks/kernel.mk:46: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED *
build/core/tasks/kernel.mk:47: * Please configure your device to download the kernel *
build/core/tasks/kernel.mk:48: * source repository to kernel/htc/qsd8k
build/core/tasks/kernel.mk:49: * See http://wiki.cyanogenmod.com/wiki/Integrated_kernel_building
build/core/tasks/kernel.mk:50: * for more information *
build/core/tasks/kernel.mk:51: ***************************************************************
make: *** No rule to make target `out/target/product/bravo/kernel', needed by `out/target/product/bravo/boot.img'. Stop.
Total time elapsed: 0 minutes (52.929561210 seconds)
Click to expand...
Click to collapse
topgeardave said:
Hey guys, I've merged the cm10 files needed to get it compiling. When I tried compiling I've got this error whilst building. Any help would be much appreciated
Click to expand...
Click to collapse
Is your device support by CM9/in development for CM10? Can you add the inline kernel building feature? Also double check all the paths/filenames involved here to make sure they are valid.
thewadegeek said:
Is your device support by CM9/in development for CM10? Can you add the inline kernel building feature? Also double check all the paths/filenames involved here to make sure they are valid.
Click to expand...
Click to collapse
It's not supported by CM themselves but another Dev has compiled it from source and I have cloned his repositories. Where can I place a kernel source inside my PA source? In the htc/bravo folder? And how can I add the inline kernel building feature?
Look at a currently supported device for details I'm how to do it, or maybe lithid can help you here. I currently don't have access to all my crap though, so I can't get the information. Have you checked to make sure your kernel is named appropriately and in the correct location? Even though it's deprecated that method should work.
Sent from my SCH-R760 using Tapatalk 2
thewadegeek said:
Look at a currently supported device for details I'm how to do it, or maybe lithid can help you here. I currently don't have access to all my crap though, so I can't get the information. Have you checked to make sure your kernel is named appropriately and in the correct location? Even though it's deprecated that method should work.
Sent from my SCH-R760 using Tapatalk 2
Click to expand...
Click to collapse
Oh right ok, I'll try and ask a few HD2 devs on how they managed to build it from source. And how should I name the kernel source?
topgeardave said:
Oh right ok, I'll try and ask a few HD2 devs on how they managed to build it from source. And how should I name the kernel source?
Click to expand...
Click to collapse
You can name the folder whatever you want, it just needs to match whatever you put into your BoardConfig.Mk.
You'll need to add the following lines to is:
# Kernel Config
TARGET_KERNEL_SOURCE := path/to/your/kernel
TARGET_KERNEL_CONFIG := your_config_defconfig
thewadegeek said:
You can name the folder whatever you want, it just needs to match whatever you put into your BoardConfig.Mk.
You'll need to add the following lines to is:
# Kernel Config
TARGET_KERNEL_SOURCE := path/to/your/kernel
TARGET_KERNEL_CONFIG := your_config_defconfig
Click to expand...
Click to collapse
Thanks mate, I'll try that as soon as I get home as I'm at work at the moment. If I face any other problems, I'll let you guys know
I ran into that problem as well trying to compile PA for the Rezound, and it was just I had the kernel folder named wrong. I had to change /pa/kernel/htc/vigor to /pa/kernel/htc/vigor-3.0 but now Im running into more problems.

[Q] Error when running brunch command

So, I'm attempting to build my first ROM from source, but when I run the breakfast command, I get this displayed:
Code:
[email protected]:~$ cd /home/admin2/source/
[email protected]:~/source$ . build/envsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including sdk/bash_completion/adb.bash
[email protected]:~/source$ breakfast victara
build/core/product_config.mk:222: *** Can not locate config makefile for product "omni_victara". Stop.
WARNING: Trying to fetch a device that's already there
build/core/product_config.mk:222: *** Can not locate config makefile for product "omni_victara". Stop.
** Don't have a product spec for: 'omni_victara'
** Do you have the right repo manifest?
[email protected]:~/source$
I've ran the brunch command as well and no luck. Anyone think they know the problem? Anything else I could provide to help you solve this? Any help is appreciated. Thanks in advance!
It is because the ROM has not officially been built for your device, hence no sources defining your device are present in it.
This means you will have to add device specific tree yourself and port out the ROM yourself.
This means you will be *porting instead of *building (in rough words). I suggest you try building some other ROM instead which is available for your device.
Jaskaranbir Singh said:
It is because the ROM has not officially been built for your device, hence no sources defining your device are present in it.
This means you will have to add device specific tree yourself and port out the ROM yourself.
This means you will be *porting instead of *building (in rough words). I suggest you try building some other ROM instead which is available for your device.
Click to expand...
Click to collapse
I don't see the need to build a ROM that is already available for my device. Any pointers you could provide to adding a victara device tree?
FooBazza said:
I don't see the need to build a ROM that is already available for my device. Any pointers you could provide to adding a victara device tree?
Click to expand...
Click to collapse
I am not telling you to build an already available ROM because its easy, I am telling you to do so because you will then know how the build system (embedded android in other words) works. Porting out isnt easy, you are going to be getting a lot of dependency errors even after settings up device tree. Kernel may not be compatible, so with recovery. It may need additional flags.... a lot of stuff.
And for porting, it is necessary that you know the basic things: Location of most common and most used makefiles, knowledge of toolchains and kernels, adding device name to workflow etc.
Still, if you wanna try, first download the device tree from Cyanogenmod (you can use this tree as reference for porting): https://github.com/CyanogenMod/android_device_motorola_victara
Just clone it out in a folder "devices" in your source tree's root directory.
Then get the kernel sources.
Then you will have to get a kernel which is compatible with the ROM you are building (unfortunately, I dont have an info on that. But check out the xda, there must be some avilable.)
Then you will have to get the proprietary vendor blobs (search out how to pull those from device).
There's more (like integerating the device into device tree etc). But I am not really that good when it comes to explaining, so you can have a look at this tutorials: Porting Cyanogenmod
Although its for Cyanogenmod, but procedure is quite similar for all custom ROMs (some make filenames may change, so as I said, you need to have the knowledge of directory tree).
Again, I would recommend you to build a ROM thats already available (Cyanogenmod is, luckily). Play around with it and get to know the device structure.
Good luck

CM-13 compilation error: no rule to make target '/.txt'

Hello,
I've got this error a couple of days ago using cm-13 branch, so I redownloaded the source again using the stable branch (cm-13.0-ZNH0E), but I still get this error:
Code:
make: *** No rule to make target '/.txt', needed by '/out/target/common/obj/PACKAGING/checkpublicapi-cm-last-timestamp'. Stop.
I get this error even if I try to compile for the emulator (m_e_arm-userdebug).
I've searched on google for days. I know that there are also other ppl that have this problem (here: http://forum.xda-developers.com/chef-central/android/rule-to-make-target-txt-t3329468), but he is using an exotic source tree, while I'm 100% clean from stable branch.
I've also created a thread on cyanogen forum (here: http://forum.cyanogenmod.org/topic/123259-cant-compile-cm130-for-mini-emulator-x86-userdebug/)
Anyone solved this problem?
I get that error too. Hope CM team would resolve the issue soon.
Update: Switched to stable/cm-13.0-ZNH2K branch and to master revision of cmsdk prebuilts - the problem is solved.

[REFERENCE] [3.10.105] Stock kernel with upstream Linux patches - May 9th

Introduction
Hello all, I am bringing you this thread as a jumping off point to compiling kernels and working with upstream Linux. I will include a guide, some links, and some terms that will help you get started with modifying kernel source. This is also a good reference point for existing developers as I have consolidated all upstream patches into one repo. Let's get down into it!
What in the world is upstream Linux?
When an OEM sets up a device, they will pick a stable longterm branch from the Linux kernel to base their modifications around (drivers and such). In the case of Shamu, they picked 3.10.40. Currently, the Linux kernel's 3.10 is updated to 3.10.105, as you can see on kernel.org. This means that Google is "missing" versions 3.10.41 to 3.10.105. Now, why does this matter? Well, the way that the Linux kernel runs its stable branches, the only things that get merged into there are bug fixes and security updates. That's it, there are no wonky features or unstable patches. The only way you get a patch into a stable branch is by having it be in the mainline branch first. Some developers have an aversion to adding upstream because they claim it is excessive and not necessary and they are partially right since not all the patches that come in are relevant to our architecture (arm). However, upstream Linux is not unstable and by adding each version one at a time, you can verify this. Being up to date is good since you keep yourself protected from bugs and security issues that crop up. Google has been better about doing this lately with their monthly security updates but it never hurts to take matters into your own hands.
I suggest watching one of these talks given by Greg Kroah-Hartman, it is really interesting to see how the process goes:
https://www.youtube.com/watch?v=SPY0LyTU53w | https://www.youtube.com/watch?v=L2SED6sewRw
What did you do?
All I did was fetch the latest kernel.org patches from here and cherry pick them on top of the latest kernel source from Google.
I merge these patches by cherry-picking each version individually (3.10.40 to 3.10.41, 3.10.41 to 3.10.42, etc), that way I can verify that the kernel compiles fine and that there are no merge conflicts. Google will sometimes pick certain commits from upstream that are of a higher importance than others which can result in conflicts if you try to pick it again. Additionally, upstream might fix a bug one way and Google has done it another (which is not really good, Google should be pushing their fixes back to upstream so everything stays in sync).
What do I do with this?
I have created two repos below: one with the latest N security update branch with the latest upstream patches picked up on top of it (the shamu-upstream branch) and another one with a plain AnyKernel source for you to modify (shamu-stock is the most basic, shamu-decrypt contains an fstab file that will disable both forced encryption and dm-verity). You are free to fork these or base other branches on them, that's the whole point of this post. I have verified that all the patches contain no major detectable issues. I would like some credit if you do use it but it's not required since the kernel is licensed under GPL Another reason I offer this is I have seen a lot of developers picking in upstream in patch sets, so you get one single commit for an upstream version. This is detrimental as you start to add your own patches as you cannot fully tell what was modified and for what reason without the individual commits. It might look cleaner but you don't get full history which hurts you in the long run.
Links
Kernel source: https://github.com/nathanchance/shamu/tree/upstream-7.1.1
AnyKernel source: https://github.com/nathanchance/AnyKernel2/tree/shamu-stock-decrypt
Toolchain source: https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/
How to compile
This will be a quick, step by step guide on how to compile this kernel from source. By using this process, you can start to make modifications to the kernel source and make a flashable zip.
Clone the kernel source, the AnyKernel source, and toolchain source
Code:
cd ~
mkdir Kernel && cd Kernel
git clone https://github.com/nathanchance/shamu.git source
git clone https://github.com/nathanchance/AnyKernel2.git anykernel
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8 AOSP-4.8
Explanation:
First command: make sure you are in your home directory (or whatever directory you want to hold the kernel folder we are about to make.
Second command: make a Kernel folder and move into it
Third command: clone the kernel source from my repo into a folder named source
Fourth command: clone the AnyKernel source from my repo into a folder named anykernel
Fifth command: clone the Google 4.8 toolchain into a folder named AOSP-4.8
AnyKernel is the name of the zip we are going to make which allows the kernel to be flashed over any ROM.
A toolchain is a set of compiler tools that allow us to compile the kernel on any computer architecture.
Make sure you are on the correct branches
Code:
cd source && git checkout upstream-7.1.1
cd ../anykernel && git checkout shamu-stock-decrypt
Explanation:
First command: move into the source directory and checkout the branch "upstream-7.1.1", which is the necessary branch for this device.
Second command: move into the AnyKernel directory and checkout the branch "shamu-decrypt". If you don't want to disable forced encryption, use the "shamu-stock" branch.
Tell the compiler what you are are compiling
Code:
export CROSS_COMPILE=${HOME}/Kernel/AOSP-4.8/bin/arm-eabi-
export ARCH=arm && export SUBARCH=arm
make clean && make mrproper
make shamu_defconfig
Explanation:
First command: point the compiler to the location of your toolchain. If you have done anything different with the folder locations, you will need to modify the "${HOME}/Kernel/AOSP-4.8" part.
Second command: tell the compiler which architecture we are compiling for. In this case, our device is an arm device.
Third command: clean out any compiled files and remove our previous defconfig.
Fourth command: tell the compiler which options we want in the kernel using the shamu_defconfig.
A defconfig is a file that will tell the compiler which features we want in the kernel. No computer ever uses all of the options in the kernel since there are different drivers for various devices.
Make the kernel!
Code:
make -j$(nproc --all)
Explanation:
make tells the compiler to make the kernel (duh) and the -j$(nproc --all) tells the compiler to use the maximum number of cores your computer has available
Make the AnyKernel zip
Code:
cp -v arch/arm/boot/zImage-dtb ../anykernel
cd ../anykernel
zip -r9 stock-upstream.zip * -x README stock-upstream.zip
Explanation:
First command: copies the completed kernel (zImage-dtb) into the AnyKernel folder
Second command: moves us into the AnyKernel folder
Third command: makes the zip file (named stock-upstream.zip) in the AnyKernel folder.
If you ever want to do this again, run these commands and go straight to step 3:
Code:
cd source && git clean -fxd && git pull
cd anykernel && git clean -fxd && git pull
NOTE: This thread is aimed to be a breeding ground for kernel development, a place to jump off if you will. I am happy to answer how to questions about building kernels or flashing the one I have provided but this is not supposed to be a general Q&A thread. Please use another thread or create your own in Q&A if you need assistance.
Nice write up.
One suggestion though. Instead of using the current version as the branch name, you may want to just name them for the device, like "Shamu-Upstream" then tag the versions once you've gotten to the version commit. This will prevent you from having to update the thread for this command anytime that you pull in more upstream changes. It also makes it alot cleaner/easier if someone for whatever reason wanted to checkout a specific patch version as they could just checkout the tag rather than resetting back to the commit.
For lack of a better explanation, tags are sort of like sub-branches within a branch.
Very new to kernel building and AOSP in general. Followed the guide but I'm getting stuck when make mrproper is ran. Build stops and i get the error : unknown target 'mrproper' then the build fails. Any help?
The Flash said:
Another reason I offer this is I have seen a lot of developers picking in upstream in patch sets, so you get one single commit for an upstream version. This is detrimental as you start to add your own patches as you cannot fully tell what was modified and for what reason without the individual commits. It might look cleaner but you don't get full history which hurts you in the long run.
Click to expand...
Click to collapse
That's true. Some devs are lazy to commit each patch and bring up from 3.10.40 to 3.10.103 which comprises nearly 3000 patches.
neobuddy89 said:
That's true. Some devs are lazy to commit each patch and bring up from 3.10.40 to 3.10.103 which comprises nearly 3000 patches.
Click to expand...
Click to collapse
Exactly lol. It's also annoying for people looking at your source because if you had to fix anything, it is going to be lumped in with that enormous patch.
Root Wizard said:
Very new to kernel building and AOSP in general. Followed the guide but I'm getting stuck when make mrproper is ran. Build stops and i get the error : unknown target 'mrproper' then the build fails. Any help?
Click to expand...
Click to collapse
can I see a full terminal window/log showing you entering all the commands?
The Flash said:
can I see a full terminal window/log showing you entering all the commands?
Click to expand...
Click to collapse
Just logged off for the night. Will give a full report back tomorrow with pictures. Basically all the commands go good up to 'make mrproper' . 'make clean' runs fine but the 'make mrproper' goes through incuding all the aosp files for build, then ninja enters build directory, then the error 'unknown target 'mrproper' ' comes up, and the build fails.
Root Wizard said:
Just logged off for the night. Will give a full report back tomorrow with pictures. Basically all the commands go good up to 'make mrproper' . 'make clean' runs fine but the 'make mrproper' goes through incuding all the aosp files for build, then ninja enters build directory, then the error 'unknown target 'mrproper' ' comes up, and the build fails.
Click to expand...
Click to collapse
Oh you're building this into a ROM? Alright, that might make things different but yeah show me pictures tomorrow and I'll try to get you up and running.
The Flash said:
Oh you're building this into a ROM? Alright, that might make things different but yeah show me pictures tomorrow and I'll try to get you up and running.
Click to expand...
Click to collapse
Ah I guess I should have metioned that I was building an aosp rom. Thanks for your quick assistance. Will get back tomorrow.
If you're building into a rom, you just need to change the existing kernel source to this one in the xml for this device.
Yoinx said:
If you're building into a rom, you just need to change the existing kernel source to this one in the xml for this device.
Click to expand...
Click to collapse
Can you explain how to do this? First time building with aosp, not very familiar which xml file or what to change to apply the upstream patch.
Root Wizard said:
Can you explain how to do this? First time building with aosp, not very familiar which xml file or what to change to apply the upstream patch.
Click to expand...
Click to collapse
For shamu in aosp, the kernel is pulled with the main aosp source by that manifest. https://github.com/android/platform_manifest/blob/master/default.xml#L65
You world need to substitute this repo with the new one, and delete your existing kernel source. Then next time you sync the repo tool will pull it down.
On other roms it gets pulled in during the breakfast/brunch process. I can't remember exactly where that comes from, but I think that is in the vendor directory for the device, maybe.
How to modify rom manifests and such though is a little outside of this thread's topic. If you need more info I'd recommend opening a thread in the Q&A forum unless this is something that The flash wants to cover in this thread.
There are a few other caveats with doing it in the rom as well. The defconfig name would need to match what the rom build expects and you would need to go in and checkout the correct branch.
Yoinx said:
For shamu in aosp, the kernel is pulled with the main aosp source by that manifest. https://github.com/android/platform_manifest/blob/master/default.xml#L65
You world need to substitute this repo with the new one, and delete your existing kernel source. Then next time you sync the repo tool will pull it down.
On other roms it gets pulled in during the breakfast/brunch process. I can't remember exactly where that comes from, but I think that is in the vendor directory for the device, maybe.
How to modify rom manifests and such though is a little outside of this thread's topic. If you need more info I'd recommend opening a thread in the Q&A forum unless this is something that The flash wants to cover in this thread.
There are a few other caveats with doing it in the rom as well. The defconfig name would need to match what the rom build expects and you would need to go in and checkout the correct branch.
Click to expand...
Click to collapse
Ok, thanks for your help.
For those of you who have forked my kernel, you will need to revert this patch: https://github.com/nathanchance/and...mmit/0b17006c16bba286ecc9d7bacd75a3902a26835e
It causes issues with Wi-Fi and Chrome.
The Flash said:
For those of you who have forked my kernel, you will need to revert this patch: https://github.com/nathanchance/and...mmit/0b17006c16bba286ecc9d7bacd75a3902a26835e
It causes issues with Wi-Fi and Chrome.
Click to expand...
Click to collapse
It does? I have been using Chrome Beta (on wifi) since last night fine with that patch. Maybe its just a matter of time before things start failing. Thanks anyway, will keep a heads up.
Root Wizard said:
It does? I have been using Chrome Beta (on wifi) since last night fine with that patch. Maybe its just a matter of time before things start failing. Thanks anyway, will keep a heads up.
Click to expand...
Click to collapse
If you toggle Wi-Fi, start flipping through pages in Chrome, and toggle Wi-Fi again, it will reboot. Oddest issue I have ever dealt with.
Sent from my Nexus 6P using XDA Labs
The Flash said:
If you toggle Wi-Fi, start flipping through pages in Chrome, and toggle Wi-Fi again, it will reboot. Oddest issue I have ever dealt with.
Click to expand...
Click to collapse
Interesting, will look into this. I also have been getting reboots from searching forums in xda labs app. Logcat says a ton of "PowerHAL_touch_boost failed to send: Connection refused" before reboots. Is this what is happening to you?
Root Wizard said:
Interesting, will look into this. I also have been getting reboots from searching forums in xda labs app. Logcat says a ton of "PowerHAL_touch_boost failed to send: Connection refused" before reboots. Is this what is happening to you?
Click to expand...
Click to collapse
No I haven't had that happen but that error shouldn't cause reboots.
The Flash said:
No I haven't had that happen but that error shouldn't cause reboots.
Click to expand...
Click to collapse
Huh, odd
Github and the kernel in the OP are updated to 3.10.104.

Categories

Resources