[Q] Some programs not in repositories on v0.3 - HD2 Ubuntu Q&A, Help & Troubleshooting and General

Please, give me some help with a simple question about apt-get:
I can not find (to install) some programs like "vnc4server". Is this normal?
I have uncommented every line at /etc/apt/sources.lst .
And here is my console output:
[email protected]:~$ sudo apt-get install vnc4server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package vnc4server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'vnc4server' has no installation candidate
Click to expand...
Click to collapse
Thanks.

Related

How to build busybox from sources?

I'm trying to build busybox from sources.
I use last NDK as toolchain.
I started building it from original sources checked out from official busybox's git. Some small fixes with includes/declarations and stuff. Didn't finish fixing these problems.
And found out that cyanogenmod already has it with fixes I made for my build, but wrapped in __BIONIC__ define.
I decided to build it from cyanogenmod git (http://github.com/cyanogen/android_external_busybox) cause it looks like it already solved all that small build problems.
But I can't invoke make properly.
It has Android.mk, If I invoke usual
Code:
make ARCH=arm CROSS_COMPILE="arm-eabi-" CFLAGS="-I/home/astar/android/android-ndk-r4/build/platforms/android-8/arch-arm/usr/include"
it doesn't use Android.mk makefile and fails with those small problems.
But if I invoke it with -f Android.mk It fails with error
Code:
$ make ARCH=arm CROSS_COMPILE="arm-eabi-" CFLAGS="-I/home/astar/android/android-ndk-r4/build/platforms/android-8/arch-arm/usr/include" -f Android.mk
cat: /busybox-full.sources: No such file or directory
make: *** CC=cc: No such file or directory. Stop.
cat: /busybox-full.links: No such file or directory
cat: /busybox-minimal.sources: No such file or directory
make: *** CC=cc: No such file or directory. Stop.
looking inside Android.mk i think, that it fails with setting LOCAL_PATH. Setting it manually inside Android.mk doesn't help.
Can anyone point me to proper guide/howto?
How do You build busybox?
I have really little knowledge about building parts of Android system, but I think that you can't build it using makefile directly. When you are building Android system, then building process begins with some initialization, macros are defined, etc. and then makefiles of subprojects are called. This is why you get errors - you run makefile of busybox directly, but building process isn't initialized properly.
On the other hand NDK does this initialization when you are building native application, but you don't use NDK properly. NDK apps aren't build using regular make command.
There's three build systems for android:
SDK - Java
NDK - C/C++
android-sources - unixy stuff
You might need the android-sources rather than NDK to build busybox. To do that you'll need to download the sources then source the build/envsetup.sh then run "mm" in the directory that has your Android.mk
I have some instructions here (for dropbear, not busybox, but should be similar):
http://teslacoilsw.com/dropbear
Check the Building section.
[email protected] said:
I have some instructions here (for dropbear, not busybox, but should be similar):
http://teslacoilsw.com/dropbear
Check the Building section.
Click to expand...
Click to collapse
Thank you very much. It is the magic I was looking for (crap, I spent 10 hours trying to find out how to do it):
Code:
export TOP=/path/to/android-sources
source "$TOP/build/envsetup.sh"
mm
I managed to build AOSP with java 1.6. Check this patch if you're interested in.
I tried to build cm's busybox with AOSP but it fails (I expected that). Currently I'm getting cm sources. Hope that it'll be ok.
Do you know if I have to build whole tree before external utils (=busybox)? Cause when I tried to do it before aosp build it failed with make dependencies.

cyanogenmod development

I want to port cyanogenmod to archos
Are there any developers who know how to download the source of cnm and archos firmware
I'm a game developer and I have no experience with drivers but we can compare are achos devices with other cnm supported devices, the nexus s has the same processor, so we don't have to create a driver for that
Compare list (Update 24 June)
processor is the same as in the droid 2
touchscreen = ?
sound hardware =
screen hardware =
You should take a look at the [DEVELOPEMENT] Cyanogen thread on the Dev subforum - think they'll be pretty happy to see you over there!
fisha21 said:
You should take a look at the [DEVELOPEMENT] Cyanogen thread on the Dev subforum - think they'll be pretty happy to see you over there!
Click to expand...
Click to collapse
Yes, but I'm a newcomer and I can't post a replay there
coen22 said:
Yes, but I'm a newcomer and I can't post a replay there
Click to expand...
Click to collapse
im the thread starter at the post above
Just post 6 posts and you can post at dev section
Lennb said:
im the thread starter at the post above
Just post 6 posts and you can post at dev section
Click to expand...
Click to collapse
Thx, but what do think of my idea
coen22 said:
Thx, but what do think from my idea
Click to expand...
Click to collapse
Im happy, if anyone want to help, but
we need a guy who really have android developement knowledge
Anyone?
I still can't reply to the main thread of cyanogenmod [DEV]
The first thing we have to do is a hardware research
the archos gen8 devices have a
First
Processor: Arm cortex-A8 <-- same as galaxy s, and nexus s
Screen: <--- ?
Then
Touchscreen: <--- ?
Later
Camera: <--- ?
Camera A43: <--- ?
WiFi: <--- ?
Sound: <--- ?
Software buttons
I think we should first make the processor and the screen working, then we are able to debug the device using adb
And we are able to view debug codes on archos
Because all drivers are included in the kernel, what would be the outcome of running say AOSP gingerbread on top of the current kernel?
Archos didn't make much changes to the kernel and the system compared to other manufactures like HTC and it's Sense ROM.
Sorry for this rant, but I cant help myself.
Guys, stop the nonsense regarding not being an android dev and thusnot being able to get anything done. Are you not capable of learning? Please dont reply with negative until you ve tried.
I'm a linuxadmin. It took me 2 hours to get a CM build just by following the instructions. How much longer would it take to rip the drivers ad add them to the image? My guess is that if you start with CM 6 (froyo?) you ll be done in a few days.
So please stop begging for an android dev and all the idle talk of how you think you might get things to work. Just get started with the cyanogenmod build guide already!
Again sorry for the rant
wvl0 said:
Sorry for this rant, but I cant help myself.
Guys, stop the nonsense regarding not being an android dev and thusnot being able to get anything done. Are you not capable of learning? Please dont reply with negative until you ve tried.
I'm a linuxadmin. It took me 2 hours to get a CM build just by following the instructions. How much longer would it take to rip the drivers ad add them to the image? My guess is that if you start with CM 6 (froyo?) you ll be done in a few days.
So please stop begging for an android dev and all the idle talk of how you think you might get things to work. Just get started with the cyanogenmod build guide already!
Again sorry for the rant
Click to expand...
Click to collapse
Ho year sure, downloading sources for a supported device and building the entire thing is not rocket science and can be easily done by following the wiki.
But building one for an unsupported device is an other story.
It requires a good knowledge and a lot of spare time.
The knowledge can be learned online but it requires a lot more spare time too and many of us don't have that spare time, unfortunately.
do you?
I'm not here to lecture people on how they spend their time. I simply want to point out that waiting for a dev to come along to fix your woes isn't the right way to get a project started. Besides, all the time spent on forum posts will nicely accumulate into a plentiful amount of time that can be spent on learning.
If there is an dev interested in building a rom, they will. No need to create some kind of placeholder containing information you think someone might want.
The open source way is to scratch your own itch.
Just on the technical side of things. If you port the cyanogen froyo version, you should simply be able to use the same drivers archos uses. So there isn't going to be any development involved, just compiling stuff.
As to your last question, I surely don't have to reply.
wvl0 said:
I'm not here to lecture people on how they spend their time.
Click to expand...
Click to collapse
I see , what are you here for ?
I simply want to point out that waiting for a dev to come along to fix your woes isn't the right way to get a project started. Besides, all the time spent on forum posts will nicely accumulate into a plentiful amount of time that can be spent on learning.
If there is an dev interested in building a rom, they will. No need to create some kind of placeholder containing information you think someone might want.
The open source way is to scratch your own itch.
Just on the technical side of things. If you port the cyanogen froyo version, you should simply be able to use the same drivers archos uses. So there isn't going to be any development involved, just compiling stuff.
As to your last question, I surely don't have to reply.
Click to expand...
Click to collapse
Well that was one of the useless posts found on this thread. Thank you for adding yours to the list
Hey guys, please join us at the Developer Thread.]
Its better to have only one thread
sibere said:
I see , what are you here for ?
Well that was one of the useless posts found on this thread. Thank you for adding yours to the list
Click to expand...
Click to collapse
Touché. I guess I'll just add what I learned then.
How to get your buildsystem up and running on Ubuntu Oneiric 64bit.
Before following this guide: http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Sholes
Do this first, just to avoid having to install individual packages later on:
Code:
add-apt-repository "deb http://archive.canonical.com/ maverick partner"
Code:
apt-get install bison build-essential curl flex g++-4.3-multilib gcc-4.3-multilib git-core g++-multilib gnupg gperf lib32ncurses5-dev lib32readline5-dev lib32z1-dev libc6-dev-i386 libesd0-dev libncurses5-dev libsdl1.2-dev libsdl-dev libwxgtk2.6-dev ncurses-dev pngcrush schedtool squashfs-tools sun-java6-jdk zip zlib1g-dev
I think I ran into compile issues with gcc-4.6, so I switched over to 4.4
Code:
rm /usr/bin/gcc
ln -s /usr/bin/gcc-4.4 /usr/bin/gcc
rm /usr/bin/g++
ln -s /usr/bin/g++-4.4 /usr/bin/g++
Then following this guide to get ADB running with your tablet:
http://forum.xda-developers.com/archive/index.php/t-892847.html
Now you can follow the Sholes build guide.
You might run into compile issues. This bug report includes a fix:
http://code.google.com/p/cyanogenmod/issues/detail?id=2455
and in case you run into this one:
frameworks/base/core/java/android/widget/ListView.java:3631: warning 13: Method android.widget.ListView.getCheckItemIds: (at)Deprecated annotation and (at)deprecated doc tag do not match
Checking API: checkapi-last
(unknown): error 17: Field org.apache.http.protocol.HTTP.EXPECT_CONTINUE has changed value from "100-Continue" to "100-continue"​
Solve it by:
The error here is that someone needs to change the "100-continue" line on line 63 of file external/apache-http/src/org/apache/http/protocol/HTTP.java to "100-Continue"​
And there's this one too:
Code:
host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
host SharedLib: libneo_cs (out/host/linux-x86/obj/lib/libneo_cs.so)
host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1
make: *** Waiting for unfinished jobs....
Which can be fixed by edditing frameworks/base/libs/utils/Android.mk
Change the line:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
To:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
This should give you a few files that possibly can be flashed to our tablets:
Code:
Install system fs image: out/target/product/generic/system.img
Target ram disk: out/target/product/generic/ramdisk.img
Target userdata fs image: out/target/product/generic/userdata.img
Happy Hacking.
[edit]
Here's the result, just in case anyone is brave enough to flash it.
http://www.megaupload.com/?d=7PCNF69Z
[/edit]
[edit 2]
I guess the next step would be editing the img files to order to add the necessary drivers.
You need YAFFS2 support to mount these files. YAFFS2 isn't included in this version of ubuntu however.
So get yaffs2:
Code:
git clone ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
..and get a nice old kernel, considering the current version in git doesn't support 2.6.39 cleanly.
Code:
wget http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.35/linux-2.6.35.13.tar.bz2
untar your kernel sources.
then follow the instructions included with YAFFS:
Code:
cd yaffs-dir
./patch-ker.sh c m linux-tree
complains that linux-tree/fs/yaffs2 already exists
rm -rf linuux-tree/fs/yaffs2
./patch-ker.sh c m linux-tree
Copy your /boot/config-XXX to the directory you unpacked your kernel tarball.
run a:
Code:
make oldconfig
Now add YAFFS to your config using
Code:
make menuconfig
(Filesystems->Miscellaneous filesystems->yaffs)
..compile and reboot ubuntu into your own kernel containing yaffs2 support
mount your img files with
Code:
mount -o loop -t yaffs2 filename mountpoint
[/edit 2]
[edit 3]
So apparently building cyanogenmod doesn't mean you're building a full rom, you have to do the kernel seperately (as far as I can tell ATM):
http://wiki.cyanogenmod.com/index.php?title=Building_Kernel_from_source
there was no /proc/config.gz, so i ripped the urkdroid kernel .config file instead
also getting an arm toolchain working seemed tedious, so I followed the advice in on the wiki and got one from:
http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3053
Had to tell the compile process where to find the arm compiler. Think I'm actually using one I downloaded from Ubuntu's repository instead of the one from the above link - oh well.
Code:
[email protected]:~/android/kernel/cm-kernel# make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- -j`grep 'processor' /proc/cpuinfo | wc -l`
[/edit 3]
wvl0 said:
Touché. I guess I'll just add what I learned then.
How to get your buildsystem up and running on Ubuntu Oneiric 64bit.
Before following this guide: http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Sholes
Do this first, just to avoid having to install individual packages later on:
Code:
add-apt-repository "deb http://archive.canonical.com/ maverick partner"
Code:
apt-get install bison build-essential curl flex g++-4.3-multilib gcc-4.3-multilib git-core g++-multilib gnupg gperf lib32ncurses5-dev lib32readline5-dev lib32z1-dev libc6-dev-i386 libesd0-dev libncurses5-dev libsdl1.2-dev libsdl-dev libwxgtk2.6-dev ncurses-dev pngcrush schedtool squashfs-tools sun-java6-jdk zip zlib1g-dev
I think I ran into compile issues with gcc-4.6, so I switched over to 4.4
Code:
rm /usr/bin/gcc
ln -s /usr/bin/gcc-4.4 /usr/bin/gcc
rm /usr/bin/g++
ln -s /usr/bin/g++-4.4 /usr/bin/g++
Then following this guide to get ADB running with your tablet:
http://forum.xda-developers.com/archive/index.php/t-892847.html
Now you can follow the Sholes build guide.
You might run into compile issues. This bug report includes a fix:
http://code.google.com/p/cyanogenmod/issues/detail?id=2455
and in case you run into this one:
frameworks/base/core/java/android/widget/ListView.java:3631: warning 13: Method android.widget.ListView.getCheckItemIds: (at)Deprecated annotation and (at)deprecated doc tag do not match
Checking API: checkapi-last
(unknown): error 17: Field org.apache.http.protocol.HTTP.EXPECT_CONTINUE has changed value from "100-Continue" to "100-continue"​
Solve it by:
The error here is that someone needs to change the "100-continue" line on line 63 of file external/apache-http/src/org/apache/http/protocol/HTTP.java to "100-Continue"​
And there's this one too:
Code:
host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
host SharedLib: libneo_cs (out/host/linux-x86/obj/lib/libneo_cs.so)
host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1
make: *** Waiting for unfinished jobs....
Which can be fixed by edditing frameworks/base/libs/utils/Android.mk
Change the line:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
To:
Code:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
This should give you a few files that possibly can be flashed to our tablets:
Code:
Install system fs image: out/target/product/generic/system.img
Target ram disk: out/target/product/generic/ramdisk.img
Target userdata fs image: out/target/product/generic/userdata.img
Happy Hacking.
[edit]
Here's the result, just in case anyone is brave enough to flash it.
http://www.megaupload.com/?d=7PCNF69Z
[/edit]
[edit 2]
I guess the next step would be editing the img files to order to add the necessary drivers.
You need YAFFS2 support to mount these files. YAFFS2 isn't included in this version of ubuntu however.
So get yaffs2:
Code:
git clone ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
..and get a nice old kernel, considering the current version in git doesn't support 2.6.39 cleanly.
Code:
wget http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.35/linux-2.6.35.13.tar.bz2
untar your kernel sources.
then follow the instructions included with YAFFS:
Code:
cd yaffs-dir
./patch-ker.sh c m linux-tree
complains that linux-tree/fs/yaffs2 already exists
rm -rf linuux-tree/fs/yaffs2
./patch-ker.sh c m linux-tree
Copy your /boot/config-XXX to the directory you unpacked your kernel tarball.
run a:
Code:
make oldconfig
Now add YAFFS to your config using
Code:
make menuconfig
(Filesystems->Miscellaneous filesystems->yaffs)
..compile and reboot ubuntu into your own kernel containing yaffs2 support
mount your img files with
Code:
mount -o loop -t yaffs2 filename mountpoint
[/edit 2]
[edit 3]
So apparently building cyanogenmod doesn't mean you're building a full rom, you have to do the kernel seperately (as far as I can tell ATM):
http://wiki.cyanogenmod.com/index.php?title=Building_Kernel_from_source
there was no /proc/config.gz, so i ripped the urkdroid kernel .config file instead
also getting an arm toolchain working seemed tedious, so I followed the advice in on the wiki and got one from:
http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3053
Had to tell the compile process where to find the arm compiler. Think I'm actually using one I downloaded from Ubuntu's repository instead of the one from the above link - oh well.
Code:
[email protected]:~/android/kernel/cm-kernel# make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- -j`grep 'processor' /proc/cpuinfo | wc -l`
[/edit 3]
Click to expand...
Click to collapse
That looks very good
wvl0 said:
Touché. I guess I'll just add what I learned then.
How to get your buildsystem up and running on Ubuntu Oneiric 64bit.
Before following this guide: http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Sholes
Click to expand...
Click to collapse
This may be my misunderstanding but I thought this guide only teaches you how to compile your own cyanogen build for the Motorola Sholes. It even states that you need a sholes with a working copy of cyanogenmod installed. This guide will only work for devices which are already supported by the cyanogenmod team, and is not a guide to build for unsupported devices. At least, that was my understanding from spending most of a day crawling around the cyanogenmod wiki.
Part of the build process involves pulling proprietary system files from the device. I guess one starting point would be to work out which files these are, then obtain the files from the archos. However, this stuff takes time to learn and I have very little to spare, like most. But then, neither am I asking someone else to do it, or sitting waiting for it.
If it comes, it comes...
Building for a compatible CPU architecture should at least give you a semi bootable ROM, after that you have to get the drivers in.
Considering we have the source and are using the same kernel versions, we can just recompile the drivers for our kernel.
wvl0 said:
Building for a compatible CPU architecture should at least give you a semi bootable ROM, after that you have to get the drivers in.
Considering we have the source and are using the same kernel versions, we can just recompile the drivers for our kernel.
Click to expand...
Click to collapse
Thank, you guys!
Could you please joyn my Thread for CM Developement, so other guys could help?
One thread is better than two
Finally, guys with Knowledge work on a CM, how can i help?
You could help by completely taking over, 'cause I don't want a cyanogen rom per se, I just want to show people that you don't have to be a developer to compile a rom.
wvl0 said:
You could help by completely taking over, 'cause I don't want a cyanogen rom per se, I just want to show people that you don't have to be a developer to compile a rom.
Click to expand...
Click to collapse
Okey, i understand^^
Could you tell me a few steps to compile the CM ?, i think the drivers we'll do later

[GUIDE][ICS] Compile Cyanogenmod 9 on Mac OS X Lion

There are a lot of toturials for building CM9 on ubuntu or CM7 on Mac but I couldn't find a decent toturial for building CM9 on Mac (specially Lion). Development in AOSP/CM land is rapid and guides frequently need updating. I had to spend a little time to figure everything out and I decided to share it here.
This tutorial is for building CM9 (ICS) for Galaxy Nexus GSM (maguro) on Mac OS X Lion 10.7.3 using Xcode 4.3 and homebrew . You can easily make the instructions work for most other cm9 devices, but I wouldn't know anything about that.
DISCLAIMER: I'm not responsible if you blow yourself up, blah blah blah
However, I've tried to make this as noob friendly as possible because, well I'm a noob myself
Instrunctions:
UPADTE (MAY 29TH) : The Xcode 4.3 default compiler (llvm-gcc) used to be incompatible with CM9. Thanks to jocelyn and topprospect, the LLVM compatibility patches from mainline AOSP are now merged into CM9. Therefore, you can now use Xcode 4.3 and its command line tools without installing another compiler. However, since GCC is still the only officially supported compiler, incompatibilites with llvm-gcc could still be introduced with future updates. Therefore, if your build fails, it might be worth it to try installing and compiling with GCC 4.2. See the Troubleshooting section for more info.
Now that we have Xcode 4.3 and Xcode command line tools (CLT) installed, let's continue.
Open Terminal and run
Code:
java
if you don't have Java, you will get a prompt asking you to download and install Java. Go ahead and install it.
If you don't have adb and fastboot working, download the android-sdk from google (version r18 as of now) and put it in /usr/local/ and rename the folder to "android-sdk".
Install the homebrew package manager
Code:
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
To make sure that homebrew and android-sdk executables are in $PATH:
Code:
touch ~/.bash_profile && echo "PATH=/usr/local/bin:/usr/local/sbin:$PATH:/usr/local/android-sdk/tools:/usr/local/android-sdk/platform-tools" >> ~/.bash_profile
Relaunch Terminal for the change to take effect.
At this point you can run
Code:
brew doctor
to detect any problems there might be (Homebrew may instruct you to use the xcode-select utility to select the xcode installation path). Hopefully, your system is raring to brew
Now we have to install a bunch of packages:
Code:
brew install git coreutils findutils gnu-sed gnupg pngcrush repo
We now need to create a couple of symlinks so that the gnu versions of 'sed' and 'find' are used rather than the osx provided versions :
Code:
ln -s /usr/local/bin/gfind /usr/local/bin/find && ln -s /usr/local/bin/gsed /usr/local/bin/sed && ln -s /usr/local/bin/gstat /usr/local/bin/stat
It's time to create a case sensitive image which will hold our working directory:
Code:
hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 40g -volname "android" -attach ~/Desktop/Android
Now we have a disk image in ~/Desktop/Android. Mount it if it's not mounted already. (Don't be picky about the size, the image will only take as much as space as its contents).
Now we need to create a working directory inside the mounted volume:
Code:
cd /Volumes/android && mkdir cm9 && cd cm9
We can initialize and download the source now:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b ics && repo sync && say 'finished'
Now we need to get the required proprietry files for our device. We can get these from the device itself. Connect your phone (make sure USB Debugging is enabled) and run the following (for maguro):
Code:
cd /Volumes/android/cm9/device/samsung/maguro/ && ./extract-files.sh
[If you see errors in the output from extract-files.sh, see the Troubleshooting section below]
For Google devices,we can also get them directly from google. For maguro, download the 3 files and extract them to /Volumes/android/cm9. Then,
Code:
cd /Volumes/android/cm9
/Volumes/android/cm9/extract-broadcom-maguro.sh
/Volumes/android/cm9/extract-imgtec-maguro.sh
/Volumes/android/cm9/extract-samsung-maguro.sh
We also need the prebuilts (like ROM manager and Term.apk):
Code:
/Volumes/android/cm9/vendor/cm/get-prebuilts
You can optionally tell the build to use the ccache tool. CCache acts as a compiler cache that can be used to speed-up rebuilds :
Code:
export USE_CCACHE=1 && /Volumes/android/cm9/prebuilt/darwin-x86/ccache/ccache -M 20G
Default is 1GB. Anything between 20GB-50GB should be fine.
Before starting the build, we need to workaround an issue with Lion and compiling the QEMU emulator.
[This step doesn't seem to be needed anymore. QEMU is automatically ignored on OS X/Darwin]
If you build now, you're probably gonna get kernel build errors regarding the missing elf.h header (this error might be device specific). Fortunately, we already have this file downloaded, so we only need to copy it to /usr/local/include:
Code:
cp /Volumes/android/cm9/external/elfutils/libelf/elf.h /usr/local/include
FINALLY, we are ready to build:
Code:
cd /Volumes/android/cm9 && source build/envsetup.sh && brunch
Pick your device from the list and enter the number. For maguro, you could use "brunch maguro" instead and skip the menu. Depending on your system, this will take 30min-4hours.
You should now see a beautiful zip file waiting to be flashed:
{
"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"
}
​Troubleshooting:
The extract script for maguro seems to be a little outdated, as it doesn't pull the gps proprietary blob. You can either use the google provided scripts, or add koush's git repository for your device to your local_manifest.xml.
As explained above, the CM9 source is currently compatible with llvm-gcc. In the future, if llvm-gcc fails to build correctly, you should try installing and compiling using GCC4.2 (the Xcode 3 compiler). You can install apple-gcc4.2 from homebrew:
Code:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
This version of gcc can happily coexist with Xcode 4.x .
So now you have GCC 4.2 installed, but it won't be used unless we update the corresposing environment variables:
Code:
export CC=/usr/local/bin/gcc-4.2 && export CXX=/usr/local/bin/g++-4.2
Notice that using the export command is temporary. If you relaunch Terminal, you will need to set these again. However, this is a good thing, because changing these values permanently (by putting them in ~/.bash_profile) can interfere with other builds.
If you use this method, the build might fail while compiling "external/zlib/x86/adler32.c". It appears that a recent change in zlib has introduced an incompatibility with gcc 4.2. you have to revert the following 2 commits:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Alternatively, you can add topprospect's zlib on github (which has those commits reverted) to your local_manifast.xml. Simply run:
Code:
nano /Volumes/android/cm9/.repo/local_manifest.xml
and add the following line
Code:
<project name="dferg/android_external_zlib" path="external/zlib" remote="github" />
If you get a build error, and your error is not covered here, copy the last 20-30 lines of the build output AND the output from the following command into pastebin and post the link. Hopefully me or someone else will help you.
Code:
echo -e "\nENV:\n$(env)\n\nWHICH GCC\n:$(which gcc)\n\nWHICH G++:\n$(which g++)\n\nWHICH CC:\n$(which cc)\n\nWHICH C++:\n$(which c++)\n\nBREW DOCTOR:\n$(brew doctor)\n\nBREW LIST:\n$(brew list)\n\n/USR/BIN:\n$(ls -l /usr/bin | grep gcc)\n\n/USR/LOCAL/BIN:\n$(ls -l /usr/local/bin | grep gcc)\n\n"
​Notes/Extras:
To quickly setup your environment, add an alias like the following to ~/.bash_profile:
Code:
alias cm9env="hdiutil attach PATH-TO-DISK-IMAGE -mountpoint /Volumes/android && cd /Volumes/android/cm9 && source ./build/envsetup.sh && export USE_CCACHE=1"
alias cm9build="cm9env && make clobber && reposync && brunch maguro"
Now you can save time by using "cm9env" to get your environment setup or "cm9build" to compile a clean updated build.
To clear your output directory for a new build, run "make clobber". You probably don't need this if you've only changed a few lines of code.
To cherry pick yet-to-be-merged changes from the gerrit instance:
1. Pick an open commit from CM Gerrit
2. Under list of Patch Sets pick the latest and open cherry-pick tab
3. Check what Git repository the url is pointing e.g. http://review.cyanog...frameworks_base
4. In your CM9 working tree go to the corresponding directory, which in this case is something like ~/your-working-directory/frameworks/base/
5. Now simply paste the whole line seen in CM Gerrit cherry-pick tab e.g. "git fetch http://review.cyanog....rameworks_base refs/changes/00/13100/4 && git cherry-pick FETCH_HEAD"
It should be now included in your next compiled build. When doing repo sync again, cherry picks will be lost.[CREDIT Fihlvein from xda]
Click to expand...
Click to collapse
Enjoy your custom built CM9!
I updated OP with some updated info about Xcode 4.3.
Nice work man. Very helpful.
conantroutman said:
Nice work man. Very helpful.
Click to expand...
Click to collapse
thanks! I'll try to keep this topic updated as issues with mac are introduced/resolved.
Nice write up. Thanks.
Before I start again from scratch I have a question. Does this guide apply to previous versions of mac os x (mine is 10.6.8)? I used the official android initializing build environment page & cm7 wiki page for the instructions to setup my build environment.
Also, any tips to switch from macports to homebrew?
In the past I've had to cherry pick to get my OS X build environment set up for CM9. The compile from source fails because I started with macports instead of homebrew (bad idea). I tried to switch to homebrew without success. Any tips to switch from macports to homebrew?
For the sake of keeping this page on topic a pm response is ok if that is what you prefer.
Hi thanks for this !! Helpful one question what do i change so i can do AOSP instead of cm9??
grad061980 said:
Nice write up. Thanks.
Before I start again from scratch I have a question. Does this guide apply to previous versions of mac os x (mine is 10.6.8)? I used the official android initializing build environment page & cm7 wiki page for the instructions to setup my build environment.
Also, any tips to switch from macports to homebrew?
In the past I've had to cherry pick to get my OS X build environment set up for CM9. The compile from source fails because I started with macports instead of homebrew (bad idea). I tried to switch to homebrew without success. Any tips to switch from macports to homebrew?
For the sake of keeping this page on topic a pm response is ok if that is what you prefer.
Click to expand...
Click to collapse
Yes, this guide should work fine on Snow Leopard. It mostly depends on your Xcode version. If you have Xcode 3, you can skip step 1 entirely, since you already have gcc4.2 as part of Xcode.
If you have access to Xcode 4.2 and above, you will need to install gcc4.2 separately, as explained in the guide.
Now regarding Macports, I strongly suggest that you completely uninstall Macports before installing homebrew. Instructions are here: http://guide.macports.org/chunked/installing.macports.uninstalling.html
WonkyYew said:
Hi thanks for this !! Helpful one question what do i change so i can do AOSP instead of cm9??
Click to expand...
Click to collapse
Full instructions are available on android.com : http://source.android.com/source/initializing.html
If you are using this guide, you need to change the repo initialization command to :
Code:
repo init -u https://android.googlesource.com/platform/manifest
and then do repo sync. You can setup ccache as usual. I don't think AOSP has the "brunch command", so you have to use launch and then make.
Run "lunch" and select an option from the menu. You can find more info about the options here: http://source.android.com/source/building.html. For maguro, you should use "full_maguro-userdebug".
To start the build, use
Code:
make -j$(sysctl -n hw.ncpu)
@ArmanUV. Sounds good & thanks for the input. I'll give the link to macports uninstall a go.
Im a real noob, whats the advantage of compiling from source?
Thanks for the help man !
Hi, thanks for your guide, setting up the repo was no problem at all!
But: I'm getting the following error when building.
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libz_intermediates/adler32.o] Error 1
make: *** Waiting for unfinished jobs....
Seems to be a problem with the compiler, but I'm on xcode 4.3 and I've installed gcc-4.2 and set the env vars. Any help?
ArmanUV,
Thanks so much for posting this guide. Very helpful!
Are you having any trouble with errors like this?
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
Googling for this error implies that the fix is to use a version of GCC > 4.2. But there does not seem to be a GCC 4.4 in Homebrew.
Thanks again for the guide!
EDIT: Sorry for the double post with empyyy. Seems like there is someone else having my same issue!
topprospect said:
ArmanUV,
Thanks so much for posting this guide. Very helpful!
Are you having any trouble with errors like this?
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
Googling for this error implies that the fix is to use a version of GCC > 4.2. But there does not seem to be a GCC 4.4 in Homebrew.
Thanks again for the guide!
EDIT: Sorry for the double post with empyyy. Seems like there is someone else having my same issue!
Click to expand...
Click to collapse
empyyy said:
Hi, thanks for your guide, setting up the repo was no problem at all!
But: I'm getting the following error when building.
Code:
external/zlib/x86/adler32.c: In function ‘adler32_MMX’:
external/zlib/x86/adler32.c:747: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
external/zlib/x86/adler32.c:747: error: ‘asm’ operand has impossible constraints
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libz_intermediates/adler32.o] Error 1
make: *** Waiting for unfinished jobs....
Seems to be a problem with the compiler, but I'm on xcode 4.3 and I've installed gcc-4.2 and set the env vars. Any help?
Click to expand...
Click to collapse
You guys seem to have the same issue. What sort of Xcode configuration are you using? Can you post the output from "which gcc","which g++", "gcc -v", "g++ -v" and "cc -v"?
ArmanUV said:
You guys seem to have the same issue. What sort of Xcode configuration are you using? Can you post the output from "which gcc","which g++", "gcc -v", "g++ -v" and "cc -v"?
Click to expand...
Click to collapse
I am on Lion 10.7.4 with Xcode 4.3.2. Here is the output that you asked for:
Code:
# echo -n "which gcc: "; which gcc; echo -n "which g++: "; which g++; echo ""; echo "gcc -v:"; gcc -v; echo ""; echo "g++ -v:"; g++ -v; echo ""; echo "cc -v:"; cc -v
which gcc: /usr/bin/gcc
which g++: /usr/bin/g++
gcc -v:
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
g++ -v:
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
cc -v:
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix
They are pointing to LLVM, but my CC and CXX variables point to:
Code:
env|grep 4.2
CXX=/usr/local/bin/g++-4.2
CC=/usr/local/bin/gcc-4.2
Do I need to add something to PATH? I'm sure I just missed something obvious in your instructions.. Thanks for helping!
topprospect said:
I am on Lion 10.7.4 with Xcode 4.3.2. Here is the output that you asked for:
Do I need to add something to PATH? I'm sure I just missed something obvious in your instructions.. Thanks for helping!
Click to expand...
Click to collapse
Everything checks out. I'm away from my main machine so I can't run a test build, but I suspect that a recent change is causing problems.
Now, regarding the compiler, Setting CC/CXX *should* take care of everything, but I am currently not 100% sure that somewhere in a makefile, these environment variables aren't being ignored. Since I wrote the guide, I noticed a lot of clang warnings in the build, which means that CC/CXX is not honored and /usr/bin/cc and /usr/bin/c++ is being used.
A more robust method of making sure gcc-4.2 is being used is creating symlinks to gcc-4.2 and g++-4.2 :
Code:
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/gcc
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/cc
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/c++
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/g++
Obviousely, a systemic method like this has its downsides but it may be the only choice without having to change CM code (especially since I lack the knowledge to do so )
[I recently found out that master aosp is no longer using CC/CXX to find the compiler (see ./build/core/combo/). Instead, it uses "gcc" and "g++" directly, which means that llvm-gcc will be used no matter what env variable you have. Fortunately, unlike cm9, master aosp is supposed to build fine with llvm-gcc (except for qemu, which doesn't matter for device images). ]
ArmanUV said:
Everything checks out. I'm away from my main machine so I can't run a test build, but I suspect that a recent change is causing problems.
Now, regarding the compiler, Setting CC/CXX *should* take care of everything, but I am currently not 100% sure that somewhere in a makefile, these environment variables aren't being ignored. Since I wrote the guide, I noticed a lot of clang warnings in the build, which means that CC/CXX is not honored and /usr/bin/cc and /usr/bin/c++ is being used.
A more robust method of making sure gcc-4.2 is being used is creating symlinks to gcc-4.2 and g++-4.2 :
Code:
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/gcc
ln -s /usr/local/bin/gcc-4.2 /usr/local/bin/cc
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/c++
ln -s /usr/local/bin/g++-4.2 /usr/local/bin/g++
Click to expand...
Click to collapse
Okay, just tried this. I created a new dir (/Volumes/Android/bin) that simply houses those softlinks you recommended. Then I put /Volumes/Android/bin at the beginning of my PATH. That should fix it without breaking the rest of the system, e.g. homebrew.
The GENERAL_REGS problem still exists though. Pretty sure b/c gcc 4.2.1 doesn't understand this construct properly (need a newer version of gcc).
So I backed out the change that introduced this adler32.c.
https://github.com/CyanogenMod/android_external_zlib/commit/13bf40af68236c961542bdee1d4b7c0176bf15a0
The compile is getting farther now. I have to run to work so I'll post later if it succeeds.
The weird thing is: This change was made back in December. Why would it have worked for you?
topprospect said:
The compile is getting farther now. I have to run to work so I'll post later if it succeeds.
Click to expand...
Click to collapse
Build works (and boots!) with the following:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Note the 1st revert is just to avoid massive conflicts seen when reverting the 2nd one by itself. The 2nd revert is the one that really matters here.
So this isn't really a solution.. Seems like we need to move to a newer version of gcc or figure out a patch to adler32.c that makes it gcc 4.2 compatible.
topprospect said:
Build works (and boots!) with the following:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Click to expand...
Click to collapse
The first revert works fine, however the second one gives me the following error:
Code:
$ git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
error: could not revert 13bf40a... Implement vectorized adler32 and optimized slhash
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
error: Could not parse conflict hunks in zlib.h
empyyy said:
The first revert works fine, however the second one gives me the following error:
Code:
$ git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
error: could not revert 13bf40a... Implement vectorized adler32 and optimized slhash
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
error: Could not parse conflict hunks in zlib.h
Click to expand...
Click to collapse
Well, run git status. You'll see that the only conflict is in the comments in zlib.h. So, you can just ignore it.
topprospect said:
Okay, just tried this. I created a new dir (/Volumes/Android/bin) that simply houses those softlinks you recommended. Then I put /Volumes/Android/bin at the beginning of my PATH. That should fix it without breaking the rest of the system, e.g. homebrew.
The GENERAL_REGS problem still exists though. Pretty sure b/c gcc 4.2.1 doesn't understand this construct properly (need a newer version of gcc).
So I backed out the change that introduced this adler32.c.
https://github.com/CyanogenMod/android_external_zlib/commit/13bf40af68236c961542bdee1d4b7c0176bf15a0
The compile is getting farther now. I have to run to work so I'll post later if it succeeds.
The weird thing is: This change was made back in December. Why would it have worked for you?
Click to expand...
Click to collapse
topprospect said:
Build works (and boots!) with the following:
Code:
cd external/zlib
git revert dd6786cae3f4493faa6661d5f74db587932f15d7
git revert 13bf40af68236c961542bdee1d4b7c0176bf15a0
Note the 1st revert is just to avoid massive conflicts seen when reverting the 2nd one by itself. The 2nd revert is the one that really matters here.
So this isn't really a solution.. Seems like we need to move to a newer version of gcc or figure out a patch to adler32.c that makes it gcc 4.2 compatible.
Click to expand...
Click to collapse
Nice find. I tried to compile this morning and I ran into the same issue. This is what I don't understand: I did a couple of builds about a week ago without running into this issue. But, the latest commits on zlib are from 2 months ago.
Amazingly, the Xcode 4.3 toolchain (clang and llvm-gcc) builds this external/zlib/adler32.c just fine.
An alternative to this problem is to install an up to date gcc 4.7 :
Code:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/gcc.rb
and then create symlinks to gcc-4.7/g++-4.7. I have not tested this yet.

[Step by Step] Build ICS/JB Kernel

I have created a new thread with a script to build the kernel. Full credit for the script goes to the amazing mapkel. Without him there would be no script.
[Script] Build ICS/JB Kernel
This thread will remain as a Step by Step guide. Either method works fine but the script method is much simpler.
This is an informative guide and I decline responsibility for any damage to your device.
Do not attempt to build this kernel if you are going to complain to devs about issues.
That being said, I designed this so that even those with little knowledge can follow the exact commands and will run into no issues. If you have issues building, post here and I will try to assist you.
The following is a complete tutorial to building the kernel.
Credits:
Kernel Devs: krystianp, lehjr, Epinter, and mmontuori for making this kernel; without them there is no kernel.
Big thanks to benouch for the idea and basic outline of this tutorial.
Another big thanks to zen25205 for help with building the kernel and getting the Linaro Toolchain.
A final big thanks to mchinand for suggesting using "${HOME}" (no need to change for username anymore)
Kernel Kitchen
Thanks to:
quetzalcoatl2435
nlabrad
You need to install Ubuntu 12.04 64bit (Google for instructions)
1. Download linaro.zip (toolchain) from here: http://www.mediafire.com/?ok2paef7uhx2ji8
2. Download kitchen.zip from here: https://mega.co.nz/#!Uc4D0YiD!bs-f4FLWQTu7Q8FQziY0o3GWRPJWGBl-6-Hhm6nta-k
3. Download kernel-working.zip from here: http://www.mediafire.com/?wtavk4yb24x3lj1
4. Download misc.zip from here: http://www.mediafire.com/?q693gipql6a6ty8
If there are any issues with this guide, or if you have any issues building the kernel, post here and I will assist you as best I can.
The following is for Arch Linux Only. Ignore if you are using Ubuntu
Code:
pacman -Syu
pacman -S base-devel
pacman -S git
pacman -S bzip2
pacman -S unzip
Ubuntu Users Start Here
If you get an error on apt-get (something about package not found), enable all software sources in Ubuntu Software Center.
Stage 1 (first time only). Go to Stage 2 if you have already built the kernel.
Open a terminal and run the following commands:
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
Code:
sudo apt-get install git
Create a folder named “olympus” in your home directory:
Code:
mkdir ${HOME}/olympus/
Extract the downloaded .zip files to the “olympus” folder (you can use the file manager or the following commands):
Code:
unzip ${HOME}/Downloads/linaro.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/kitchen.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/kernel-working.zip -d ${HOME}/olympus/
unzip ${HOME}/Downloads/misc.zip -d ${HOME}/olympus/
There should now be 4 folders in ${HOME}/olympus/: “linaro”, “kitchen”, “kernel-working” and “misc”.
In a terminal:
Code:
cd ${HOME}/olympus/
Code:
git clone git://github.com/CyanogenMod-Atrix/android_kernel_motorola_olympus.git
Stage 2 (start here if you are building again).
Code:
cd ${HOME}/olympus/android_kernel_motorola_olympus/
Get the latest updates from git:
Code:
git remote update
Now run the following commands to build the kernel:
Code:
export CROSS_COMPILE=${HOME}/olympus/linaro/bin/arm-unknown-linux-gnueabi-
Code:
make clean && make mrproper
Code:
make -j2 ARCH=arm tegra_olympus_defconfig
Code:
make -j2 ARCH=arm
Now start packing the new kernel and modules:
Code:
cp ${HOME}/olympus/android_kernel_motorola_olympus/arch/arm/boot/zImage ${HOME}/olympus/kitchen/kernel-tools/input/
Code:
cp ${HOME}/olympus/misc/CM9/boot.img ${HOME}/olympus/kitchen/kernel-tools/input/
(Replace CM9 with CM10 for CM10)
Code:
cd ${HOME}/olympus/kitchen/kernel-tools/
Code:
./menu
Press Enter Key
Select Option 1
Press Enter Key (again)
Select Option 1 (again)
Type “olympus” and press Enter Key
Press "Ctrl+C"
Code:
cp ${HOME}/olympus/kitchen/kernel-tools/output/bootimg-contents/initrd.img ${HOME}/olympus/kitchen/kernel-tools/input/
Code:
cd ${HOME}/olympus/kitchen/kernel-tools/
Code:
./menu
Press Enter Key
Select Option 1
Press Enter Key (again)
Select Option 3
Type “olympus” and press Enter Key
Press "Ctrl+C"
Run the following commands:
Code:
cp ${HOME}/olympus/kitchen/kernel-tools/output/boot.img ${HOME}/olympus/kernel-working/
Code:
find ${HOME}/olympus/android_kernel_motorola_olympus/drivers/ -name *.ko -exec cp -f {} ${HOME}/olympus/kernel-working/system/lib/modules/ \;
Code:
cd ${HOME}/olympus/kernel-working/
Code:
zip -r new_kernel.zip *
The “new_kernel.zip” file will be located at ${HOME}/olympus/kernel-working/new_kernel.zip
This is a flashable zip that you can flash on top of MROM CM9 and the ROMs that the devs will be releasing.
You will have the latest kernel changes by building it yourself.
Thanks for the tutorial. Just a quick question, why did you include the kernel modules in the kernel-working.zip; aren't they going to be overwritten with the newly compiled ones?
I can do it in debian?
mchinand said:
Thanks for the tutorial. Just a quick question, why did you include the kernel modules in the kernel-working.zip; aren't they going to be overwritten with the newly compiled ones?
Click to expand...
Click to collapse
They were useless. I have reuploaded. New link in OP.
Ufoex said:
I can do it in debian?
Click to expand...
Click to collapse
I have not tested. You can try and report back. If it works I will update the thread.
Usually devs stick to Ubuntu for Android development.
Seeing as Ubuntu is based off Debian, it should work.
atrix4g18 said:
They were useless. I have reuploaded. New link in OP.
Click to expand...
Click to collapse
I think it is better to only include what is necessary in the zips. Not for space/bandwidth reasons (they were small as you said), but more for understanding the process and knowing what's essential to build a flashable kernel.
mchinand said:
I think it is better to only include what is necessary in the zips. Not for space/bandwidth reasons (they were small as you said), but more for understanding the process and knowing what's essential to build a flashable kernel.
Click to expand...
Click to collapse
100 Percent agree. I appreciate the suggestion. As I said the new kernel-working.zip is updated without those files. Check OP.
Thanks
You forgot "sudo apt-get install git".
Oh, and if you get an error on apt-get (something about package not found), enable all software sources in Ubuntu Software Center.
quetzalcoatl2435 said:
You forgot "sudo apt-get install git".
Oh, and if you get an error on apt-get (something about package not found), enable all software sources in Ubuntu Software Center.
Click to expand...
Click to collapse
Second Post Updated. Thanks. (I don't think anyone will have the apt-get error, but if they do I will let them know).
I got that error on apt-get, which is why I mentioned it.
It was weird, I had to enable local (CD) sources to make apt-get work. It had to read the source list from the CD first before downloading the packages.
It might be a wonky install, though. I just put it here in case anyone faces the same problem.
what?
Does the kernel already includes Linaro?
omg Kristian said he'll look at it, so did he? :crying: Happy:crying:
crazymania56 said:
what?
Does the kernel already includes Linaro?
omg Kristian said he'll look at it, so did he? :crying: Happy:crying:
Click to expand...
Click to collapse
No this is only the Linaro Toolchain used to build the kernel.
Other tutorials would have you download the Android NDK for the toolchains within.. This tutorial uses the Linaro Toolchain instead.
quetzalcoatl2435 said:
I got that error on apt-get, which is why I mentioned it.
Click to expand...
Click to collapse
Added to second post. Thanks. Also made a list of credits in the OP and you are in it.
Hi, i'm trying this in Arch, i looked for the equivalent packages that are needed in ubuntu and seems that Arch has some of them in the arch-devel group of packages and the *-dev packages are included in the non-dev (arch doesn't splits the packages in dev and nondev).
So, i started unziping, and when i'm unzipping the linaro.zip, some files are overwritten, (it asks if i want to overwrite them or not), i chose yes to overwrite.
I'm compiling, so far no problems, i'll update after i finish.
nlabrad said:
Hi, i'm trying this in Arch, i looked for the equivalent packages that are needed in ubuntu and seems that Arch has some of them in the arch-devel group of packages and the *-dev packages are included in the non-dev (arch doesn't splits the packages in dev and nondev).
So, i started unziping, and when i'm unzipping the linaro.zip, some files are overwritten, (it asks if i want to overwrite them or not), i chose yes to overwrite.
I'm compiling, so far no problems, i'll update after i finish.
Click to expand...
Click to collapse
Good to know.
If it works get into the specifics and I can edit the guide or make a second one for Arch. With full credit to you of course.
Im writing this as it compiles
-No errors in make clean && make mproper
-No errors in make mrom_deconfig
The errors must be in the make.
There are a few warnings, unused functions, unused variables, uninitialized variables, i see a few modules being built, but the extension is ".o" not ".ko", for example dhd_something.o
"arch/arm/boot/compressed/head.S: Assembler messages:
arch/arm/boot/compressed/head.S:[num]: Warning: (null) (it appears a like 30 times.
Then i see, for example
"LD [M] drivers/char/hw_random/rng-core.ko" so i guess it was compiled.
Ok nevermind, the find command DOES FIND the files, but i thought that it didn´t because im used to run cp with -v, and i saw no output and i got confused.
ITS OK THEN.
Something else, after running the kitchen, its faster to press CTRL-C instead of closing/opening the terminal.
Plus you have the log of what you've been doing so far.
No current issue, the modules were compiled, i got confused.
I have the kernel zip ready to be tested.
CTRL-C will work in any bash terminal, which is the one that Ubuntu uses.
Instead of closing the terminal, it just ends the current running process (in this case, the kitchen script will end, and you get the prompt ready again).
My english is weak so if you need to change some grammar of this next few lines, feel free to do so:
So far, to compile it in Arch you need to run: (or check if you already have the packages)
pacman -Syu
pacman -S base-devel
pacman -S git
pacman -S bzip2
pacman -S unzip
Then follow the tutorial normally.
Is MROM CM9 = MROM ICS?
nlabrad said:
No current issue, the modules were compiled, i got confused.
I have the kernel zip ready to be tested.
CTRL-C will work in any bash terminal, which is the one that Ubuntu uses.
Instead of closing the terminal, it just ends the current running process (in this case, the kitchen script will end, and you get the prompt ready again).
My english is weak so if you need to change some grammar of this next few lines, feel free to do so:
So far, to compile it in Arch you need to run: (or check if you already have the packages)
pacman -Syu
pacman -S base-devel
pacman -S git
pacman -S bzip2
pacman -S unzip
Then follow the tutorial normally.
Is MROM CM9 = MROM ICS?
Click to expand...
Click to collapse
Updated Second Post. Take a look.

Can someone help me?

I am building a custom rom and I got into this error:
https://github.com/masterdoctor/Lin...i/LineageOS-|-Build-Tutorial-|-Huawei-P8-Lite
I used this tutorial for building the rom and done exactly what says in the tutorial.
I am at the step of building the rom,but command "croot" and "mka" don't work. It gives me "unknown command" and lists some apps with the same command.
Althrough, make command works, I did it in ~/android/system
It listed a LOT of code, after 3 minutes left me with this codeah,I forgot to copy it and I closed the terminal)
After 10 minutes of waiting:
This is what I got:
Running kati to generate build-aosp_arm.ninja...
No need to regenerate ninja file
Starting build with ninja
ninja: Entering directory `.'
ninja: error: '/.txt', needed by '/root/android/system/out/target/common/obj/PACKAGING/checkpublicapi-cm-last-timestamp', missing and no known rule to make it
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
[email protected]:~/android/system#
here is the code of "croot" too:
[email protected]:~/android/system# croot
No command 'croot' found, did you mean:
Command 'proot' from package 'proot' (universe)
Command 'root' from package 'root-system-bin' (universe)
Command 'chroot' from package 'coreutils' (main)
croot: command not found
[email protected]:~/android/system#
here is the code from "mka":
[email protected]:~/android/system# mka
No command 'mka' found, did you mean:
Command 'mkp' from package 'check-mk-server' (universe)
Command 'mkfa' from package 'julius' (multiverse)
Command 'mma' from package 'mma' (universe)
Command 'moka' from package 'alliance' (universe)
Command 'm-a' from package 'module-assistant' (universe)
mka: command not found
[email protected]:~/android/system#
Has someone an idea on how to fix this, please?I already filled my hdd from repo sync and I don't want to quit this project
It seems that you don't have installed all android building tools, talking about mka and croot.
If you're building with gbmasterdoctors guide: First go to /android/system folder and then run "source build/envsetup.sh" and then run command "lunch cm_hi6210sft-userdebug"
And then normally continue with "croot" and "mka"
Vika__ said:
If you're building with gbmasterdoctors guide: First go to /android/system folder and then run "source build/envsetup.sh" and then run command "lunch cm_hi6210sft-userdebug"
And then normally continue with "croot" and "mka"
Click to expand...
Click to collapse
, too late, I reinstalled Ubuntu 16.04 x64on my laptop and I'm doing everything from the start
Still, thx very much if this is the right solution
XTutorials said:
, too late, I reinstalled Ubuntu 16.04 x64on my laptop and I'm doing everything from the start
Still, thx very much if this is the right solution
Click to expand...
Click to collapse
Well. That works on cm13 so i guess its same for 14. Hopefully i helped :good:
Vika__ said:
If you're building with gbmasterdoctors guide: First go to /android/system folder and then run "source build/envsetup.sh" and then run command "lunch cm_hi6210sft-userdebug"
And then normally continue with "croot" and "mka"
Click to expand...
Click to collapse
I'm back, still with errors,tried to build CM 14.1, again LOS 14, again CM 14.1, again LOS 14...
I've got past the ninja error with an tweak in .bashrc, but now I get this error:
make: *** No rule to make target '/.txt', needed by '/root/android/system/out/target/common/obj/PACKAGING/checkpublicapi-cm-last-timestamp'. Stop.
[email protected]:~/android/system#
My question is, can you explain me how you builded CM 13? Not detailed, I know the essentials, but that step what are you saying with envsetup.sh and lunch cm_hi6210sft weren't in LOS 14 Tutorial.
P.S: I tried your fix many time for cm 14.1 and los 14, didn't work. When I lunch it was saying device not found in list or something almost the same, I think you understand.
Thanks in advance!
:good:

Categories

Resources