Jump to content

[Kernel] init.d support for ZTE Blade V


Guest shiftyc

Recommended Posts

Guest shiftyc

What is this?
It's a boot image which adds support for init.d scripts.

What does that mean?
By flashing this to your phone, it gives support for custom scripts to be executed at boot time.  There are plenty of examples of the kind of mods this will allow, see this post as an example.

Prerequisites
You must be rooted and ideally have CWM recovery installed.  This post tells you how to do both of these things.

Next, boot the phone to recovery and MAKE A BACKUP - flashing a new boot image is not without risk.

How do I test if it will work for me?
You can test the install without permanently flashing it to your phone, I'd suggest you do this first if you have any concerns.  You will need to have set up the ZTE USB drivers and have fastboot working on your computer, again see this post for details.

1. Download init.d-test.zip and put it somewhere on your phone that you can find it again, for example in the root folder
2. Download boot-gah0.9-8225uk2.2.img and put in on your computer in the folder that contains fastboot.exe
3. Connect your phone via a USB cable to the same computer
4. Reboot your phone and hold volume down to boot into CWM recovery
5. install zip → choose zip from sdcard → (find init.d-test.zip) → Yes to install
6. +++++ Go Back +++++ → advanced → reboot to bootloader
7. When the green android appears, on your computer navigate to the folder containing boot-gah0.9-8225uk2.2.img and type
 

fastboot boot boot-gah0.9-8225uk2.2.img

Give your phone a few seconds and it should boot normally.  To check that the new boot image has worked, use a file explorer to navigate to /data/local/tmp and look for a file named 00confirm.txt.  If the file exists, congratulations, the boot image works for you.  You can safely delete /data/local/tmp/00confirm.txt and also /system/etc/init.d/00confirm (make sure you use a root explorer to mount /system as rw first).

You can now permanently flash the image if you wish.

How do I install after testing?
If you haven't done a test install, I suggest you try the above first.  To flash the image you will need to have set up the ZTE USB drivers and have fastboot working on your computer, again see this post for details.

1. Download boot-gah0.9-8225uk2.2.img and put in on your computer in the folder that contains fastboot.exe
2. Connect your phone via a USB cable to the same computer
3. Reboot your phone and hold volume down to boot into CWM recovery
4. advanced → reboot to bootloader
5. When the green android appears, on your computer navigate to the folder containing boot-gah0.9-8225uk2.2.img and type
 

fastboot flash boot boot-gah0.9-8225uk2.2.img
fastboot reboot

Congratulations, your Blade V now has init.d support!

What next?
Create a script to do something cool and put it in the /system/etc/init.d folder.  Don't forget to give the script execute permissions (755 suggested).  The script should run every time your phone is booted.  If it's really cool, make sure you share :)

Technical details
I extracted boot.img from the UK v2.2 stock ROM, specifically, this.  I split the image, unpacked the ramdisk, added a hook to execute init.d scripts to init.rc then repacked it all.  The kernel itself is untouched, only the ramdisk was modified.

Credits
100% of the credit for this goes to KonstaT.  Not only did he encourage me and patiently tell me where I was repeatedly going wrong, he also wrote most of the code!
 

[edit]

Update links.

Edited by shiftyc
Link to comment
Share on other sites

Guest targetbsp

I don't think so.  I think the kernel would need higher frequencies added to it for that to work.  Then once that's done, init'd would be one way (amongst others) of setting the desired frequency.

Link to comment
Share on other sites

Guest shiftyc

Correct, I didn't modify the kernel itself because I couldn't get ZTE's source to compile.

 

I've now got it to compile which should open up more possibilities, including overclocking.  Oddly, the zImage from my compile is 5MB whereas the one ZTE released is 4.5MB so that's not a great start.

Link to comment
Share on other sites

Guest KonstaT

Oddly, the zImage from my compile is 5MB whereas the one ZTE released is 4.5MB so that's not a great start.

Does your kernel boot? What defconfig did you use?
 
You can extract defconfig from a running device (/proc/config.gz) or from stock zImage by using extract-ikconfig script.
Link to comment
Share on other sites

Guest AloneInTheDark19

Im sorry for off-topic i need to ask something KonstaT, here is my problem i have flashed MIUI for blade V in my blade III pro with Blade V boot.img and rom booted but touch dont works only power key is working and i tried with my stock boot.img, apps were optimizing the same procedure as blade V boot.img but the phone after apps optimizing again goes to bootanimation and its stucked here and only LED Notification is going on here is logcat:

https://drive.google.com/file/d/0B0LcuL3pgqjydEhmRnRpTV9STUU/edit?usp=sharing

Link to comment
Share on other sites

Guest KonstaT

Thanks, I did extract the defconfig from my running phone.  Kernel boots just fine.

What toolchain did you use? It can make a small difference in size (0.1-0.2 mb) but I doubt that much. I can't remember if the kernel I built had any major differences in size compared to stock.
 
Most likely it just indicates that ZTE has releases non-GPL compliant source that doesn't match the binary kernels shipped in devices.
Link to comment
Share on other sites

Guest shiftyc

 

What toolchain did you use? It can make a small difference in size (0.1-0.2 mb) but I doubt that much. I can't remember if the kernel I built had any major differences in size compared to stock.

 

I used r7 of the android NDK, I guess I could try a newer revision.  Oddly my boot.img comes out at 7.1mb versus 7mb for the stock, so the bloated zImage compresses well.

 

[edit]

I reset everything and compiled with the r9d toolchain.  This time zImage is 4.8mb and boot.img is 6.9mb.  So zImage still larger, boot.img smaller (??)  Still seems to boot OK so I'll go with the smaller boot.img and pretend that the reduced size is due to my "optimisations" lol.

 

 

Most likely it just indicates that ZTE has releases non-GPL compliant source that doesn't match the binary kernels shipped in devices.

 

 

I came to the same conclusion.  The fact that it doesn't even compile without tweaking means it can't be the version they shipped.

 

I've been running my compiled version for almost 48 hours without any issues so it looks fine.

 

I started to read up on adding governors, I thought I'd start with smartassV2 as it's one I've used before in CM etc.  But it's a huge learning curve, so much to understand and so much of the info our there is contradictary.  Anyway, I was making some reasonable progress in understanding when I came across a recent IRC chat log where an experienced kernel dev was ridiculing someone for adding smartassV2 to a dual core device, as it was originally intended for single core.  And here I am trying to add it to a quad core.  Maybe back to the drawing board!

Edited by shiftyc
Link to comment
Share on other sites

Guest shiftyc

With smartassV2 it's not even a case of "just" adding it.  It works on a principle of what it calls "ideal" frequencies.  So before you even include it, you need to supply a value of what you believe is the ideal frequency to aim for when the device is awake and when it's suspended and the deltas for ramping up and down.

 

Like I said, a lot to get your head around and a lot of conflicting info.  I think instead of trying to reinvent the wheel I need to KANG someone's else's work!

Link to comment
Share on other sites

Guest mike-kt

Is here some one who fix this problem ?

 

I have the same problem on stock rom and on miui rom too.

 

Notification sometime works sometimes doesnt. Its the same on wifi or 3g. Push notification have big dealey. I have this probem with facebook messages, whatsapp and others .... Have you got someone this problem?

 

thanks

Link to comment
Share on other sites

Guest shiftyc

Any news guys?

 

Not really.  I tried a couple of governors but couldn't get them to compile, I seem to be missing a lot of dependencies.

 

If I'm reading the source correctly, the stock kernel includes some additional frequencies for our chipset, so I though overclocking would be easier.  I increased the maximum frequency that the kernel allows, but when I tried to install some overclocking apps, it didn't let me select anything higher than 1.21GHz.

 

There's also an option to enable USB OTG.  I tried this and got a bunch of compilation errors.  After a few hours of debugging I was able to get it compiled, but once again, when I tried a USB powered hub it didn't detect any devices.

 

So nothing very successful at all, and at the moment I have no time to work on it further.

 

Is here some one who fix this problem ?

 

I have the same problem on stock rom and on miui rom too.

 

Notification sometime works sometimes doesnt. Its the same on wifi or 3g. Push notification have big dealey. I have this probem with facebook messages, whatsapp and others .... Have you got someone this problem?

 

thanks

 

Sorry, I don't have the skills for that.  But I would question whether it's a kernel bug anyway because I don't have this problem.

Link to comment
Share on other sites

  • 5 months later...

Hello, which .config did you use? I have tried the one from your kernel (/proc/config.gz) but it doesn't work(compiled, but I have some problems with screen)

Very nice to see someone working on kernel , hope to make it work good , so it will boost our phones more !!!!

Regards!!!!!

Edited by gkalen
Link to comment
Share on other sites

Hello, which .config did you use? I have tried the one from your kernel (/proc/config.gz) but it doesn't work(compiled, but I have some problems with screen)

 

I had the UK v2.2 stock installed on my phone and I extracted the .config from that.  I then used it to compile the UK v2.2 source.

 

What kernel source are you using?

Link to comment
Share on other sites

nothing, it don't even compile :angry:

 

Well if you want some help, you need to give more clues.  What OS?  What toolchain?  What did it say on screen, any errors?

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.