I followed the instructions listed here to compile the kernel from the source and was successful. Next, I saw some instructions here on how to compile our own loadable kernel modules:
Code:
First we must retrieve and copy the kernel config from our device.
$ cd /path/to/android-sdk/tools
$ ./adk pull /proc/config.gz
$ gunzip ./config.gz
$ cp config /path/to/kernel/.config
Next we have to prepare our kernel source for our module.
$ cd /path/to/kernel
$ make ARCH=arm CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi- modules_prepare
PREPARING YOUR MODULE FOR COMPILATION
We need to create a Makefile to cross-compile our kernel module. The contents of your Makefile should be similar to the following:
obj-m := modulename.o
KDIR := /path/to/kernel
PWD := $(shell pwd)
CCPATH := /path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-eabi- -C $(KDIR) M=$(PWD) modules
COMPILING AND INSTALLING YOUR MODULE
$ cd /path/to/module/src
$ make
$ cd /path/to/android-sdk/tools/
$ ./adb push /path/to/module/src/modulename.ko /sdcard/modulename.ko
RUNNING YOUR MODULE
$ cd /path/to/android-sdk/
$ ./adb shell
$ su
# insmod /sdcard/modulename.ko
When I try executing:
Code:
make ARCH=arm CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi- modules_prepare
I get an error:
Code:
make: *** No rule to make target `modules_prepare`. Stop.
Can someone please tell me if I am missing something here?
EliteLegend said:
I followed the instructions listed here to compile the kernel from the source and was successful. Next, I saw some instructions here on how to compile our own loadable kernel modules:
Code:
First we must retrieve and copy the kernel config from our device.
$ cd /path/to/android-sdk/tools
$ ./adk pull /proc/config.gz
$ gunzip ./config.gz
$ cp config /path/to/kernel/.config
Next we have to prepare our kernel source for our module.
$ cd /path/to/kernel
$ make ARCH=arm CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi- modules_prepare
PREPARING YOUR MODULE FOR COMPILATION
We need to create a Makefile to cross-compile our kernel module. The contents of your Makefile should be similar to the following:
obj-m := modulename.o
KDIR := /path/to/kernel
PWD := $(shell pwd)
CCPATH := /path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-eabi- -C $(KDIR) M=$(PWD) modules
COMPILING AND INSTALLING YOUR MODULE
$ cd /path/to/module/src
$ make
$ cd /path/to/android-sdk/tools/
$ ./adb push /path/to/module/src/modulename.ko /sdcard/modulename.ko
RUNNING YOUR MODULE
$ cd /path/to/android-sdk/
$ ./adb shell
$ su
# insmod /sdcard/modulename.ko
When I try executing:
Code:
make ARCH=arm CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi- modules_prepare
I get an error:
Code:
make: *** No rule to make target `modules_prepare`. Stop.
Can someone please tell me if I am missing something here?
Click to expand...
Click to collapse
The topic is old but the reply may be useful for other people:
this is the tipical issue when is missing the .config file which is a defconfig to be taken from /kernelfolder/arch/arm/configs
Building CM9 from Sources for O2X
This Guide is a Step by Step Guide to Build CM9 from official CM9 Sources.
It based on:
aMpeX`s [TUTORIAL] The Step-By-Step guide to build Cyanogenmod7 for the LG Optimus 2X
loganmc10`s [GUIDE] Building CM9 for G2X
I only change to P990, respectively CM9 and add the fix for working Baseband
You need:
- a installed Linux, (I use Ubuntu 11.10, 64 Bit)
- a fast PC or Notebook is recommended
- a fast internet-connections is recommended, (you have to download several GBs)
There are 10 Steps, (8 for building, and 2 optionals ):
1. Installing Build-Packages
2. Install and setup Android-SDK
3. Update path
4. Create directories
5. Install repository and download CM9 Sources
6. Fix for non working camera
6a. Fix the known issues
7. Compiling Unofficial CM9 Build
8. Fix unknown Baseband
9. Extended building
10. Optional changes
Some infos before start:
- read the whole Guide carefully, (possibly you have to read it a few times, untill you understand all steps)
- if you do it exactly as explained, there should be no problems, and the result is a working Unofficial CM9-Build
- don`t login to Linux as root
- if you get problems, feel free to PM me, if you can`t post in Dev-Forum
lets start,
1. Installing Build-Packages
install this for 32 bit and 64 bit:
Terminal:
type:
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jdk pngcrush schedtool
NOTE:
this will install Open-JDK instead of Sun-JDK,
(Sun-JDK isn`t longer official available for Ubuntu)
this will result in an error message at the beginning of compiling,
just ignore it, compiling will working fine.
If you want to install Sun-JDK instead of Open-JDK,
the user tonyp has made a tutorial.
use this line instead of above one
Terminal:
type:
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool
than go to this tutorial
for me the tutorial above doesn`t work (Ubuntu 11.10 64 Bit)
this is working for me:
open terminal:
Code:
sudo add-apt-repository ppa:ferramroberto/java
Code:
sudo apt-get update
Code:
sudo apt-get install sun-java6-jdk sun-java6-plugin
Code:
sudo update-alternatives --config java
(note: you have to press the tab button to be able to press ok, after the last command )
install this for 64 bit also:
Terminal:
type:
Code:
sudo apt-get install g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-4.4-multilib g++-4.4-multilib
2. Install and setup Android-SDK
Download newest Android-SDK from here (Linux (i386) )
Extract the Zip-Package to a directory of your choice
Terminal:
navigate to the tools-folder of Android-SDK and type:
Code:
./android
this will launch the AVD-Manager
check repository, select newest repository, and click install packages
3. Update path
go to your Home-Directory, and press CTRL + H to show hidden files,
open .bashrc
and add this:
Code:
export PATH="/home/<yourusername>/<path to the android SDK >/platform-tools/:${PATH}"
export PATH="/home/<yourusername>/bin/:${PATH}"
now you have to log out and in again for the changes take effect.
now check if changes are working,
Terminal:
type:
Code:
adb devices
you should see something like this:
[email protected]:~$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
Click to expand...
Click to collapse
4. Create directories
Terminal:
type:
Code:
mkdir -p ~/bin
Code:
mkdir -p ~/android/system
5. Install repository and download CM9 Sources
Install repository
Terminal:
type:
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Code:
cd ~/android/system/
Code:
repo init -u git://github.com/CyanogenMod/android.git -b ics
enter name, email adress, and choose if you want colors or not
Download CM9 Sources:
Terminal:
type:
Code:
cd ~/android/system/
Code:
repo sync
depending on your internet connection speed this can take several hours
press CTRL + H
go to :
/android/system/.repo/
create:
local_manifest.xml
paste into local_manifest.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/lge/p990" name="CyanogenMod/android_device_lge_p990" />
<project path="device/lge/star-common" name="CyanogenMod/android_device_lge_star-common" />
<project path="vendor/lge" name="Owain94/proprietary_vendor_lge.git" remote="github" />
</manifest>
Terminal:
type:
Code:
cd ~/android/system/
Code:
repo sync
6. Fix for non working camera
download this zip-package MediaFire SolidFiles.
(I don`t make this patch, and don`t know who had made it, if you made it PM me and I`ll give credit for your work)
Extract the Zip-Package to a directory of your choice.
Terminal:
type:
Code:
cd ~/android/system
Code:
patch -p1 <
NOTE: after "<" there has to be a "blank space" (press spacebar)
now drop the first ...diff file from extracted package into terminal, the path will be automatically added,
run the created command,
the same procedure for the other 4 files
6a. Fix the known issues
for broken building:
open:
device/lge/p990/BoardConfig.mk
delete line:
Code:
BOARD_TOUCH_RECOVERY := true
For mobile data fix:
place this file to android/system/system/core/init/ (overwrite excisting file),
7. Compiling Unofficial CM9 Build
Terminal:
type:
Code:
~/android/system/vendor/cm/get-prebuilts
Code:
cd ~/android/system/
Code:
. build/envsetup.sh
Code:
brunch p990
depending on your PC or Notebooks specs compiling will take from 30 minutes to several hours
you can find your Rom-Zip-Package at:
/android/system/out/target/product/p990/
Click to expand...
Click to collapse
8. Fix unknown Baseband
open your Rom-Zip-Package and extract /system/build.prop
(don`t close Archivmanager)
open build.prop:
delete line:
ro.modversion=9-...-UNOFFICIAL-p990
Click to expand...
Click to collapse
(thanks to owain94 for deleting line info)
find line:
ro.cm.version=9-...-UNOFFICIAL-p990
Click to expand...
Click to collapse
replace this line with:
ro.cm.version=9.0.0-RC1-p990-UNOFFICIAL
Click to expand...
Click to collapse
save build.prop
drop modded build.prop into Archivemanager (/system, overwrite existing file)
Now your Unofficial CM9 Build is ready to install
------------------------------------------------------------------------------------------------------------------------------------------------------------
9. Extended building:
I decided to make a optional 9. Step to have a better building experience
(all tipps by owain94, thanks)
This Step is a replacement for Step 7!
Terminal:
type:
Code:
cd ~/android/system && clear && cd vendor/cm && ./get-prebuilts && cd ../../ && clear && . build/envsetup.sh && brunch p990 2> warn.log
this command downloads the cm-prebuilds,
sets up the build environment,
start the building,
exports all warnings and errors to a text file
and cleans the Terminal.
open another Terminal
type:
Code:
cd ~/android/system && clear && tail -f warn.log
this command cleans the terminal,
shows the warnings and errors in this second Terminal,
and keep the focus on it,
first terminal only shows the building process,
so it`s much easier to catch problems while compiling.
If you have connected two screens to your PC or Notebook,
you can also place second Terminal on second screen.
you can find your Rom-Zip-Package also at:
/android/system/out/target/product/p990/
Click to expand...
Click to collapse
10. Optional changes:
Fix for working torch and torch power-widget:
"activate" torch and power-widget:
open:
/android/system/packages/apps/Torch/res/values/config.xml
add or change to:
Code:
<bool name="useCameraInterface">true</bool>
open:
/android/system/packages/apps/Settings/res/values
add or change to:
Code:
<bool name="has_led_flash">true</bool>
add Torch.apk to the package:
open:
/android/system/device/lge/star-common/star.mk
change:
Code:
## LGE stuffs
PRODUCT_PACKAGES += \
LGEServices \
bridgeutil \
libbridges \
libbridge \
libbridge_jni \
secureclockd \
libsecureclock \
screencap \
hwprops \
com.android.future.usb.accessory
to:
Code:
## LGE stuffs
PRODUCT_PACKAGES += \
LGEServices \
bridgeutil \
libbridges \
libbridge \
libbridge_jni \
secureclockd \
libsecureclock \
screencap \
hwprops \
com.android.future.usb.accessory \
Torch
Credits:
aMpeX, loganmc10, pastime1971, owain94, tonyp, temasek
The -j part isn't needed anymore the build script figure it out on their own
and for the vendor files you can ad this to the local manifest
<project name="koush/proprietary_vendor_lge.git" path="vendor/lge" remote="github" />
it is less work we don't want to do to much
also this is maybe a nice addition
Code:
clear && cd vendor/cm && ./get-prebuilts && cd ../../ && clear && . build/envsetup.sh && brunch p990 2> warn.log
i use this build line
clear - make my terminal nice and empty
cd vendor/cm && ./get-prebuilts && cd ../../ - get the cm prebuilts
clear - make the terminal clean again
. build/envsetup.sh - set up the build env
brunch p990 - lunch and bacon for the p990
2> warn.log - exports al the warnings and errors to a text file to keep the terminal clean
i have three screens attached to my pc
on one screen i run the above command (clear && cd vendor/cm && ./get-prebuilts && cd ../../ && clear && . build/envsetup.sh && brunch p990 2> warn.log)
on another screen i run this command (clear && tail -f warn.log) this will print (and keep track of) the warn.log file with all the errors and warnings
and on the other screen i do useless stuff hehe
anyway i really like to use 2 terminals it is just easier to catch problems
Nice tut mate!
Sent from my HTC One X using xda premium
reserved
great guide bro.
Edit:
If anyone wants to install the SUN JDK instead of Open JDK you can install it from the partner repository:
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
Thanks, for your replies, I'll change my Guide at the evening.
Gesendet von meinem HTC One S mit Tapatalk 2
Great! Maybe I will stay building
Sent from LG 2X using Tapatalk 2 Elite
Thanks a lot !!
The Guide is updated, (big thanks to owain94).
I`ll add a new Step or Section (lets see, atm I don`t know) for extended Build-Line and possibly multiscreen using, I`ll test it while compiling for my One-S.
i am getting an error
make: *** No rule to make target `out/target/product/p990/obj/lib/libnvdispmgr_d.so', needed by `out/target/product/p990/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates/LINKED/libsurfaceflinger.so'. Stop.
plz help me..
thanks for the tutorial.
podanimesh said:
i am getting an error
make: *** No rule to make target `out/target/product/p990/obj/lib/libnvdispmgr_d.so', needed by `out/target/product/p990/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates/LINKED/libsurfaceflinger.so'. Stop.
plz help me..
Click to expand...
Click to collapse
did you sync the vendor files?
libnvdispmgr_d.so is a vendor file that cannot be build because we don't have the sources
you need to sync them from koush his github or extract the vendor files using the script in the device folder
good luck
owain94 said:
did you sync the vendor files?
libnvdispmgr_d.so is a vendor file that cannot be build because we don't have the sources
you need to sync them from koush his github or extract the vendor files using the script in the device folder
good luck
Click to expand...
Click to collapse
ok now compiled successfully..
ROM booted but no wi-fi and camera..
podanimesh said:
ok now compiled successfully..
ROM booted but no wi-fi and camera..
Click to expand...
Click to collapse
Wifi working fine for me, but I'll add a step for camera fix, thanks for reporting
Gesendet von meinem HTC VLE_U mit Tapatalk 2
If anyone wants to have SUN JDK instead of Open JDK it's still possible:
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
I also put that in "my" post 3.
thanks for reporting, but as far as I know, sun has many security risks, isn`t it?
XXMrHyde said:
thanks for reporting, but as far as I know, sun has many security risks, isn`t it?
Click to expand...
Click to collapse
Hm I don't think so. As far as I know the reason why Open JDK is used in Ubuntu instead of Sun JDK is that Open JDK is fully open sourced while Sun JDK still uses some pre compiled closed source binaries. Some open source fanatics might call this a security risk as they can't check the source themselves, but apart from that their shouldn't be any risks.
Sent from my LG-P990 using xda app-developers app
this procedure did not make .zip file, but normal folder
tonyp said:
Hm I don't think so. As far as I know the reason why Open JDK is used in Ubuntu instead of Sun JDK is that Open JDK is fully open sourced while Sun JDK still uses some pre compiled closed source binaries. Some open source fanatics might call this a security risk as they can't check the source themselves, but apart from that their shouldn't be any risks.
Sent from my LG-P990 using xda app-developers app
Click to expand...
Click to collapse
Ok, nice to know, I`ll change the Guide, so users can decide, which JDK they want to install
tomsi91 said:
this procedure did not make .zip file, but normal folder
Click to expand...
Click to collapse
Then you make a mistake, if so, my Rom wouldn`t excist
Please upload camera fix tutorial....
Sorry, I was a little bit busy today, I`ll ad the camera fix to the guide now
added camera fix to the Guide
edit:
now it can be choosen if you want to install Sun- or Open-JDK
I've had some people PM me for guidance building CM12 from source from the Atrix HD. There are currently no device specific guides, so this will help those of you who want to get their hands dirty with development but don't have a place to start.
Please note that I am writing this from memory as I don't feel like wiping my build environment and setting it up again for the purpose of this tutorial. That said, this *should* be accurate, but if you hit any snags comment and we can try and sort them out.
CREDITS:
This is adapted from http://wiki.cyanogenmod.org/w/Build_for_mb886 and http://forum.xda-developers.com/nexus-4/general/guide-cm11-how-to-build-cyanogenmod-11-t2515305 (Big thank you to @Raum1807 for the excellent guide, I'm merely modifying it to work for the MB886).
{
"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"
}
Overview
I. Preparation
II. Installation of the required packages
III. Installing Java
IV. The sources
V. Building the ROM
VI. Rebuilding with newest sources
I. Preparation
Things you need for building:
A computer
An internet connection
An open mind
Time
Patience
First of all, you need a running up-to-date Ubuntu/Linux system. I used Ubuntu 14.04 LTS 64-bit from within a VirtualBox VM.
Use the terminal to make the steps. A terminal window can be opened by pressing Ctrl+Alt+T. Every single command for the terminal is marked with a $ sign. Just paste every command (without the $ sign) to your terminal window and there shouldn't be any problem.
IMPORTANT: INSTALL EVERYTHING AS A NORMAL USER. DON'T INSTALL AS ROOT!
II. Installation of the required packages (Ubuntu 14.04 LTS 64-bit)
Install packages:
Code:
$ sudo apt-get install bison build-essential curl flex \
g++-multilib gcc-multilib git-core gnupg gperf \
lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev \
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
III. Installing Java
You need a version 6 Java Development Kit for building CM12.0. Usually, the SUN JDK 6 is recommended. But there is another way: you can use the OpenJDK 6. When you installed the required packages as described above, you will just need to configure your Java installation.
Check your Java version:
Code:
$ java -version
Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the right Java location and version:
Code:
$ ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
If they are pointing to the wrong versions you have to change that to OpenJDK6.
Select the default Java version for your system:
Code:
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javaws
$ sudo update-alternatives --config javadoc
$ sudo update-alternatives --config javah
$ sudo update-alternatives --config javap
$ sudo update-alternatives --config jar
All done.
IV. The sources
Install repo:
Repo is a tool that makes it quite easy to download and maintain the sources of Cyanogenmod.
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ cd ~/bin
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Create the working directory:
Code:
$ mkdir ~/cm12
$ cd ~/cm12
Initialize Repo:
Code:
$ repo init -u git://github.com/CyanogenMod/android.git -b cm-12.0
and enter your credentials.
Download the sources:
Code:
$ repo sync
Wait until it's finished - takes some time to download the many GB of source code!
If the process hangs use Ctrl+C to break out of it and resume the download with another
Code:
$ repo sync
If you are running into a lot of syncing errors the reason might be that the 'repo sync' command is establishing four threads automatically. This might be too much. So try to change the command to run with one thread only by using
Code:
$ repo sync -j1
Initialize the environment
Code:
$ . build/envsetup.sh
Obtain the proprietary files:
First get missing repositories for the Atrix HD by running
Code:
$ breakfast mb886
Then create a file with the name local_manifest.xml in the local_manifests directory. To see this directory, you have to press Ctrl-H in your file manager. Use this code
Code:
$ gedit ~/cm12/.repo/local_manifests/local_manifest.xml
Paste the following lines to the editor
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="TheMuppets/proprietary_vendor_motorola.git" path="vendor/motorola" remote="github" revision="cm-12.0"/>
</manifest>
Save the file.
Run
Code:
$ repo sync
again to get the files needed.
Download the necessary prebuilts from cyanogenmod by running
Code:
$ cd ~/cm12/vendor/cm
$ . get-prebuilts
$ croot
And you're done!
V. Building the ROM
Now build it:
Code:
$ brunch mb886
And the building process starts. Now have patience. Building takes around half an hour on fast systems and a lot more on older,slower machines and VMs.
When everything worked as it should you will find your new ROM-image in ~/cm12/out/target/product/mb886
It is called cm-12-DATE-UNOFFICIAL-mb886-zip. You can flash it via CWM/PhilZ/Cyanogen Recovery as usual.
VI. Rebuilding with newest sources
Whenever you like to update your sources and build a new version you have to run these four simple commands:
Code:
$ cd ~/cm12
$ repo sync
$ . build/envsetup.sh
$ brunch mb886
Compiling takes less time than it took for creating the ROM the first time because it's only building new parts while reusing old parts that haven't changed. Occasionally you might want to wipe your output directory and build completely anew. To do this:
Code:
$ cd ~/cm12
$ repo sync
$ make clean
$ . build/envsetup.sh
$ brunch mb886
Good luck!
Thank you. Great work!
Awesome work mate
How can we build aosp for atrix hd?
madhurvyas said:
How can we build aosp for atrix hd?
Click to expand...
Click to collapse
almost the same, just you have to download aosp source insted of cm's.. give the aosp link while initialising the repo.. google it, you will find it
I have the aosp source, but I dont think the "brakfast" and "lunch" command will work till I edit/add few files, I have added the local_manifest file, and given path to muppets repo.
Still few more things would be required. any links to read would be great help.
madhurvyas said:
I have the aosp source, but I dont think the "brakfast" and "lunch" command will work till I edit/add few files, I have added the local_manifest file, and given path to muppets repo.
Still few more things would be required. any links to read would be great help.
Click to expand...
Click to collapse
https://source.android.com/source/initializing.html
http://xda-university.com/as-a-developer/getting-started-building-android-from-source
These two links can be useful..
How to build the kernel, or get a prebuilt one.
I downloaded atrixhd kernel source from cm12.1 https://github.com/CyanogenMod/android_kernel_motorola_msm8960-common/tree/cm-12.1
madhurvyas said:
How to build the kernel, or get a prebuilt one.
I downloaded atrixhd kernel source from cm12.1 https://github.com/CyanogenMod/android_kernel_motorola_msm8960-common/tree/cm-12.1
Click to expand...
Click to collapse
http://wiki.cyanogenmod.org/w/Doc:_integrated_kernel_building
try this..
Welcome to Termux!
Wiki: https://wiki.termux.com
Community forum: https://termux.com/community
Gitter chat: https://gitter.im/termux/termux
IRC channel: #termux on freenode
Working with packages:
* Search packages: pkg search <query>
* Install a package: pkg install <package>
* Upgrade packages: pkg upgrade
Subscribing to additional repositories:
* Root: pkg install root-repo
* Unstable: pkg install unstable-repo
* X11: pkg install x11-repo
Report issues at https://termux.com/issues
$ <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creativ
bash: syntax error near unexpected token `<'
$ pkg install root-rep
Err:1 https://dl.bintray.com/termux/termux-packages-24 stable InRelease
Could not resolve host: dl.bintray.com
Err:2 https://dl.bintray.com/grimler/game-packages-24 games InRelease
Could not resolve host: dl.bintray.com
Err:3 https://dl.bintray.com/grimler/science-packages-24 science InRelease
Could not resolve host: dl.bintray.com
Reading package lists... Done
Building dependency tree... Done
All packages are up to date.
W: Failed to fetch https://dl.bintray.com/termux/termux-packages-24/dists/stable/InRelease Could not resolve host: dl.bintray.com
W: Failed to fetch https://dl.bintray.com/grimler/game-packages-24/dists/games/InRelease Could not resolve host: dl.bintray.com
W: Failed to fetch https://dl.bintray.com/grimler/science-packages-24/dists/science/InRelease Could not resolve host: dl.bintray.com
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package root-rep
$ package install unstable-tepo
No command 'package' found, did you mean:
Command 'pamedge' from package 'netpbm'
Command 'pbmpage' from package 'netpbm'
Command 'pacat' from package 'pulseaudio'
$ Command 'pamedge' from package 'netpbm'
No command 'Command' found, did you mean:
Command 'w3mman' from package 'w3m'
$ Command 'pbmpage' from package 'netpbm'
No command 'Command' found, did you mean:
Command 'w3mman' from package 'w3m'
$ Command 'pacat' from package 'pulseaudio'No command 'Command' found, did you mean:
Command 'w3mman' from package 'w3m'
$ $pkg install x11-repo
BusyBox v1.30.1 (2019-03-19 00:36:42 UTC) multi-call binary.
Usage: install [-cdDsp] [-o USER] [-g GRP] [-m MODE] [-t DIR] [SOURCE]... DEST
Copy files and set attributes
-c Just copy (default)
-d Create directories
-D Create leading target directories
-s Strip symbol table
-p Preserve date
-o USER Set ownership
-g GRP Set group ownership
-m MODE Set permissions
-t DIR Install to DIR
$ Usage: install [-cdDsp] [-o USER] [-g GRP] [-m MODE] [-t DIR] [SOURCE]... DEST
No command 'Usage:' found, did you mean:
Command 'osage' from package 'graphviz'
$ Command 'osage' from package 'graphviz'
No command 'Command' found, did you mean:
Command 'w3mman' from package 'w3m'
$ $-c Just copy (default)
bash: syntax error near unexpected token `('
$ -d Create directories
No command '-d' found, did you mean:
Command 'ld' from package 'binutils'
Command 'id' from package 'busybox'
Command 'od' from package 'busybox'
Command 'dd' from package 'busybox'
Command 'hd' from package 'busybox'
Command 'dd' from package 'coreutils'
Command 'od' from package 'coreutils'
Command 'id' from package 'coreutils'
Command 'ed' from package 'ed'
Command 'fd' from package 'fd'
$ -D Create leading target directories
No command '-D' found, did you mean:
Command 'ab' from package 'apache2'
Command 'dc' from package 'bc'
Command 'bc' from package 'bc'
Command 'ld' from package 'binutils'
Command 'nm' from package 'binutils'
Command 'ar' from package 'binutils'
Command 'as' from package 'binutils'
Command 'cp' from package 'busybox'
Command 'rm' from package 'busybox'
Command 'sv' from package 'busybox'
Command 'dc' from package 'busybox'
Command 'ln' from package 'busybox'
Command 'vi' from package 'busybox'
Command 'id' from package 'busybox'
Command 'du' from package 'busybox'
Command 'nc' from package 'busybox'
Command 'od' from package 'busybox'
Command 'ar' from package 'busybox'
Command 'wc' from package 'busybox'
Command 'ps' from package 'busybox'
Command 'dd' from package 'busybox'
Command 'rx' from package 'busybox'
Command 'tr' from package 'busybox'
Command 'hd' from package 'busybox'
Command 'xz' from package 'busybox'
Command 'ls' from package 'busybox'
Command 'mv' from package 'busybox'
Command 'cc' from package 'clang'
Command 'dd' from package 'coreutils'
Command 'cp' from package 'coreutils'
Command 'ln' from package 'coreutils'
Command 'ls' from package 'coreutils'
Command 'rm' from package 'coreutils'
Command 'od' from package 'coreutils'
Command 'wc' from package 'coreutils'
Command 'id' from package 'coreutils'
Command 'tr' from package 'coreutils'
Command 'nl' from package 'coreutils'
Command '[' from package 'coreutils'
Command 'mv' from package 'coreutils'
Command 'du' from package 'coreutils'
Command 'pr' from package 'coreutils'
Command 'sh' from package 'dash'
Command 'dx' from package 'dx'
Command 'ed' from package 'ed'
Command 'fd' from package 'fd'
Command 'gs' from package 'ghostscript'
Command 'go' from package 'golang'
Command 'gm' from package 'graphicsmagick'
Command 'gc' from package 'graphviz'
Command 'jq' from package 'jq'
Command 'k' from package 'kona'
Command 'm4' from package 'm4'
Command 'mc' from package 'mc'
Command 'mg' from package 'mg'
Command 'lz' from package 'mtools'
Command 'uz' from package 'mtools'
Command 'ne' from package 'ne'
Command 'nc' from package 'netcat'
Command '7z' from package 'p7zip'
Command 'ps' from package 'procps'
Command 'pv' from package 'pv'
Command 'r2' from package 'radare2'
Command 'co' from package 'rcs'
Command 'ci' from package 'rcs'
Command 'rg' from package 'ripgrep'
Command 'ri' from package 'ruby-ri'
Command 'ag' from package 'silversearcher-ag'
Command 'sl' from package 'sl'
Command 'am' from package 'termux-am'
Command 'pm' from package 'termux-tools'
Command 'df' from package 'termux-tools'
Command 'su' from package 'termux-tools'
Command 'ip' from package 'termux-tools'
Command 'ht' from package 'texlive-bin'
Command 'mf' from package 'texlive-bin'
Command 'ul' from package 'util-linux'
Command 'vi' from package 'vim'
Command 'vi' from package 'vim-python'
Command 'wg' from package 'wireguard-tools'
Command 'xz' from package 'xz-utils'
$ -s Strip symbol table
No command '-s' found, did you mean:
Command 'as' from package 'binutils'
Command 'ps' from package 'busybox'
Command 'ls' from package 'busybox'
Command 'ls' from package 'coreutils'
Command 'gs' from package 'ghostscript'
Command 'ps' from package 'procps'
$ -p Preserve date
No command '-p' found, did you mean:
Command 'cp' from package 'busybox'
Command 'cp' from package 'coreutils'
Command 'ip' from package 'termux-tools'
$ -o USER Set ownership
No command '-o' found, did you mean:
Command 'go' from package 'golang'
Command 'co' from package 'rcs'
$ -g GRP Set group ownership
Rooted my thinkpad 430 laptop
Cruelty will be in your memory on your deathbed, not mine.
jrummy¿ said:
Rooted my thinkpad 430 laptop
Click to expand...
Click to collapse
How 'bout G8 next?
I need to be able to afford one hahaha
The pc has 973 GB of software memory
Anybody want to buy it???
Cant find the RAM size on it but its got 4 i5s and 4 i7s
Im confused did you get root for Q710AL?
There are a lot of web pages about building your own TWRP image in the internet but at least I did not find a HowTo with all necessary instructions and infos in one place.
Therefor I wrote this little HowTo about building a TWRP image for the ASUS Zenfone 8. The instructions in the HowTo can also be used to create TWRP images for other phones supported by TWRP. The HowTo is for a PC running the Linux OS.
Note that this HowTo can only be used for phones that are officially supported by TWRP.
In the end, creating a TWRP image is also quite easy once you know how it works, thanks to the well-done setup of the development environment by the TWRP developer.
Prereqs
The repositories with the manifests for TWRP are here https://github.com/minimal-manifest-twrp and the repositories with the TWRP files and the device trees for the phones supported by TWRP are here: https://github.com/TeamWin . So you need access to github for creating your own TWRP image.
The tool repo is required to maintain the repositories for TWRP; you can download repo from https://gerrit.googlesource.com/git-repo
It's not necessary to install additional tools for creating an TWRP image -- all necessary tools to create the image are in the repositories for TWRP.
Note
To check if there is a repository with the device tree for another phone for TWRP use the search function on the page https://github.com/TeamWin and search for the device ID of the phone.
To search via script use (I006D is the device ID for the ASUS Zenfone 8):
Bash:
wget "https://api.github.com/search/repositories?q=I006D" -O ./repository_list
Spoiler: search example for the ASUS Zenfone 8
Code:
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $ wget "https://api.github.com/search/repositories?q=I006D" -O ./repository_list
--2022-11-27 09:20:27-- https://api.github.com/search/repositories?q=I006D
Resolving api.github.com (api.github.com)... 140.82.121.5
Connecting to api.github.com (api.github.com)|140.82.121.5|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘./repository_list’
./repository_list [ <=> ] 46.30K --.-KB/s in 0.01s
2022-11-27 09:20:28 (3.55 MB/s) - ‘./repository_list’ saved [47414]
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $ grep "full_name" ./repository_list
"full_name": "CaptainThrowback/android_device_asus_I006D",
"full_name": "nguyenhung9xdev2022/android_kernel_asus_I006D",
"full_name": "nguyenhung9xdev2022/android_vendor_asus_I006D",
"full_name": "nguyenhung9xdev2022/android_device_asus_I006D",
"full_name": "asus-development/android_device_asus_I006D",
"full_name": "OpenPecha-Data/I006D4C7E",
"full_name": "dmd79/android_device_asus_I006D",
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $
To get the device ID for a phone execute :
Bash:
adb shell getprop ro.product.system.device
e,g.
Code:
#
# on a PC for a connected ASUS Zenfone 8
#
[[email protected] /data/develop/android/twrp]$ adb shell getprop ro.product.system.device
I006D
[[email protected] /data/develop/android/twrp]$
#
# on the ZUK Z2 Pro
#
z2_row:/ # getprop ro.product.system.device
z2_row
z2_row:/ #
The device ID is required for the lunch command used to copy the repositories with the device trees (see below).
Building the ROM
First copy the necessary repositories for building TWRP to your local machine using these commands:
Bash:
#
# create a new directory for the repositories (optional)
#
mkdir twrp
cd twrp
# init the local repositories
#
# As of 27.11.2022 the latest version of the TWRP repositories is 12.1 ;
# to download the default repository version you can omit the parameter "-b twrp-12.1"
# As of 27.11.2022 the repositories for TWRP 12.1 use about 45 GB; to save some
# space (about 12 GB) you could add the parameter --depth=1
#
repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1
# sync the repositories (Parameter -j8 = use 8 parallel jobs; adjust this parameter to
# the number of CPU available on your PC)
#
repo sync -c -j8 --force-sync --no-clone-bundle --no-tags
Next add the device dependent repositories for the ASUS Zenfone 8.
The format of the parameter for the lunch command is
twrp_<device_id>-eng
So the parameter for the ASUS Zenfone 8 is twrp_I006D-eng.
Bash:
#
# init the environment to build the TWRP image
#
. build/envsetup.sh
export ALLOW_MISSING_DEPENDENCIES=true
lunch twrp_I006D-eng
Spoiler: lunch example
Code:
TWRP Dev - [email protected] /data/develop/android/twrp ] $ lunch twrp_I006D-eng
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
build/make/core/product_config.mk:160: error: Can not locate config makefile for product "twrp_I006D".
11:35:37 dumpvars failed with: exit status 1
Device I006D not found. Attempting to retrieve device repository from TeamWin Github (http://github.com/TeamWin).
Found repository: android_device_asus_I006D
Checking branch info
Calculated revision: android-12.1
Adding dependency:
Repository: android_device_asus_I006D
Branch: android-12.1
Remote: TeamWin
Path: device/asus/I006D
Syncing repository to retrieve project.
Fetching: 100% (1/1), done in 12.846s
NOT Garbage collecting: 0% (0/1), done in 0.001s
repo sync has finished successfully.
Repository synced!
Looking for dependencies
Adding dependencies to manifest
Adding dependency:
Repository: android_device_asus_sm8350-common
Branch: android-12.1
Remote: TeamWin
Path: device/asus/sm8350-common
Syncing dependencies
Fetching: 100% (1/1), done in 15.848s
NOT Garbage collecting: 0% (0/1), done in 0.001s
repo sync has finished successfully.
Looking for dependencies
device/asus/sm8350-common has no additional dependencies.
Done
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.0.9-200.fc36.x86_64-x86_64-Fedora-Linux-36-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
============================================
[ TWRP Dev - [email protected] /data/develop/android/twrp ] $
And final build the TWRP image
Bash:
mka bootimage
Spoiler: mka bootimage example
Code:
[ TWRP Dev - [email protected] /data/develop/android/twrp ] $ time mka bootimage
build/make/core/soong_config.mk:197: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:198: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=99.87.36
TARGET_PRODUCT=twrp_I006D
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.0.9-200.fc36.x86_64-x86_64-Fedora-Linux-36-(MATE-Compiz)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP2A.220405.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/asus/sm8350-common
============================================
[ 78% 246/312] including bootable/recovery/Android.mk ...
bootable/recovery/prebuilt/Android.mk:437: warning: vendor_hw: bootable/recovery/prebuilt/relink.sh out/target/product/I006D/recovery/root/vendor/bin/hw
[ 95% 299/312] including system/sepolicy/Android.mk ...
system/sepolicy/Android.mk:57: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
system/sepolicy/Android.mk:62: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
[ 30% 8637/28297] //bionic/libc:libc_bionic clang arch-arm64/bionic/setjmp.S
....
Removing unneeded service: keymaster-4-1-citadel
Service_Cleanup script complete.
[100% 28297/28297] Target boot image from recovery: out/target/product/I006D/boot.img
#### build completed successfully (14:50 (mm:ss)) ####
real 14m50.110s
user 182m6.217s
sys 11m58.492s
[ TWRP Dev - [email protected] /data/develop/android/twrp ] $
Note:
For devices without A/B devices use mka recoveryimage.
The TWRP image will be created in file boot.img the directory ./out/target/product/I006D e.g.:
Code:
[ TWRP Dev - [email protected]t15g /data/develop/android/twrp ] $ ls -ltr out/target/product/I006D/boot.img
-rw-rw-r--. 1 xtrnaw7 xtrnaw7 100663296 Nov 27 12:06 out/target/product/I006D/boot.img
[ TWRP Dev - [email protected] /data/develop/android/twrp ] $
To test the image just boot the phone from the image
Bash:
adb reboot bootloader
sudo fastboot boot out/target/product/I006D/boot.img
And check if the boot was succesfull:
Code:
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $ adb shell getprop ro.bootmode
unknown
[ OmniRom 13 Dev - [email protected] /data/develop/android/twrpX ] $
unknown is the expected value here.
Trouble Shooting
On some pages I found a hint that the build scripts require python2 and will not work with python3. But this is most probably not true anymore because building the image with python3 worked without problems.
It's strongly recommended to use separate sessions for compiling OmniROM or TWRP or even different versions of TWRP:
All these build environments define the same commands in the file ./build/envsetup.sh but with different functionality.
As of 27.11.2022 there are only 2 branches in the repository with the manifests for TWRP : version 11 and version 12.1.
If there is no branch for one of these versions in the repositories for the device tree of the phone for which you want to create a TWRP image the lunch command will fail.
The repositories with the manifests for TWRP prior to version 11 can be fetched with this command:
Bash:
# Minimal manifest for building TWRP for devices shipped with Android 5.1 through Android 9.0
#
repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-9.0
Note that the lunch command in the old repositories does work different.
Notes:
The URL to the repository with the device tree for a phone is also on the page for the device on the TWRP device list: https://twrp.me/Devices/
See https://unofficialtwrp.com/build-compile-twrp-recovery for other possible settings for the build
see here for How to add additional files to an TWRP image
XDA Forum thread about compiling TWRP: How to compile TWRP touch recovery