[DEV][LB]ramdiskHijack - CM for locked bootloaders?

Search This thread

dh.harald

Senior Member
May 20, 2010
594
1,611
London
I try to implement 2nd-init method (Motorola Milestone/Defy/etc) to hijack ramdisk.
With this method, we can change stock ramdisk, and we can boot CM with stock kernel...
Here's KeiranFTW's original thread too: http://xdaforums.com/showthread.php?t=2608408, but I used 2nd-init instead of chroot

So, i'm done with following steps:
Successfully implement recovery and hijack ramdisk...
I can replace ramdisk contents with new one...
I can boot CM10.2, but it has defects:
Kernel and user space graphical drivers are mismatch, screen is yellowish (no blue), and a lots of mdp errors in dmesg, and no boot animation
no radio
there's some problem with /data/ / sdcard mount...

So i call for help, because i've limited time for this project, but it can interesting...

If you want to try it, do the following steps:
get hijack from here: https://github.com/dh-harald/hijack-ramdisk-huashan
get CM from source (preferred) or fxp, and delete boot.img from zip (and connected lines from update-script)
(optional) replace jelly.tar and recovery.tar to your device specific ramdisks, if you're on other device than Xperia SP
go to recovery, apply CM, (optional gapps), copy chargemon and hijack.tar to /system/bin and fix rights, and factory reset...
install 4.3 kernel only via flashtool (if you aren't on 4.3)...

Known problem, that you need original kernel modules too, to get wifi working (not tested)

I think, it's mainly CM configuration, but it maybe helps, when CM team starts to use Sony's 4.3 kernel based CM kernel...

Any helps are welcome...

Here's a screenshot about cm and locked bootloader and stock kernel... It's a bit confusing, because when i screenshot it via ddms, colors are fine, but in screen, there's no blue color, only yellow...

EDIT:
I've found that radio/fs problems are selinux related...

EDIT: Current status:
No wifi
No sdcard on /sdcard (only /data/media)
Got baseband, but still no radio
Visible glitches, yellowish screen (aosp <-> caf ?)
 

Attachments

  • Screenshot_baseband.png
    Screenshot_baseband.png
    129.9 KB · Views: 1,122
Last edited:

dh.harald

Senior Member
May 20, 2010
594
1,611
London
ATM, i'm playing stock rom with 2nd-init, to minimalize differences..

I passed selinux problems with @Hashcode binaries, got bootlogo, and i've no selinux errors, etc.

Next problem is modem initialization:

== cut ==

Any idea?

I cut some sleeps, in script, and modem doesn't initialized before script runs 2nd-init.

Now it boots, but still no radio...
 
Last edited:
  • Like
Reactions: baga255

PAINfájdalom

Member
Aug 22, 2013
28
31
I try to implement 2nd-init method (Motorola Milestone/Defy/etc) to hijack ramdisk.
With this method, we can change stock ramdisk, and we can boot CM with stock kernel...
Here's KeiranFTW's original thread too: http://xdaforums.com/showthread.php?t=2608408, but I used 2nd-init instead of chroot

So, i'm done with following steps:
Successfully implement recovery and hijack ramdisk...
I can replace ramdisk contents with new one...
I can boot CM10.2, but it has defects:
Kernel and user space graphical drivers are mismatch, screen is yellowish (no blue), and a lots of mdp errors in dmesg, and no boot animation
no radio
there's some problem with /data/ / sdcard mount...

So i call for help, because i've limited time for this project, but it can interesting...

If you want to try it, do the following steps:
get hijack from here: https://github.com/dh-harald/hijack-ramdisk-huashan
get CM from source (preferred) or fxp, and delete boot.img from zip (and connected lines from update-script)
(optional) replace jelly.tar and recovery.tar to your device specific ramdisks, if you're on other device than Xperia SP
go to recovery, apply CM, (optional gapps), copy chargemon and hijack.tar to /system/bin and fix rights, and factory reset...
install 4.3 kernel only via flashtool (if you aren't on 4.3)...

Known problem, that you need original kernel modules too, to get wifi working (not tested)

I think, it's mainly CM configuration, but it maybe helps, when CM team starts to use Sony's 4.3 kernel based CM kernel...

Any helps are welcome...

Here's a screenshot about cm and locked bootloader and stock kernel... It's a bit confusing, because when i screenshot it via ddms, colors are fine, but in screen, there's no blue color, only yellow...

EDIT:
I've found that radio/fs problems are selinux related...


when will be a good working ROM?
 

KeiranFTW

Inactive Recognized Developer
Nov 17, 2011
2,637
2,692
28
Sunderland
I know this sounds crazy, but don't stop the sdcard service and some of the RIL services in hijack.sh.. and then see what happens.
The stock RAMdisk already starts some of these

You'll also probably need stock binaries too such as:
hostapd
wpa_supplicant
stock firmware files at /etc/firmware
/etc/wifi/calibration
libhardware_legacy.so

Hope I helped..

Sent from my C5303 using Tapatalk
 
Last edited:

KeiranFTW

Inactive Recognized Developer
Nov 17, 2011
2,637
2,692
28
Sunderland
So looks like you have got baseband working but radio interface layer does not seem to be.. good work we are getting there

Sent from my C5303 using Tapatalk
 
  • Like
Reactions: diabolus81

KeiranFTW

Inactive Recognized Developer
Nov 17, 2011
2,637
2,692
28
Sunderland
Really? Thats very good, congratz. Do you think the method you are using could be used in other Xperia devices? (Ex. Xperia Go)

Yeah I think that it could (and should) work. The only thing is that it is hard testing on a locked bootloader, because if you mess up you have to reflash whole system again, gain root again and all that.
Xperia Go uses different board to Xperia SP (novathor v krait) so it may be a hard task.

I have an Xperia U, which is very similar to Xperia Go as far as I know, just it doesn't charge, I need to solder pins back onto board (long story short water damage). If I can fix it I'll see what I can do.

Sent from my C5303 using Tapatalk
 
  • Like
Reactions: SapoPT

baga255

Senior Member
Jan 19, 2012
71
16
Yeah I think that it could (and should) work. The only thing is that it is hard testing on a locked bootloader, because if you mess up you have to reflash whole system again, gain root again and all that.
Xperia Go uses different board to Xperia SP (novathor v krait) so it may be a hard task.

I have an Xperia U, which is very similar to Xperia Go as far as I know, just it doesn't charge, I need to solder pins back onto board (long story short water damage). If I can fix it I'll see what I can do.

Sent from my C5303 using Tapatalk

Do you think it would be possible to use this method to hijack ramdisk on Xperia Z?
It also has a Krait board as Xperia SP.
I want to try porting it to Xperia Z, but I don't have nearly as much experience in developing. So I'd like to know your opinion before I start searching more into the subject :)

Thanks!
 

sijav

Senior Member
Sep 3, 2012
903
954
32
Tehran
We have CyanogenMod 10.2 running on a locked bootloader, everything works bar GPS.... so huge progress

Sent from my C5303 using Tapatalk
wow!! JUST WOW!! I really like to do it for xperia ZR, I've tried to port omni which was aosp based to cm kernel and it worked with just replacing some libs and it is now perfect! but this process is much more interesting!! for CM11!!
also about that glitches? I think it's because of the hw composer lib, it might appear on logcat too :)
 

MARKOZD15

Senior Member
Dec 19, 2013
109
16
Zadar
Hy guys! Really awesome work!

So will there be available CM11 or CM10.2 for XZ1 with lockedbootloader soon?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    I try to implement 2nd-init method (Motorola Milestone/Defy/etc) to hijack ramdisk.
    With this method, we can change stock ramdisk, and we can boot CM with stock kernel...
    Here's KeiranFTW's original thread too: http://xdaforums.com/showthread.php?t=2608408, but I used 2nd-init instead of chroot

    So, i'm done with following steps:
    Successfully implement recovery and hijack ramdisk...
    I can replace ramdisk contents with new one...
    I can boot CM10.2, but it has defects:
    Kernel and user space graphical drivers are mismatch, screen is yellowish (no blue), and a lots of mdp errors in dmesg, and no boot animation
    no radio
    there's some problem with /data/ / sdcard mount...

    So i call for help, because i've limited time for this project, but it can interesting...

    If you want to try it, do the following steps:
    get hijack from here: https://github.com/dh-harald/hijack-ramdisk-huashan
    get CM from source (preferred) or fxp, and delete boot.img from zip (and connected lines from update-script)
    (optional) replace jelly.tar and recovery.tar to your device specific ramdisks, if you're on other device than Xperia SP
    go to recovery, apply CM, (optional gapps), copy chargemon and hijack.tar to /system/bin and fix rights, and factory reset...
    install 4.3 kernel only via flashtool (if you aren't on 4.3)...

    Known problem, that you need original kernel modules too, to get wifi working (not tested)

    I think, it's mainly CM configuration, but it maybe helps, when CM team starts to use Sony's 4.3 kernel based CM kernel...

    Any helps are welcome...

    Here's a screenshot about cm and locked bootloader and stock kernel... It's a bit confusing, because when i screenshot it via ddms, colors are fine, but in screen, there's no blue color, only yellow...

    EDIT:
    I've found that radio/fs problems are selinux related...

    EDIT: Current status:
    No wifi
    No sdcard on /sdcard (only /data/media)
    Got baseband, but still no radio
    Visible glitches, yellowish screen (aosp <-> caf ?)
    3
    here is my own attempt: https://github.com/keiranFTW/huashan_ramdisk-hijack

    follow there for progress
    3
    Did you get any promissing results yet?

    We have CyanogenMod 10.2 running on a locked bootloader, everything works bar GPS.... so huge progress

    Sent from my C5303 using Tapatalk
    1
    ATM, i'm playing stock rom with 2nd-init, to minimalize differences..

    I passed selinux problems with @Hashcode binaries, got bootlogo, and i've no selinux errors, etc.

    Next problem is modem initialization:

    == cut ==

    Any idea?

    I cut some sleeps, in script, and modem doesn't initialized before script runs 2nd-init.

    Now it boots, but still no radio...
    1
    So looks like you have got baseband working but radio interface layer does not seem to be.. good work we are getting there

    Sent from my C5303 using Tapatalk