[S][MOD][LB] CyanogenMod 10 for locked bootloaders

Search This thread

letama

Senior Member
Feb 13, 2008
1,689
2,324
just the recovery.tar left .. how to get it ??

I guess you have a locked bootloader version for your phone ? You can re-use this one. I did twrp as I prefer it and the cwm I grabbed wasn't working so well, but you can use whatever is working for yours.

If you don't have a lb version, it's the same principle as cm10 cm.tar, grab twrp for instance, extract initramfs, tar it back to recovery.tar
 

Guynan

Senior Member
May 24, 2013
96
21
Auckland
Extracting initramfs

Here you are,


I also separated locked bootloader boot mechanism from cm in zip if Ion people want to adapt it, check lb-and-wifi directory. To adapt it for ion, you need to extract ion cm10 initramfs, tar it into cm.tar (tar -cvf, not compressed), then replace it in zip. Same goes for recovery, you can also grab a recovery.tar if it exists for ion.

How do you extract the initramfs? I'm looking at porting to Ray, and can't quite get my head around this, any help would be much appreciated.

Thank you for your excellent work. :)
 

letama

Senior Member
Feb 13, 2008
1,689
2,324

MrGezz

Senior Member
Dec 27, 2012
714
820
Gps looks fine here, are your date and time correct? That's the usual cause of problem.

---------- Post added at 10:04 PM ---------- Previous post was at 09:52 PM ----------



Difficult to be completely affirmative without having the device but basically, yes, that's all you need:

1) make sure that stock init.*.rc is calling /system/bin/pre_hw_config.sh
Ion/hikari/nozomi are more or less same motherboard so it should be similar to what I did for XS.

how to make sure init.*.rc is calling /system/bin/pre_hw_config.sh , I'm stuck with the sony bootlogo thou , n I can enter recovery .. haha
 

letama

Senior Member
Feb 13, 2008
1,689
2,324
how to make sure init.*.rc is calling /system/bin/pre_hw_config.sh , I'm stuck with the sony bootlogo thou , n I can enter recovery .. haha

You can or you can't enter recovery ? If you are able to reach recovery, it means that script is called.

To make sure that init*.rc are calling it, boot stock firmware and do from adb:

Code:
cd /
grep pre_hw_config *.rc

If you see as result "exec /system/bin/pre_hw_config.sh" or "exec sh /system/bin/pre_hw_config.sh", you're good.
 

MrGezz

Senior Member
Dec 27, 2012
714
820
You can or you can't enter recovery ? If you are able to reach recovery, it means that script is called.

To make sure that init*.rc are calling it, boot stock firmware and do from adb:

Code:
cd /
grep pre_hw_config *.rc

If you see as result "exec /system/bin/pre_hw_config.sh" or "exec sh /system/bin/pre_hw_config.sh", you're good.

I can enter recovery :)
 

MrGezz

Senior Member
Dec 27, 2012
714
820
Good! Except if this is the old recovery, it means that the script is working.

Can you try to boot cm once again, reboot, and grab from adb dmesg and /proc/last_kmsg ?

I can confirm that it is the recovery for the ROM , btw , do you mean the cm for LB ??
 

letama

Senior Member
Feb 13, 2008
1,689
2,324
I can confirm that it is the recovery for the ROM , btw , do you mean the cm for LB ??

Ok, I'm a bit lost :). Yes, I meant try to boot cm for lb again, the one that gets stuck.

You are able to enter your original recovery, but not the one from you cm for lb attempt, that's what you mean?
 

MrGezz

Senior Member
Dec 27, 2012
714
820
Ok, I'm a bit lost :). Yes, I meant try to boot cm for lb again, the one that gets stuck.

You are able to enter your original recovery, but not the one from you cm for lb attempt, that's what you mean?

haha, sorry to confused you , I meant the recovery for cm for lb ..
 

letama

Senior Member
Feb 13, 2008
1,689
2,324
I need to take it when I enter recovery right ??

Yes. Your logs are good. Interesting...

In last_kmsg, first thing strange is this:

Code:
[   17.969940] enable_store: android_usb: already disabled
[   17.971649] init: cannot execve('/sbin/sh'): Permission denied

And this shows that /system is not mounted:

Code:
[   18.239685] init: execve /system/bin/sh (ret = -1, errno = 2)
[   18.239898] init: cannot find '/system/bin/tad', disabling 'tad'
[   18.241851] init: execve /system/bin/sh (ret = -1, errno = 2)
[   18.244995] init: cannot find '/system/bin/servicemanager', disabling 'servicemanager'
[   18.245025] init: cannot find '/system/bin/vold', disabling 'vold'
[   18.245056] init: cannot find '/system/bin/sh', disabling 'qcom-c_core-sh'
[   18.245086] init: cannot find '/system/bin/netd', disabling 'netd'
[   18.245086] init: cannot find '/system/bin/debuggerd', disabling 'debuggerd'
[   18.245117] init: cannot find '/system/bin/rild', disabling 'ril-daemon'
[   18.245117] init: cannot find '/system/bin/drmserver', disabling 'drm'
[   18.245147] init: cannot find '/system/bin/mediaserver', disabling 'media'
[   18.245178] init: cannot find '/system/bin/dbus-daemon', disabling 'dbus'
[   18.245178] init: cannot find '/system/bin/installd', disabling 'installd'
[   18.245208] init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
[   18.245208] init: cannot find '/system/bin/keystore', disabling 'keystore'
[   18.245239] init: cannot find '/system/bin/sh', disabling 'qcom-c_main-sh'
[   18.245239] init: cannot find '/system/bin/iddd', disabling 'iddd'
[   18.245269] init: cannot find '/system/bin/suntrold', disabling 'suntrold'
[   18.245269] init: cannot find '/system/bin/fast-dormancy', disabling 'fast-dormancy'
[   18.245300] init: cannot find '/system/bin/illumination_service', disabling 'illumination'
[   18.245330] init: cannot find '/system/bin/sh', disabling 'hw_config'
[   18.245330] init: cannot find '/system/bin/updatemiscta', disabling 'updatemiscta'
[   18.245361] init: cannot find '/system/bin/nvimport', disabling 'nvimport'
[   18.245361] init: cannot find '/system/bin/touchd', disabling 'touchd'
[   18.245391] init: cannot find '/system/bin/imei_transporter', disabling 'imei_transporter'

Can you check permissions in your cm.tar ? Especially for /sbin/sh ?

And check your fstab.semc in it ?


Now, regarding dmesg, this is strange:

Code:
<4>[   20.547363]   140 0          0:00 /tmp/sh -c /tmp/step2.sh
<4>[   20.547363]   496 0          0:00 {step2.sh} /tmp/sh /tmp/step2.sh
....
<4>[   20.547393]   562 0          0:00 /tmp/sh -c /tmp/step2.sh
<4>[   20.547393]   929 0          0:00 {step2.sh} /tmp/sh /tmp/step2.sh
...

<4>[   20.551025]  1002 0          0:00 /tmp/sh -c /tmp/step2.sh
<4>[   20.551025]  1358 0          0:00 {step2.sh} /tmp/sh /tmp/step2.sh

It looks like the script is executed multiple times, I don't see why. Could you check recovery.tar init*rc files if they have the exec /system/bin/pre_hw_config.sh ? If they do, comment any occurence in your recovery.tar

Same goes for cm.tar, you shouldn't have any exec /system/bin/pre_hw_config.sh left. I think I forgot to tell this in method, sorry :)
 

MrGezz

Senior Member
Dec 27, 2012
714
820
Yes. Your logs are good. Interesting...

In last_kmsg, first thing strange is this:

Code:
[   17.969940] enable_store: android_usb: already disabled
[   17.971649] init: cannot execve('/sbin/sh'): Permission denied

And this shows that /system is not mounted:

Code:
[   18.239685] init: execve /system/bin/sh (ret = -1, errno = 2)
[   18.239898] init: cannot find '/system/bin/tad', disabling 'tad'
[   18.241851] init: execve /system/bin/sh (ret = -1, errno = 2)
[   18.244995] init: cannot find '/system/bin/servicemanager', disabling 'servicemanager'
[   18.245025] init: cannot find '/system/bin/vold', disabling 'vold'
[   18.245056] init: cannot find '/system/bin/sh', disabling 'qcom-c_core-sh'
[   18.245086] init: cannot find '/system/bin/netd', disabling 'netd'
[   18.245086] init: cannot find '/system/bin/debuggerd', disabling 'debuggerd'
[   18.245117] init: cannot find '/system/bin/rild', disabling 'ril-daemon'
[   18.245117] init: cannot find '/system/bin/drmserver', disabling 'drm'
[   18.245147] init: cannot find '/system/bin/mediaserver', disabling 'media'
[   18.245178] init: cannot find '/system/bin/dbus-daemon', disabling 'dbus'
[   18.245178] init: cannot find '/system/bin/installd', disabling 'installd'
[   18.245208] init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
[   18.245208] init: cannot find '/system/bin/keystore', disabling 'keystore'
[   18.245239] init: cannot find '/system/bin/sh', disabling 'qcom-c_main-sh'
[   18.245239] init: cannot find '/system/bin/iddd', disabling 'iddd'
[   18.245269] init: cannot find '/system/bin/suntrold', disabling 'suntrold'
[   18.245269] init: cannot find '/system/bin/fast-dormancy', disabling 'fast-dormancy'
[   18.245300] init: cannot find '/system/bin/illumination_service', disabling 'illumination'
[   18.245330] init: cannot find '/system/bin/sh', disabling 'hw_config'
[   18.245330] init: cannot find '/system/bin/updatemiscta', disabling 'updatemiscta'
[   18.245361] init: cannot find '/system/bin/nvimport', disabling 'nvimport'
[   18.245361] init: cannot find '/system/bin/touchd', disabling 'touchd'
[   18.245391] init: cannot find '/system/bin/imei_transporter', disabling 'imei_transporter'

Can you check permissions in your cm.tar ? Especially for /sbin/sh ?

And check your fstab.semc in it ?


Now, regarding dmesg, this is strange:

Code:
<4>[   20.547363]   140 0          0:00 /tmp/sh -c /tmp/step2.sh
<4>[   20.547363]   496 0          0:00 {step2.sh} /tmp/sh /tmp/step2.sh
....
<4>[   20.547393]   562 0          0:00 /tmp/sh -c /tmp/step2.sh
<4>[   20.547393]   929 0          0:00 {step2.sh} /tmp/sh /tmp/step2.sh
...

<4>[   20.551025]  1002 0          0:00 /tmp/sh -c /tmp/step2.sh
<4>[   20.551025]  1358 0          0:00 {step2.sh} /tmp/sh /tmp/step2.sh

It looks like the script is executed multiple times, I don't see why. Could you check recovery.tar init*rc files if they have the exec /system/bin/pre_hw_config.sh ? If they do, comment any occurence in your recovery.tar

Same goes for cm.tar, you shouldn't have any exec /system/bin/pre_hw_config.sh left. I think I forgot to tell this in method, sorry :)
okay, it got solves , just comment the line , thanks :) the rom boot :)
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 26
    v2 out

    Here you are,

    Wifi is fixed in this one. Just reflash it on top on previous one.

    I also separated locked bootloader boot mechanism from cm in zip if Ion people want to adapt it, check lb-and-wifi directory. To adapt it for ion, you need to extract ion cm10 initramfs, tar it into cm.tar (tar -cvf, not compressed), then replace it in zip. Same goes for recovery, you can also grab a recovery.tar if it exists for ion.

    You may have to adapt step2.sh regarding notification led, I'm not sure XS dev are same as ion, having them working is good to help debugging.

    Here is a quick explanation of the principle:

    Stock kernel is calling /system/bin/pre_hw_config.sh in its initramfs, we hijack the script to replace stock behavior to launch cm. To do that, I do it in two steps, first, pre_hw_config.sh will grab step2.sh and busybox from /system/bin, copy them to /tmp, relink busybox applets then launch step2.sh. Step2.sh will grab /system/bin/cm.tar, extract it to / then umount everything to start init again.

    Wifi fix is basically use some stock binaries and firmware plus disable wifi direct. Just replace the binaires with the one for ion, hopefully it should work.
    17
    This is CM10 for LB. If you want to check how it works, go here out. Though it's very unlikely to happen, I am not reponsible for bricked devices/whining children whatsoever. :p
    You can get the mod, containing the latest commits and patches from here (*.zip) or here (*.tar.gz). I will also upload it here on XDA, but it may not always be up-to-date. Also feel free to contribute to my source, any help is appreciated. :)

    Oh and since I don't have time to update this thread very often, I will not post a changelog. Though you can track my progress here.

    VERY IMPORTANT: Do NOT flash this mod using CWM. Please follow the installation instructions given in the second post instead. If you want to flash it, go here.

    Thanks!

    XDA:DevDB Information
    CyanogenMod 10 for LB, a Tool/Utility for the Sony Xperia S

    Contributors
    djolivier, atis112, letama

    Version Information
    Status: Beta

    Created 2013-12-16
    Last Updated 2014-01-03
    14
    Hello All,

    Be careful, I didn't test it much! Don't do that if you're not used to flash stock firmware when everything is broken or phone doesn't boot. Wait for feeback from experienced users!

    Now that disclaimer is done, here is a little gift for the end of the year :).

    I was able to steal my wife XS for few hours and continued @djolivier work, cm10 boots and runs fine now as far as I can tell.

    Requirements:

    - Rooted stock 1.96 firmware with working recovery

    Instructions:

    - Download zip from the link above
    - Push zip to /sdcard
    - Go to recovery
    - Flash zip
    - Flash gapps
    - Wipe data

    Note:
    I replaced recovery with TWRP, the one I had on locked doesn't work properly. I didn't test much TWRP either, but it seems to behave properly. Be cautious too with it.

    Let me know if it works for you. Mine is unlocked, but it runs with a fully stock kernel so it should be the same for you guys.

    I'll hand over my scripts and hints to @djolivier, I'll let him manage it, this is his baby after all and I don't have the XS very often.
    7
    Installation instructions

    Instructions:

    Advanced users can use this instead.

    1. Step: Download (a) CM10(-based) ROM (which means other ROMs such as AOKP or PAC could work too)
    2. Step:
    3. Step:
      • Delete META-INF folder
      • Copy META-INF folder from my zip to the ROM.zip
    4. Step:
      • Copy lb-and-wifi folder from my zip to the ROM.zip
    5. Flash the modified ROM.zip like any other ROM

    Happy flashing! :cyclops:
    4
    Does in work on Xperia T?
    The prefix should be sufficient to answer your question

    Sent from my GT-I9100 using xda app-developers app