Jump to content

Manipulating the boot process and/or changing the kernel [GUIDE]


Guest omegamoon

Recommended Posts

Guest omegamoon

I'm trying to change the boot.img in order to do some testing/debugging (new kernel, ICS rom etc). There are lots of guides which explain how to extract and repack the boot.img, but somehow (even without making any actual changes) the new boot.img doesn't work.

Here is what I do:

abootimg -x boot.img

  1. Extract the boot.img file
    perl ../split_bootimg.pl ../boot.img
    abootimg -x boot.img
  2. Extract the ramdisk
    mkdir ramdisk
    cd ramdisk
    gzip -dc ../boot.img-ramdisk.gz | cpio -i

  3. Make the changes you want

  4. Recreate the ramdisk
    cd ..
    ../mkbootfs ./ramdisk | gzip > ramdisk-new.gz

  5. Recreate the boot.img file
    abootimg -u boot.img -r ramdisk-new.gz
    abootimg -u boot.img -f bootimg.cfg -k zImage -r ramdisk-new.gz

What am I doing wrong here? After doing this I reflash the new boot.img. On reboot the device is stuck at the Huawei logo. As I said, even without making any changes to the files in the ramdisk.

Any ideas? Help is much appreciated!

Edited after getting this fixed:

- Changed step 1: Use "abootimg" instead of perl script. This creates a handy config file for use when recreating the boot.img in the last step.

- Changed step 5: Use "abootimg" again to update the original boot.img file. Use the config file created in step 1, otherwise it won't work

Edited by omegamoon
Link to comment
Share on other sites

Guest FlatPackPete

Note I don't do this all the time, but the few times I did do it I followed this guide and mine worked.

What I would initially do is unpack and immediately repack it. If that works then you know that you can create valid images and if any of your amendments hang the phone you know what to blame.

Link to comment
Share on other sites

Guest Davidoff59

Tilal has released an Ics build.

Are you working alone or could you and Tilal work together as he doesn't have a G300 phone yet

Link to comment
Share on other sites

Guest omegamoon

I'm currently working on my own. Didn't know that others were trying as well.

I am now at the stage that the 3.0.8 kernel boots, but android (MIUI v4) is bailing out early in the init phase. I can't get any logcat info, since adb is giving "exec '/system/bin/sh' failed" errors.

Search continues...

Link to comment
Share on other sites

Guest tilal6991

Wow. You got the 3.0 kernel??? That's bloody amazing.

The sh bailing. Go into recovery and chmod the /system/bin/* folder to 777.

Could you please share the source as well?

Link to comment
Share on other sites

Guest omegamoon

I'm still trying to build the kernel from source, with all the snippets I find here and there. Unsuccessful until now, so no source (yet), but I'm getting there :)

Currently I'm just trying to port the MIUI.us_Honor_v4_2.5.11 image, which contains the 3.0.8 kernel. It boots, and hey, I just got logcat working. The screen is flashing now, showing the Huawei logo on and off...

Small steps...

Link to comment
Share on other sites

Guest hecatae

I'm downloading your "update-cm-9-20120518-NIGHTLY-u8815-signed.zip" right now. Let's see what that brings :)

any further?

Link to comment
Share on other sites

Guest omegamoon

any further?

No, unfortunately had not much time today to investigate any further. Didn't check tilal6991's cm9 yet with the 3.0 kernel.

The problems I see in the logcat with the MIUI v4 image + 3.0.8 kernel combo seem to be related to the kernel. Things like...

  • Couldn't open /dev/gyro
  • genlock_create_lock: open genlock device (err=No such file or directory)
  • service 'sensorservice' died; service 'entropy' died; service 'power' died

These are all fatal errors, killing the ServiceFlinger and with that the Zygote process. The lcd seems not to be initialized correctly, it only flashes shortly.

I'm again trying to rebuild the 3.0.8 kernel from source now. I first have to get rid of all the build problems. The sources are meant for the U8860, and it looks like some parts are missing for a succesful build on the U8815. I don't see light at the end of the tunnel yet :wacko:

Link to comment
Share on other sites

Guest omegamoon

For the sake of reference, in order to get a kernel build for the U8815 you need this info about the exact hardware...

board_id: MSM7227A_8815.VerB

hw_version: HD1U8815M.VerB

charge_flag: 0

compass_gs_position: COMPASS_TOP_GS_TOP

sensors_list: G_L_P_M_SENSORS

lcd_id: CHIMEI RSP61408

wifi chip: BROADCOM

audio_property: 2

I couln't find the lcd type, and just picking one might not be such a good idea, but then I realized that a simple "cat /proc/app_info" shows al the things I need :)

Link to comment
Share on other sites

  • 2 months later...

Hello,

I tried the above process on the boot image I extracted from my g300. However, although i mange to create an image with exactly the same size, the device does not boot with my modified boot.img.

Help would be much appreciated.

Thanks,

Arik

OK - Succeeded - the line: perl ../split_bootimg.pl ../boot.img should not be erased!

Edited by ahalp
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.