Kernel Building Help - Nexus 5 Q&A, Help & Troubleshooting

Wondering if anyone can give me a hand. I am trying to build the kernel from source and am running into a problem. What am I doing wrong?
First I obtain the kernel binary git log
git clone https://android.googlesource.com/device/lge/hammerhead
cd hammerhead
git log --max-count=1
I then made note of the commit message received
Then I downloaded kernel sources
git clone https://android.googlesource.com/kernel/msm.git
Then I downloaded prebuilt GCC
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
Then I went to build
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
git checkout (with the commit message from earlier)
make hammerhead_deconfig
Then I get this error message
make: *** No rule to make target `hammerhead_deconfig'. Stop.
Not sure what I did wrong or how to resolve. Any suggestions? Thanks.

Dude, its hammerhead_defconfig not hammerhead_deconfig.
Check my SCRIPT

Gnome said:
Dude, its hammerhead_defconfig not hammerhead_deconfig.
Check my SCRIPT
Click to expand...
Click to collapse
I'll give that a go and should I perform that command in the hammerhead path or msm path?
Sent from my Nexus 5 using XDA Free mobile app

Chochiwpg said:
I'll give that a go and should I perform that command in the hammerhead path or msm path?
Sent from my Nexus 5 using XDA Free mobile app
Click to expand...
Click to collapse
Do that in kernel patch itself..
Based on your post the Kernel Path is msm, so:
Code:
cd msm
then run the commands, dont forget to checkout the right branch, I think it's android-hammerhead-kk-mr2
Code:
git checkout android-hammerhead-kk-mr2

Gnome said:
Dude, its hammerhead_defconfig not hammerhead_deconfig.
Check my SCRIPT
Click to expand...
Click to collapse
Hey bud,
tried defconfig as well and got the exact same error message. Sigh

Related

[DEV GUIDE] Build CM7 from source in its current state. Updated: 2011/05/16-23:52

PLEASE READ THIS BEFORE CONTINUING:
We are changing to a new build system which will result in an updated but VERY different ROM underneath the hood. There is a HIGH POSSIBILITY that building in the current state could BRICK your device, potentially PERMANENTLY. PLEASE DO NOT FLASH unless you are HIGHLY confident you know what you're doing.
For kernel building, see post #2.
For known issues and changelog, see post #3.
Kanged from the CM-Wiki. Yes it's a wiki, yes I could have created an epic page, but we aren't official yet.
Install ADB
Install the Android SDK.
Install the Build Packages
Install using the package manager of your choice:
For 32-bit & 64-bit systems:
Code:
git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool
For 64-bit only systems:
Code:
g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
NOTE: On Ubuntu 10.10, and variants, you need to enable the parter repository to install sun-java6-jdk:
Code:
add-apt-repository "deb http://archive.canonical.com/ maverick partner"
Create the Directories
You will need to set up some directories in your build environment.
To create them:
Code:
mkdir -p ~/bin
mkdir -p ~/android/system
Install the Repository
Enter the following to download make executable the "repo" binary:
Code:
curl http://android.git.kernel.org/repo > ~/bin/repo
chmod a+x ~/bin/repo
NOTE: You may need to reboot for these changes to take effect.
Now enter the following to initialize the repository:
Code:
cd ~/android/system/
repo init -u git://github.com/EpicCM/android.git -b teamhacksung-merge
repo sync -j16
Download RomManager and Google Files
NOTE: This only needs to be done when an update to RomManager or GoogleApps is released. If you are up-to-date, you may skip to Building CyanogenMod.
Code:
cd ~/android/system/
./build.sh prepare
Building CyanogenMod
First, check for updates in the source:
Code:
cd ~/android/system/
repo sync
Configure Build & Compile
Now, the environment must be configured to build and the ROM compiled, from code, for the epic.
Code:
cd ~/android/system/
. build/envsetup.sh
./build.sh epic
Build failed? Check post #3 for common problems and solutions.
Install
1. The build system should create a flashable zipfile. Place it on the root of your sdcard.
Optional: Download Google Apps for CyanogenMod 7 and place it on the root of the SD card.
2. Boot into a custom recovery like ClockworkMod Recovery and flash the CM7 update.zip. Then flash google apps if you like.
Please don't flash yet, unless you want an expensive doorstop.
This section of the guide will inform you on how to build a CM7-compatible kernel using our github sources.
Download the Code
Due to the way the new build system works, you'll need the entire CM source to build a proper kernel. (Sorry)
Follow the steps in post #1 to initialize and download our entire CM source repository.
Keeping your code up-to-date:
Code:
cd ~/android/system
repo sync
Toolchain setup
The new build system automatically utilizes the toolchain included in CM7 source.
Prepare to build
The kernel build script requires a few environment vars be set by the CM build system.
Code:
cd ~/android/system/
. build/envsetup.sh
lunch cyanogen_epic-eng
Compile the kernel
Code:
cd ~/android/system/kernel/samsung/2.6.35/
./build.sh epic
cd ~/android/system/releasetools/
./kernel.sh epic
You should now have a flashable zip in out/target/product/epic/
Please don't flash yet, unless you want an expensive doorstop.
This is also incompatible with stock roms, and unless you're amazing, never will be compatible.
KNOWN BUILD-TIME ISSUES
WARNING: These fixes may cause your repo to become out-of-sync from the official repo. Make sure you know how to revert these changes so repo sync doesn't fail.
Error: New build does not boot.
Fix: Working on it
KNOWN RUN-TIME ISSUES
Will update this when it runs.
GUIDE CHANGELOG:
20110516-2352: New build system from teamhacksung.
20110506-1842: Switched to our forks of teamhacksung work.
CODE CHANGELOG:
Available at each of our repositories:
https://github.com/EpicCM
Love seeing these types of posts; makes a pathway for new developers to learn =)
XtaC318 said:
Love seeing these types of posts; makes a pathway for new developers to learn =)
Click to expand...
Click to collapse
I agree! Time to start playing!
Cool guide, makes it easy for the new guys.
Sent from my SPH-D700 using Tapatalk
getting same error. edited make file and tried to remove the samsung/device/crespo device.mk overlap but still a no-go
Code:
build/core/base_rules.mk:479: warning: overriding commands for target `out/target/product/epic/recovery/root/sbin/tune2fs'
bootable/recovery/Android.mk:87: warning: ignoring old commands for target `out/target/product/epic/recovery/root/sbin/tune2fs'
build/core/base_rules.mk:162: *** device/samsung/epic/libs3cjpeg: MODULE.TARGET.SHARED_LIBRARIES.libs3cjpeg already defined by device/samsung/crespo/libs3cjpeg. Stop.
smeyerhuky said:
getting same error. edited make file and tried to remove the samsung/device/crespo device.mk overlap but still a no-go
Code:
build/core/base_rules.mk:479: warning: overriding commands for target `out/target/product/epic/recovery/root/sbin/tune2fs'
bootable/recovery/Android.mk:87: warning: ignoring old commands for target `out/target/product/epic/recovery/root/sbin/tune2fs'
build/core/base_rules.mk:162: *** device/samsung/epic/libs3cjpeg: MODULE.TARGET.SHARED_LIBRARIES.libs3cjpeg already defined by device/samsung/crespo/libs3cjpeg. Stop.
Click to expand...
Click to collapse
yes, that's something that we can't easily fix in our own device repo. you could always remove the crespo folder as a temporary fix, but we need to push a patch upstream that fixes crespo makefiles. I will be adding this to known issues shortly.
So my windows seven crashed on me and I'm gonna go with Ubuntu 10.10 for now
I can play with this on that Linux install, correct?
sent by an Epic4g through the cosmos
raiderep said:
So my windows seven crashed on me and I'm gonna go with Ubuntu 10.10 for now
I can play with this on that Linux install, correct?
Click to expand...
Click to collapse
Yes, it's mentioned in the instructions.
Alternatively, you can use VMWare to do compiling from Windows. That's how I'd set up my old development system. There are tons of free Ubuntu 10.10 vm images.
Updated. Sorry for the mistake in Copy Proprietary Files. That should fix a compile error related to libcamera.
Any clue what causes a build to fail due to unable to dopen system/lib/egl/libandroid_servers.so. When I build with boardconfig has generic audio I'm fine, when I set has galaxys audio it fails
Sent from my SPH-D700 using Tapatalk
dreamsforgotten said:
Any clue what causes a build to fail due to unable to dopen system/lib/egl/libandroid_servers.so. When I build with boardconfig has generic audio I'm fine, when I set has galaxys audio it fails
Sent from my SPH-D700 using Tapatalk
Click to expand...
Click to collapse
Audio in and out works if you leave it at default values.
If you absolutely want to compile with galaxys audio, it looks like ./extract-files.sh might not be pulling that file? Check ~/android/system/vendor/samsung/epic/proprietary/lib/egl/ for that file.
Thanks for the heads up, no the fileisn't in egl and from what I can tell its not supposed to be.
Sent from my SPH-D700 using Tapatalk
Fix: Open up Context.java, find the three chunks of WimaxManager JAVADOC in comments. Delete JUST the commented stuff that's related to WiMax.
Click to expand...
Click to collapse
Can anyone please elaborate, I don't understand wat exactly to be done. Even though I deleted commented lines I still receive errors
Thanks
THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!
So for kernel compilation I received and error
fs/binfmt_aout.c: In function 'load_aout_binary':
fs/binfmt_aout.c:271: error: 'SEGMENT_SIZE' undeclared (first use in this function)
Click to expand...
Click to collapse
And I had to update a line in Makefile
from
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
Click to expand...
Click to collapse
to
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) -Dlinux
Click to expand...
Click to collapse
Still nearly at the end of compile I receive
samsung-kernel-epic/scripts/mksysmap: line 44: arm-none-eabi-nm: No such file or directory
Click to expand...
Click to collapse
I'll see if I can cream system.map from vmlinux and report again
The kernel compilation issue was discussed here: http://forum.xda-developers.com/showthread.php?t=825611
I needed to do
make update-api
Click to expand...
Click to collapse
After removing those comments
it went ahead now the next place I'm stuck is
CameraService.cpp:1478: error: undefined reference to 'openCameraHardware'
Click to expand...
Click to collapse
Any ideas?
Thanks
\m/ I got cm7 compiled
So here are nullghosts instructions:
open android/system/device/samsung/epic/full_epic.mk for editing and
replace any instance of SPH-D700 to epic
Click to expand...
Click to collapse
Then open extract-files.sh for editing and make sure Copy Files (from mid to bottom) list is same as files list (at top)
add these 2 lines to
FILES="
Click to expand...
Click to collapse
section of extract-files.sh
bin/netcfg
lib/libQmageDecoder
Click to expand...
Click to collapse
If you have any other file missing read below:
head -197 extract-files.sh > files may come in handy to compare 2 files
vendor/samsung/__DEVICE__/proprietary/bin/netcfg:system/bin/netcfg
vendor/samsung/__DEVICE__/proprietary/lib/libQmageDecoder.so:system/lib/libQmageDecoder.so
Click to expand...
Click to collapse
are the 2 lines in copy files which did not have corresponding files
Now need to zip it and see if I can get kernel compiled
Can anyone that has it compiled post a zip? I dont wanna download lile 10gb of stuff.
Sent from my SPH-D700 using XDA App

Building From from AOSP Source help

Hi all I have been trying to compile a pure stock from for my phone using someone elces kernel, device, and vendor directories. I synced the master branch of aosp repo and symlinked my sepreatly downloaded device directories to the proper directories. When I go to build, I use the command
Code:
. /build envsetup.sh && brunch ancora_tmo[Code]
I get
[Code]Including devices/samsung/ancora_tmo/vendorsetup.sh
No command 'brunch' found
[Code]
as well as 4 other aosp devices.
I added ancora tmo by symlinking the sources to my system tree.
I tried building with the command lunch and I get
[Code] don't have product specs for: full_ancora_tmo
Do you have right report manifest[Code]
where am I going wrong on building
I followed some custom build instructions and haven't modified much source yet but am simply trying to build pure stock for my phone what am I doing wrong?
Sent from my Galaxy Exhibit running Jocala's CM9
Try these:
Make sure you run the "PATH" command that it says to in SDK setup:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
Also, if you are making a new device, try to use the mkvendor.sh script in build/tools/device
WhiteHatHacker said:
Try these:
Make sure you run the "PATH" command that it says to in SDK setup:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
Also, if you are making a new device, try to use the mkvendor.sh script in build/tools/device
Click to expand...
Click to collapse
I did I setup the sdk and edited The .bashrc (or something similar) file
and added the sdk path
Sent from my Galaxy Exhibit running Jocala's CM9
Maybe the '-eng' part was missing
try:
Code:
brunch full_ancora_tmo-eng
or do everything:
Code:
brunch full-eng
WhiteHatHacker said:
Maybe the '-eng' part was missing
try:
Code:
brunch full_ancora_tmo-eng
or do everything:
Code:
brunch full-eng
Click to expand...
Click to collapse
Nope, still says brunch isn't found.
possible the report sync didn't complete right
Sent from my Galaxy Exhibit running Jocala's CM9
Who's kernel are you using?
You did:
Code:
source build/envsetup.sh
correct?
WhiteHatHacker said:
Whose kernel are you using?
Click to expand...
Click to collapse
jocala's custom rooted kernel
Sent from my Galaxy Exhibit running Jocala's CM9
WhiteHatHacker said:
Who's kernel are you using?
You did:
Code:
source build/envsetup.sh
correct?
Click to expand...
Click to collapse
Yes correct
I get this error when I try and build from the lunch menu
Don't have product specs for full_ancora_tmo
Do you have right report manifests.
Sent from my Galaxy Exhibit running Jocala's CM9
Its hard for me to help without browsing your directories, but try this.
Grab your boot.img
do:
Code:
build/tools/device/mkvendor.sh device_manufacturer_name device_name /your/path/to/the/boot.img
once that finishes, do:
Code:
lunch full_device_name-eng
then if you go to devices/product/something or other to your device, you should be able to try and replace your stock kernel with his.
I'm shooting from the hip here, so if i'm f***ed up please let me know, we're all learning ;-)
WhiteHatHacker said:
Its hard for me to help without browsing your directories, but try this.
Grab your boot.img
do:
Code:
build/tools/device/mkvendor.sh device_manufacturer_name device_name /your/path/to/the/boot.img
once that finishes, do:
Code:
lunch full_device_name-eng
[CODE]
then if you go to devices/product/something or other to your device, you should be able to try and replace your stock kernel with his.
I'm shooting from the hip here, so if i'm f***ed up please let me know, we're all learning ;-)[/QUOTE]
Huh? I think my repo sync didn't complete there is no device directory in build/ tools.
my directory is only 5.4gb in size that may be my whole problem
Sent from my Galaxy Exhibit running Jocala's CM9
Click to expand...
Click to collapse
Hmmm, then I'm tapped out.
But, at least this thread has been kept bumped
Whereas mine is back down near the bottom of the page :-(
WhiteHatHacker said:
Hmmm, then I'm tapped out.
But, at least this thread has been kept bumped
Whereas mine is back down near the bottom of the page :-(
Click to expand...
Click to collapse
Yep I think my source tree is jacked up I'll resyncing everything and see how that goes
thanks for helping
Sent from my Galaxy Exhibit running Jocala's CM9
No problem, best I could do was try.

CROSS COMPILE path not found ?!

I've set up a VM build environment using Ubuntu with the aim of building kernel modules for my Samsung S3. Particularly interested in the asix
ethernet module so I can use this USB Ethernet adapter. Kevinf28 has very kindly assisted to provide initial builds of the module and prove that
it works. ( see http://forum.xda-developers.com/showthread.php?t=2131825) However, it needs to be rebuilt when a new ROM is released, and I
therefore want to create my own build environment. I have everything setup using git, have cloned the tool chains etc from git and have the kernel source ready to go from samsung. I can create the config file for the make, but then the build fails with the following. This seems very odd as the file its saying it cant find is clearly there! Any ideas ? I'm new to building kernels in linux. The output below was an attempt to build a CM10 version, but the same error occurs when building a samsung one.
export CROSS_COMPILE=/root/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-
[email protected]:~/kernel/android_kernel_samsung_smdk4412-43aaedbcde478c8e032771d62a1956133b29b1d4#
make cyanogenmod_i9300_defconfig#
# configuration written to .config
#
[email protected]:~/kernel/android_kernel_samsung_smdk4412-43aaedbcde478c8e032771d62a1956133b29b1d4#make make: /root/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-gcc: Commandnot found scripts/kconfig/conf --silentoldconfig Kconfig make: /root/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-gcc: Commandnot found CHK include/linux/version.h CHK include/generated/utsrelease.h make[1]: `include/generated/mach-types.h' is up to date. CC kernel/bounds.s /bin/sh: 1: /root/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-gcc:not found make[1]: *** [kernel/bounds.s] Error 127 make: *** [prepare0] Error 2----
-Saying its not found - but here is the directory showing the file is there:
[email protected]:~/git/Android_Toolchains/arm-eabi-4.4.3/bin# ls
arm-eabi-addr2line
arm-eabi-gcc
arm-eabi-ld
arm-eabi-readelf
arm-eabi-ar
arm-eabi-gcc-4.4.3
arm-eabi-ld.bfd
arm-eabi-run
arm-eabi-as
arm-eabi-gccbug
arm-eabi-ld.gold
arm-eabi-size
arm-eabi-c++
arm-eabi-gcov
arm-eabi-nm
arm-eabi-strings
arm-eabi-c++filt
arm-eabi-gdb
arm-eabi-objcopy
arm-eabi-strip
arm-eabi-cpp
arm-eabi-gdbtui
arm-eabi-objdump
arm-eabi-g++
arm-eabi-gprof
arm-eabi-ranlib
Code:
[SIZE=4][COLOR=Red]~[/COLOR][/SIZE]/git/Android_Toolchains/arm-eabi-4.4.3/bin
and
Code:
/root/git/Android_Toolchains/arm-eabi-4.4.3/bin/
are not the same directories.
~ = is your home directory, which is like /home/[username]/
You have to use this
Code:
export CROSS_COMPILE=~/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-
Thanks - but still no joy....
set the CROSS_COMPILE, confirmed its set, confirmed the contents of the dir, then make...
trying to set it using ~ gets replaced with /root/...
Code:
[email protected]:~/git/Android_Toolchains/arm-eabi-4.4.3/bin# export CROSS_COMPILE=~/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-
[email protected]:~/git/Android_Toolchains/arm-eabi-4.4.3/bin# echo $CROSS_COMPILE
/root/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-
[email protected]:~/git/Android_Toolchains/arm-eabi-4.4.3/bin# ls
arm-eabi-addr2line arm-eabi-gcc arm-eabi-ld arm-eabi-readelf
arm-eabi-ar arm-eabi-gcc-4.4.3 arm-eabi-ld.bfd arm-eabi-run
arm-eabi-as arm-eabi-gccbug arm-eabi-ld.gold arm-eabi-size
arm-eabi-c++ arm-eabi-gcov arm-eabi-nm arm-eabi-strings
arm-eabi-c++filt arm-eabi-gdb arm-eabi-objcopy arm-eabi-strip
arm-eabi-cpp arm-eabi-gdbtui arm-eabi-objdump
arm-eabi-g++ arm-eabi-gprof arm-eabi-ranlib
[email protected]:~/git/Android_Toolchains/arm-eabi-4.4.3/bin# cd /root/kernel/
[email protected]:~/kernel# make
make: /root/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-gcc: Command not found
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/bin/sh: 1: /root/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
Wait, you said ~ gets replaced with /root ?
Why your home_dir is root? That's odd...
However, do this
Code:
cd ~/git/Android_Toolchains/arm-eabi-4.4.3/bin
pwd
After "pwd" you will get a full path of the directory where you in
Use that path for
Code:
export CROSS_COMPILE=<path you got>/arm-eabi-
Are you logged in as root?
Sent from my SCH-R950 using Tapatalk 2
thewadegeek said:
Are you logged in as root?
Sent from my SCH-R950 using Tapatalk 2
Click to expand...
Click to collapse
Yes he is logged in as root. That's why his home directory is /root.
Sent from my GT-I9300 using xda app-developers app
I know, I was getting him to think of that though. Sorry missed the post answering his question, but he still hasn't responded. @op Why are you logged in as root? You can build as a standard user.
Sent from my SCH-R950 using Tapatalk 2
thewadegeek said:
I know, I was getting him to think of that though. Sorry missed the post answering his question, but he still hasn't responded. @op Why are you logged in as root? You can build as a standard user.
Sent from my SCH-R950 using Tapatalk 2
Click to expand...
Click to collapse
I actually have the exact same problem. I can't build as root or as a standard user. No matter what I do, it won't compile ( running a VM just like the OP).
The virtual machine environment causing the problem?
Sent from my GT-I9300 using xda app-developers app
Well what is the error? I've built on multiple VMs without a problem.
Sent from my SCH-R950 using Tapatalk 2
thewadegeek said:
Well what is the error? I've built on multiple VMs without a problem.
Sent from my SCH-R950 using Tapatalk 2
Click to expand...
Click to collapse
Make can't find gcc compiler in the path given through CROSS_COMPILE
123shree said:
I actually have the exact same problem. I can't build as root or as a standard user. No matter what I do, it won't compile ( running a VM just like the OP).
The virtual machine environment causing the problem?
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
I don't think so, I've built a kernel several times on a virtual machine (virtualbox)
Well the fix for the OP is to use the toolchains fixed path instead of the relative path. I was curious as to what the other gentleman's error was.
Sent from my SCH-R950 using Tapatalk 2
I still cant get this to run - even following the instructions above.
I am using "sudo -i"
I could try as a user and shift everything across from the root home, but not sure that this will make a difference.... ?
gingerneil said:
I still cant get this to run - even following the instructions above.
I am using "sudo -i"
I could try as a user and shift everything across from the root home, but not sure that this will make a difference.... ?
Click to expand...
Click to collapse
Can you answer my question about why you were running as root in the first place? It is not needed so I want to know what circumstances lead up to this. Also now why is it failing? Same error? If so you got the path to the toolchain wrong.
No real reason to run as root - just that the instructions that I was following had it as root.
As far as the path being wrong - have a look back through my code snippets - I'm sure it isnt unless you can spot something I cant.....
gingerneil said:
No real reason to run as root - just that the instructions that I was following had it as root.
As far as the path being wrong - have a look back through my code snippets - I'm sure it isnt unless you can spot something I cant.....
Click to expand...
Click to collapse
64-bit VM by any chance?
thewadegeek said:
64-bit VM by any chance?
Click to expand...
Click to collapse
Yes - the vm is 64bit. Could that be why? Does the kernel only compile on 32bit?
Nope it will build, but do you have ia32-libs install? Any other toolchains on the machine?
Sent from my SCH-R950 using Tapatalk 2
thewadegeek said:
Nope it will build, but do you have ia32-libs install? Any other toolchains on the machine?
Sent from my SCH-R950 using Tapatalk 2
Click to expand...
Click to collapse
I've tried to install ia32-libs but I get lots of dependancy errors that Ive not been able to fix. As its a VM and easy to rebuild, I'm downloading the 32bit version and will see if I have any better results.
I've swapped my S3 for a Note2 - so will have a go at building the modules for that once I have the VM up again.
gingerneil said:
I've swapped my S3 for a Note2 - so will have a go at building the modules for that once I have the VM up again.
Click to expand...
Click to collapse
Looks like I may havce sorted this - i added in the CROSS_COMPILE= statement statement to the make command - like in (4) here: http://xda-university.com/as-a-developer/getting-started-building-a-kernel-from-source
Seems to be building ok now - but will see if it completes ok.
I reinstalled the VM with everything in a user home area rather than using /root/ - but the user is admin anyway so I dont suppose this will have made a difference.

[GUIDE] Building Pure Nexus

Introduction
Hello everyone, this is a guide to get you up and running with your own build of Pure Nexus for the Nexus 5X. In this thread, you will learn how to get your computer set up to build and the commands you will need to run. Please read the entire guide and the FAQ. Additionally, this is a developer's thread, there should be no off topic discussion.
Compilation Guide
This is available on my Github, where it may be a little more up to date.
0. Getting started
In this guide, I will go over how to build Pure Nexus on your Linux machine. This particular tutorial will focus on Ubuntu 16.04 as that is what I use (Mint 18 is also good) but this should work with any version of Linux; it does need to be 64-bit however. I will leave the installation of that up to you, Google is a wonderful resource. If you don't have a good computer but still want to build, check out this thread on XDA: http://forum.xda-developers.com/chef-central/android/guide-how-to-build-rom-google-cloud-t3360430
1. Set up your environment
1. Automatically
Code:
sudo apt-get install git-core
git clone https://github.com/akhilnarang/scripts
cd scripts
ls
bash <script-name>
<script-name> should be one of the scripts in the folder for your particular architecture.
2. Manually
1. Install Java 8
Code:
sudo apt-get update
sudo apt-get install openjdk-8-jdk
sudo apt-get install openjdk-8-jre
2. Install other build tools
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip
2. Configure repo and git
If you have any problems with the below commands, try running as root:
Code:
sudo -s
Git is an open source version control system which is incredibly robust for tracking changes across repositories. Repo is Google's tool for working with Git in the context of Android. More reading if you are interested: https://source.android.com/source/developing.html
Run these commands to get repo working (only do this if you did the manual set up method above:
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Run these commands to get git working:
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
3. Download the source
First, before downloading the source, create a folder for the source and move into it.
Code:
mkdir ~/<foldername> (eg. mkdir ~/PN or ~/PureNexus)
cd ~/<foldername>
Then, we need to grab the manifest and sync down the repositories. Here are the commands to do this for Pure Nexus for Nougat (make sure you are in the source folder you made above):
Code:
repo init -u https://github.com/PureNexusProject/manifest.git -b n
repo sync --force-sync
Here is the process generally for other ROMs:
When you go to build a ROM, you must download its source. All, if not most, ROMs will have their source code available on Github. To properly download the source, follow these steps:
Go to your ROM's Github (e.g. http://github.com/PureNexusProject)
Search for a manifest (usually called manifest or android_manifest).
Go into the repo and make sure you are in the right branch (located right under the Commits tab).
Go into the README and search for a repo init command. If one exists, copy and paste it into the terminal and hit enter.
If one does not exist, you can make one with this formula:
Code:
repo init -u <url_of_manifest_repo>.git -b <branch_you_want_to_build>
For example:
Code:
repo init -u http://github.com/PureNexusProject/manifest.git -b n
After the repo has been initialized, run this command to download the source:
Code:
repo sync --force-sync
This process can take a while depending on your internet connection.
4. Build it!
At this point, it'd be a good idea to set up ccache. ccache is a compiler cache, it stores previously compiled files in a directory and pulls from that instead of recompiling if nothing has changed. This speeds up compilation a LOT. If you want to use it, follow the below steps:
Open up your .bashrc file in your home directory using a text editor or nano and append this to the end of it:
Code:
export USE_CCACHE=1
Then type:
Code:
source ~/.bashrc
After that, run one of the below command (replacing the # with how many GBs of ccache you want, 50 is recommended)
Use this one if you used the manual method of set up in section 1:
Code:
prebuilts/misc/linux-x86/ccache/ccache -M #G
Use this one if you used the automatic method of set up in section 1:
Code:
ccache -M #G
After that, it's time to build!
Code:
. build/envsetup.sh
breakfast bullhead
mka bacon
After that, your computer will build the flashable zip file and if you see something that says make completed, you've done it!
Any time that you want to rebuild, type the following commands:
Code:
repo sync --force-sync
. build/envsetup.sh
breakfast bullhead
mka clobber
mka bacon
I also have a script to do this on my Github here
Frequently Asked Questions
1.1 Q: I got an error, what do I do??
1.1 A: Well to start, if it is anything with Ninja, I would go ahead and disable it. You can add this to your .bashrc file:
Code:
export USE_NINJA=false
Then type this
Code:
source ~/.bashrc
. build/envsetup.sh
breakfast bullhead
mka clobber
mka bacon
If it is saying you ran out of memory, follow this post.
If it isn't Ninja related, check out @AzraelsKiss's post here, where he has documented a few common issues. If none of those apply, post here with a detailed list of what you have done and we will do our best to help you.
1.2 Q: Can you guys share your personal builds?
1.2 A: No, personal builds are just that: personal. Beans releases whenever he feels that the release is ready for the masses and if a bunch of personal builds are floating around, that tarnishes the Pure Nexus name. We are more than happy to help get you up and running but we will not be sharing our builds. Thanks for understanding!
this wont work on Windows, right?
RonnellTapawan said:
this wont work on Windows, right?
Click to expand...
Click to collapse
I have heard people try to use Bash for Windows but I don't think it will work. Linux or bust.
nathanchance said:
I have heard people try to use Bash for Windows but I don't think it will work. Linux or bust.
Click to expand...
Click to collapse
I tried on bash for windows but it can't build android roms
Dude you should seriously get a XDA medallion or some sort of metal for all you do all over XDA. I see you everywhere. Thanks for building for us and also for this write up. :good: @ nathan
SM210 said:
Dude you should seriously get a XDA medallion or some sort of metal for all you do all over XDA. I see you everywhere. Thanks for building for us and also for this write up. :good: @ nathan
Click to expand...
Click to collapse
Talk to my superiors :silly: thanks for the kind words
Edited.......
Sent from my Nexus 5X using Tapatalk
myawan said:
Anybody wanna share home made build?
Sent from my Nexus 5X using Tapatalk
Click to expand...
Click to collapse
If you read at the end of the OP, it says:
"1.2 Q: Can you guys share your personal builds?
1.2 A: No, personal builds are just that: personal. Beans releases whenever he feels that the release is ready for the masses and if a bunch of personal builds are floating around, that tarnishes the Pure Nexus name. We are more than happy to help get you up and running but we will not be sharing our builds. Thanks for understanding!"
Reason being, because if we start compiling these and handing it out like it's no ones business, we're going to run Pure Nexus into the ground and people will start uploading them on AFH and it'll be one big mess. My guess is, this is just a courtesy by the original poster to those of us who can't wait.
My two cents.:laugh::highfive:
i'm on it!!!!! thank you very much!!! download is taking forever ugh
Building it right now! Thanks
I think this would work in Cygwin. I used to compile stuff for the PS3 way back. I'd have a lot of reading to do if I wanted to build this for my phone.
Which gapps to use with this?
Open Gapps micro are working fine.
Gesendet von meinem Nexus 5X mit Tapatalk
So WE can't share our build either? Or what, i didn't get it.
CreasingMass Dev said:
So WE can't share our build either? Or what, i didn't get it.
Click to expand...
Click to collapse
Don't distribute personal builds. Flash them yourself and that is it.
4 hours of download :crying:
OOH MAN!!!!!! no more space in my device!!! how can i resume that???
Code:
Checking out files: 100% (1717/1717), done.
error: unable to write file current/platforms/android-21/arch-x86_64/usr/lib/libz.a
error: unable to write file current/platforms/android-21/arch-x86_64/usr/lib/libz.so
fatal: cannot create directory at 'current/platforms/android-21/arch-x86_64/usr/lib64': Spazio esaurito sul device
Traceback (most recent call last):
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 531, in <module>
_Main(sys.argv[1:])
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 507, in _Main
result = repo._Run(argv) or 0
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 180, in _Run
result = cmd.Execute(copts, cargs)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/subcmds/sync.py", line 769, in Execute
project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/project.py", line 1325, in Sync_LocalHalf
self._InitWorkTree(force_sync=force_sync)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/project.py", line 2482, in _InitWorkTree
raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree
can i move the PureNexus folder in an external drive and resume??? please
MatteXperiaU said:
4 hours of download :crying:
OOH MAN!!!!!! no more space in my device!!! how can i resume that???
can i move the PureNexus folder in an external drive and resume??? please
Click to expand...
Click to collapse
You can try. Your build times will be much slower though.
Sent from my Nexus 6P using XDA Labs
nathanchance said:
You can try. Your build times will be much slower though.
Sent from my Nexus 6P using XDA Labs
Click to expand...
Click to collapse
i have another partition in the same HD (300GB).. i can use that :fingers-crossed:
which command i need to resume?
sorry for the questions man, you're too kind
TPMJB said:
I think this would work in Cygwin. I used to compile stuff for the PS3 way back. I'd have a lot of reading to do if I wanted to build this for my phone.
Click to expand...
Click to collapse
No promises...
http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
Out of curiosity, realistically how much disk space would be required to download everything and compile with a 50GB cache? I got everything downloaded and the compile ran but threw some warnings (most of which may have been benign). When the compile terminated with an error, I had about 40MB left on my Linux Mint 18 partition so I assume it ran out of space I started with about 70GB free space
I deleted everything and decided to try again if and when I have a larger partition to play with..... I am currently dual booting on a Windows machine and didn't think to allocate that much space to Mint.
Paul

Kernel-Source_Nokia_1

Kernel Source of Nokia 1
(TA-1047/TA-1060/TA-1056/TA-1079/TA-1066)
LINK > https://github.com/DhirajSurvase/Kernel_Nokia_1_MT6737​
Instructions >
clone the source code
go to kernel dir
run "bash build.sh" command
ur compiled kernel will be under out/arch/arm/*
Official release of Nokia 1 Kernel sources available at https://www.nokia.com/en_int/phones/opensource
Hi,
We tried the official kernel and built it. After flashing the kernel, phone boot and it asked for a password. We gave password "1234" and it reboots and went in recovery.
Its always rebooting in recovery. We flashed the original boot image. Behavior did not change.
Is there any other recovery image we can use and flash the original boot image and bring the phone to working condition?
Thank You!
Mayur
DhirajMS said:
Kernel Source of Nokia 1
(TA-1047/TA-1060/TA-1056/TA-1079/TA-1066)
LINK > https://github.com/DhirajSurvase/Kernel_Nokia_1_MT6737​
Instructions >
clone the source code
go to kernel dir
run "bash build.sh" command
ur compiled kernel will be under out/arch/arm/*
Click to expand...
Click to collapse
Everyone, help me compile kernel from this source please. I can't do it, because i'm noobie for compile any sources.
ntnamkg said:
Everyone, help me compile kernel from this source please. I can't do it, because i'm noobie for compile any sources.
Click to expand...
Click to collapse
just clone it..
and hit "bash build.sh"
Thanks for respond. But, it is fail, below (some text):
make[1]: *** [scripts] Error 2
make[1]: Leaving directory `/home/namnt/Nokia1/Kernel_Nokia_1_MT6737-master/out'
make: *** [sub-make] Error 2
make: Leaving directory `/home/namnt/Nokia1/Kernel_Nokia_1_MT6737-master'
Click to expand...
Click to collapse
I try build on Ubuntu 14.04, 16.04 and Manjaro linux, all get this notice.
Ok
build.sh: line 35: make: command not found
build.sh: line 39: make: command not found
Click to expand...
Click to collapse
After run bash build get above notice. How to fix it? Thanks
ntnamkg said:
After run bash build get above notice. How to fix it? Thanks
Click to expand...
Click to collapse
apt-get install build-essential
would install make, gcc and other required tools.

Categories

Resources