My other tutorial for building CM for G2x
Last tested on 6/2/2011
This tutorial requires a basic to intermediate knowledge of linux terminal commands. First you will need to be running the latest CM nightly. Then you will need to install Ubuntu 11.04. This tutorial will work for if you are running Ubuntu in a virtual machine and if you installed it to your hard drive. I have tested this by installing it to my hard drive and in a virtual machine, but I have not tried it in Wubi but it should work. You need 11.04 64 bit.
How to install Ubuntu: https://help.ubuntu.com/community/Installation
After you have installed Ububtu, make sure that your OS is up to date. You can do that by running the Update Manager from the System>Administration menu. Once that is completed, go to Applications>Accessories and open Terminal.
Now you will be setting up your build environment.
Next lets open a terminal. Copy and paste the following into terminal.
(Copy from this tutorial with control+c and paste in terminal with control+shift+v)
Code:
sudo apt-get update && sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev gitg qt3-dev-tools libqt3-mt-dev eclipse valgrind pngcrush schedtool
Code:
sudo add-apt-repository ppa:ferramroberto/java && sudo apt-get update && sudo apt-get install sun-java6-jdk && sudo update-java-alternatives -s java-6-sun
Now you will be installing ADB
Download the sdk from the android website (use the Linux download) http://developer.android.com/sdk/index.html
extract the sdk to your ~/ directory (home directory). So you should be able to go to a terminal and cd ~/AndroidSDK/platform-tools to access your platform-tools folder in your sdk. After that, update your android sdk by opening terminal and run:
Code:
~/AndroidSDK/tools/./android
Open the terminal, and type gedit .bashrc and at the top of the file, paste this (replacing user with your username)
Code:
#AndroidDev PATH
export PATH=${PATH}:/home/user/AndroidSDK/platform-tools
export PATH=${PATH}:/home/user/AndroidSDK/tools
This will make ADB, Fastboot and DDMS available from the terminal on next login.
Now, to make the device available to normal users, open a terminal and type
Code:
sudo gedit /etc/udev/rules.d/51-android.rules
Then paste
Code:
SUBSYSTEMS == "usb", ATTRS {idVendor} == "18d1", ATTRS {idProduct} == "4E11", MODE = "0666"
SUBSYSTEMS == "usb", ATTRS {idVendor} == "18d1", ATTRS {idProduct} == "4e12", MODE = "0666"
SUBSYSTEMS == "usb", ATTRS {idVendor} == "0bb4", ATTRS {idProduct} == "0FFF", MODE = "0666"
SUBSYSTEM=="usb",ATTRS(idVendor)=="18d1",SYMLINK+="android_adb",MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666"
Save and exit.
Ensure that the rules are executable:
Code:
sudo chmod a+rx /etc/udev/rules.d/*
Then type
Code:
sudo restart udev
You should restart your computer (or virtual machine) right now to ensure that everything is running properly.
Note: idVendor may vary. Use lsusb from the terminal, look for your Android device and replace “0bb4? with the first 4 characters after “ID”.
If ADB is still not working, read http://forum.xda-developers.com/showthread.php?t=533 and http://alan.lamielle.net/2010/01/22/nexus-one-usb-in-ubuntu-9-10
You should now have a fully working android build environment.
Now before you begin getting and building the source, make sure that you are on the latest CM7 nightly and have the latest gapps from Rom Manager.
Now to setup the CyanogenMod build environment and to build it
Enter the following lines in terminal:
Code:
cd ~/
mkdir -p ~/bin
mkdir -p ~/cm7
cd ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
cd ~/
chmod a+x ~/bin/repo
PATH="$HOME/bin:$PATH"
PATH="$HOME/AndroidSDK/platform-tools:$PATH"
PATH="$HOME/AndroidSDK/tools:$PATH"
cd ~/cm7
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
Press enter and enter the information it asks for.
The next command will download all of the CM source. It will take at least a few hours or more depending on your internet speed.
Code:
repo sync -j16
After the sync, plug your phone in, and run adb devices and if your phone is listed, continue. Otherwise, go back and make sure you have properly installed adb and the drivers.
Plug your phone in, copy the following commands into terminal, and press enter.
Code:
cd ~/cm7/device/htc/passion/
./extract-files.sh
cd ~/cm7/vendor/cyanogen/
./get-rommanager
./get-google-files
now you your CM build environment is complete.
Warning: Building CM pushes your computer to the max your cpu can handle. Make sure that your computer can handle compiling CM. If It cannot, DO NOT DO THIS.
To build, just run(use this command every time you want to build CM):
**** Here is a new updated command to build CM****
Code:
cd ~/cm7 && make clean && repo sync -j6 && . build/envsetup.sh && brunch passion
If you come across any problems while syncing use repo sync -f -j6 -d and it will force sync and override any changes made to the source on your computer.
and it will make an update.zip in ~/cm7/out/target/product/passion/update-cm-7.1.0-RC1-N1-signed.zip (or whatever the latest RC is)
Congratulations you have just compiled CyanogenMod for the Nexus One!
Possible causes if the build fails:
1. Make sure you followed the directions precisely.
2. Try all three of the build commands.
3. If you changed any of the code, make sure it has no errors. Open it up in eclipse and check for errors.
4. Search Google and XDA.
**If you are getting a problem with getting the gapps, it it because of the CM gapps mirror system.
1. download and install the latest gapps
2. plug your phone in and run:
Code:
~/cm7/vendor/cyanogen/./extract-google-files
Sources:
http://developer.android.com/sdk/index.html
http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_passion
http://www.lineardroid.co.uk/2010/07/configure-build-environment/
http://www.lineardroid.co.uk/2010/04/how-to-set-up-adb-in-ubuntu/
http://forum.xda-developers.com/showthread.php?t=533090
http://alan.lamielle.net/2010/01/22/nexus-one-usb-in-ubuntu-9-10
http://forum.xda-developers.com/showthread.php?t=704561
Be sure to thank if this was helpful!
Building on a Mac
Building on a Mac may not work.
Install MacPorts
Install MacPorts using the instructions at MacPorts.org
Install the Developer Tools
Install the Mac OS X Developer Tools from your Mac OS X DVD or from the Apple developer site.
Install the Java Developer Package
Install the Java Developer Package from Apple's site — you'll need a free developer account from Apple. The installer you are looking for will be "Java for Mac OS X 10.6 Update 3 Developer Package" (Update 3 is the latest as of this writing).
Install the Android SDK using the instructions from the first post
Create a Case-Sensitive Workspace
While normal Macintosh volumes are case insensitive, the CyanogenMod/Android source contains files with the same name but in different cases. To solve this issue, you'll have to create and then work out of a case-sensitive disk image.
1. Open the Disk Utility (/Applications/Utilities/Disk Utility.app).
2. Click on New Image.
3. Save as "CyanogenModWorkspace.sparseimage" and set the following parameters as followed:
Name: "CyanogenModWorkspace"
Size: 15 GB is minimum recommended (A sparseimage will save unused space)
Format: Mac OS Extended (CASE-SENSITIVE, Journaled)
Encryption: none, Partition- Single Apple Partition Map
Image Format: Sparse Disk Image (this will save you disk space)
4. Save this wherever you like, and then double-click the sparseimage file to mount.
5. Your workspace will be:
/Volumes/CyanogenModWorkspace/
Install Required Ports
Now you need to install some stuff from macports:
Code:
sudo port selfupdate
POSIXLY_CORRECT=1 sudo port install gmake libsdl git-core gnupg e2fsprogs gsed curl libiptcdata xorg-libX* pngcrush findutils
sudo ln -s /opt/local/bin/gsed /opt/local/bin/sed
sudo ln -s /opt/local/libexec/gnubin/find /opt/local/bin/find
Now you need to downgrade gmake to 3.81 because 3.82 breaks the build.
Here's how to downgrade to 3.81:
1. Visit http://trac.macports.org/log/trunk/dports/devel/gmake
2. Click the link that says "@50980" - although it doesn't explicitly say 3.81, this is it
3. Click the link that says "Portfile"
4. Scroll to the bottom and just below "Download in other formats:" click "Original Format"
5. This is subtle but important: If your browser e.g. Chrome renamed it to Portfile.txt, you need to rename it to simply "Portfile"
6. cd to the location of Portfile and
Code:
sudo port install
This should install and configure gmake 3.81, after which:
Code:
sudo port installed gmake
will print out:
The following ports are currently installed:
gmake @3.81_0 (active)
gmake @3.82_0
Set up the Workspace
Now to setup the CyanogenMod build environment and to build it
copy each line individually into a terminal and press enter:
(This entire process could take hours, depending on your computer and your Internet speed.)
(And make sure your Nexus One is plugged in for the commands after repo sync.)
(Also, you should be running the latest CM nightly (which is CM7) and you should have clockwork recovery and rom manager)
Code:
cd /Volumes/CyanogenModWorkspace/
mkdir -p /Volumes/CyanogenModWorkspace/bin
mkdir -p /Volumes/CyanogenModWorkspace/android-cm7
curl http://android.git.kernel.org/repo > /Volumes/CyanogenModWorkspace/bin/repo
chmod a+x /Volumes/CyanogenModWorkspace/bin/repo
PATH=${PATH}:/Volumes/CyanogenModWorkspace/bin:
echo "PATH=\${PATH}:/Volumes/CyanogenModWorkspace/bin:" >> ~/.profile
cd /Developer/SDKs
sudo ln -s MacOSX10.6.sdk/ MacOSX10.4u.sdk
cd /Volumes/CyanogenModWorkspace/android-cm7
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
repo sync
cd /Volumes/CyanogenModWorkspace/android-cm7/device/htc/passion/
./extract-files.sh
cd /Volumes/CyanogenModWorkspace/android-cm7/vendor/cyanogen/
./get-rommanager
./get-google-files
./extract-google-files
now you your CM build environment is complete.
Build CyanogenMod
open a terminal and type:
Code:
touch ~/Desktop/build.sh
chmod u+x ~/Desktop/build.sh
open -e ~/Desktop/build.sh
paste the following into TextEdit and save:
Code:
#!/bin/bash
echo "cd to android-cm7";
cd /Volumes/CyanogenModWorkspace/android-cm7
echo "Make clean";
make clean
make installclean
echo "Syncing";
repo sync
echo "Copying the make file";
cp ./vendor/cyanogen/products/cyanogen_passion.mk ./buildspec.mk
echo "Setting up build env\n";
. build/envsetup.sh
echo "Setting up lunch";
lunch cyanogen_passion-eng
cd /Volumes/CyanogenModWorkspace/android-cm7
echo "Using the make command";
make -j`sysctl -an hw.logicalcpu` bacon
save and quit TextEdit.
Run the following command in terminal every time you want to build CM.
Code:
~/Desktop/./build.sh
If you get an error saying:
Code:
ASSERTION FAILURE external/elfcopy/elfcopy.c:932: [ranges[i].start >= last_end]
You need to open /Volumes/CyanogenModWorkspace/external/elfcopy/elfcopy.c and comment line 932 (Add // in front of the line). This should fix the problem and allow you to successfully build CM.
Congratulations you have just compiled CyanogenMod for the Nexus One on a Mac!
Sources:
Most of this tutorial came from the CM wiki and the first post.
http://wiki.cyanogenmod.com/index.p...for_Passion_(Mac)#Install_the_Developer_Tools
http://forum.xda-developers.com/showthread.php?t=899674
..........
I love you
Sent from my Nexus One using XDA App
How much hdd disk space is required?
Last time I tried with a 8 GB disk image on virtual box and run out of space while syncing repo!
Sent from my Nexus One using XDA App
lhurtado said:
How much hdd disk space is required?
Last time I tried with a 8 GB disk image on virtual box and run out of space while syncing repo!
Sent from my Nexus One using XDA App
Click to expand...
Click to collapse
A lot is required. I haven't built it in a while but I suspect it close to 8GB.
Thanks for this man. Last time I tried this with Virtual Box I could never get my phone detected in ADB. Going to give this a whirl today.
thanks dude for the tutorial! luv it!
Hi, just a couple corrections:
To set PATH, you wrote gedit .basrc, should be gedit .bashrc
To set repo, you wrote mkdir -p ~/bin/repo, should be mkdir -p ~/bin
btw, thanks for this tutorial!
lhurtado said:
How much hdd disk space is required?
Last time I tried with a 8 GB disk image on virtual box and run out of space while syncing repo!
Sent from my Nexus One using XDA App
Click to expand...
Click to collapse
My cyan-froyo source have 6.1GB now without any modification.
It's huge! Now I'm syncing repo, this time I made a bigger disk on virtual box .
Now I have to check how to build just an app...
Sent from my Nexus One using XDA App
i only had an 8gb partition so i'm just using an nfs share to store the source.
syncing repo now. Thanks a lot lhurtado for those two fixes. I was stuck trying to get repo to work.
mikroN1 said:
syncing repo now. Thanks a lot lhurtado for those two fixes. I was stuck trying to get repo to work.
Click to expand...
Click to collapse
you're welcome!
There's no need to add Jaunty repos to your Lucid/Maverick install, just enable the partner repository in System > Administration > Software Sources > Other Software
I think I'm stuck where I was before. Can't get my phone detected in ADB.
./extract-files.sh: 54: adb: not found
Any ideas?
edit: doing ./adb devices show's nothing connected.
lhurtado said:
Hi, just a couple corrections:
To set PATH, you wrote gedit .basrc, should be gedit .bashrc
To set repo, you wrote mkdir -p ~/bin/repo, should be mkdir -p ~/bin
btw, thanks for this tutorial!
Click to expand...
Click to collapse
thanks, editing now
mikroN1 said:
I think I'm stuck where I was before. Can't get my phone detected in ADB.
./extract-files.sh: 54: adb: not found
Any ideas?
edit: doing ./adb devices show's nothing connected.
Click to expand...
Click to collapse
first, make sure that your phone is connected, and if you are using a virtual machine, mounted with the program and make sure that you restarted your computer. If that doesn't fix it, then your problem is with the rules. Try reading the other two links I wrote to read.
awesome guide
thanks alot for the guide. big help. although the line "make -j`grep 'processor' /proc/cpuinfo | wc -l` CYANOGEN_WITH_GOOGLE=true otapackage" # Not working right now. It says that on the cyanogen wiki. also how do you go about adding your own stuff to the builds you make?
samir5421 said:
first, make sure that your phone is connected, and if you are using a virtual machine, mounted with the program and make sure that you restarted your computer. If that doesn't fix it, then your problem is with the rules. Try reading the other two links I wrote to read.
Click to expand...
Click to collapse
Phone is connected and shows up under USB Devices in VirtualBox. Also the two links you supplied for the ADB section both don't work. I tried changing my idVendor but still can't get it to detect my phone.
Edit:
Added my phone as a usb filter in VirtualBox. Still not working. I'm getting this pop up trying to click on my phone.
{
"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"
}
Related
Arch Linux is a rolling release distribution, but Android requires you to have jdk6 (or openjdk6) and python2 to build it. It took me some time to setup everything, and I hope this guide will be useful to anyone who's trying to do the same.
The ArchWiki is a bit outdated. Among other things, it suggests changing the "python" symlink to point to python2, which I didn't want to do as it could cause problems ("python" is supposed to point to python3). Also, Arch Linux uses openjdk7, so you'd have to downgrade to openjdk6 (or Oracle's jdk6) - which isn't mentioned in the Wiki, and is something I'd rather avoid as I want to keep using the latest version.
Basically, I'd like to share this here for now to get some input, and later update the ArchWiki.
0- Quick note about this guide
I think it's pretty safe to assume you're familiar with the terminal.
Also note that this guide will not really talk about how to actually build Android, it's focused on setting up your Arch distro to do so in an easy way.
1- Prerequisites
The ArchWiki covers installing the Android SDK and ADB pretty well.
You'll need these packages for building Android:
Code:
git gnupg flex bison gperf sdl wxgtk squashfs-tools curl ncurses zlib schedtool perl-switch zip unzip
And for 64 bit systems (make sure multilib is enabled):
Code:
lib32-zlib lib32-ncurses lib32-readline gcc-libs-multilib gcc-multilib lib32-gcc-libs
You also need the "repo" utility, which is available in the AUR.
2- Setting up Java
The AUR has packages that should install alongside openjdk7, but that didn't work for me and I found it easier to simply install jdk6 independently of pacman's packages.
To do so, download the latest Linux .bin file (jdk-6u45-linux-x64.bin), and place it in /opt (run a root shell, "sudo bash"):
Code:
cp ~/Downloads/jdk-6u45-linux-x64.bin
Make it executable and run it as root:
Code:
cd /opt
chmod +x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
We'll be updating our path before building to use this version.
3- Setting up Python
We're going to create a python symlink to python2, and place it in /opt/android-build. We'll use this later by updating our path when necessary.
Code:
mkdir /opt/android-build
cd /opt/android-build
ln -s $(which python2) python
4- (Temporarily) Setting up our PATH to test if everything's fine
We just installed jdk6 and made a symlink to python2, but we still need to update our path. In this step, we'll do that in order to test that everything's fine:
Code:
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
Make sure jdk6 and python2 are being used:
Code:
echo -n $(python -V)
echo -n $(java -version)
The output should be similar to:
Code:
Python [COLOR="Red"]2[/COLOR].x.x
java version "1.[COLOR="Red"]6[/COLOR].xx"
Java(TM) SE Runtime Environment (build 1.[COLOR="Red"]6[/COLOR].xx)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
5- Make a build script (or just build).
I'd highly suggest making a build script and placing it in ~/bin. You can then easily run it, and it will take care of everything.
Otherwise, you can run this in the terminal every time before building:
Code:
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
And then proceed normally, for example:
Code:
. build/envsetup.sh
lunch cyanogen_cooperve-eng
make clean
time make -j6 bacon
This is my (trimmed down to remove some git revert checks) personal build script, you can modify it to fit your needs. The working directory is your home folder, change the "path" variable around the middle if yours is different.
Code:
Help() {
echo -n "Usage: build [OPTIONS]
-h, --help show this screen
-s, --sync run repo sync before building
-c, --clean make clean"
echo
}
box () {
tput setaf 6
echo
str="[email protected]"
len=$((${#1}+4))
for ((i = 1; i <= $len; i++)); do
echo -n '*'
done
echo
echo "* $str *"
for ((i = 1; i <= $len; i++)); do
echo -n '*'
done
echo
tput sgr0
}
path="/home/germain/"
sync=0
clean=0
while :; do
case $1 in
-h | --help)
Help
exit 0
;;
-s | --sync)
sync=1
shift
;;
-c | --clean)
clean=1
shift
;;
--)
shift
break
;;
-*)
echo "Unknown option $1, ignoring" >&2
shift
;;
*)
break
;;
esac
done
clear
box "Setting up \$PATH..."
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
echo -n $(python -V)
echo -n $(java -version)
cd "$path"
(( "$sync"==1 )) && box "Syncing..." && repo sync -j64
box "Starting build..."
. build/envsetup.sh
lunch cyanogen_cooperve-eng
(( "$clean"==1 )) && box "Clean build!" && echo && make clean
time make -j6 bacon
box "Done!"
To set it up:
Code:
nano ~/bin/build
<copy the above script, press SHIFT + INSERT to paste, and CTRL+X followed by "Y" to save>
chmod +x ~/bin/build
Usage:
Code:
Usage: build [OPTIONS]
-h, --help show this screen
-s, --sync run repo sync before building
-c, --clean make clean
Sources
These web pages helped me a lot.
http://f0rki.at/building-android-on-arch-linux-x86_64.html
https://wiki.archlinux.org/index.php/Android
https://bbs.archlinux.org/viewtopic.php?id=131939
Good job dude. I already use Arch Linux for developing Android firmware but I haven't the time to make one tutorial for others.:laugh:
Thanks for the guide, but even after I have set the correct java path, (java -version shows Java SE), while building, it still gives a warning that I'm building with Java 1.7 (openjdk). Any pointers?
Checking build tools versions...
************************************************************
You are attempting to build with an unsupported version
of java.
Your version is: java version "1.7.0_21".
The correct version is: Java SE 1.6 or 1.7.
Please follow the machine setup instructions at
https://source.android.com/source/download.html
EDIT: NVM. Fixed by exporting JAVA_HOME and J2SDKDIR
Geat job GermainZ!
The packages in the AUR which should install alongside openjdk7 should work (it works for me) if you:
Code:
export PATH="/opt/java6/bin:$PATH"
Then (as you mention) you can check by:
Code:
echo -n $(java -version)
Anyway thanks for the guide, I think it is definitely worth updating the Arch Wiki to include this information!
marno11 said:
Geat job GermainZ!
The packages in the AUR which should install alongside openjdk7 should work (it works for me) if you:
Code:
export PATH="/opt/java6/bin:$PATH"
Then (as you mention) you can check by:
Code:
echo -n $(java -version)
Anyway thanks for the guide, I think it is definitely worth updating the Arch Wiki to include this information!
Click to expand...
Click to collapse
I see they were recently updated. They weren't building for me at the time, and I didn't have enough time to check the PKGBUILD.
I'll do my best to update the wiki when I can, including both options. Thanks.
Thanks for putting this up, I landed on this after following the link in the Arch wiki.
I have a suggestion concerning point 3 (python). Wouldn't it be more sane to use python's virtualenv to set up a python distro for Android?
And BTW, I am trying out the new android-studio, which works for me out of the box, even with openjdk7. Just make sure you install openjdk7-src as Java sources are not (yet) in the dependencies of the android-studio package from the AUR.
stammler said:
Thanks for putting this up, I landed on this after following the link in the Arch wiki.
I have a suggestion concerning point 3 (python). Wouldn't it be more sane to use python's virtualenv to set up a python distro for Android?
And BTW, I am trying out the new android-studio, which works for me out of the box, even with openjdk7. Just make sure you install openjdk7-src as Java sources are not (yet) in the dependencies of the android-studio package from the AUR.
Click to expand...
Click to collapse
So basically, create a python 2.7 virtualenv, activate and build from it?
Personally, I find that creating a symlink and adding it to your path (temporary) seems easier and requires no extra tools, but that's up to you. Have you tried it out? Can you please elaborate on why it would be preferable?
Thanks
i have to ask, instead of doing all these steps, wouldn't it be easier just to install BBQLinux and change the java version with a purge command and reinstall 1.6 ?
Warped420 said:
i have to ask, instead of doing all these steps, wouldn't it be easier just to install BBQLinux and change the java version with a purge command and reinstall 1.6 ?
Click to expand...
Click to collapse
Are you suggesting that installing a whole distro on top of the one you use, just to build ROMs, is easier than installing one package, making a symlink and prepending something to your path? Because if you think that's hard, then I must say Arch might be the wrong distro for you.
All these instructions should not take more than 2 minutes, excluding the download time (frankly, I spent most of my time deciding if I should get openjdk6 or java6, then customizing my build script (you can just use a bash profile which virtually takes no time to setup, but I needed some extra stuff)).
That being said, if you want to downgrade, you can also do it using Arch (get openjdk6 from the ARM (Arch Rollback Machine), install it, edit pacman.conf to ignore it - very straightforward to do). The whole point was not to, but you can.
??
Warped420 said:
not exactly, i build with Mint, I have 5 OS's on my drive at the moment, but i want to add Arch. And BBQ is supposed to be Arch made 4 us. Still having trouble getting it to boot, Its the kernel i think, error messages and str8 to black screen on a intel chip. tried no modset, video=SVIDEO-1:d, i915.modeset=0 , and acpi=off, no luck.
Click to expand...
Click to collapse
Well, this is meant for existing Arch users (and Arch is my main distro/OS - not Windows/...).
IMHO, Arch derived distros that add installers and packages go against the Arch philosophy, but whatever suits you. Anyway, I'd suggest asking the BBQLinux community since you're installing that, I can't help you in this thread. Good luck.
Ok i fixed it شكرا لكم على المساعدة
Warped420 said:
Ok then, i will stick to a Arch question, What is the Arch Philosophy ? and what makes it different from other distros?
Click to expand...
Click to collapse
Not to be mean, but this isn't an "Ask your Arch related enquiries" thread, and you're hijacking/off-topic.
Read the archwiki article on The Arch Way. There's also another article that compares Arch to other distros.
GermainZ said:
Arch Linux is a rolling release distribution, but Android requires you to have jdk6 (or openjdk6) and python2 to build it. It took me some time to setup everything, and I hope this guide will be useful to anyone who's trying to do the same.
The ArchWiki is a bit outdated. Among other things, it suggests changing the "python" symlink to point to python2, which I didn't want to do as it could cause problems ("python" is supposed to point to python3). Also, Arch Linux uses openjdk7, so you'd have to downgrade to openjdk6 (or Oracle's jdk6) - which isn't mentioned in the Wiki, and is something I'd rather avoid as I want to keep using the latest version.
Basically, I'd like to share this here for now to get some input, and later update the ArchWiki.
0- Quick note about this guide
I think it's pretty safe to assume you're familiar with the terminal.
Also note that this guide will not really talk about how to actually build Android, it's focused on setting up your Arch distro to do so in an easy way.
1- Prerequisites
The ArchWiki covers installing the Android SDK and ADB pretty well.
You'll need these packages for building Android:
Code:
git gnupg flex bison gperf sdl wxgtk squashfs-tools curl ncurses zlib schedtool perl-switch zip unzip
And for 64 bit systems (make sure multilib is enabled):
Code:
lib32-zlib lib32-ncurses lib32-readline gcc-libs-multilib gcc-multilib lib32-gcc-libs
You also need the "repo" utility, which is available in the AUR.
2- Setting up Java
The AUR has packages that should install alongside openjdk7, but that didn't work for me and I found it easier to simply install jdk6 independently of pacman's packages.
To do so, download the latest Linux .bin file (jdk-6u45-linux-x64.bin), and place it in /opt (run a root shell, "sudo bash"):
Code:
cp ~/Downloads/jdk-6u45-linux-x64.bin
Make it executable and run it as root:
Code:
cd /opt
chmod +x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
We'll be updating our path before building to use this version.
3- Setting up Python
We're going to create a python symlink to python2, and place it in /opt/android-build. We'll use this later by updating our path when necessary.
Code:
mkdir /opt/android-build
cd /opt/android-build
ln -s $(which python2) python
4- (Temporarily) Setting up our PATH to test if everything's fine
We just installed jdk6 and made a symlink to python2, but we still need to update our path. In this step, we'll do that in order to test that everything's fine:
Code:
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
Make sure jdk6 and python2 are being used:
Code:
echo -n $(python -V)
echo -n $(java -version)
The output should be similar to:
Code:
Python [COLOR="Red"]2[/COLOR].x.x
java version "1.[COLOR="Red"]6[/COLOR].xx"
Java(TM) SE Runtime Environment (build 1.[COLOR="Red"]6[/COLOR].xx)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
5- Make a build script (or just build).
I'd highly suggest making a build script and placing it in ~/bin. You can then easily run it, and it will take care of everything.
Otherwise, you can run this in the terminal every time before building:
Code:
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
And then proceed normally, for example:
Code:
. build/envsetup.sh
lunch cyanogen_cooperve-eng
make clean
time make -j6 bacon
This is my (trimmed down to remove some git revert checks) personal build script, you can modify it to fit your needs. The working directory is your home folder, change the "path" variable around the middle if yours is different.
Code:
Help() {
echo -n "Usage: build [OPTIONS]
-h, --help show this screen
-s, --sync run repo sync before building
-c, --clean make clean"
echo
}
box () {
tput setaf 6
echo
str="[email protected]"
len=$((${#1}+4))
for ((i = 1; i <= $len; i++)); do
echo -n '*'
done
echo
echo "* $str *"
for ((i = 1; i <= $len; i++)); do
echo -n '*'
done
echo
tput sgr0
}
path="/home/germain/"
sync=0
clean=0
while :; do
case $1 in
-h | --help)
Help
exit 0
;;
-s | --sync)
sync=1
shift
;;
-c | --clean)
clean=1
shift
;;
--)
shift
break
;;
-*)
echo "Unknown option $1, ignoring" >&2
shift
;;
*)
break
;;
esac
done
clear
box "Setting up \$PATH..."
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
echo -n $(python -V)
echo -n $(java -version)
cd "$path"
(( "$sync"==1 )) && box "Syncing..." && repo sync -j64
box "Starting build..."
. build/envsetup.sh
lunch cyanogen_cooperve-eng
(( "$clean"==1 )) && box "Clean build!" && echo && make clean
time make -j6 bacon
box "Done!"
To set it up:
Code:
nano ~/bin/build
<copy the above script, press SHIFT + INSERT to paste, and CTRL+X followed by "Y" to save>
chmod +x ~/bin/build
Usage:
Code:
Usage: build [OPTIONS]
-h, --help show this screen
-s, --sync run repo sync before building
-c, --clean make clean
Sources
These web pages helped me a lot.
http://f0rki.at/building-android-on-arch-linux-x86_64.html
https://wiki.archlinux.org/index.php/Android
https://bbs.archlinux.org/viewtopic.php?id=131939
Click to expand...
Click to collapse
Could i put this line in my .bashrc file? wouldn't this do the same thing....
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
dantheman1977 said:
Could i put this line in my .bashrc file? wouldn't this do the same thing....
export PATH="/opt/android-build:/opt/jdk1.6.0_45/bin:$PATH"
Click to expand...
Click to collapse
Not exactly the same thing, considering calling 'python' will always direct to 'python2' and 'java' to java1.6, and not only when actually building.
Also, can you please not quote the whole post?
GermainZ said:
Not exactly the same thing, considering calling 'python' will always direct to 'python2' and 'java' to java1.6, and not only when actually building.
Also, can you please not quote the whole post?
Click to expand...
Click to collapse
Great guide.. !!
I had a problem with setting up JDK6 cause I already had OPENJDK7
So I did is
Code:
sudo pacman -Rndd jdk7-openjdk jre7-openjdk icedtea-web-java7 java-rhino jre7-openjdk-headless
and did what you said i.e. installed the binary and it works awesomely well ! .
Thanks for this tutorial! I learned android on ubuntu and ubuntu forks, so trying it on arch is totaly different ball game.
I have one remark:
you also need to install make-3.81 from AUR otherwise you get error:
build/core/main.mk:45: ********************************************************************************
build/core/main.mk:46: * You are using version 4.0 of make.
build/core/main.mk:47: * Android can only be built by versions 3.81 and 3.82.
build/core/main.mk:48: * see https://source.android.com/source/download.html
build/core/main.mk:49: ***************************************************************************
Click to expand...
Click to collapse
so I am using make-3.81 -j4 (have both versions of make on system)
or you can make use simlink a add to your path (similar as export PATH="/opt/android-build:$PATH")
Are you sure about that? https://gerrit.paranoidandroid.co/#/c/108/
absolutly - as you can see at my first post - it is warning message during trying to compile fROM few hours ago today. so yes, I am sure. you can try (I am trying KITKAT)
Did you try? with make-3.81 I do not have this error
---------- Post added at 06:23 PM ---------- Previous post was at 06:00 PM ----------
have another strange problem:
I have running custom kernel on my phone. I've downloaded sources from git, compile on my pc but --- kernel does not boot, immediatelly goes to reboot (compiling procces was successfull). So where the problem is I do not know.
Has anybody any idea? Can it be by bad toochains?
Linux 3.11.6-1-ARCH #1 SMP PREEMPT Fri Oct 18 23:22:36 CEST 2013 x86_64 GNU/Linux
make v4 and also make-3.81
Python 3.3.2 and also Python2
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b09)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01, mixed mode)
toolchains arm-eabi-4.4.3
kernel cm10 for xperia x10i
Click to expand...
Click to collapse
Hi,
I have decided to write this post after reading so many different guides on my journey to build my own version of Cyanogenmod and after countless tries and hours of research I succeeded. Here's how:
You will need:
A Ubuntu box
A basic knowledge of Linux
A fast internet connection or a lot of patience.
Once you have setup your Ubuntu box either in a Virtual Machine of as a stand alone PC you will need to open a terminal, this can be done by pressing 'CTRL + ALT + T' or opening the search menu and typing "Terminal".
You should see the following:
Code:
[email protected]:~$
We will need to install all the necessary files in order to build and download Cyanogenmod, we can do this by running the following command:
Code:
sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev openjdk-7-jdk openjdk-7-jre
As many Linux users have more than one version of Java installed we will need to set the the version we just installed as our default version.
Code:
sudo update-alternatives --config java
sudo update-alternatives --config javac
If by any chance you have a 64-bit version of Ubuntu installed we will require some extra files, if not please skip this command.
Code:
sudo apt-get install g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
We will now for simplicity's sake need to create the following directories in your home folder. These directories will host our build.
Code:
mkdir -p ~/bin
mkdir -p ~/android/system
Once you have setup everything correctly we will now to download the Cyanogenmod source code of which we are going to use the 'Repo' utility. This utility is an automated tool for GitHub cloning. We can download this and set the correct permissions by running the following commands.
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
To continue with download the source code we will now initialize the GitHub repository that holds Cyanogenmod. We are going to need to specify the repository with -u and the branch with -b. Here I am going to download the latest available version of Cyanagenmod 13.0.
Code:
cd ~/android/system/
~/bin/repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
And to finally start downloading the source:
Code:
~/bin/repo sync -c -f -j8
Where:
-c Download the current version instead of all history.
-F Forces the connection to continue even if a connection error occurs.
-j8 This specifies the number of parallel operations. Use -j8 for a quad core processor and a -j16 for an octa-core.
Once the download completes successfully we will need to download the device specific code, this includes specific applications and kernel configurations for your device. To start downloading the files type:
Code:
source build/envsetup.sh
breakfast angler
The download should now start, it should only take minutes however this depends on your internet connection.
Again once this completes, we need to grab proprietary specific files. We first need to navigate to ~/android/system/device/huawei/angler. You can do this by running the following command:
Code:
cd ~/android/system/device/huawei/angler
As the script we are going to use has some dependencies we will need to get them first.
Code:
git clone https://github.com/JesusFreke/smali
cd smali
./gradlew build
cd ..
Additionally we need to download a Google Stock Image, I'm using angler-mmb29m-factory-8c31db3f.tgz, once downloaded you will need to unzip it and cd to it within the terminal.
and then download:
Code:
wget http://people.canonical.com/~mfisch/tools/ext4_utils.tar.gz
tar xzsf ext4_utils.tar.gz
cd ext4_utils
mv simg2img ../angler-mmb29m/
cd ../angler-mmb29m/
We will now convert the system and vendor img's using simg2img to a readable format and mount them so we extract the propriety files using ./extract_files.sh
We can do all of this by using the following commands.
Code:
./simg2img system.img system.ext4
./simg2img vendor.img vendor.ext4
sudo mkdir -p /mnt/system
sudo mkdir -p /mnt/vendor
sudo mount -rw system.ext4 /mnt/system
sudo mount -rw vendor.ext4 /mnt/vendor
Finally we can extract the proprietary files for the system image by running the following commands.
Code:
cd ~/android/system/device/huawei/angler/
./extract_files /mnt/ smali/
Finally we can finish off by our by running the brunch command to build and generate the .zip file of our own Cyanogenmod.
Code:
brunch angler
Note: This will take 20 mins - 2 hours - 2 days depending on your hardware spec.
And well that's it, the location of your generated .zip file should be in blue at the end of your terminal.
Reserved
N/A
This is amazing. Many thanks.
Great I've been looking
Sent from my XT1526 using XDA Forums Pro.
If there are bugs how can we fix that .Such as camera ,ril.For nexus 6p it is fine but for other phones
AANISH said:
If there are bugs how can we fix that .Such as camera ,ril.For nexus 6p it is fine but for other phones
Click to expand...
Click to collapse
As I have only just started my journey on this long path I have done a bit of research for you. Google released there own device specific binaries for the Nexus devices of which usually include the following:
NFC, Bluetooth and Wi-Fi
Media, Audio, Thermal, Touch Screen, Sensors
GPS, Camera, Gestures, Graphics, DRM, Video
This to me suggests that the chipset suppliers supply them - Broadcom, Qualcomm... or even other companies like Motorola. So if you are looking for binaries for other devices I would start with there chipset.
If you would like to look at Google's binaries following the link below however before you go looking for the 6P binaries they haven't been uploaded yet + if you do find any further information please reply to this comment or PM me.
Just saying, the official guide on the wiki works just fine. Been building for all my CM12-capable devices since 2015. Good for people who don't go there, though.
Sent from Google Nexus 6P @ CM13
[WARNING: XDA One have not implemented "mark forum as read" - do not use]
AndyYan said:
Just saying, the official guide on the wiki works just fine. Been building for all my CM12-capable devices since 2015. Good for people who don't go there, though.
Sent from Google Nexus 6P @ CM13
[WARNING: XDA One have not implemented "mark forum as read" - do not use]
Click to expand...
Click to collapse
That is true but I had major difficulties with it, for example it asks you to initialise the cm 12.1 branch when it wasn't available and I had a major pain with extract_files as it wouldnt use adb but instead had to use stock firmware to grab the proprietary files.
connectionalive said:
That is true but I had major difficulties with it, for example it asks you to initialise the cm 12.1 branch when it wasn't available and I had a major pain with extract_files as it wouldnt use adb but instead had to use stock firmware to grab the proprietary files.
Click to expand...
Click to collapse
You still have to spot the tiny mistakes in the guide, of course. The guide hasn't been updated in a long time.
I didn't grab any proprietary files for any of my devices and the builds still run fine - the files should already be in the repo.
Sent from Google Nexus 6P @ CM13
[WARNING: XDA One have not implemented "mark forum as read" - do not use]
AndyYan said:
You still have to spot the tiny mistakes in the guide, of course. The guide hasn't been updated in a long time.
I didn't grab any proprietary files for any of my devices and the builds still run fine - the files should already be in the repo.
Sent from Google Nexus 6P @ CM13
[WARNING: XDA One have not implemented "mark forum as read" - do not use]
Click to expand...
Click to collapse
Ah I didn't know this, I have only just started learning and researching all of this so all helps, if you could point me in the right direction, it would be greatly appreciated.
connectionalive said:
Ah I didn't know this, I have only just started learning and researching all of this so all helps, if you could point me in the right direction, it would be greatly appreciated.
Click to expand...
Click to collapse
I'm also just at the beginning - building according to official guides without modifying the source. Just giving some tips so that you don't step on the same mines as I did
P.S. Transition from CM12.1 to CM13 was a real PITA...
Sent from Google Nexus 6P @ CM13
[WARNING: XDA One have not implemented "mark forum as read" - do not use]
Great guide, I have a build environment setup on Linux Mint, but I am curious to know if the simg2img stuff and extraction is necessary, I thought the initial build process took care of that??
adzcache said:
Great guide, I have a build environment setup on Linux Mint, but I am curious to know if the simg2img stuff and extraction is necessary, I thought the initial build process took care of that??
Click to expand...
Click to collapse
It's not, it's a lot easier to just use the Muppets and not worry about it.
akellar said:
It's not, it's a lot easier to just use the Muppets and not worry about it.
Click to expand...
Click to collapse
I suppose I should start learning how to building up a roomservice.xml for this 6P then. Thanks for the confirmation.
akellar said:
It's not, it's a lot easier to just use the Muppets and not worry about it.
Click to expand...
Click to collapse
I couldn't find it on their repository under Google or Huawei
connectionalive said:
I couldn't find it on their repository under Google or Huawei
Click to expand...
Click to collapse
Look under the right branch
Code:
./simg2img system.img system.ext4
./simg2img vendor.img vendor.ext4
sudo mkdir -p /mnt/system
sudo mkdir -p /mnt/vendor
sudo mount -rw system.ext4 /mnt/system
sudo mount -rw vendor.ext4 /mnt/vendor
Code:
cd ~/android/system/device/huawei/angler/
./extract_files /mnt/ smali/
You have to take ownership of the mounted images before you can extract the blobs. Otherwise you have to use sudo for extract. Then the folder is root and make is denied permission while compiling.
XxMORPHEOUSxX said:
Code:
./simg2img system.img system.ext4
./simg2img vendor.img vendor.ext4
sudo mkdir -p /mnt/system
sudo mkdir -p /mnt/vendor
sudo mount -rw system.ext4 /mnt/system
sudo mount -rw vendor.ext4 /mnt/vendor
Code:
cd ~/android/system/device/huawei/angler/
./extract_files /mnt/ smali/
You have to take ownership of the mounted images before you can extract the blobs. Otherwise you have to use sudo for extract. Then the folder is root and make is denied permission while compiling.
Click to expand...
Click to collapse
I had no issues when actioning any of these commands but in theory you are correct.
connectionalive said:
I had no issues when actioning any of these commands but in theory you are correct.
Click to expand...
Click to collapse
I ran into issues. That's why I mentioned it. Also the extract-files tool is formatted different in my tree. After mounting these were are my exact commands. Maybe it will help someone else.
Code:
sudo chown -hR <user> /mnt/system
sudo chown -hR <user> /mnt/vendor
cd ~/android/system/device/huawei/angler
./extract-files.sh /mnt/ smali/
Hola
I have gone through this guide (really well put together) but I am getting an error almost at the very end and I need some guidance please:
I invoke brunch angler command but it shows:
~/android/system/device/huawei/angler$ brunch angler
bash: build/tools/roomservice.py: No such file or directory
** Don't have a product spec for: 'cm_angler'
** Do you have the right repo manifest?
No such item in brunch menu. Try 'breakfast'
I tried the lunch and breakfast commands but it comes up with the same error.
I did run both:
source build/envsetup.sh
breakfast angler
from the right directory and no errors came up. Can anyone assist me? Thanks.
Tutorial how set up Android Build Enviroment on openSUSE Leap
If this help's u hit Thanks!
1) If you don’t have fresh installed openSUSE Leap first you need remove all Java installation, many people might have the wrong version of Java installed.
Code:
sudo zypper remove openjdk-* icedtea-* icedtea6-*
Follow the on-screen instructions to remove any stray Java versions. Otherwise, move on to the next step.
2) Install the main build tools with this command:
Code:
sudo zypper install bison curl flex git gnupg gperf libesd-devel liblz4-1_4 ncurses-devel libSDL-devel python-wxWi dgets-devel libxml2-2 libxml2-tools lzop java-1.7.0-openjdk java-1.7.0-openjdk-devel schedtool squashfs libxslt1 zip zlib-devel make gcc-c++
Appendx A to 2:
To setup maven which is needed for building:
1. Download maven:
wget http://mirrors.ibiblio.org/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
2. Extract the file
tar -xvzf apache-maven-3.3.9-bin.tar.gz /tmp
3. Move to /opt/ folder
sudo mv /tmp/apache-maven-3.3.9 /opt/
4. Update environment, cd to home directory
cd ~
nano .bashrc
5. Append the path
export PATH=$PATH:/opt/apache-maven-3.3.9/bin
6. Reload
source .bashrc
7. Verify maven
mvn --version
Appendix B to 2:
For 64-bit system also install:
sudo zypper install glibc-devel-32bit ncurses-devel-32bit readline-devel-32bit libz1-32bit
>> build-essential << is Ubuntu meta package which in openSUSE is devel_basis
And u can install it by command
sudo zypper install --type pattern devel_basis
Select y to what it is offering to install.
3) Repo install...
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Appendix to 3:
To fix repo sync u will need install this:
sudo zypper install libpth20-32bit
maybe this to:
sudo zypper install openjdk-8-devel
4) Use your favorite text editor to open ~/.bashrc - I like nano:
Code:
nano ~/.bashrc
By default nano is not installed so install it by command:
sudo zypper install nano
5) At the very bottom (use the Page Down key) paste this code to a new line:
Code:
export PATH=~/bin:$PATH
export USE_CCACHE=1
6) Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
Code:
source ~/.bashrc
7) In the terminal, navigate to where you would like to download the Android source code. The commands below will make it in your home folder.
Code:
mkdir ~/android
cd ~/android
8) Now you're going to initialize the repo. This is where you decide the flavor of Android you want to build, i.e. AOKP, CyanogenMod, AOSP etc.
For the purposes of this tutorial, here's the command for Cyanogenmod 13 (Marshmallow) :
Code:
repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
9) Time to get the source, many gigabytes of downloading await.
Don't worry, it's automated. It's the last one!
Code:
repo sync
Check back periodically every hour or so. It all depends on how fast your connection is.
That's it! Everything should be ready to go.
Thanks for the guide
In Tumbleweed, the package is liblz4-1_7
There is a typo, it should be python-wxWidgets-devel
Also, the link to repo should be complete:
Code:
http://commondatastorage.googleapis.com/git-repo-downloads/repo
Thanks
does it worth to have a separate user for builds?
Android Build Enviroment for openSUSE tumbleweed early 2019
Sorry for necromancing this old thread, but I've recently switched to openSUSE and these are the dependencies that I've used to successfully build LineageOS-16.0.:
Code:
sudo zypper install --type pattern devel_basis
sudo zypper install bison java-1_8_0-openjdk java-1_8_0-openjdk-devel SDL-devel python-wxWidgets-devel lzop schedtool squashfs glibc-devel-32bit ncurses-devel-32bit ncurses5-devel-32bit readline-devel-32bit ccache libz1-32bit python-xml bc
You can find maven here:
https://software.opensuse.org/package/maven
and android-tools here:
https://software.opensuse.org/package/android-tools
Dependencies already included by default in my system (not included in "devel_basis") that may you don't have but you need:
Code:
gpg2 liblz4-1 libxml2-2 libxml2-tools libxslt-tools zip
Just sharing because this post will (probably) save some time to someone in the same situation in early 2019.
_mone said:
Sorry for necromancing this old thread, but I've recently switched to openSUSE and these are the dependencies that I've used to successfully build LineageOS-16.0.:
Code:
sudo zypper install --type pattern devel_basis
sudo zypper install bison java-1_8_0-openjdk java-1_8_0-openjdk-devel SDL-devel python-wxWidgets-devel lzop schedtool squashfs glibc-devel-32bit ncurses-devel-32bit ncurses5-devel-32bit readline-devel-32bit ccache libz1-32bit python-xml bc
You can find maven here:
https://software.opensuse.org/package/maven
and android-tools here:
https://software.opensuse.org/package/android-tools
Dependencies already included by default in my system (not included in "devel_basis") that may you don't have but you need:
Code:
gpg2 liblz4-1 libxml2-2 libxml2-tools libxslt-tools zip
Just sharing because this post will (probably) save some time to someone in the same situation in early 2019.
Click to expand...
Click to collapse
Thanks for this. I'm still getting an error and wondering what SSL packages you have installed? I'm obviously missing one below.
EDIT: i kept installing SSL packages until it worked, can't remember which one did the trick but it seems it's chugging along now
/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845/scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: No such file or directory
#include <openssl/bio.h>
^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.host:101: scripts/extract-cert] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845/Makefile:558: scripts] Error 2
make[1]: Leaving directory '/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/out/target/product/fajita/obj/KERNEL_OBJ'
make: *** [Makefile:152: sub-make] Error 2
make: Leaving directory '/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845'
[ 0% 70/94167] //external/protobuf:aprotoc clang++ src/google/protobuf/compiler/javanano/javanano_extension.cc [linux_glibc]
ninja: build stopped: subcommand failed.
12:41:48 ninja failed with: exit status 1
Hi all...
Happy Holidays
I have been looking around haven't found a tutorial on compiling kernel for oneplus2, so i decided on making one for those who are new to compiling kernel from source.
This tutorial will be divided into 3 parts...
>Preparing the build environment... (Ubuntu 16.04 LTS).
>Downloading source code, Toolchain and compiling.
>Testing
######################################################################
Preparing the build environment
Preparing the build environment is easy. If u haven't install Ubuntu yet, check out how to dual-boot alongside windows from here.
If u are looking for something easier like running it from a virtual machine check out this.
Right now i have Ubuntu 16.04 LTS installed which i will be using.
Once u have booted into Ubuntu, it's time to head to the terminal.
Lunch the terminal by right clicking on desktop an select "open terminal"
Once in terminal type in these commands individually (note: some commands will prompt u to type y and enter):
Code:
sudo apt-get install synaptic
Code:
sudo apt-get install libncurses5-dev
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Code:
sudo apt-get install -y ccache &&echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc &&source ~/.bashrc && echo $PATH
Code:
export USE_CCACHE=1
Installing repo...
Code:
mkdir ~/bin
Code:
export PATH=~/bin:$PATH
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Installing Java...
Code:
sudo add-apt-repository ppa:webupd8team/java
Code:
sudo apt update; sudo apt install oracle-java8-installer
Code:
sudo apt install oracle-java8-set-default
Run this command to check if Java is installed correctly:
Code:
javac -version
If it says something like this (javac 1.8.0_111) then u are good to go.
That's it for preparing the build environment. Easy... right.:highfive:
######################################################################
Downloading source code, Toolchain and compiling
Now it's time to download the source, u will be creating a folder to download the source in so type to commands below,
Code:
mkdir oneplus2-kernel
Code:
cd oneplus2-kernel
(The folder can be found in the home directory)
If u are building for cm, download the kernel source using command below...
Code:
git clone https://github.com/CyanogenMod/android_kernel_oneplus_msm8994.git
If u are building for other rom use this one...
Code:
git clone https://github.com/OnePlusOSS/android_kernel_oneplus_msm8994.git
Once download is completed, u need to download the toolchain which is the tool used in compiling the kernel.
It can be downloaded from here.
When download completed, move the zip file to the oneplus2-kernel folder u made earlier and then right click and select extract here.
U can now delete the zip file when extracted. So now u would have 2 folders to in ur oneplus2-kernel folder. One is the kernel and the other is the toolchain.
Time to compile the kernel... But first u need to point the variable to toolchains path. To do this, u need to go to the kernel source, folder(which is called android_kernel_oneplus_msm8994 in the oneplus2-kernel folder) right click and open in terminal, then run the command
Code:
export CROSS_COMPILE=/home/[B]"UR_USERNAME"[/B]/oneplus2-kernel/aarch64-linux-android-4.9-uber-master/bin/aarch64-linux-android-
(NOTE:Replace "UR_USERNAME" with the name u used when installing ubuntu)
Now run the commands below in the same terminal:
Code:
export ARCH=arm64
Code:
export SUBARCH=arm64
Code:
export USE_CCACHE=1
U will need to locate the defconfig file. If u are compiling for cm, the file name will be "cm_oneplus2_defconfig", and for the other source, name will be "msm8994-OnePlus2_defconfig". It is located in /home/"UR_USERNAME"/oneplus2-kernel/android_kernel_oneplus_msm8994/arch/arm64/configs/...
(Note: The defconfig file may vary for different roms ur building for so pay attention to that.)
So if u are compiling for cm, run the command:
Code:
make cm_oneplus2_defconfig
to add it to the config file. Change name of defconfig file accordingly as said above.
Now it's time to give ur kernel a name so run the command:
Code:
make menuconfig
This will look like when u boot into the BIOS, so use the arrow keys to navigate. This menu allows the u to choose the features of the kernel (and other options) that will be compiled. To add the name, go to "General setup" then "(-perf) Local version - append to kernel release", then type in the name for ur custom kernel and save/exit.
Finally type this command to compile...
Code:
make -j2
(Replace -j2 with the number of cpu cores)
IF (make -j2) gives errors try:
Code:
make
This will take A WHILE, so let it do it's ting.
If it compiled without errors, u will find the kernel file named "Image.gz-dtb" located in /home/"UR_USERNAME"/oneplus2-kernel/android_kernel_oneplus_msm8994/arch/arm64/boot/...
:good:SUCCESS:good::victory:
If FAILED:crying: , u can post a screen-shot of ur error below and i will try an help u out.
######################################################################
Testing
Time to test ur newly built kernel, since everything went smoothly and u cant wait to boot it up.
Well download this flashable zip from here.
Open the zip file using Archive Manager without extracting.
Delete the file named "Image.gz-dtb" and replace with ur kernel located at /home/"UR_USERNAME"/oneplus2-kernel/android_kernel_oneplus_msm8994/arch/arm64/boot/Image.gz-dtb.
That's it...Just copy the zip to ur device and flash away...
As i said early... any problem u are having with compiling, just post a screen-shot of ur error below and i will try an help u.
:good:REMEMBER TO HIT THANKS/LIKE:good:
reserved
So I've decided to give this a try today. Run into a slight problem though.
1. When I execute make msm8994-OnePlus2_defconfig I receive an error 'make: Nothing to be done for msm8994-OnePlus2_defconfig'. This file did already exist under the folder structure.
2. When I execute make menuconfig I receive an error 'No rule to make target menuconfig. Stop'.
Any ideas to what I am doing wrong?
Thanks in advance.
Woodzrul said:
So I've decided to give this a try today. Run into a slight problem though.
1. When I execute make msm8994-OnePlus2_defconfig I receive an error 'make: Nothing to be done for msm8994-OnePlus2_defconfig'. This file did already exist under the folder structure.
2. When I execute make menuconfig I receive an error 'No rule to make target menuconfig. Stop'.
Any ideas to what I am doing wrong?
Thanks in advance.
Click to expand...
Click to collapse
It been a while but I'll try to help ima assume you building the latest lineage kernel right? If so use
make oneplus2_defconfig
Then
make -j4
The menu config is to name the kernel if you want to it appears after the Linux version default is often perf+, but not required
example: 3.10.93 perf+
Appreciate the prompt response. I shall give this ago. Have clicked the Thanks! button.
Brandon Indar said:
reserved
Click to expand...
Click to collapse
Sir I'm trying to compile from boeffla kernel sources But I'm just stuck here...i also tried "make cm_oneplus2_defconfig" but no use I followed all the below steps also installed java and I'm on Ubuntu 17.04 (dualboot)..
Any help would be appreciated
Prathamesh Kapure said:
Sir I'm trying to compile from boeffla kernel sources But I'm just stuck here...i also tried "make cm_oneplus2_defconfig" but no use I followed all the below steps also installed java and I'm on Ubuntu 17.04 (dualboot)..
Any help would be appreciated
Click to expand...
Click to collapse
Hi...
What error exactly u are getting when u running the command:
"make cm_oneplus2_defconfig"
Sent from my ONE A2005 using Tapatalk
Brandon Indar said:
Hi...
What error exactly u are getting when u running the command:
"make cm_oneplus2_defconfig"
Click to expand...
Click to collapse
The error wguch i get always is "make: *** No rule to make target 'cm_oneplus2_defconfig'. Stop"
Edit:the error can be seen in the attachment
---------- Post added at 04:17 AM ---------- Previous post was at 04:11 AM ----------
Prathamesh Kapure said:
The error wguch i get always is "make: *** No rule to make target 'cm_oneplus2_defconfig'. Stop"
Edit:the error can be seen in the attachment
Click to expand...
Click to collapse
Edit 2:At first one of my developer frnd said try "make boeffla_defconfig" it didn't work thwn he said try "make cm_oneplus2_defconfig" this also didn't work so i thought i might post it here and get some help..
Prathamesh Kapure said:
The error wguch i get always is "make: *** No rule to make target 'cm_oneplus2_defconfig'. Stop"
Edit:the error can be seen in the attachment
---------- Post added at 04:17 AM ---------- Previous post was at 04:11 AM ----------
Edit 2:At first one of my developer frnd said try "make boeffla_defconfig" it didn't work thwn he said try "make cm_oneplus2_defconfig" this also didn't work so i thought i might post it here and get some help..
Click to expand...
Click to collapse
Look at the arch/boot/arm64/configuration inside the kernel source and the files in there will give you an idea what you can build the usually one is oneplus2_defconfig sometimes developers will make another Defconfig and you'll find it there. typically for LineageOS oneplus2_defconfig is the one used.
After looking at boeffla source cm Defconfig is old and prob will break something, "make boeffla_defconfig" should work and make sure your inside the kernel source as you do the make Defconfig command
Dr_DjEnder said:
Look at the arch/boot/arm64/configuration inside the kernel source and the files in there will give you an idea what you can build the usually one is oneplus2_defconfig sometimes developers will make another Defconfig and you'll find it there. typically for LineageOS oneplus2_defconfig is the one used.
After looking at boeffla source cm Defconfig is old and prob will break something, "make boeffla_defconfig" should work and make sure your inside the kernel source as you do the make Defconfig command
Click to expand...
Click to collapse
Ok Thank you sir.. I'll try and report
Offtopic: Do u know any of our whatsapp and telegram group? If so can u plz add me
Dr_DjEnder said:
Look at the arch/boot/arm64/configuration inside the kernel source and the files in there will give you an idea what you can build the usually one is oneplus2_defconfig sometimes developers will make another Defconfig and you'll find it there. typically for LineageOS oneplus2_defconfig is the one used.
After looking at boeffla source cm Defconfig is old and prob will break something, "make boeffla_defconfig" should work and make sure your inside the kernel source as you do the make Defconfig command
Click to expand...
Click to collapse
Sir i tried but no use i get same error but i just noticed some bottom commands show a bit different error "make: Nothing to be done for 'oneplus_2' and also for 'make boeffla_defconfig'
Prathamesh Kapure said:
Sir i tried but no use i get same error but i just noticed some bottom commands show a bit different error "make: Nothing to be done for 'oneplus_2' and also for 'make boeffla_defconfig'
Click to expand...
Click to collapse
Have u set up the cross compiler and run the commands in the root of the kernel source folder before using make command. If so, run command: "make menuconfig".
If that fails that means the cross compiler isn't set up right.
Sent from my ONE A2005 using Tapatalk
Brandon Indar said:
Have u set up the cross compiler and run the commands in the root of the kernel source folder before using make command. If so, run command: "make menuconfig".
If that fails that means the cross compiler isn't set up right.
Click to expand...
Click to collapse
Yaa sir it already setup cross compiler... Then after i downloaded los sources and tried with them and the kernel got compiled successfully...
Thank You for the wonderful and simple guide :good:
first of all thanks for guide
i tried to give it a try(using lineage os 14.1) and went through exact steps and when i gave command make or make - j2 then i am getting this error
Code:
Makefile:805: *** multiple target patterns. Stop.
And This is In Makefile
Code:
# Include targets which we want to
# execute if the rest of the kernel build went well.
line 805 >> vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
ifdef CONFIG_HEADERS_CHECK
$(Q)$(MAKE) -f $(srctree)/Makefile headers_check
endif
ifdef CONFIG_SAMPLES
$(Q)$(MAKE) $(build)=samples
endif
ifdef CONFIG_BUILD_DOCSRC
$(Q)$(MAKE) $(build)=Documentation
endif
+$(call if_changed,link-vmlinux)
Hope you will help me
Vaas_FC said:
first of all thanks for guide
i tried to give it a try(using lineage os 14.1) and went through exact steps and when i gave command make or make - j2 then i am getting this error
Code:
Makefile:805: *** multiple target patterns. Stop.
And This is In Makefile
Code:
# Include targets which we want to
# execute if the rest of the kernel build went well.
line 805 >> vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
ifdef CONFIG_HEADERS_CHECK
$(Q)$(MAKE) -f $(srctree)/Makefile headers_check
endif
ifdef CONFIG_SAMPLES
$(Q)$(MAKE) $(build)=samples
endif
ifdef CONFIG_BUILD_DOCSRC
$(Q)$(MAKE) $(build)=Documentation
endif
+$(call if_changed,link-vmlinux)
Hope you will help me
Click to expand...
Click to collapse
What it shows before that error.
If u run; make menuconfig and u get same error, check back the command used to configure the toolchain and make sure the path to the folder is set right.
Sent from my ONE A2005 using Tapatalk
deleted
deleted
I flashed my kernel and it boots in fastboot mode ??
used "make -j2" but got error see in pic
Brandon Indar said:
Hi all...
Happy Holidays
I have been looking around haven't found a tutorial on compiling kernel for oneplus2, so i decided on making one for those who are new to compiling kernel from source.
This tutorial will be divided into 3 parts...
>Preparing the build environment... (Ubuntu 16.04 LTS).
>Downloading source code, Toolchain and compiling.
>Testing
######################################################################
Preparing the build environment
Preparing the build environment is easy. If u haven't install Ubuntu yet, check out how to dual-boot alongside windows from here.
If u are looking for something easier like running it from a virtual machine check out this.
Right now i have Ubuntu 16.04 LTS installed which i will be using.
Once u have booted into Ubuntu, it's time to head to the terminal.
Lunch the terminal by right clicking on desktop an select "open terminal"
Once in terminal type in these commands individually (note: some commands will prompt u to type y and enter):
Code:
sudo apt-get install synaptic
Code:
sudo apt-get install libncurses5-dev
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Code:
sudo apt-get install -y ccache &&echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc &&source ~/.bashrc && echo $PATH
Code:
export USE_CCACHE=1
Installing repo...
Code:
mkdir ~/bin
Code:
export PATH=~/bin:$PATH
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Installing Java...
Code:
sudo add-apt-repository ppa:webupd8team/java
Code:
sudo apt update; sudo apt install oracle-java8-installer
Code:
sudo apt install oracle-java8-set-default
Run this command to check if Java is installed correctly:
Code:
javac -version
If it says something like this (javac 1.8.0_111) then u are good to go.
That's it for preparing the build environment. Easy... right.:highfive:
######################################################################
Downloading source code, Toolchain and compiling
Now it's time to download the source, u will be creating a folder to download the source in so type to commands below,
Code:
mkdir oneplus2-kernel
Code:
cd oneplus2-kernel
(The folder can be found in the home directory)
If u are building for cm, download the kernel source using command below...
Code:
git clone https://github.com/CyanogenMod/android_kernel_oneplus_msm8994.git
If u are building for other rom use this one...
Code:
git clone https://github.com/OnePlusOSS/android_kernel_oneplus_msm8994.git
Once download is completed, u need to download the toolchain which is the tool used in compiling the kernel.
It can be downloaded from here.
When download completed, move the zip file to the oneplus2-kernel folder u made earlier and then right click and select extract here.
U can now delete the zip file when extracted. So now u would have 2 folders to in ur oneplus2-kernel folder. One is the kernel and the other is the toolchain.
Time to compile the kernel... But first u need to point the variable to toolchains path. To do this, u need to go to the kernel source, folder(which is called android_kernel_oneplus_msm8994 in the oneplus2-kernel folder) right click and open in terminal, then run the command
Code:
export CROSS_COMPILE=/home/[B]"UR_USERNAME"[/B]/oneplus2-kernel/aarch64-linux-android-4.9-uber-master/bin/aarch64-linux-android-
(NOTE:Replace "UR_USERNAME" with the name u used when installing ubuntu)
Now run the commands below in the same terminal:
Code:
export ARCH=arm64
Code:
export SUBARCH=arm64
Code:
export USE_CCACHE=1
U will need to locate the defconfig file. If u are compiling for cm, the file name will be "cm_oneplus2_defconfig", and for the other source, name will be "msm8994-OnePlus2_defconfig". It is located in /home/"UR_USERNAME"/oneplus2-kernel/android_kernel_oneplus_msm8994/arch/arm64/configs/...
(Note: The defconfig file may vary for different roms ur building for so pay attention to that.)
So if u are compiling for cm, run the command:
Code:
make cm_oneplus2_defconfig
to add it to the config file. Change name of defconfig file accordingly as said above.
Now it's time to give ur kernel a name so run the command:
Code:
make menuconfig
This will look like when u boot into the BIOS, so use the arrow keys to navigate. This menu allows the u to choose the features of the kernel (and other options) that will be compiled. To add the name, go to "General setup" then "(-perf) Local version - append to kernel release", then type in the name for ur custom kernel and save/exit.
Finally type this command to compile...
Code:
make -j2
(Replace -j2 with the number of cpu cores)
IF (make -j2) gives errors try:
Code:
make
This will take A WHILE, so let it do it's ting.
If it compiled without errors, u will find the kernel file named "Image.gz-dtb" located in /home/"UR_USERNAME"/oneplus2-kernel/android_kernel_oneplus_msm8994/arch/arm64/boot/...
:good:SUCCESS:good::victory:
If FAILED:crying: , u can post a screen-shot of ur error below and i will try an help u out.
######################################################################
Testing
Time to test ur newly built kernel, since everything went smoothly and u cant wait to boot it up.
Well download this flashable zip from here.
Open the zip file using Archive Manager without extracting.
Delete the file named "Image.gz-dtb" and replace with ur kernel located at /home/"UR_USERNAME"/oneplus2-kernel/android_kernel_oneplus_msm8994/arch/arm64/boot/Image.gz-dtb.
That's it...Just copy the zip to ur device and flash away...
As i said early... any problem u are having with compiling, just post a screen-shot of ur error below and i will try an help u.
:good:REMEMBER TO HIT THANKS/LIKE:good:
Click to expand...
Click to collapse
I've created kernel/oneplus2 folder, git cloned in this folder and then extracted the aarch64 zip file and follow all instructions. Used "make -j2" but got error. Please see in pic. I'm trying "make", if it is going right, then ill hit thanks and reply. Thanks
also got error in "make"
Brandon Indar said:
Hi all...
Happy Holidays
I have been looking around haven't found a tutorial on compiling kernel for oneplus2, so i decided on making one for those who are new to compiling kernel from source.
This tutorial will be divided into 3 parts...
>Preparing the build environment... (Ubuntu 16.04 LTS).
>Downloading source code, Toolchain and compiling.
>Testing
######################################################################
Preparing the build environment
Preparing the build environment is easy. If u haven't install Ubuntu yet, check out how to dual-boot alongside windows from here.
If u are looking for something easier like running it from a virtual machine check out this.
Right now i have Ubuntu 16.04 LTS installed which i will be using.
Once u have booted into Ubuntu, it's time to head to the terminal.
Lunch the terminal by right clicking on desktop an select "open terminal"
Once in terminal type in these commands individually (note: some commands will prompt u to type y and enter):
Code:
sudo apt-get install synaptic
Code:
sudo apt-get install libncurses5-dev
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Code:
sudo apt-get install -y ccache &&echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc &&source ~/.bashrc && echo $PATH
Code:
export USE_CCACHE=1
Installing repo...
Code:
mkdir ~/bin
Code:
export PATH=~/bin:$PATH
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Installing Java...
Code:
sudo add-apt-repository ppa:webupd8team/java
Code:
sudo apt update; sudo apt install oracle-java8-installer
Code:
sudo apt install oracle-java8-set-default
Run this command to check if Java is installed correctly:
Code:
javac -version
If it says something like this (javac 1.8.0_111) then u are good to go.
That's it for preparing the build environment. Easy... right.:highfive:
######################################################################
Downloading source code, Toolchain and compiling
Now it's time to download the source, u will be creating a folder to download the source in so type to commands below,
Code:
mkdir oneplus2-kernel
Code:
cd oneplus2-kernel
(The folder can be found in the home directory)
If u are building for cm, download the kernel source using command below...
Code:
git clone https://github.com/CyanogenMod/android_kernel_oneplus_msm8994.git
If u are building for other rom use this one...
Code:
git clone https://github.com/OnePlusOSS/android_kernel_oneplus_msm8994.git
Once download is completed, u need to download the toolchain which is the tool used in compiling the kernel.
It can be downloaded from here.
When download completed, move the zip file to the oneplus2-kernel folder u made earlier and then right click and select extract here.
U can now delete the zip file when extracted. So now u would have 2 folders to in ur oneplus2-kernel folder. One is the kernel and the other is the toolchain.
Time to compile the kernel... But first u need to point the variable to toolchains path. To do this, u need to go to the kernel source, folder(which is called android_kernel_oneplus_msm8994 in the oneplus2-kernel folder) right click and open in terminal, then run the command
Code:
export CROSS_COMPILE=/home/[B]"UR_USERNAME"[/B]/oneplus2-kernel/aarch64-linux-android-4.9-uber-master/bin/aarch64-linux-android-
(NOTE:Replace "UR_USERNAME" with the name u used when installing ubuntu)
Now run the commands below in the same terminal:
Code:
export ARCH=arm64
Code:
export SUBARCH=arm64
Code:
export USE_CCACHE=1
U will need to locate the defconfig file. If u are compiling for cm, the file name will be "cm_oneplus2_defconfig", and for the other source, name will be "msm8994-OnePlus2_defconfig". It is located in /home/"UR_USERNAME"/oneplus2-kernel/android_kernel_oneplus_msm8994/arch/arm64/configs/...
(Note: The defconfig file may vary for different roms ur building for so pay attention to that.)
So if u are compiling for cm, run the command:
Code:
make cm_oneplus2_defconfig
to add it to the config file. Change name of defconfig file accordingly as said above.
Now it's time to give ur kernel a name so run the command:
Code:
make menuconfig
This will look like when u boot into the BIOS, so use the arrow keys to navigate. This menu allows the u to choose the features of the kernel (and other options) that will be compiled. To add the name, go to "General setup" then "(-perf) Local version - append to kernel release", then type in the name for ur custom kernel and save/exit.
Finally type this command to compile...
Code:
make -j2
(Replace -j2 with the number of cpu cores)
IF (make -j2) gives errors try:
Code:
make
This will take A WHILE, so let it do it's ting.
If it compiled without errors, u will find the kernel file named "Image.gz-dtb" located in /home/"UR_USERNAME"/oneplus2-kernel/android_kernel_oneplus_msm8994/arch/arm64/boot/...
:good:SUCCESS:good::victory:
If FAILED:crying: , u can post a screen-shot of ur error below and i will try an help u out.
######################################################################
Testing
Time to test ur newly built kernel, since everything went smoothly and u cant wait to boot it up.
Well download this flashable zip from here.
Open the zip file using Archive Manager without extracting.
Delete the file named "Image.gz-dtb" and replace with ur kernel located at /home/"UR_USERNAME"/oneplus2-kernel/android_kernel_oneplus_msm8994/arch/arm64/boot/Image.gz-dtb.
That's it...Just copy the zip to ur device and flash away...
As i said early... any problem u are having with compiling, just post a screen-shot of ur error below and i will try an help u.
:good:REMEMBER TO HIT THANKS/LIKE:good:
Click to expand...
Click to collapse
I've told that I've got error in "make -j2" and so i tried the "make" and got error again. Please see in this pic.
After building Chromium OS kernel 4.14.96 & my inability to figure out how to properly deploy it as an update to an existing Chromium OS installation like Arnoldthebat v72 (with Chrome OS Kernel 4.14.83)
efforts here -
https://forum.xda-developers.com/showpost.php?p=78830818&postcount=3
I will post here my efforts at building the full Chromium OS with the latest available Kernel - I will try & start with same version as arnoldthebat i.e. v72 which has now reached stable...
There will be a lot of editing here, as it's a learning curve to me...
First is to clone the Google Chrome OS repo -
I was given this link to learn how to do this -
https://chromium.googlesource.com/chromiumos/docs/+/master/developer_guide.md
As for building Kernel for ATB v72 - I will be keeping a log of instructions here...
I do the work from within a Ubuntu xenial 16.04.xx box as suggested by the documentation,
Preparation instructions:
Create a folder where the code will be stored (they suggest chromeos) I used code
from an ext4 partition/disk with plenty of space (mine 150 GB+)
$ mkdir code
input instructions to get to clone the repo later to reach here:
$ sudo apt-get install repo
$ sudo apt-get install git-core gitk git-gui curl lvm2 thin-provisioning-tools \
python-pkg-resources python-virtualenv python-oauth2client
Install depot_tools
$ git config --global user.name "John Doe"
$ git config --global user.email "[email protected]"
$ git config --global core.autocrlf false
$ git config --global core.filemode false
$ # and for fun!
$ git config --global color.ui true
Tweak your sudoers configuration
cd /tmp
cat > ./sudo_editor <<EOF
#!/bin/sh
echo Defaults \!tty_tickets > \$1 # Entering your password in one shell affects all shells
echo Defaults timestamp_timeout=180 >> \$1 # Time between re-requesting your password, in minutes
EOF
chmod +x ./sudo_editor
sudo EDITOR=./sudo_editor visudo -f /etc/sudoers.d/relax_requirements
Configure git
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
Verify that your default file permissions (umask) setting is correct
put the following line into your ~/.bashrc
umask 022
preparation for enough disk space
in folder code/
sudo dd if=/dev/zero of=swapfile bs=1024 count=$((1024*3000))
mkswap swapfile
sudo swapon swapfile
git config --global http.sslVerify false
git config --global http.postBuffer 1048576000
initialise the repo
$ repo init
$ repo init -u https://chromium.googlesource.com/chromiumos/manifest.git --repo-url https://chromium.googlesource.com/external/repo.git [-g minilayout]
get the source code
$ repo sync -j4
getting/syncing the source code took a long time as it kept failing...
I am now in this position with the source code in code/
I will fill in gaps of instructions I missed later...
Create a chroot
make sure depot_tools/ is inside the folder code/: code/depot_tools
temporary put depot_tools in the path
export PATH=$PATH:depot_tools
$ cros_sdk
... this will take some time...
NOTICE: Mounted .../code/chroot.img on chroot
NOTICE: Downloading SDK tarball..
All done
INFO cros_sdk:make_chroot: Elapsed time (make_chroot.sh): 74m37s
cros_sdk:make_chroot: All set up. To enter the chroot, run:
$ cros_sdk --enter
CAUTION: Do *NOT* rm -rf the chroot directory; if there are stale bind
mounts you may end up deleting your source tree too. To unmount and
delete the chroot cleanly, use:
$ cros_sdk --delete
(cr) ((c62d307...)) [email protected] ~/trunk/src/scripts $
now comes the real stuff...
Notes -
some extra commands might be needed to get this working:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install linux-generic
$ sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge
$ sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev
...
Hello, My guide should fill in the blanks for you (Specifically the Over The Air Upgrades) - https://kmyers.me/blog/chromeos/a-g...s-distribution-with-ota-updates-and-crostini/
could someone please tell me if there is a rpm file so chromium os could be installed on top of ubuntu using alien cause terminal too difficult for noobs to understand but rpm and alien super easy
ghostdogg49504 said:
could someone please tell me if there is a rpm file so chromium os could be installed on top of ubuntu using alien cause terminal too difficult for noobs to understand but rpm and alien super easy
Click to expand...
Click to collapse
No, ChromiumOS is a operating system that either replaces your default operating system or that you dual boot into. It is not simply a application that you can install. If you want to run it without installing it, you could in theory build it yourself and convert the image to a virtual machine image and run it in Qemu or VirtualBox.
KMyers said:
No, ChromiumOS is a operating system that either replaces your default operating system or that you dual boot into. It is not simply a application that you can install. If you want to run it without installing it, you could in theory build it yourself and convert the image to a virtual machine image and run it in Qemu or VirtualBox.
Click to expand...
Click to collapse
fydeos has a installer in fydeos store with dualboot option but its in chinese