Jump to content


Photo

[Kernel] init.d support for ZTE Blade V


  • Please log in to reply
24 replies to this topic

#1
shiftyc

shiftyc

    Regular

  • Members
  • PipPip
  • 92 posts
  • Gender:Male

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, 21 March 2014 - 09:47 AM.

  • 1

#2
targetbsp

targetbsp

    Hardcore

  • MoDaCo Silver
  • PipPipPipPipPipPip
  • 4,017 posts
  • Gender:Male
  • Devices:Hudl 2, Blade V

I can confirm that the kernel works as intended. Nice one!


  • 0
My Blade site - includes vanilla KANGS's of CM7. Also available: modified GB Gapps with various market versions, mini ICS Gapps for 160mb system partitions and Flash for ARMv6
CM7 Blade changelog

#3
shiftyc

shiftyc

    Regular

  • Members
  • PipPip
  • 92 posts
  • Gender:Male

Great, thanks for confirming.  Hope it helps with your project.


  • 0

#4
djfnz

djfnz

    Regular

  • Members
  • PipPip
  • 123 posts
  • Gender:Male
  • Location:Hungary, Hajdúhadház
  • Devices:SGSIII-LTE & SGSM2

Thanks guys!


Edited by djfnz, 21 March 2014 - 10:35 AM.

  • 1

#5
popoyaya

popoyaya

    Diehard

  • Members
  • PipPipPipPip
  • 474 posts
  • Gender:Male
  • Devices:ZTE Blade V, Galaxy S3

Great stuff! Does this mean overclocking cpu is possible now?


  • 0

#6
targetbsp

targetbsp

    Hardcore

  • MoDaCo Silver
  • PipPipPipPipPipPip
  • 4,017 posts
  • Gender:Male
  • Devices:Hudl 2, Blade V

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.


  • 0
My Blade site - includes vanilla KANGS's of CM7. Also available: modified GB Gapps with various market versions, mini ICS Gapps for 160mb system partitions and Flash for ARMv6
CM7 Blade changelog

#7
shiftyc

shiftyc

    Regular

  • Members
  • PipPip
  • 92 posts
  • Gender:Male

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.


  • 0

#8
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,781 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio

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.

  • 0

#9
shiftyc

shiftyc

    Regular

  • Members
  • PipPip
  • 92 posts
  • Gender:Male

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


  • 0

#10
AloneInTheDark19

AloneInTheDark19

    Regular

  • Members
  • PipPip
  • 59 posts
  • Devices:ZTE Blade III Pro

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...dit?usp=sharing


  • 0

#11
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,781 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio

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.

  • 0

#12
shiftyc

shiftyc

    Regular

  • Members
  • PipPip
  • 92 posts
  • Gender:Male

 

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, 26 March 2014 - 05:45 PM.

  • 0

#13
targetbsp

targetbsp

    Hardcore

  • MoDaCo Silver
  • PipPipPipPipPipPip
  • 4,017 posts
  • Gender:Male
  • Devices:Hudl 2, Blade V

Interesting.  I'd just have used SmartAssv2 as well if it was in there.  Never considered the whole single vs multi-core thing!


  • 0
My Blade site - includes vanilla KANGS's of CM7. Also available: modified GB Gapps with various market versions, mini ICS Gapps for 160mb system partitions and Flash for ARMv6
CM7 Blade changelog

#14
shiftyc

shiftyc

    Regular

  • Members
  • PipPip
  • 92 posts
  • Gender:Male

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!


  • 0

#15
djfnz

djfnz

    Regular

  • Members
  • PipPip
  • 123 posts
  • Gender:Male
  • Location:Hungary, Hajdúhadház
  • Devices:SGSIII-LTE & SGSM2

Any news guys?


  • 0

#16
mike-kt

mike-kt

    Newbie

  • Members
  • Pip
  • 47 posts
  • Devices:zte blade v

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


  • 0

#17
shiftyc

shiftyc

    Regular

  • Members
  • PipPip
  • 92 posts
  • Gender:Male

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.


  • 0

#18
binatron

binatron

    Newbie

  • Members
  • Pip
  • 8 posts
  • Gender:Male
  • Location:Slovakia
  • Devices:ZTE Blade V

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)


  • 1

#19
gkalen

gkalen

    Enthusiast

  • Members
  • PipPipPip
  • 172 posts

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, 17 September 2014 - 02:09 PM.

  • 0

#20
binatron

binatron

    Newbie

  • Members
  • Pip
  • 8 posts
  • Gender:Male
  • Location:Slovakia
  • Devices:ZTE Blade V

As first thing , i have to get it working with default configuration. If it will work, then i can add some tweaks maybe


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users