Jump to content


Photo

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

- - - - -

  • Please log in to reply
15 replies to this topic

#1
omegamoon

omegamoon

    Regular

  • Members
  • PipPip
  • 133 posts
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
  • Extract the boot.img file
    perl ../split_bootimg.pl ../boot.img
    abootimg -x boot.img
  • Extract the ramdisk
    mkdir ramdisk
    cd ramdisk
    gzip -dc ../boot.img-ramdisk.gz | cpio -i

  • Make the changes you want
  • Recreate the ramdisk
    cd ..
    ../mkbootfs ./ramdisk | gzip > ramdisk-new.gz

  • 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, 18 May 2012 - 08:35 AM.

  • 1

#2
Frankish

Frankish

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 3,535 posts
  • Gender:Male
  • Devices:iPhone 4S Xiaocai X9 THL W200
Not quite sure. I made changes to the boot img using dsixda kitchen using cygwin in windows and it still boots...

  • 0

#3
FlatPackPete

FlatPackPete

    Regular

  • Members
  • PipPip
  • 118 posts
  • Gender:Male
  • Location:Liverpool
  • Devices:Nexus 7, Nexus 4, Note 2
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.

  • 0

#4
Frankish

Frankish

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 3,535 posts
  • Gender:Male
  • Devices:iPhone 4S Xiaocai X9 THL W200
He already said that he tried that.

  • 0

#5
omegamoon

omegamoon

    Regular

  • Members
  • PipPip
  • 133 posts
It finally works now. I updated the first post with instructions on how I did it :)

  • 0

#6
Davidoff59

Davidoff59

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 2,317 posts
  • Gender:Male
  • Devices:Orange San Francisco, G300
Tilal has released an Ics build.
http://www.modaco.co...up/page__st__20

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

  • 0

#7
omegamoon

omegamoon

    Regular

  • Members
  • PipPip
  • 133 posts
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...

  • 0

#8
tilal6991

tilal6991

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,781 posts
  • Gender:Male
  • Devices:ZTE Skate, Huawei U8150
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?

  • 0
If you like my work or if I helped, click the Plus button.

#9
tilal6991

tilal6991

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,781 posts
  • Gender:Male
  • Devices:ZTE Skate, Huawei U8150
Another suggestion:

Could you try flashing the cm9 port and then your kernel over the top and see if it boots?

  • 0
If you like my work or if I helped, click the Plus button.

#10
omegamoon

omegamoon

    Regular

  • Members
  • PipPip
  • 133 posts
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...

  • 1

#11
tilal6991

tilal6991

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,781 posts
  • Gender:Male
  • Devices:ZTE Skate, Huawei U8150
Oh cool. Still good. You should be able to build the honor source though.

  • 0
If you like my work or if I helped, click the Plus button.

#12
omegamoon

omegamoon

    Regular

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

  • 0

#13
hecatae

hecatae

    Hardcore

  • Moderator Team
  • PipPipPipPipPipPip
  • 3,224 posts
  • Gender:Male
  • Location:northampton
  • Devices:Samsung i9305
  • Twitter:@meritez

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


any further?

  • 0

#14
omegamoon

omegamoon

    Regular

  • Members
  • PipPip
  • 133 posts

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:

  • 0

#15
omegamoon

omegamoon

    Regular

  • Members
  • PipPip
  • 133 posts
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 :)

  • 0

#16
ahalp

ahalp

    Newbie

  • Members
  • Pip
  • 1 posts
  • Devices:G300
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, 21 August 2012 - 08:03 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users