Jump to content

[HOWTO] Build and update kernel using CWM


Guest schmatzler

Recommended Posts

Guest schmatzler

I finally found out how to build a kernel and flash it using CWM. Here is a step by step guide that tells you how to do it. As a starting point, I assume the device is not rooted and comes directly out of the box.

First, you need the device and an SD card. Make a folder called "image" on the card. This folder is used for flashing ClockworkMod - download it from here, extract the image.bin into the image folder and then go to the settings of Android and use the SD flash method to install it.

CWM is installed now - fine. Let's move on to getting root access on the device. Copy this zip file onto your SD card.

After that, reboot the device and hold the Power and VOL Down buttons simultaneously. CWM will start up - use the "Install zip file" option to install the zip file and - voila - your device is rooted now.

Now on to the real stuff - to be able to install a new kernel we have to get the image of the stock kernel out of the device first - in order to do so, make a full Backup in CWM - it is copying a file called "boot.img" onto your SD card.

This boot.img contains the actual kernel and the ramdisk. We have to unpack both of them using a script called split_bootimg.pl - it throws out two files: boot.img-kernel.gz and boot.img-ramdisk.cpio.gz. Make a backup of both of them in case anything goes wrong!

If you already compiled the kernel you just have to do the following easy steps:

Take the boot.img-ramdisk.cpio.gz and your own zImage and combine them into a new boot.img which can be flashed using CWM's restore method. You need a tool called mkbootimg for that. Utilize it using the following command:

./mkbootimg --kernel zImage --ramdisk boot.img-ramdisk.cpio.gz --base 0x02600000 -o boot.img

Done. Copy the new boot.img onto your SD and overwrite the old one. Make sure you adjust the MD5 sums so CWM doesn't complain and flash it using the restore method.

I followed these simple instructions to build my own kernel:

http://forum.xda-developers.com/showthread.php?t=1686310

Link to comment
Share on other sites

Guest schmatzler

Sadly, the camera driver is missing in the kernel source.

I tried patching the Blade's camera driver into it, but nothing happens with that either:

https://github.com/K...0157729d96f6db7

So it looks like we can gain the advantage of really nice customized kernels but only with the precompiled Wi-Fi module and no camera. Shame.

If somebody wants to build my kernel, here is the source: https://github.com/schmatzler/zte-tureis-optimized

A flashable boot.img can be downloaded here: http://schmatzler.de/boot.img

MD5SUM: 0737828b3ee7f69c3c0ce1bda05f95d8

I already added a lot of governors and the BFQ scheduler in there, you can activate them with SetCPU. Have a lot of fun :)

Edited by schmatzler
Link to comment
Share on other sites

Guest schmatzler

A little follow-up on the camera: If I compile my own kernel and enter *983*24474636# into the dialer, it shows "Sensor error".

When I use the stock kernel, it does at least show that it's accessing an MT9T112 sensor.

Sadly my knowledge about driver engineering is absolutely nonexistant. So I can't do anything about that problem.

I even opened the device and looked if there is anything written on the sensor, but - no. Just a part number that is nowhere to find.

Edited by schmatzler
Link to comment
Share on other sites

Guest mikeioannina

Do you have the original kernel that shipped with your device?

If yes, get /proc/config.gz from your phone using the original kernel and check the difference between this and the kernel config you use. Maybe you'll find some more info about the camera.

I'm developing a custom CM7 rom for ZTE Racer, I also ported 2.6.35.7 kernel from cyanogenmod's source and camera was a thing that wasn't working that I fixed.

Link to comment
Share on other sites

Guest schmatzler

I use the original config.gz, but it's not working.

The config option for the MT9T112 is activated in the default config, but it is only recognized with the stock kernel. It just looks like ZTE did not include all code that is neccessary for the device. I also contacted them, but no answer so far. I doubt I will get one.

Edited by schmatzler
Link to comment
Share on other sites

Guest mikeioannina

Weird, MT9T11X option is supposed to enable the camera driver. This driver is also used in ZTE Racer & works fine. Maybe the board file isn't updated properly by ZTE as you said.

Link to comment
Share on other sites

Guest schmatzler

I will order a broken ZTE Blade now on Ebay and swap out the camera.

If I can get that to work I have a better camera than I already have and will continue with ROM development.

Maybe I can get a newer Android tree to run.

Link to comment
Share on other sites

Guest mikeioannina

I will order a broken ZTE Blade now on Ebay and swap out the camera.

If I can get that to work I have a better camera than I already have and will continue with ROM development.

Maybe I can get a newer Android tree to run.

If you need any help about development I'm interested to help... maybe you won't need to change the camera at all. I'll look into your sources in the next 2 days that I have free time, maybe I can fix it.

Link to comment
Share on other sites

Guest schmatzler

That would be very cool.

I will get the Blade's camera nevertheless...because it is a bit better - 5MP instead of just the 3MP in the Tureis.

The config screen is giving me the following information:

Camera Information:

ID:0x2682

NMae:MT9T112-3.0Mp-AF

Edited by schmatzler
Link to comment
Share on other sites

Guest mikeioannina

That would be very cool.

I will get the Blade's camera nevertheless...because it is a bit better - 5MP instead of just the 3MP in the Tureis.

The config screen is giving me the following information:

Camera Information:

ID:0x2682

NMae:MT9T112-3.0Mp-AF

You can get the camera but the difficult thing will be to swap the camera modules. I don't know if it's easy or not, but there's a possibility of breaking the camera completely (or the phone). I wouldn't risk it.

Link to comment
Share on other sites

  • 2 weeks later...
Guest schmatzler

I already opened the Tureis, it's a piece of cake :)

I got a broken Orange San Francisco (=ZTE Blade) now. Display and camera module are still intact. Will swap out the module and then let's see if it works. :)

There is QTECH written on it, I think there is a driver somewhere.

Edit:

The new module works with the stock rom, but the image is turned 90 degrees.

The sensor information is exactly the same:

Camera Information:

ID:0x2682

NMae:MT9T112-3.0Mp-AF

Edited by schmatzler
Link to comment
Share on other sites

Guest schmatzler

Looks like I got really unlucky here.

I ported every known camera sensor for the ZTE Blade into the Tureis' kernel but it still won't initialize. Not the original module, nor the one from the Orange San Francisco:

<3>[02-03 03:09:59.450000] [66: mt9t11x_wq]mt9t11x_sensor_dev_probe: rc=0x0,model_id = 0x2682

<3>[02-03 03:09:59.450000] [66: mt9t11x_wq]mt9t11x_sensor_dev_probe: model_id = 0x2682

<3>[02-03 03:10:00.850000] [66: mt9t11x_wq]mt9t11x_sensor_dev_probe: rc=0x0,model_id = 0x2682

<3>[02-03 03:10:00.850000] [66: mt9t11x_wq]mt9t11x_sensor_dev_probe: model_id = 0x2682

<3>[02-03 03:10:01.050000] [66: mt9t11x_wq]msm_i2c msm_i2c.0: (007a) Error during data xfer (-5)

<3>[02-03 03:10:01.050000] [66: mt9t11x_wq]msm_sync_init: failed to initialize mt9t11x

Both of them work in the stock kernel. It just looks like I got 2 unknown camera modules here.

I won't give up. Next thing is trying to get the 5MP version of the Blade sensor. There are just 2 options. It could be an OV5640 or an OV5642 - and drivers for both of them do exist. Wish me luck to get this sucker fully customized!

Edited by schmatzler
Link to comment
Share on other sites

Guest schmatzler

I'm getting near it! Got the ZTE Blade with the OV5642 5MP sensor now and this one is being recognized via the kernel. It shows "OV5642" when I enter the dialer code mentioned above! :)

The Camera and the Camcorder app still crash, however. But I think I can resolve that problem in the next days.

Looks like I got a Frankenmobile now - upgraded camera with better resolution, yahoo. :)

Link to comment
Share on other sites

Ok now I also got the kernel to populate /dev/msm_camera entries but it still doesn't work.

I'm afraid I need some help here. More infos: http://www.modaco.co...mera-to-tureis/

Hi mate, I try to roote it to use Iink2sd app, but when I put image.bin to Image folder, system updates from settings doing nothing, it found this file in Image folder but just rebooting my phone and when I press Power and Vol- FTM mode is on, no custom recovery,

ZTE tureis (UK not branded) GB 2.3.5 build TUREISV1.0.0B01, any ideas? thanks

Link to comment
Share on other sites

Guest schmatzler

The Image.bin from CWM should reboot your phone and start the Bootloader which will automatically overwrite your recovery partition with Clockworkmod.

At least that's what it did on my phone.

I flashed the Brightpoint Update first, though. BP_P725AV1.0.0B06.

You should try doing that first if CWM doesn't flash.

Edited by schmatzler
Link to comment
Share on other sites

The Image.bin from CWM should reboot your phone and start the Bootloader which will automatically overwrite your recovery partition with Clockworkmod.

At least that's what it did on my phone.

I flashed the Brightpoint Update first, though. BP_P725AV1.0.0B06.

You should try doing that first if CWM doesn't flash.

thanks, btw I can not find any downloadable this BP update and how to install it? via ZTE update tool or from SD Image folder?

Link to comment
Share on other sites

Well I've done everything you mentioned, no lucky. Any image.bin file in the Image folder dosn't work at all. Just rebooting after "system update" has been selected.

not sure what to do now.

Link to comment
Share on other sites

Guest schmatzler

I don't know how this could possibly happen.

As there is no fastboot active via USB in the bootloader there is no other way to root the device :(

The zergrush exploit has already been fixed...

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.