[Q&A] Kernel-Building for Huawei Ascent P6

Search This thread

Hotfingers

Senior Member
Jul 5, 2012
341
202
Roodepoort
Hi all,

I'd like to build the kernel, but I'm not winning.

I'm new to this kind of development, and am looking for some advice on how to get going..

My first thing is -After setting up Ubuntu, and downloading the source, I and the toolchain and doing sudo get The TheWorld... I can't get it to compile.
(Some error about an unterminated string constant when I try the make command..)

The other thing is how yo get the ramdisk out of boot.img

Thanks

Sent from my HUAWEI P6-U06 using XDA Free mobile app
 

surdu_petru

Recognized Contributor
Feb 3, 2010
7,560
23,795
Paris
Hi all,

I'd like to build the kernel, but I'm not winning.

I'm new to this kind of development, and am looking for some advice on how to get going..

My first thing is -After setting up Ubuntu, and downloading the source, I and the toolchain and doing sudo get The TheWorld... I can't get it to compile.
(Some error about an unterminated string constant when I try the make command..)

The other thing is how yo get the ramdisk out of boot.img

Thanks

Sent from my HUAWEI P6-U06 using XDA Free mobile app

Hi!

First , you shouldn't use sudo when you want to build kernel .

You can unpack repack boot.img with a tool by @dsixda

Good luck!

Edit :

If you can post here your build error, maybe I can help you more ...
 
Last edited:
  • Like
Reactions: Hotfingers

Hotfingers

Senior Member
Jul 5, 2012
341
202
Roodepoort
trouble with toolchain

Hi all, me again.

Sorry that I'm slow, but I don't get too much time to play with android stuff.
I've got everything set up now (as described in the 1st post), but I get an error in the toolchain when I try to run

make clean && make mrproper

I have already run this bit of code to set all the variables correclty...
Code:
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=/media/david/Android_Dev_Data/android/kernel/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-

export PATH=$PATH:/media/david/Android_Dev_Data/android/kernel/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-


So now I get this error below (something about an Unterminated quoted string in "arm-linux-androideabi-gcc"...
Code:
/media/david/Android_Dev_Data/android/kernel/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: 4: /media/david/Android_Dev_Data/android/kernel/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Syntax error: Unterminated quoted string
Building with KERNELRELEASE = 3.0.8
  CLEAN   .tmp_versions
/media/david/Android_Dev_Data/android/kernel/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: 4: /media/david/Android_Dev_Data/android/kernel/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Syntax error: Unterminated quoted string
Building with KERNELRELEASE = 3.0.8
  CLEAN   scripts/basic
  CLEAN   scripts/kconfig
  CLEAN   scripts
  CLEAN   include/config include/generated arch/arm/include/generated
  CLEAN   .config .config.old include/linux/version.h

Does anyone have any idea what I've done wrong..?

Thanks,
Hotfingers
 

Hotfingers

Senior Member
Jul 5, 2012
341
202
Roodepoort
Maaybe we can get a new kernel

Hi all,

Can some-one try applying a patch from https://www.kernel.org/pub/linux/kernel/v3.0/incr/ to our 3.0.8 kernel?
I wanted to do this, but I can't even get the kernel to compile.

My friend has a Samsung, and for his phone all kernels 3.0.x have the same ramdisk. So maybe we can even get 3.0.101 kernel by just applying patches to the 3.0.8 code that was released by Huawei..?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Hello !


    Kernel-Build from source




    Because I was able to build the Kernel from Huawei's source(3.0.8) for Huawei Ascend P6 ,
    I want to open a Topic for Questions and Answers ! (like Surdu Petru did for his CM)

    Post Questions and Ideas about this topic here :

    Thanks !



    regards,
    raolleel
    2
    To build the kernel you need the source from huawei:

    Chinese : http://download-c.huawei.com/download/downloadCenter?downloadId=16381&siteCode=cn (3.0.8) [B112]
    International: http://consumer.huawei.com/en/support/downloads/index.htm?id=7583(3.0.8) [sorry site is not awaliable (i think huawei has some problems with its website)]

    You also need the right toolchain : https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6 [B112]

    Little Tutorial to compile the kernel (Linux):

    extract your source-file and your toolchain (only the 4.6 toolchain works)

    open a terminal and cd into the source

    now type:

    now you have your zImage of the kernel

    International: http://download-c.huawei.com/download/downloadCenter?downloadId=17788&siteCode=worldwide
    2
    It works... I finally decided to use fastboot flash boot and it booted. Also the procedure I sent you via PM works too... I'll send you the zip file I used, probably it's a more user friendly way to update a kernel.

    This is great, I'll soon start a kernel test as well. Been itching since I builded kernels for the 2011 Sony phones.

    Good work!

    Sent from my P6-U06 using Tapatalk
    1
    To build the kernel you need the source from huawei:

    Chinese : http://download-c.huawei.com/download/downloadCenter?downloadId=16381&siteCode=cn (3.0.8) [B111]
    International: http://download-c.huawei.com/download/downloadCenter?downloadId=17788&siteCode=worldwide) (3.08) [B111]

    You also need the right toolchain : https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6

    Little Tutorial to compile the kernel (Linux):

    extract your source-file and your toolchain (only the 4.6 toolchain works)

    open a terminal and cd into the source

    now type:
    export ARCH=arm (select architecture of your phone)
    export SUBARCH=arm (select architecture of your phone)
    export CROSS_COMPILE=[path to your toolchain]/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi- (tell the Kernel, where your compiler is)
    make clean && make mrproper (to clean the source)
    make hisi_k3v2oem1_defconfig ARCH=arm (to load the default config of your phone)
    make menuconfig (configue the Kernel [dont change settings you don't know, or your kernel will not work)
    make -j[number of your cpu-cores+1] ARCH=arm (This will start the process .. will take some time)
    make ARCH=arm zImage

    now you have your zImage of the kernel
    1
    So, can you build a custom kernel for this phone and we would get much better perfomance? Just asking.

    Much better .. not at this point ... but in the future ... maybee

    I just started to get an idear how this phone really is ^^

    At first, I was a little bit confused of the rom/kernel-history:

    Code:
    B107 International 	4.2.2	-> 	3.0.8-0769-g8cca155
    B108 International	4.2.2 	-> 	3.0.8-0772-g83e47c3 
    B109SP02 International	4.2.2	-> 	3.0.8-0779-g33784a0 
    B111 International	4.2.2	->	3.0.8-0780-g62cb956
    B112 International	4.2.2	->	3.0.8-0780-g62cb956
    B114 International	4.2.2	-> 	3.0.8-0781-g88bfdc2
    B118 International	4.2.2	-> 	3.0.8-00788-g5d19ba2
    B119 International	4.2.2	-> 	3.0.8-00794-g8845b56
    B125 International	4.2.2	-> 	3.0.8-00795-g35bf84a
    B109SP02 China 		4.2.2	-> ? 	 
    B112SP01 China 		4.2.2	-> ?	
    B115 China 	 	4.2.2	->	3.0.8-0802-g081004a
    B116SP01 China  	4.2.2	-> 	3.0.8-00821-g6fd9b1d
    B117SP01 China  	4.2.2	-> 	3.0.8-00829-gb6fffbf
    B118 China 	 	4.2.2	-> 	3.0.8-00844

    Everyone talks about that there are many different kernels, and that we only have the source of B111, but ... for me it sounds like there is only the kernel 3.0.8 (like we have the source) ... the code after the - is only a code to tell, when the kernel was builded/who builded the kernel

    The Source is the Linux/Android-Kernel 3.0.8 (no subversion nothing added)

    So a Kernel build with this source should work on every Firmware with the 3.0.8-kernel.

    But we have another Problem.

    To get the zImage working, you need the Boot.img ...

    OK you can extract it via Huawei-Update-Extractor, but "abootimg" tells:

    Code:
    B111/BOOT.img: no Android Magic Value
    B111/BOOT.img: not a valid Android Boot Image.
    
    B118China/09.boot.img: no Android Magic Value
    B118China/09.boot.img: not a valid Android Boot Image.
    
    B125/09.boot.img: no Android Magic Value
    B125/09.boot.img: not a valid Android Boot Image.

    So at this point we can't put a zImage into boot.img because of wrong filesystem (I'll have a idear how to get out of this trouble, but I need some time)

    Also there is a question, can't we simply flash 07.fastboot.img (from B118CH) over the B125International-Rom (to get the "bootloader unlocked")
    We should be able to do this with dd, or am I wrong.
    Some people told that they are able to flash the B125 without loosing the "unlocked-BL", so B125 must be able to boot.

    Correct me if I'm wrong.

    I'm only trying to get kernel-developing started ^^