official cm7.2 kernel source - Click General

Hello,
I need to recompile the kernel to get the serial port through the usb plug (google: android serialport api htc )
The kernel shipped with cm-7.2.0-click is 2.6.35.14 (-Arco-Kalim) and I can't find this version on git for this phone (that would take /proc/config.gz with no modification by using make menuconfig+save).
Anybody has some clue ?
Thanks
david

deyv said:
Hello,
I need to recompile the kernel to get the serial port through the usb plug (google: android serialport api htc )
The kernel shipped with cm-7.2.0-click is 2.6.35.14 (-Arco-Kalim) and I can't find this version on git for this phone (that would take /proc/config.gz with no modification by using make menuconfig+save).
Anybody has some clue ?
Thanks
david
Click to expand...
Click to collapse
If you need to make just minor tweaks, use dsxda's kitchen to extract the kernel, make changes and then repack it

Hi deyv,
kernel source for tattoo and wildfire are into arco git:
https://github.com/arco/htc-kernel-msm7225
and here's the gingerbread branch config file for tattoo:
https://github.com/arco/htc-kernel-msm7225/blob/gingerbread/arch/arm/configs/click_defconfig
bye
yen

Thanks a lot !

Thanks to both of you I managed to recompile a kernel, and repack it in the official cm7.2 using dsixda.
I have now the serial port /dev/ttyMSM2 that appeared (which I still have to test) and this is great
But I have now the touchscreen which is totally broken (touch is working but gives random places, never under the thumb). I compared the two rom-zip files, and there is absolutely no difference between them, except a new binary /system/bin/wmdsi, and of course the kernel (no difference in ramdisk.img).
Here is the .config diff.
Do you have any clue ?
edit: screen and touchpad X and Y axis are reversed, (in both landscape and portrait mode)
Code:
--- click_defconfig 2012-07-25 08:56:38.219763553 +0200
+++ click_defconfig-noheadset-serialport 2012-07-26 01:43:44.190274884 +0200
@@ -2,5 +2,5 @@
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.35.14
-# Wed Feb 1 07:32:28 2012
+# Thu Jul 26 01:43:22 2012
#
CONFIG_ARM=y
@@ -363,6 +363,5 @@
# CONFIG_MICROP_COMMON is not set
# CONFIG_HTC_HEADSET_MGR is not set
-CONFIG_HTC_HEADSET_V1=y
-CONFIG_HTC_AUDIOJACK_V1=y
+# CONFIG_HTC_HEADSET_V1 is not set
# CONFIG_HTC_ONMODE_CHARGING is not set
# CONFIG_BUILD_CIQ is not set
@@ -1192,5 +1191,7 @@
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
-# CONFIG_SERIAL_MSM is not set
+CONFIG_SERIAL_MSM=y
+# CONFIG_SERIAL_MSM_CONSOLE is not set
+# CONFIG_SERIAL_MSM_CLOCK_CONTROL is not set
# CONFIG_SERIAL_MSM_HSL is not set
CONFIG_SERIAL_MSM_HS=y

Is not the L missing here?
Code:
# CONFIG_SERIAL_MSM_HSL is not set
CONFIG_SERIAL_MSM_HS=y
CONFIG_SERIAL_MSM_HS is flagged for 2.6.39 kernel onwards here http://cateee.net/lkddb/web-lkddb/SERIAL_MSM_HS.html
Other than this i suggest to extract kernel config from a working cm7 rom to check if it match that on github (just in case of)
To compile kernel do you have used toolchain shipped with cm?
bye
yen

The /proc/config.gz extracted from the original running cm7.2 matches the second link you wrote above.
and the two following lines are in it (you can check):
Code:
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.35.14
# Wed Feb 1 07:32:28 2012
[...]
# CONFIG_SERIAL_MSM_HSL is not set
CONFIG_SERIAL_MSM_HS=y
Yes, I have used the toolchain shipped with cm's git repository.
I'm using the remotes/origin/gingerbread branch of arco's kernel :
Code:
$ git branch -a
* (no branch)
ics
remotes/origin/HEAD -> origin/ics
remotes/origin/gingerbread
remotes/origin/ics
$ git diff -r remotes/origin/gingerbread
$
I had also compiled the entired android (not the kernel) with the same toolchain and it worked. I am now using the original CM distribution, not the one I compiled but with the new .config I described above.
Can it be a /proc/cmdline problem ? I can't see where it is stored, it's obviously not in the rom:
Code:
# bash
localhost / # cat /proc/cmdline
board_bahamas.disable_uart3=0 board_bahamas.usb_h2w_sw=0 board_bahamas.disable_sdcard=0 diag.enabled=0 board_bahamas.debug_uart=0 smisize=0 androidboot.baseband=3.35.07.20 androidboot.cid=ORANG202 androidboot.carrier=ORANGE-French androidboot.mid=CLIC10000 androidboot.keycaps=azerty androidboot.mode=normal androidboot.serialno=SH9BGLG00083 androidboot.bootloader=0.52.0001 no_console_suspend=1 console=null
localhost / #
Should I restart the process from scratch ?

So original kernel config & source and toolchain are all good, i got no (possibly) good idea at all.
Should I restart the process from scratch ?
Click to expand...
Click to collapse
last try should perhaps be to compile kernel inline with the rom (not tested if it's possible in cm7 too like for cm9)
bye
yen

Related

Dropbear SSHD Ported!

No need to use telnet anymore, I ported dropbear sshd over. (Mostly just mangled up the authentication.)
I provide the patch with basically no support, and reserve the right to ridicule you if you ask stupid questions. (If I described something incorrectly or you have actual questions, thats different. But if you aren't comfortable cross-compiling code - or compiling it at all - then this is not for you.)
It isn't plug and play, its a patch to the dropbear shipped with the Android platform code and you are on your own getting it to cross-compile. (I used the sourcery pack.) My build is MULTICALL=1 STATIC=1 and includes dbclient, dropbear, dropbearkey. You'll want to set the root password in debug.h and follow the instructions in the patch.
Latest patch here: http://link.sigkill.net/dropbear-v1.1.patch
# A couple of hints for this script.
# debug.h - you want to set a password at the bottom
# I prefer to build STATIC=1 MULTICALL=1 but you can do what you want.
#
# It still checks /etc/shells so unfortunately you have to create that file
# and put your shell in it. (by default I use /system/bin/rootsh. Which you
# will want to create.)
# If you want key-based authentication, there's some additional prep work:
# /data/dropbear needs to be root:root 744 and
# /data/dropbear/.ssh root:root 700
# options.h | 30 +++++++++++++++---------------
# svr-auth.c | 34 +++++++++++++++++++++++++++++++++-
# svr-chansession.c | 2 ++
# 3 files changed, 50 insertions(+), 16 deletions(-)
Changelog: v1.1 initial public release
Plans:
v1.2 remove /etc/shells check
v? add configurable password
v? auto-create directories
THANK YOU!!

[Guide] How to build kernel from source

Build-kernel​
Building Kernel only from Oppo Source​
"Official Oppo Find 5 kernel source":https://github.com/oppo-source/Find5-Kernel-Source
EDIT: the 12025_release_defconfig doesn't work for me (touchscreen doesn't respond). Most likely a change needs to be made here
Code:
446,447c436,437
< CONFIG_TOUCHSCREEN_MELFAS=y
< CONFIG_TOUCHSCREEN_SYNAPTICS_S3202_I2C_RMI=y
---
> CONFIG_TOUCHSCREEN_ATMEL_MXT=y
> CONFIG_TOUCHSCREEN_CYTTSP_I2C_QC=y
Check out the source code
Code:
git clone git://github.com/oppo-source/Find5-Kernel-Source.git
Using +12025_debug_defconfig+ as config. You can use +12025_release_defconfig+ , with some modifications to the source to make it work properly
Code:
cd Find5-Kernel-Source
make ARCH=arm clean
make ARCH=arm 12025_debug_defconfig
edit include/config/kernel.release
if you want to modify the kernel version numbering
Build
Code:
make -j4 ARCH=arm CROSS_COMPILE=arm-eabi-
or use this following (uses as many cores as your computer has
Code:
make -j$(grep -c ^processor /proc/cpuinfo) ARCH=arm CROSS_COMPILE=arm-eabi-
\n if you want to use the +12025_release_defconfig+, there are some config problems. I have fixed them in my github
My github (use the branch [*]config-fixes): https://github.com/ngvincent/android-kernel-oppo-find5
The end, you'll get two files (Image and zImage) inside arch/arm/boot
Image = full kernel image, zImage = compressed version
*_The boot partition has ~10MB of space(see bottom of page for details). Make sure your kernel+ramdisk doesn't exceed this_*
Make boot.img file (need to add ramdisk)​
Copy the ramdisk from existing device or ROM. "Here":https://git.ngvincent.com/attachments/download/5/ramdisk.gz is one I extracted from the X909EN_13_130307 rom
Extracting kernel from device​
Code:
adb shell
su
dd if=/dev/block/mmcblk0p18 of=/sdcard/boot.img
exit
adb pull /sdcard/boot.img
Extracting from boot.img​
Code:
abootimg -x boot.img
Making boot.img​
Copy the stuff below into a file called bootimg.cfg (gives the configuration for abootimg to create the img properly)
Code:
bootsize =
pagesize = 0x800
kerneladdr = 0x80208000
ramdiskaddr = 0x82200000
secondaddr = 0x81100000
tagsaddr = 0x80200100
name =
cmdline = console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3
Code:
abootimg --create bootimage.img -f bootimg.cfg -k zImage -r ramdisk.gz
Flash kernel onto device​
You'll need to use fastboot to do it. I need to sudo as root for fastboot to work properly
Code:
adb reboot bootloader
sudo -s
fastboot devices
fastboot flash boot bootimage.img
fastboot reboot
verify​
Code:
adb shell
cat /proc/version
Linux version 3.4.0-perf-g5d91181 ([email protected]) (gcc version 4.4.3 (GCC) ) [*]1 SMP PREEMPT Sat Mar 16 13:29:19 EDT 2013
partition space on the device​
Code:
adb shell
cat /proc/partitions
Code:
179 18 10240 mmcblk0p18
Code:
[email protected]:/dev/block/platform/msm_sdcc.1/by-name $ ls -la
lrwxrwxrwx root root 1970-01-16 12:58 DDR -> /dev/block/mmcblk0p15
lrwxrwxrwx root root 1970-01-16 12:58 aboot -> /dev/block/mmcblk0p17
lrwxrwxrwx root root 1970-01-16 12:58 boot -> /dev/block/mmcblk0p18
Looks like there's plenty of space for the kernel/boot.img - 10240 kilobytes
Thanks for this. While this is way beyond my skill level, I'm glad the info is available. I'm slowing scratching the surface.. just recently learned how to build Nightlies! Thanks
Sent from my X909 using Tapatalk 2
Coreym said:
just recently learned how to build Nightlies! Thanks
Sent from my X909 using Tapatalk 2
Click to expand...
Click to collapse
are you planning on making nightlies for the oppo ?
CoopZor said:
are you planning on making nightlies for the oppo ?
Click to expand...
Click to collapse
I think kAmMa is working on CM right now? So hopefully we will have the CM Rom to install on the Find 5 in the near future. I know he said that he almost had it complete but was having problems with the drivers for the display and needed the drivers from the source code. Now that the source code has been released we might see something good soon. I don't know if his CM will be the official CM release though. We do need an official CM for the Find 5 though.
Personally, I would like to see Paranoid Android 3+ on the Find 5 as its my favorite rom, and it would be amazing on the Find 5. I use it as my daily on my Nexus 4 and 7 and both run great!
This is out of my league also, I wish I could build some good kernels and Roms. I will beta test Roms and Kernels if anyone needs me too though.
Coreym said:
Thanks for this. While this is way beyond my skill level, I'm glad the info is available. I'm slowing scratching the surface.. just recently learned how to build Nightlies! Thanks
Sent from my X909 using Tapatalk 2
Click to expand...
Click to collapse
once you get the hang of linux build tools, the next part is rather easy
I'm porting over the changes that faux123 made in his kernel for the Nexus 4 (same Qualcomm S4Pro APQ8064 processor+SoC)...
finished reading his mods for voltage control, i'll probably slicing in the code tomorrow...
I'm not touching CM10 (or AOKP/Paranoid...) porting yet... had some experience with kernel development a few years ago, but not for android porting...
error when run Command
I got error when run Command : make ARCH=arm clean , how can I fix it?
PHP:
[email protected]:~/aosp/kernel/Find5-4.2-kernel-source-master$ make ARCH=arm clean
scripts/Makefile.clean:17: /home/war/aosp/kernel/Find5-4.2-kernel-source-master/drivers/networkpmsmodule/Makefile: No such file or directory
make[2]: *** No rule to make target `/home/war/aosp/kernel/Find5-4.2-kernel-source-master/drivers/networkpmsmodule/Makefile'. Stop.
make[1]: *** [drivers/networkpmsmodule] Error 2
make: *** [_clean_drivers] Error 2
#### make failed to build some targets (1 seconds) ####

[Q] Compile rom without Recovery and kernel

Hi,
I want to compile OmniRom for Grouper (Nexus 7 2012 wifi) without recovery and kernel built-in (I'll flash prebuilt .zips of them).
I have added to BoardConfig.mk these lines
Code:
#added
TARGET_NO_RECOVERY := true
TARGET_NO_KERNEL := true
#
USE_CAMERA_STUB := true
USE_PROPRIETARY_AUDIO_EXTENSIONS := false
BOARD_HAL_STATIC_LIBRARIES := libdumpstate.grouper
TARGET_RECOVERY_UI_LIB := librecovery_ui_grouper
TARGET_RELEASETOOLS_EXTENSIONS := device/asus/grouper
...
but when I try to compile, it gives me this error
Code:
including ./vendor/omni/Android.mk ...
build/core/tasks/kernel.mk:65: ***************************************************************
build/core/tasks/kernel.mk:66: * Using prebuilt kernel binary instead of source *
build/core/tasks/kernel.mk:67: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED *
build/core/tasks/kernel.mk:68: * Please configure your device to download the kernel *
build/core/tasks/kernel.mk:69: * source repository to kernel/asus/grouper
build/core/tasks/kernel.mk:70: * See http://forum.xda-developers.com/wiki/ROM/Integrated_Kernel_Build
build/core/tasks/kernel.mk:71: * for more information *
build/core/tasks/kernel.mk:72: ***************************************************************
make: *** Nessuna regola per generare l'obiettivo "bacon". Arresto.
What I did is right?
Thanks for the attention.
gorneman said:
Code:
including ./vendor/omni/Android.mk ...
build/core/tasks/kernel.mk:65: ***************************************************************
build/core/tasks/kernel.mk:66: * Using prebuilt kernel binary instead of source *
build/core/tasks/kernel.mk:67: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED *
build/core/tasks/kernel.mk:68: * Please configure your device to download the kernel *
build/core/tasks/kernel.mk:69: * source repository to kernel/asus/grouper
build/core/tasks/kernel.mk:70: * See http://forum.xda-developers.com/wiki/ROM/Integrated_Kernel_Build
build/core/tasks/kernel.mk:71: * for more information *
build/core/tasks/kernel.mk:72: ***************************************************************
make: *** Nessuna regola per generare l'obiettivo "bacon". Arresto.
What I did is right?
Click to expand...
Click to collapse
Do you have any more errors, or more of the log? Last I checked, that kernel.mk line 65-72 is not a showstopper, just a warning. I've never messed with lines that you've added before. As for the kernel, why don't you compile the kernel from sources you choose? And if you really don't want to do that, why don't use the precompiled kernel, and that inserted in your build?
PonsAsinorem said:
Do you have any more errors, or more of the log? Last I checked, that kernel.mk line 65-72 is not a showstopper, just a warning. I've never messed with lines that you've added before. As for the kernel, why don't you compile the kernel from sources you choose? And if you really don't want to do that, why don't use the precompiled kernel, and that inserted in your build?
Click to expand...
Click to collapse
Thanks, but no luck. I try to include prebuilt kernel, but but gives me an error about overwriting commands.
gorneman said:
Thanks, but no luck. I try to include prebuilt kernel, but but gives me an error about overwriting commands.
Click to expand...
Click to collapse
Maybe some links? I can't really see what you're doing and I'm missing parts of the puzzle.
Can you link me to your device tree? And to the kernel source? A full build log, including commands, uploaded to pastebin would be nice as well.
Also, have you tried compiling the kernel with the build? That is the preferred method. And if you insist on using a prebuilt, I'd try the method below, instead of skipping.
Here's some good reading in the meantime: http://wiki.cyanogenmod.org/w/Doc:_...Step_4._Configuring_the_fallback_to_prebuilts
http://pastebin.com/neh14Aj4 build log
http://pastebin.com/fURqBpMQ boardCommonConfig
My device is Grouper (Nexus 7 2012 Wifi) and I follow this wiki page (grouper instead of tilapia).
Thanks
If I do "brunch" in term :
Code:
[email protected] ~/Android/Omni $ brunch
You're building on Linux
Lunch menu... pick a combo:
1. full-eng
Which would you like? [aosp_arm-eng]

[ROM] [Development] [Source] [Noob] [Friendly]

Introduction & Setting Up Build Environment​
Well hello everyone today I will teach you “How to build custom ROM’s for your device from source”. So, if you are interested then please continue to read. So, first of all, you must know how Linux work and few commands for that you can simply visit here
I guess you are done with commands now let's move ahead. First and for most important… You must have a high specs PC like with i7, 16gb ram, 512gb SSD. If yes then move ahead if no then look for online cloud services like GCloud/AWS.
Setting Up Environment for the build!
Woo-ho! We will set up the environment for the build now …
Now install Linux in your PC. You can install any distro but I would suggest installing Ubuntu 16.04.
Just copy paste below codes and if asked for y/n then type y and hit enter, all set!
Code:
sudo apt-get update && sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip openjdk-8-jdk openjdk-11-jdk && sudo apt-get upgrade
Code:
git clone https://github.com/akhilnarang/scripts.git ~/scripts
cd scripts
bash setup/android_build_env.sh
All set! As mentioned earlier allow the packages to be installed by typing “y” if asked.
Syncing Sources ​
Now look for your favorite ROM sources like for me its lineage so source are here
After you are done with your sources just clone the source but before that let's make a directory where we will store our source like for me I am using android/lineage for your ROM you can change as per your wish! Well if you still didn’t get your ROM sources then I will drop down link below of my top 5 favorite ROM sources!
Now let's make our directory
Code:
mkdir android/lineage && cd android/lineage
Now let’s initialize our ROM repo like for me its lineage, but for you change it as per your ROM. Here for your info after “-b” is your branch you will have to look for your ROM and change accordingly.
Code:
repo init -u git://github.com/LineageOS/android.git -b lineage-16.0
Well, now you will encounter a small error to fix it up just copy below code.
Code:
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
Replace [email protected] & “Your Name with your GitHub account email and username respectively. After that re-initize source.
Wow, it’s for Pie hehehe but it’s not yet done. We have just initialized source we are yet let to sync it. but before that please note source size is about 60-80gb so make sure you have enough bandwidth with high speed …
Now let’s sync our source
Code:
repo sync -f –-no-tags –-no-clone-bundle
Well, now you can do only one thing that is wait ... as repo is long (60g-80gb)
Done? Then why to wait just start with syncing device related sources.
Now you must be wondering what are they and why we need those… So, device related sources are of the device tree, kernel source, vendor blobs. You can find those by searching your device codename like for me I will search k5fpr device tree, k5fpr kernel source, k5fpr vendor tree (Here k5fpr is my device codename you change as per your device.) Now I got these links
DT : https://github.com/SahilSonar/android_device_lenovo_k5fpr
Kernel Source : https://github.com/SahilSonar/android_kernel_lenovo_k5fpr
Vendor Blobs/Tree : https://github.com/SahilSonar/android_vendor_lenovo_k5fpr
Well, now you don’t use these until and unless you want to build for k5fpr. You look for your device and now let’s clone them to our working dir. Again as dir. may change please edit the code as per your ROM
Code:
git clone https://github.com/SahilSonar/android_device_lenovo_k5fpr.git -b lineage-15.1 ~/android/lineage/device /lenovo/k5fpr
git clone https://github.com/SahilSonar/android_kernel _lenovo_k5fpr.git -b lineage-15.1 ~/android/lineage/kernel /lenovo/k5fpr
git clone https://github.com/SahilSonar/android_vendor _lenovo_k5fpr.git -b lineage-15.1 ~/android/lineage/vendor /lenovo/k5fpr
Now after -b is our branch just look one there in your source, which one you want to use just change it now most of the people must have thought hey man there is another way for this … We can use manifest… yes, those are 100000% but cloning is an easy way instead of manifest but still for those who want to clone using manifest then simply follow below steps instead of above … No issue you can use anyone.
First, let’s move to the dir where we are supposed to add manifest like for me its android/lineage/.repo You will have to change as per your dir.
Code:
cd android/lineage/.repo && mkdir local_manifests && cd local_manifests && nano roomservice.xml
After pasting above code you will see a text editor in that we are supposed to paste our manifest okay I am giving manifest of k5fpr you change source as per your device.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/lenovo/k5fpr" name="mohancm/android_device_lenovo_A7010a48" remote="github" revision="oreo" />
<project path="vendor/lenovo/k5fpr" name="mohancm/android_vendor_lenovo_k5fpr" remote="github" revision="oreo" />
<project path="kernel/lenovo/k5fpr" name="mohancm/android_kernel_lenovo_A7010a48" remote="github" revision="oreo" />
</manifest>
Okay, so you must be wondering what to do for my device… Well don’t worry as we have used -b here its revision so after revision what comes is our branch and after “name” it's our source link and after “path” it's our destination like we have used ~/android/lineage/device/lenovo/k5fpr. That’s all for manifest just save it and exit after that just sync sources again … Whoa man, I don’t have 60-80gb left. Well, don’t worry its just loads the repo which is downloaded also it only fetches device specific sources.
Code:
repo sync -f –-no-tags –-no-clone-bundle
Patches & Bring-up!​
Now let it finish syncing and after that, we will apply patches. Yes! Patches now most of you must be thinking what are those? Well, patches are nothing more than fixes they are located in your device tree(android/lineage/device/lenovo/k5fpr/patches) Now look there and see which patches you want to apply. If you are confused which to apply then simply apply all. Whoa man, we are new and no idea how to apply those. Well I know don’t worry I will teach you same now.
First of all copy patches from device tree to our source like for e.g I will show you how to apply bionic_libc.patch.
Code:
cp ~/android/lineage/device/lenovo/k5fpr/patches/bionic/bionic_libc.patch ~/android/lineage/bionic
Now what comes after bionic_libc.patch is our destination where we are copying our patch. For your info “cp” is nothing then copy. Now just apply it by using below codes.
Code:
cd android/lineage
git add .
git commit -m “Patch”
Now you are done with applyin bionic_libc. patch but there are many other patches left do same with those just change their dir location like we choose/bionic/bionic_lib.patch same way for other patches just changes as accordingly.
Now after you are done applying all patches lets build our ROM … Oh! Yea finally.
Well not yet before that will learn a new thing called as “bing-up” well not device is universal for every ROM but there are some changes needed to be done before you build for any ROM like for me my device tree is already on lineage but if in case I want to build aosp or rr or any other ROM I will have to do certain changes in device tree for that particular ROM. Like here we will choose AOSP.
Now move to device tree like here in my case
Code:
cd ~/android/lineage/device/lenovo/k5fpr
Now following things will require changes :
*AndroidProducts.mk
*lineage.mk (Now pretty tricky this file name is lineage if your source is for dot just consider then its dot .mk)
*vendorsetup.sh
Just these 3 needed few changes now pay careful attention or else you won't get what I am saying. Now here we are doing bring-up for aosp from lineage so first and for most, we will start with AndroidProducts.mk so I am showing before bring-up and after bring-up (These changes are done using notepad like nano AndroidProducts.mk)
Before
Code:
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/lineage.mk
After
Code:
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/aosp_k5fpr.mk
Now if you can see then we have changed lineage.mk to aosp_k5fpr.mk… yes for newer oses like pie we will have to include device code name as we did so here you are supposed to change lineage to aosp_k5fpr. Well, now we will talk about lineage.mk itself as we have changed it to aosp_k5fpr there then let's change the name of the file itself for that save the change and exit notepad and copy below code to rename it.
Code:
mv lineage.mk aosp_k5fpr.mk
Here you can observe we have typed lineage.mk at first so it means we want to change this file name and to what after space we typed aosp_k5fpr.mk. This means you will have to change it as per your current makefile and to which you want. Now open aosp_k5fpr.mk by using nano aosp_k5fpr.mk
Before
Code:
#
# Copyright (C) 2015-2016 The CyanogenMod Project
# Copyright 2017-2018 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Inherit some common lineage stuff.
$(call inherit-product, vendor/lineage/config/common_full_phone.mk)
# Inherit device configuration
$(call inherit-product, $(LOCAL_PATH)/device_k5fpr.mk)
# Device display
TARGET_SCREEN_HEIGHT := 1920
TARGET_SCREEN_WIDTH := 1080
# Device identifier
PRODUCT_BRAND := lenovo
PRODUCT_DEVICE := k5fpr
PRODUCT_MANUFACTURER := LENOVO
PRODUCT_MODEL := Lenovo K4 Note
PRODUCT_NAME := lineage_k5fpr
PRODUCT_RELEASE_NAME := k5fpr
PRODUCT_RESTRICT_VENDOR_FILES := false
After
Code:
#
# Copyright (C) 2015-2016 The CyanogenMod Project
# Copyright 2017-2018 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Inherit device configuration
$(call inherit-product, $(LOCAL_PATH)/device_k5fpr.mk)
# Device display
TARGET_SCREEN_HEIGHT := 1920
TARGET_SCREEN_WIDTH := 1080
# Device identifier
PRODUCT_BRAND := lenovo
PRODUCT_DEVICE := k5fpr
PRODUCT_MANUFACTURER := LENOVO
PRODUCT_MODEL := Lenovo K4 Note
PRODUCT_NAME := aosp_k5fpr
PRODUCT_RELEASE_NAME := k5fpr
PRODUCT_RESTRICT_VENDOR_FILES := false
Now if you observe we removed a line “
# Inherit some common lineage stuff.
$(call inherit-product, vendor/lineage/config/common_full_phone.mk)
“ Well in aosp there is no common_full_phone.mk so we removed entire but for most of the ROM’s its common.mk So make sure you check that out. Also, path will be changed like vendor/dot/config/common.mk for dot but for aosp there is nothing so we removed. Now also we did a change to PRODUCT_NAME : aosp_k5fpr from lineage_k5fpr.mk Well that all changes needed just save it and move to last but not the least vendorsetup.sh. Just open it by nano vendorsetup.sh
Before
Code:
add_lunch_combo lineage_k5fpr-eng
add_lunch_combo lineage_k5fpr-userdebug
add_lunch_combo lineage_k5fpr-user
After
Code:
add_lunch_combo aosp_k5fpr-eng
add_lunch_combo aosp_k5fpr-userdebug
add_lunch_combo aosp_k5fpr-user
This was a simple change just aosp from the lineage that all save it and let's start building now … Wait we did bring-up just for teaching you how exactly it works but doesn’t use aosp bring-up for lineage. Also if you still see some error cannot locate makefile for your device then try changing aosp_k5fpr.mk to aosp.mk and also in AndroidProducts.mk If still not then see for common.mk file or can seek your maintainer who has made trees.
Building ROM & Basic Info regarding errors!​
Now let's start the build
Code:
. build/envsetup.sh
export USE_CCACHE=1
export LC_ALL=C
brunch aosp_k5fpr-userdebug
Now we used userdebug but I would suggest eng as debugging is on by default so as to pull logs in case ROM doesn’t boot and wont to know what went wrong. For your info “export LC_ALL=C” Enables local time as it fixes up an error which new kernel causes due to improper time. “export USE_CCACHE=1” Enables cache, now cache speed up build. If you want to know more about lunch, brunch, mka and make just read this
Now building takes a long time as of me it took ~ 5hrs but I am sure it takes around ~6 hrs.
Also some basics… Now you will see many things in screen just ignore those as you may see “warning’s” well those are normal and will see those don’t worry about those but if you see something like “error” or “failed” That means something is wrong with certain file just ask Android ROM Development Group (Telegram)about the error as I cannot help with device-related errors. Also, these errors are due to device tree issues most of the cases as your maintainer has not maintained tree properly or due to some changes required for bring-up! Additionally, your device tree may also contain build manual just have a look at it
You forgot to add build guide for Snapdragon as you said MTK and Snapdragon are different.
Good guide btw.
SkaboXD said:
You forgot to add build guide for Snapdragon as you said MTK and Snapdragon are different.
Good guide btw.
Click to expand...
Click to collapse
Added !

How to compile a kernel module for stock OnePlus 6T kernel?

Hi guys,
I am trying to compile an xt_HL.ko module which will allow me to use target TTL in iptables to fix the TTL when using the phone as a hotspot. I would like to do so for a stock kernel.
I am doing this under linux mint 19.
I have gotten as far as
1) Getting the sources for the Oneplus 6T kernel from git.
2) I got the android NDK installed (sudo apt install google-android-ndk-installer)
3) export ARCH=arm64
4) export CROSS_COMPILE=/usr/lib/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-
5) in the kernel source
6) make ARCH=arm64 CROSS_COMPILE=/usr/lib/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android- sdm845-perf_defconfig
7) make menuconfig >> here I add the TTL Target as a module, save the .config
8) make -j8
9) make modules
10) everything builds successfully with no errors in the modules area
11) I transfer the resulting xt_HL.ko into the phone onto /sdcard/xt_HL.ko
12) adb shell
13) su
14) insmod /sdcard/xt_HL.ko
and after all this I get an error:
Code:
OnePlus6T:/sdcard # insmod xt_HL.ko -f
insmod: failed to load xt_HL.ko: Required key not available
As i understand I am using the wrong toolchain? Or am I missing something else?
when I look at /proc/version I get:
Code:
OnePlus6T:/sdcard # cat /proc/version
Linux version 4.9.106-perf+ ([email protected]) (gcc version 4.9.x 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Tue Nov 27 03:37:42 CST 2018
Please help me with this. I don't really want to go as far as a completely custom kernel yet.
The kernel in the phone was built with EFI_SECURE_BOOT_SIG_ENFORCE=y. This prevents loading unsigned, 3rd-party modules. You would probably need a custom kernel.
Mind elaborating on EXACTLY how to do this? I see your steps but am finding them a little sparse. I created this thread: https://forum.xda-developers.com/t/...ive-guide-to-kernels-update-21-12-16.3121088/
I'm trying to do this on LineageOS18.1 so hoping the secure_boot isn't an issue, but don't know how to add this module! Thanks!!

Categories

Resources