• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

GUIDE: From Kernel-Sources to a boot.img (Huawei U8860) [SOLVED]

Search This thread

kaefert

Senior Member
Nov 14, 2007
513
190
Vienna
EDIT: For the Guide scroll down to post number 4
http://forum.xda-developers.com/showpost.php?p=23916656&postcount=4

Hi there!

I would like to get started with building kernels for my newly bought Huawei Honour U8860

My motivation comes from the desire to have this app running on my device, which apparently needs some kernel patches to be applied, since I'm missing the devicefiles called /dev/voc* --> http://code.google.com/p/rvoix/
The Kernel patches can be found here: http://code.google.com/p/rvoix/source/browse/#svn/branches/snapdragon/kernel

What I found on my own is this:
http://source.android.com/source/building-kernels.html

But I have no idea what kernel to start from, the list of devices they have over there
http://source.android.com/source/building-devices.html
have names like: "maguro, panda, wingray, crespo, passion, sapphire, dream" and I have no idea what they mean, except for those few names that are explained on the same page.

I am currently running a rooted Android 4.0.3 that I gained by following this guide:
http://forum.xda-developers.com/showpost.php?p=22688341&postcount=53

I would really apreciate any help anyone can give me! Thanks in advance

EDIT: okey!! I found a download from huawei here
http://www.huaweidevice.com/worldwide/technicaIndex.do?method=gotoProductSupport&productId=3834
Thats called: "open source-kernel-3.0.8-U8860-IcecreamSandwich"
http://www.huaweidevice.com/worldwi...=toDownloadFile&flay=software&softid=NDQwNDc=
So I will try to work with this and get it build and deployed on my device. Thats gonna be a lot of work, will report back when I finished or aborted my mission frustrated.

EDIT2:
Okey, this is really a hard thing if you don't know what you're doing, like me... I think I'm gonna give up, all these config options (i stopped reading after the first 50 and just hold down the enter key for agreeing to the default), and in the end some strange errors:
..._kernel/arch/arm/include/asm/irqflags.h:11:5: warning: "__LINUX_ARM_ARCH__" is not defined
error, forbidden warning: irqflags.h:11
make[1]: *** [arch/arm/kernel/asm-offsets.s] Fehler 1
make: *** [prepare0] Fehler 2

About my initial motivation for compiling myself a kernel:
There are a lot of call recording apps, though most only record from the microphone, and therefore only record a weak shadow of the other side of the conversation.

For the moment I stick with this one:
https://play.google.com/store/apps/details?id=androidlab.allcall

When I tested it with a few testcalls, it seemed to me that the other side is also recorded, even though it gave me an error that it can't record the other side. However, now after a few days real usage I'm not so sure if it truely records the other side, or if this is only this shadow that comes in through the mic. It is hardly understandable in the recordings most of the times now.

So this alternative app is at least an interim solution, but I still wan't to get myself a kernel compiled, and once done try to apply or adept the kernel patches from http://code.google.com/p/rvoix/ to this kernel
 
Last edited:

kaefert

Senior Member
Nov 14, 2007
513
190
Vienna
Okey. So about building this kernel from huawei. From googling a bit I learned that this error
Code:
...arch/arm/include/asm/irqflags.h:11:5: warning: "__LINUX_ARM_ARCH__" is not defined
error, forbidden warning: irqflags.h:11
make[1]: *** [arch/arm/kernel/asm-offsets.s] Fehler 1
make: *** [prepare0] Fehler 2
stems from problems with the toolchain used for building

But first let me document a bit how I got this far:

1.) download the kernel sources from:
http://www.huaweidevice.com/worldwide/technicaIndex.do?method=gotoProductSupport&productId=3834&tb=0

2.) get the kernel config from the device, by connecting it via usb, turning on the usb debugging on it and then using
Code:
adb pull /proc/config.gz
to fetch it. unpack it and put it into the same directory as the extracted kernel, but by the name ".config"
--> learned this one from http://mjanja.co.ke/2011/06/compiling-custom-kernels-on-the-huawei-u8150/

3.) Download and extract an android NDK

4.) open a terminal and set up a few environment variables:
Code:
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=/path_where_i_extracted/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-

5.) simply call make. I also tried to run "make menuconfig" before running make, since a few sources stated it would be neccecary, but that didn't change the error I got.

This guy here states that 7b is not good and 5c is the way to go, but this error kept the same.
http://www.android-hilfe.de/root-ha...deos-x3/172743-kernel-selbst-kompilieren.html

So I looked into ubuntu and found that there is also an arm gcc toolchain, and got it by simply installing this package:
Code:
sudo apt-get install gcc-arm-linux-gnueabi

and since the system puts its stuff all into the proper path so you can use it easily just call
Code:
export CROSS_COMPILE=arm-linux-gnueabi-

and afterwards again "make" and I got a new and different output:
Code:
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: »include/generated/mach-types.h« ist bereits aktualisiert.
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/arm/kernel/asm-offsets.s
In file included from include/linux/irqflags.h:15:0,
                 from path_to_kernel/arch/arm/include/asm/system.h:61,
                 from path_to_kernel/arch/arm/include/asm/bitops.h:27,
                 from include/linux/bitops.h:22,
                 from include/linux/kernel.h:17,
                 from include/linux/sched.h:55,
                 from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/irqflags.h:11:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from path_to_kernel/arch/arm/include/asm/bitops.h:27:0,
                 from include/linux/bitops.h:22,
                 from include/linux/kernel.h:17,
                 from include/linux/sched.h:55,
                 from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/system.h:123:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/system.h:129:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/system.h:130:3: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/system.h:136:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/system.h:140:35: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from path_to_kernel/arch/arm/include/asm/bitops.h:27:0,
                 from include/linux/bitops.h:22,
                 from include/linux/kernel.h:17,
                 from include/linux/sched.h:55,
                 from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/system.h: In Funktion »__xchg«:
path_to_kernel/arch/arm/include/asm/system.h:274:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/system.h:281:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from path_to_kernel/arch/arm/include/asm/bitops.h:27:0,
                 from include/linux/bitops.h:22,
                 from include/linux/kernel.h:17,
                 from include/linux/sched.h:55,
                 from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/system.h: Auf höchster Ebene:
path_to_kernel/arch/arm/include/asm/system.h:351:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/bitops.h:22:0,
                 from include/linux/kernel.h:17,
                 from include/linux/sched.h:55,
                 from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/bitops.h:217:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/swab.h:6:0,
                 from include/linux/byteorder/little_endian.h:12,
                 from path_to_kernel/arch/arm/include/asm/byteorder.h:21,
                 from include/asm-generic/bitops/le.h:5,
                 from path_to_kernel/arch/arm/include/asm/bitops.h:308,
                 from include/linux/bitops.h:22,
                 from include/linux/kernel.h:17,
                 from include/linux/sched.h:55,
                 from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/swab.h:25:28: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from path_to_kernel/arch/arm/include/asm/thread_info.h:16:0,
                 from include/linux/thread_info.h:53,
                 from include/linux/preempt.h:9,
                 from include/linux/spinlock.h:50,
                 from include/linux/seqlock.h:29,
                 from include/linux/time.h:8,
                 from include/linux/timex.h:56,
                 from include/linux/sched.h:57,
                 from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/fpstate.h:32:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/spinlock_up.h:8:0,
                 from include/linux/spinlock.h:89,
                 from include/linux/seqlock.h:29,
                 from include/linux/time.h:8,
                 from include/linux/timex.h:56,
                 from include/linux/sched.h:57,
                 from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/processor.h:88:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/processor.h:108:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/spinlock.h:387:0,
                 from include/linux/seqlock.h:29,
                 from include/linux/time.h:8,
                 from include/linux/timex.h:56,
                 from include/linux/sched.h:57,
                 from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/atomic.h:30:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/time.h:9:0,
                 from include/linux/timex.h:56,
                 from include/linux/sched.h:57,
                 from arch/arm/kernel/asm-offsets.c:13:
include/linux/math64.h: In Funktion »div_u64_rem«:
include/linux/math64.h:51:15: Fehler: »__LINUX_ARM_ARCH__« nicht deklariert (erste Benutzung in dieser Funktion)
include/linux/math64.h:51:15: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet
In file included from include/linux/mm_types.h:15:0,
                 from include/linux/sched.h:64,
                 from arch/arm/kernel/asm-offsets.c:13:
path_to_kernel/arch/arm/include/asm/page.h: Auf höchster Ebene:
path_to_kernel/arch/arm/include/asm/page.h:116:2: Fehler: #error Unknown user operations model
In file included from path_to_kernel/arch/arm/include/asm/pgtable.h:27:0,
                 from include/linux/mm.h:44,
                 from arch/arm/kernel/asm-offsets.c:14:
path_to_kernel/arch/arm/include/asm/tlbflush.h:215:2: Fehler: #error Unknown TLB model
path_to_kernel/arch/arm/include/asm/tlbflush.h:577:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from include/linux/mm.h:44:0,
                 from arch/arm/kernel/asm-offsets.c:14:
path_to_kernel/arch/arm/include/asm/pgtable.h:379:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from path_to_kernel/arch/arm/include/asm/cacheflush.h:15:0,
                 from arch/arm/kernel/asm-offsets.c:16:
path_to_kernel/arch/arm/include/asm/glue-cache.h:129:2: Fehler: #error Unknown cache maintenance model
In file included from path_to_kernel/arch/arm/include/asm/cacheflush.h:17:0,
                 from arch/arm/kernel/asm-offsets.c:16:
path_to_kernel/arch/arm/include/asm/cachetype.h:26:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/cachetype.h:30:7: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from arch/arm/kernel/asm-offsets.c:16:0:
path_to_kernel/arch/arm/include/asm/cacheflush.h:215:7: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
path_to_kernel/arch/arm/include/asm/cacheflush.h:217:7: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
In file included from arch/arm/kernel/asm-offsets.c:17:0:
path_to_kernel/arch/arm/include/asm/glue-df.h:107:2: Fehler: #error Unknown data abort handler type
In file included from arch/arm/kernel/asm-offsets.c:18:0:
path_to_kernel/arch/arm/include/asm/glue-pf.h:54:2: Fehler: #error Unknown prefetch abort handler type
make[1]: *** [arch/arm/kernel/asm-offsets.s] Fehler 1
make: *** [prepare0] Fehler 2

But well. I also can't make a lot of meaning out of this... So still looking for help on how to get myself a kernel compiled
 

kaefert

Senior Member
Nov 14, 2007
513
190
Vienna
Okey, big progress! I found this string somewhere:
Linux version 3.0.8-perf ([email protected]) (gcc version 4.4.3 (GCC))
#1 PREEMPT Tue Mar 6 17:48:17 CST 2012

This told me, that this kernel can be built with gcc version 4.4

I looked into ubuntu, and found this version is also available in the repository. So I removed the standard version which is 4.6 and installed 4.4 --> now the kernel seems to build. I'm gonna leave the PC runnign over night and look in the morning at the results.

If someone wants to redo my steps:
the ubuntu package you need is "gcc-4.4-arm-linux-gnueabi"
be sure to remove all other arm gcc packages, and then set a link:
Code:
ln /usr/bin/arm-linux-gnueabi-gcc-4.4 /usr/bin/arm-linux-gnueabi-gcc

EDIT: so the "make" command finished without any error messages. So next step is to find out how to pack the builded kernel into a boot.img to deploy it to the device.
 
Last edited:

kaefert

Senior Member
Nov 14, 2007
513
190
Vienna
Okey! So I finshed the whole process! I am now able to build and deploy the 3.0.8 kernel sources released by huawei!

I will document the steps for reproducability:

-) Install and link the arm gcc version 4.4
Code:
sudo apt-get install gcc-4.4-arm-linux-gnueabi
sudo ln /usr/bin/arm-linux-gnueabi-gcc-4.4 /usr/bin/arm-linux-gnueabi-gcc

-) Download the Kernel sources from
http://www.huaweidevice.com/worldwide/technicaIndex.do?method=gotoProductSupport&productId=3834&tb=1

-) Unpack Kernel and cd into it.

-) Get the original Kernel config from your device like this:
Code:
adb pull /proc/config.gz
then unpack it into the Kernel directory and rename it to ".config"

If you want, you can adjust it with any texteditor, or by calling "make menuconfig" but for this you should first export the variables below so that make knows you want to build for the arm platform, not for x86

-) finally build the Kernel like this:
Code:
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
make

-) I found the easiest way to deploy the built kernel is the following:
install the package abootimg
Code:
sudo apt-get install abootimg

and then make a copy of some preexisting boot.img (look at your device either with the pink screen mode or with certain custom ROMs that are not built as "production build" you can directly see the folder /.cust_backup/image

warning, this copy will be directly edited, so be sure to have another copy of the same image somewhere else.
Okey, now replace the path to your built kernel and the path to your boot.img and run:
Code:
abootimg -u path/to/bootimg/boot.img -k /path/to/kernel/arch/arm/boot/zImage

thats it, this replaces the kernel from this boot.img with your newly built kernel and can be written to folder /.cust_backup/image (be sure to keep a backup of your previous boot.img) and then reboot your device - voilà!

EDIT: This deployment method does not include deployment of kernel modules, for that you need more complex deployment methods as for example described here:
http://forum.xda-developers.com/showthread.php?t=916198

For making a custom kernel just adjust the sources between download/unpacking and building :)
 
Last edited:

Decheah

Member
Apr 21, 2011
10
0
thanks for your effort mate.... good job!

a noob question, what is kernel for?? mind to explain for me??? I've flash to MIUI 4.03, rooted, overclocked, but except kernel. any difference?
 
Last edited:

kaefert

Senior Member
Nov 14, 2007
513
190
Vienna
thanks for your effort mate.... good job!

a noob question, what is kernel for?? mind to explain for me??? I've flash to MIUI 4.03, rooted, overclocked, but except kernel. any difference?

Well.. its the inner core of a linux operating system, such as android. originally linux = the kernel, but since people are lazy whole distros are for simplification just called linux.
 
  • Like
Reactions: desalesouche

yoda89

Member
Mar 26, 2010
11
1
Hi kaefert,

I'd like to work on the U8860's kernel but I don't have the .config file.
Could you give me the config.gz file please ?

Thanks
 

kaefert

Senior Member
Nov 14, 2007
513
190
Vienna
I've managed to create a Kernel that works with B919 based ROMs, but the camera is non functional..
If anybody wanna try it, get it here: http://kaefert.is-a-geek.org/huawei_honor/boot_MIUI_Germany_2-7-13_rvoix.img
UPDATE: I've just found that not only the camera doesn't work but also wifi doesn't work with this custom kernel in B919 based ROMs

Errors when trying to use the camera:
Code:
...
17:00:13.774 Error QualcommCameraHardware 133  Load libhdr.so success
...
17:00:14.992 Error HwCamera 3053  Got oom exception
17:00:14.992 Error HwCamera 3053  java.lang.ClassNotFoundException: com.huawei.hwextcamera.HwExtCamera
17:00:14.992 Error HwCamera 3053  	at java.lang.Class.classForName(Native Method)
17:00:14.992 Error HwCamera 3053  	at java.lang.Class.forName(Class.java:217)
17:00:14.992 Error HwCamera 3053  	at java.lang.Class.forName(Class.java:172)
17:00:14.993 Error HwCamera 3053  	at com.android.hwcamera.HwCamera.getHwExtCameraInstance(HwCamera.java:49)
17:00:14.993 Error HwCamera 3053  	at com.android.hwcamera.HwCamera.<init>(HwCamera.java:44)
17:00:14.993 Error HwCamera 3053  	at com.android.hwcamera.CameraHolder.open(CameraHolder.java:136)
17:00:14.993 Error HwCamera 3053  	at com.android.hwcamera.Camera.openCameraDevice(Camera.java:2089)
17:00:14.993 Error HwCamera 3053  	at com.android.hwcamera.CameraAppImpl$OpenCameraHandler.handleMessage(CameraAppImpl.java:112)
17:00:14.993 Error HwCamera 3053  	at android.os.Handler.dispatchMessage(Handler.java:99)
17:00:14.993 Error HwCamera 3053  	at android.os.Looper.loop(Looper.java:137)
17:00:14.993 Error HwCamera 3053  	at android.os.HandlerThread.run(HandlerThread.java:60)
17:00:14.993 Error HwCamera 3053  Caused by: java.lang.NoClassDefFoundError: com/huawei/hwextcamera/HwExtCamera
17:00:14.993 Error HwCamera 3053  	... 11 more
17:00:14.993 Error HwCamera 3053  Caused by: java.lang.ClassNotFoundException: com.huawei.hwextcamera.HwExtCamera
17:00:14.993 Error HwCamera 3053  	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
17:00:14.993 Error HwCamera 3053  	at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
17:00:14.994 Error HwCamera 3053  	at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
17:00:14.994 Error HwCamera 3053  	... 11 more
17:00:14.994 Warning System.err 3053  java.lang.ClassNotFoundException: com.huawei.hwextcamera.HwExtCamera
17:00:14.994 Warning System.err 3053  	at java.lang.Class.classForName(Native Method)
17:00:14.994 Warning System.err 3053  	at java.lang.Class.forName(Class.java:217)
17:00:15.053 Warning System.err 3053  	at java.lang.Class.forName(Class.java:172)
17:00:15.053 Warning System.err 3053  	at com.android.hwcamera.HwCamera.getHwExtCameraInstance(HwCamera.java:49)
17:00:15.053 Warning System.err 3053  	at com.android.hwcamera.HwCamera.<init>(HwCamera.java:44)
17:00:15.053 Warning System.err 3053  	at com.android.hwcamera.CameraHolder.open(CameraHolder.java:136)
17:00:15.053 Warning System.err 3053  	at com.android.hwcamera.Camera.openCameraDevice(Camera.java:2089)
17:00:15.053 Warning System.err 3053  	at com.android.hwcamera.CameraAppImpl$OpenCameraHandler.handleMessage(CameraAppImpl.java:112)
17:00:15.053 Warning System.err 3053  	at android.os.Handler.dispatchMessage(Handler.java:99)
17:00:15.053 Warning System.err 3053  	at android.os.Looper.loop(Looper.java:137)
17:00:15.053 Warning System.err 3053  	at android.os.HandlerThread.run(HandlerThread.java:60)
17:00:15.053 Warning System.err 3053  Caused by: java.lang.NoClassDefFoundError: com/huawei/hwextcamera/HwExtCamera
17:00:15.053 Warning System.err 3053  	... 11 more
17:00:15.053 Warning System.err 3053  Caused by: java.lang.ClassNotFoundException: com.huawei.hwextcamera.HwExtCamera
17:00:15.053 Warning System.err 3053  	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
17:00:15.054 Warning System.err 3053  	at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
17:00:15.054 Warning System.err 3053  	at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
17:00:15.054 Warning System.err 3053  	... 11 more
17:00:15.054 Error QualcommCamera 133  Qchar* android::get_parameters(camera_device*): E
17:00:15.054 Verbose QualcommCameraHardware 133  getParameters: EX
17:00:15.054 Error QualcommCamera 133  get_parameters X
17:00:15.054 Error QualcommCamera 133  Qvoid android::put_parameters(camera_device*, char*): E
17:00:15.054 Error QualcommCamera 133  put_parameters X
17:00:15.054 Info Camera 3053  [Flow] Camera opened! [email protected]
17:00:15.267 Error QualcommCamera 133  Qchar* android::get_parameters(camera_device*): E
17:00:15.267 Verbose QualcommCameraHardware 133  getParameters: EX
17:00:15.267 Error QualcommCamera 133  get_parameters X
17:00:15.267 Error QualcommCamera 133  Qvoid android::put_parameters(camera_device*, char*): E
17:00:15.293 Error QualcommCamera 133  put_parameters X
17:00:15.293 Error QualcommCamera 133  Qchar* android::get_parameters(camera_device*): E
17:00:15.294 Verbose QualcommCameraHardware 133  getParameters: EX
...
 
Last edited:

kaefert

Senior Member
Nov 14, 2007
513
190
Vienna
something that might come in handy for people wanting to do kernel developing on the huawei honor (I needed it right now and thought I'll document it here for others)

You probably know that the boot.img is to be placed in
/.cust_backup/ or spoken device wise /dev/block/mmcblk0p1

in some ROMs after the boot has completed this is mounted read only. In this case you can remount it in write mode like this:
Code:
mount -o rw,remount /dev/block/mmcblk0p1 /.cust_backup/

In other cases its not mounted at all, then you can mount it directly as in readwrite mode like this:
Code:
mount -w -t vfat /dev/block/mmcblk0p1 /.cust_backup/
 
Sep 29, 2011
30
1
34
Mumbai
Couldn't find package gcc-4.4-arm-linux-gnueabi

Okey! So I finshed the whole process! I am now able to build and deploy the 3.0.8 kernel sources released by huawei!

Hi kaefert
I am using ubuntu 10.04 and When I execute command
Code:
sudo apt-get install gcc-4.4-arm-linux-gnueabi
It gives me an message mentioned below now How do I proceed please guide.
Code:
[B]E: Couldn't find package gcc-4.4-arm-linux-gnueabi[/B]

Thank You.
 
Last edited:

kaefert

Senior Member
Nov 14, 2007
513
190
Vienna
I will not help / cooperate with forum terrorists that full-quote extremly long posts. This kind of behaviour distroys any readabilty of this forum thread
UPDATE: I will give you a more meaningful answer if you edit your post and only quote the part that you are talking about.
 
Last edited:

kaefert

Senior Member
Nov 14, 2007
513
190
Vienna
Okey.. well when I wrote up this guide, I used Ubuntu 11.04 = Natty Narwhal.

There is a site from ubuntu on http://packages.ubuntu.com/
And when you search this site for the package I mentioned, you will be lead to this page:
http://packages.ubuntu.com/natty/gcc-4.4-arm-linux-gnueabi
where you can see that this package is included in [natty] [oneiric] [precise] [quantal]

You mentioned you are using Ubuntu 10.04 LTS = Lucid Lynx --> Which is still supported by Ubuntu since its LTS.. But as you might have guessed: I am not Ubuntu staff ;) So just get a more recent Linux distribution. I would recommend Linux Mint 13 with Cinnamon desktop.
 

limzm

Senior Member
Dec 2, 2008
586
176
Hey kaefert,

I am actually learning and trying to build the kernel myself.
I've had success but however, the zImage output that results is actually larger than the one in the boot.img of my phone.

I can't use the abootimg to replace the kernel because of it.

Did you encountered this problem too? Any reasons why? :confused::confused:
 

limzm

Senior Member
Dec 2, 2008
586
176
yes the image can vary in size, but that shouldn't prevent abootimg from working..?

This is the error I get when I try to use abootimg:

Code:
[email protected] ~/Desktop/boot $ abootimg -u boot.img -k ~/android/kernel/kernel_u8860/arch/arm/boot/zImage
reading kernel from /home/zm/android/kernel/kernel_u8860/arch/arm/boot/zImage
[B]boot.img: updated is too big for the Boot Image (5038080 vs 4919296 bytes)[/B]
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Okey! So I finshed the whole process! I am now able to build and deploy the 3.0.8 kernel sources released by huawei!

    I will document the steps for reproducability:

    -) Install and link the arm gcc version 4.4
    Code:
    sudo apt-get install gcc-4.4-arm-linux-gnueabi
    sudo ln /usr/bin/arm-linux-gnueabi-gcc-4.4 /usr/bin/arm-linux-gnueabi-gcc

    -) Download the Kernel sources from
    http://www.huaweidevice.com/worldwide/technicaIndex.do?method=gotoProductSupport&productId=3834&tb=1

    -) Unpack Kernel and cd into it.

    -) Get the original Kernel config from your device like this:
    Code:
    adb pull /proc/config.gz
    then unpack it into the Kernel directory and rename it to ".config"

    If you want, you can adjust it with any texteditor, or by calling "make menuconfig" but for this you should first export the variables below so that make knows you want to build for the arm platform, not for x86

    -) finally build the Kernel like this:
    Code:
    export ARCH=arm
    export SUBARCH=arm
    export CROSS_COMPILE=arm-linux-gnueabi-
    make

    -) I found the easiest way to deploy the built kernel is the following:
    install the package abootimg
    Code:
    sudo apt-get install abootimg

    and then make a copy of some preexisting boot.img (look at your device either with the pink screen mode or with certain custom ROMs that are not built as "production build" you can directly see the folder /.cust_backup/image

    warning, this copy will be directly edited, so be sure to have another copy of the same image somewhere else.
    Okey, now replace the path to your built kernel and the path to your boot.img and run:
    Code:
    abootimg -u path/to/bootimg/boot.img -k /path/to/kernel/arch/arm/boot/zImage

    thats it, this replaces the kernel from this boot.img with your newly built kernel and can be written to folder /.cust_backup/image (be sure to keep a backup of your previous boot.img) and then reboot your device - voilà!

    EDIT: This deployment method does not include deployment of kernel modules, for that you need more complex deployment methods as for example described here:
    http://forum.xda-developers.com/showthread.php?t=916198

    For making a custom kernel just adjust the sources between download/unpacking and building :)
    5
    EDIT: For the Guide scroll down to post number 4
    http://forum.xda-developers.com/showpost.php?p=23916656&postcount=4

    Hi there!

    I would like to get started with building kernels for my newly bought Huawei Honour U8860

    My motivation comes from the desire to have this app running on my device, which apparently needs some kernel patches to be applied, since I'm missing the devicefiles called /dev/voc* --> http://code.google.com/p/rvoix/
    The Kernel patches can be found here: http://code.google.com/p/rvoix/source/browse/#svn/branches/snapdragon/kernel

    What I found on my own is this:
    http://source.android.com/source/building-kernels.html

    But I have no idea what kernel to start from, the list of devices they have over there
    http://source.android.com/source/building-devices.html
    have names like: "maguro, panda, wingray, crespo, passion, sapphire, dream" and I have no idea what they mean, except for those few names that are explained on the same page.

    I am currently running a rooted Android 4.0.3 that I gained by following this guide:
    http://forum.xda-developers.com/showpost.php?p=22688341&postcount=53

    I would really apreciate any help anyone can give me! Thanks in advance

    EDIT: okey!! I found a download from huawei here
    http://www.huaweidevice.com/worldwide/technicaIndex.do?method=gotoProductSupport&productId=3834
    Thats called: "open source-kernel-3.0.8-U8860-IcecreamSandwich"
    http://www.huaweidevice.com/worldwi...=toDownloadFile&flay=software&softid=NDQwNDc=
    So I will try to work with this and get it build and deployed on my device. Thats gonna be a lot of work, will report back when I finished or aborted my mission frustrated.

    EDIT2:
    Okey, this is really a hard thing if you don't know what you're doing, like me... I think I'm gonna give up, all these config options (i stopped reading after the first 50 and just hold down the enter key for agreeing to the default), and in the end some strange errors:
    ..._kernel/arch/arm/include/asm/irqflags.h:11:5: warning: "__LINUX_ARM_ARCH__" is not defined
    error, forbidden warning: irqflags.h:11
    make[1]: *** [arch/arm/kernel/asm-offsets.s] Fehler 1
    make: *** [prepare0] Fehler 2

    About my initial motivation for compiling myself a kernel:
    There are a lot of call recording apps, though most only record from the microphone, and therefore only record a weak shadow of the other side of the conversation.

    For the moment I stick with this one:
    https://play.google.com/store/apps/details?id=androidlab.allcall

    When I tested it with a few testcalls, it seemed to me that the other side is also recorded, even though it gave me an error that it can't record the other side. However, now after a few days real usage I'm not so sure if it truely records the other side, or if this is only this shadow that comes in through the mic. It is hardly understandable in the recordings most of the times now.

    So this alternative app is at least an interim solution, but I still wan't to get myself a kernel compiled, and once done try to apply or adept the kernel patches from http://code.google.com/p/rvoix/ to this kernel
    3
    Okey. So about building this kernel from huawei. From googling a bit I learned that this error
    Code:
    ...arch/arm/include/asm/irqflags.h:11:5: warning: "__LINUX_ARM_ARCH__" is not defined
    error, forbidden warning: irqflags.h:11
    make[1]: *** [arch/arm/kernel/asm-offsets.s] Fehler 1
    make: *** [prepare0] Fehler 2
    stems from problems with the toolchain used for building

    But first let me document a bit how I got this far:

    1.) download the kernel sources from:
    http://www.huaweidevice.com/worldwide/technicaIndex.do?method=gotoProductSupport&productId=3834&tb=0

    2.) get the kernel config from the device, by connecting it via usb, turning on the usb debugging on it and then using
    Code:
    adb pull /proc/config.gz
    to fetch it. unpack it and put it into the same directory as the extracted kernel, but by the name ".config"
    --> learned this one from http://mjanja.co.ke/2011/06/compiling-custom-kernels-on-the-huawei-u8150/

    3.) Download and extract an android NDK

    4.) open a terminal and set up a few environment variables:
    Code:
    export ARCH=arm
    export SUBARCH=arm
    export CROSS_COMPILE=/path_where_i_extracted/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-

    5.) simply call make. I also tried to run "make menuconfig" before running make, since a few sources stated it would be neccecary, but that didn't change the error I got.

    This guy here states that 7b is not good and 5c is the way to go, but this error kept the same.
    http://www.android-hilfe.de/root-ha...deos-x3/172743-kernel-selbst-kompilieren.html

    So I looked into ubuntu and found that there is also an arm gcc toolchain, and got it by simply installing this package:
    Code:
    sudo apt-get install gcc-arm-linux-gnueabi

    and since the system puts its stuff all into the proper path so you can use it easily just call
    Code:
    export CROSS_COMPILE=arm-linux-gnueabi-

    and afterwards again "make" and I got a new and different output:
    Code:
      CHK     include/linux/version.h
      CHK     include/generated/utsrelease.h
    make[1]: »include/generated/mach-types.h« ist bereits aktualisiert.
      CC      kernel/bounds.s
      GEN     include/generated/bounds.h
      CC      arch/arm/kernel/asm-offsets.s
    In file included from include/linux/irqflags.h:15:0,
                     from path_to_kernel/arch/arm/include/asm/system.h:61,
                     from path_to_kernel/arch/arm/include/asm/bitops.h:27,
                     from include/linux/bitops.h:22,
                     from include/linux/kernel.h:17,
                     from include/linux/sched.h:55,
                     from arch/arm/kernel/asm-offsets.c:13:
    path_to_kernel/arch/arm/include/asm/irqflags.h:11:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from path_to_kernel/arch/arm/include/asm/bitops.h:27:0,
                     from include/linux/bitops.h:22,
                     from include/linux/kernel.h:17,
                     from include/linux/sched.h:55,
                     from arch/arm/kernel/asm-offsets.c:13:
    path_to_kernel/arch/arm/include/asm/system.h:123:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    path_to_kernel/arch/arm/include/asm/system.h:129:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    path_to_kernel/arch/arm/include/asm/system.h:130:3: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    path_to_kernel/arch/arm/include/asm/system.h:136:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    path_to_kernel/arch/arm/include/asm/system.h:140:35: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from path_to_kernel/arch/arm/include/asm/bitops.h:27:0,
                     from include/linux/bitops.h:22,
                     from include/linux/kernel.h:17,
                     from include/linux/sched.h:55,
                     from arch/arm/kernel/asm-offsets.c:13:
    path_to_kernel/arch/arm/include/asm/system.h: In Funktion »__xchg«:
    path_to_kernel/arch/arm/include/asm/system.h:274:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    path_to_kernel/arch/arm/include/asm/system.h:281:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from path_to_kernel/arch/arm/include/asm/bitops.h:27:0,
                     from include/linux/bitops.h:22,
                     from include/linux/kernel.h:17,
                     from include/linux/sched.h:55,
                     from arch/arm/kernel/asm-offsets.c:13:
    path_to_kernel/arch/arm/include/asm/system.h: Auf höchster Ebene:
    path_to_kernel/arch/arm/include/asm/system.h:351:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from include/linux/bitops.h:22:0,
                     from include/linux/kernel.h:17,
                     from include/linux/sched.h:55,
                     from arch/arm/kernel/asm-offsets.c:13:
    path_to_kernel/arch/arm/include/asm/bitops.h:217:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from include/linux/swab.h:6:0,
                     from include/linux/byteorder/little_endian.h:12,
                     from path_to_kernel/arch/arm/include/asm/byteorder.h:21,
                     from include/asm-generic/bitops/le.h:5,
                     from path_to_kernel/arch/arm/include/asm/bitops.h:308,
                     from include/linux/bitops.h:22,
                     from include/linux/kernel.h:17,
                     from include/linux/sched.h:55,
                     from arch/arm/kernel/asm-offsets.c:13:
    path_to_kernel/arch/arm/include/asm/swab.h:25:28: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from path_to_kernel/arch/arm/include/asm/thread_info.h:16:0,
                     from include/linux/thread_info.h:53,
                     from include/linux/preempt.h:9,
                     from include/linux/spinlock.h:50,
                     from include/linux/seqlock.h:29,
                     from include/linux/time.h:8,
                     from include/linux/timex.h:56,
                     from include/linux/sched.h:57,
                     from arch/arm/kernel/asm-offsets.c:13:
    path_to_kernel/arch/arm/include/asm/fpstate.h:32:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from include/linux/spinlock_up.h:8:0,
                     from include/linux/spinlock.h:89,
                     from include/linux/seqlock.h:29,
                     from include/linux/time.h:8,
                     from include/linux/timex.h:56,
                     from include/linux/sched.h:57,
                     from arch/arm/kernel/asm-offsets.c:13:
    path_to_kernel/arch/arm/include/asm/processor.h:88:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    path_to_kernel/arch/arm/include/asm/processor.h:108:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from include/linux/spinlock.h:387:0,
                     from include/linux/seqlock.h:29,
                     from include/linux/time.h:8,
                     from include/linux/timex.h:56,
                     from include/linux/sched.h:57,
                     from arch/arm/kernel/asm-offsets.c:13:
    path_to_kernel/arch/arm/include/asm/atomic.h:30:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from include/linux/time.h:9:0,
                     from include/linux/timex.h:56,
                     from include/linux/sched.h:57,
                     from arch/arm/kernel/asm-offsets.c:13:
    include/linux/math64.h: In Funktion »div_u64_rem«:
    include/linux/math64.h:51:15: Fehler: »__LINUX_ARM_ARCH__« nicht deklariert (erste Benutzung in dieser Funktion)
    include/linux/math64.h:51:15: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet
    In file included from include/linux/mm_types.h:15:0,
                     from include/linux/sched.h:64,
                     from arch/arm/kernel/asm-offsets.c:13:
    path_to_kernel/arch/arm/include/asm/page.h: Auf höchster Ebene:
    path_to_kernel/arch/arm/include/asm/page.h:116:2: Fehler: #error Unknown user operations model
    In file included from path_to_kernel/arch/arm/include/asm/pgtable.h:27:0,
                     from include/linux/mm.h:44,
                     from arch/arm/kernel/asm-offsets.c:14:
    path_to_kernel/arch/arm/include/asm/tlbflush.h:215:2: Fehler: #error Unknown TLB model
    path_to_kernel/arch/arm/include/asm/tlbflush.h:577:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from include/linux/mm.h:44:0,
                     from arch/arm/kernel/asm-offsets.c:14:
    path_to_kernel/arch/arm/include/asm/pgtable.h:379:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from path_to_kernel/arch/arm/include/asm/cacheflush.h:15:0,
                     from arch/arm/kernel/asm-offsets.c:16:
    path_to_kernel/arch/arm/include/asm/glue-cache.h:129:2: Fehler: #error Unknown cache maintenance model
    In file included from path_to_kernel/arch/arm/include/asm/cacheflush.h:17:0,
                     from arch/arm/kernel/asm-offsets.c:16:
    path_to_kernel/arch/arm/include/asm/cachetype.h:26:5: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    path_to_kernel/arch/arm/include/asm/cachetype.h:30:7: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from arch/arm/kernel/asm-offsets.c:16:0:
    path_to_kernel/arch/arm/include/asm/cacheflush.h:215:7: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    path_to_kernel/arch/arm/include/asm/cacheflush.h:217:7: Warnung: »__LINUX_ARM_ARCH__« ist nicht definiert [-Wundef]
    In file included from arch/arm/kernel/asm-offsets.c:17:0:
    path_to_kernel/arch/arm/include/asm/glue-df.h:107:2: Fehler: #error Unknown data abort handler type
    In file included from arch/arm/kernel/asm-offsets.c:18:0:
    path_to_kernel/arch/arm/include/asm/glue-pf.h:54:2: Fehler: #error Unknown prefetch abort handler type
    make[1]: *** [arch/arm/kernel/asm-offsets.s] Fehler 1
    make: *** [prepare0] Fehler 2

    But well. I also can't make a lot of meaning out of this... So still looking for help on how to get myself a kernel compiled
    3
    Okey, big progress! I found this string somewhere:
    Linux version 3.0.8-perf ([email protected]) (gcc version 4.4.3 (GCC))
    #1 PREEMPT Tue Mar 6 17:48:17 CST 2012

    This told me, that this kernel can be built with gcc version 4.4

    I looked into ubuntu, and found this version is also available in the repository. So I removed the standard version which is 4.6 and installed 4.4 --> now the kernel seems to build. I'm gonna leave the PC runnign over night and look in the morning at the results.

    If someone wants to redo my steps:
    the ubuntu package you need is "gcc-4.4-arm-linux-gnueabi"
    be sure to remove all other arm gcc packages, and then set a link:
    Code:
    ln /usr/bin/arm-linux-gnueabi-gcc-4.4 /usr/bin/arm-linux-gnueabi-gcc

    EDIT: so the "make" command finished without any error messages. So next step is to find out how to pack the builded kernel into a boot.img to deploy it to the device.
    2
    thanks for the guide!

    you're welcome. But please for the future, if you don't have anything to add but to thank some poster before you for his post, use the thanks button instead of posting a reply!