NS4G modem patch on CM7/9/10 based roms, nightlies and previews- 2/12/13

Search This thread

xboxfanj

Recognized Developer
Apr 24, 2011
7,313
7,797
St. Louis
Hi, I made this thread because people have been asking me what to do to make a ROM compatible with the Nexus S 4G modem and RIL, so I made a flashable zip so you can use the modem and RIL on any CM7 based ROM (like MIUI or JoyOS or whatever you fancy).

Note: If using a ROM not on this list, use the closest cm patch corresponding to the os and then download the phone and settings apks from the nexus s 4g Roms and either put them in the zip or push them. That way, roaming and update prl and profile will work.

I included the KL2 modem in each AIO zip. If you do not like it, or would like to try other modem files, try the flashable zips here: http://xdaforums.com/showthread.php?t=1077168

CM7
just flash the zip below (made by nashdogg and I)
http://d-h.st/dGR
I added the nexus audio drivers in kernel and lib, and I also added voodoo color, voodoo sound, and Battery Life Extender.

CM9 (Roaming Fixed) Instructions:
Just flash this in CWM. Custom kernels are available in the 2nd post. http://d-h.st/U1L

AOKP ICS (by Nashdogg)
http://d-h.st/vVP

Jellybean patches thanks to dropple, nashdogg, andy_nu, and didhiy ( newest patch as of 12/5/12 with nitest didhiy 1124 kernel voodoo color)

PA 2.54 AIO ns4g modem patch- http://d-h.st/CQm

CM10 AIO ns4g modem patch- http://d-h.st/96W

AOKP-JB Build-4 AIO ns4g modem patch- http://d-h.st/t4n


CM10.1 http://d-h.st/i9s

Universal

http://goo.im/devs/effsi/misc
these should allow you to switch back and forth between the epic modem and nexus modem.

what it does :
installs blobs related to the modem
edits build.prop lines to match the modem
-should- work with all current versions (2.3 through 4.2.2)
-should- work with all roms that support switching modems (aokp, cm, pa, pac, baked, hellybean, etc...)

what it doesn't do :
it does not install or change the actual modem itself.
it does not install or change the kernel.
it does not backup anything.
it does not replace any apks.
it does not perform any tweaks or extras of that sort.
it does not fix issues in the system ie if 4g isn't working in the kernel this installer won't magically fix it or inversely break it if it works.

so that means you will need to install the modem itself (through zip or the MORE RECOMMENDED METHOD OF ODIN)
and that you will need to make sure you are on a proper kernel that supports your modem of choice.

Ex... on stock aokp4.2.2 (which is epic modem by default) to switch to the nexus modem you would flash kernel of choice for nexus modem (didhiy/mine), then modem with recovery or odin, then flash swap2nexusmdm.zip
Ex2... on ck10.1 (which is nexus modem by default) to switch to the epic modem you would flash modem of choice with Odin or recovery, then any kernel that supports epic modem and then flash swap2epicmdm.zip


Note: These instructions are a bit different than effsi's as the order of flashing does matter when on an epic modem ROM and kernel as the modem flash is dependent on kernel drivers that are not present in epic modem kernels.

Any Nexus S 4G modem can be used but the one included is supposedly best. Try any other one and let me know if it works better

My kernel sources are at https://github.com/xboxfanj/android_kernel_samsung_victory in the gingerbread branch so if you want to make a kernel based on that or cherrypick the patches in my kernel into another kernel, you are welcome to.
Use my commits and bbelos' commits at https://github.com/nexussense4g/android_device_samsung_epicmtd in the crespo-modem branch to get GPS and modem working on any ROM.

Thank you to didhiy for adapting the patches that bbelos and I made. For support for Update PRL and Profile, you need to copy some of the overlays from the Nexus S 4G device sources.

Thank you to bbelos, coolya, the CM SGS team, CM Nexus S team, AOSP, Samsung, Google, and me for making this patch.
 
Last edited:

xboxfanj

Recognized Developer
Apr 24, 2011
7,313
7,797
St. Louis
Custom CM9 Kernels (note these are not all in one zips, so if you choose to flash these, you must also flash the AIO if you haven't already, and each time you upgrade builds, you'll need to flash the aio and the custom kernel if you still want it):

Nyan:
http://marcusant.com/android/epic/nyan_CM9-CrpMdm.zip

Shadow: http://marcusant.com/android/epic/Shadow_CM9-CrpMdm.zip

Anyone is welcome to include this patch in their rom, just as long as you give all the contributors credit.

And also, if someone wants to make this for cm9, that'd be awesome. Use bbelos's crespo-modem branch in his device repo and use his crespo-modem branch in his vendor repo.

Then use my kernel patches at my github and make a full cm9 build and if it works, release that build and release a patch like mine with kernel, and ril bins, libs, and etc files, and build.prop and everything outside system like the mtd scripts and modify updaterscript so it works, or just use my metain folder

Sent from my SPH-D700 using Tapatalk 2
 
Last edited:

itek

Senior Member
Dec 16, 2008
86
19
SRQ, FL
First! Sweet, I always wanted to do that. :- )

And thank you so much xboxfanj for continuing to make this the phone that might never die! You and all the other great devs are definitely making it easy to
wait to upgrade to a new phone. Keep up the good work, and thanks again.
 
Last edited:

xboxfanj

Recognized Developer
Apr 24, 2011
7,313
7,797
St. Louis
First! Sweet, I always wanted to do that. :- )

And thank you so much xboxfanj for continuing to make this the phone that might never die! You and all the other great devs are definitely making it easy to
wait to upgrade to a new phone. Keep up the good work, and thanks again.

No problem. Glad you enjoy it. If there's ever anything you would like for me to port or do, PM me and I will do whatever I can to make it happen.

Sent from my SPH-D700 using Tapatalk 2
 

didhiy

Senior Member
Mar 29, 2011
1,085
1,294
Jakarta
I try to install this patch over cm7 stable & didn't work.. I think the format /system command on updater-script will erase all the previous rom
I'll try to fix it tomorrow on my free time, maybe with try find some commands to erase previous blob which unreplaceable with the patch like lib sec ril 40.so (or similar) and build.prop must be edited from the previous rom with changes on several lines.
 
  • Like
Reactions: certifiednoob93

xboxfanj

Recognized Developer
Apr 24, 2011
7,313
7,797
St. Louis
I try to install this patch over cm7 stable & didn't work.. I think the format /system command on updater-script will erase all the previous rom
I'll try to fix it tomorrow on my free time, maybe with try find some commands to erase previous blob which unreplaceable with the patch like lib sec ril 40.so (or similar) and build.prop must be edited from the previous rom with changes on several lines.
No need to delete libsecril-40. Thanks for letting me know that. Forgot to delete the format command. Got it now and the zip is updated, but at the same link.

Edit: and any CM7 ROM should be fine with CM7 build.prop AFAIK. It may not identify 100% correctly in settings>about phone, but good enough. TBH, I don't care if it says CM7 in settings while I run MIUI.
 

xboxfanj

Recognized Developer
Apr 24, 2011
7,313
7,797
St. Louis
No need to delete libsecril-40. Thanks for letting me know that. Forgot to delete the format command. Got it now and the zip is updated, but at the same link.

Edit: and any CM7 ROM should be fine with CM7 build.prop AFAIK. It may not identify 100% correctly in settings>about phone, but good enough. TBH, I don't care if it says CM7 in settings while I run MIUI.
Fixed GPS as well, sorry about the first couple batches being wrong. This one should be good. If you downloaded before, DL again.
 

Flint420

Senior Member
Mar 21, 2008
137
70
twitter.com
Not sure if it makes a difference but I flashed the modem through odin first then the patch. I'm on the newest cm7 nightly.

Sent from my SPH-D700 using Tapatalk 2
 

xboxfanj

Recognized Developer
Apr 24, 2011
7,313
7,797
St. Louis
I downloaded the newest one (not test yet) & think that this command

Code:
set_perm_recursive(0, 0, 0755, 0644, "/system");

will messed up the su permission that cause root access denied

OK, I will just not change the permissions in any folder I haven't modified. Probably some of the xbin and bin stuff is at fault too.

Thank you didhiy for looking at my updaterscripts and pointing out what to fix.
Sent from my GT-P7510 using Tapatalk 2
 
  • Like
Reactions: duce102

didhiy

Senior Member
Mar 29, 2011
1,085
1,294
Jakarta
What changes are needed in build.prop, if I was to try this on CM10?

succesful run this patch on PA 1.99 :D and Kanged CM10 0808 too

thanks to marcusant, bbelos, noobl, xboxfanj, sgktwol, darkjje, epiccm team & all great dev on xda
all credits goes to them
me just mix & match, just have fun with all the great epic community :)
you can blame me if didn't work or have some nasty bugs... but hope other can fixed it for us

ca98cd93-cb7b-c6be.jpg


ca98cc3c-18e0-3fe4.jpg


link for test or reference:
Patch for PA 1.99

Patch for CM10 0808

just flash from cwm or twrp, didn't need to wipe anything.. except an app was FC, try to clear that app data first before goes to wipe entire dalvik-cache, cache or data

don't forget to odined the crespo modem on OP
 

Attachments

  • build.prop-CM10-0808.txt
    3 KB · Views: 99
  • build.prop-PA199.txt
    3.1 KB · Views: 92
Last edited:

xboxfanj

Recognized Developer
Apr 24, 2011
7,313
7,797
St. Louis
Is it stable? Copy the last two commits here to fix GPS and modem stability: https://github.com/NexusSense4G/android_device_samsung_epicmtd/commits/crespo-modem

Also, add gpsd from my CrespoModem CM7 ROM to vendor/samsung/epicmtd/vendor/bin to fix GPS.

Let me know after you apply these patches if modem works every boot (on some old ICS builds using this, modem didn't work every boot, so reboot at least 20 times and make sure the signal bars are there, not X'ed out). If so, go ahead and release, just give me and bbelos a shout out. If you want, create your own thread for it. If not, you can certainly use the CM10 Kang thread. Also, make a patch zip like mine here if you don't mind and I can post that here, or you can make your own thread.
 
  • Like
Reactions: didhiy

didhiy

Senior Member
Mar 29, 2011
1,085
1,294
Jakarta
Sorry if I'm asking too much, but can you get a stock+backlight fixed version of the patch up and running? I'm sure others would like a Shadow version, too. Nyan never seemed to agree with me.

I'll try another build with different source tomorrow.. my internet connection was so poor so I must edit the source manually :(

posted a link for reference if you want to test a kernel build too

Is it stable? Copy the last two commits here to fix GPS and modem stability: https://github.com/NexusSense4G/android_device_samsung_epicmtd/commits/crespo-modem

Also, add gpsd from my CrespoModem CM7 ROM to vendor/samsung/epicmtd/vendor/bin to fix GPS.

Let me know after you apply these patches if modem works every boot (on some old ICS builds using this, modem didn't work every boot, so reboot at least 20 times and make sure the signal bars are there, not X'ed out). If so, go ahead and release, just give me and bbelos a shout out. If you want, create your own thread for it. If not, you can certainly use the CM10 Kang thread. Also, make a patch zip like mine here if you don't mind and I can post that here, or you can make your own thread.

just posted a link to test, it works fine after reboot (tested 3 times)
you can look over it, and if it goes fine.. maybe need to modify the build.prop for other cm10 build
just post on the OP if this tested working to other guys
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 70
    Hi, I made this thread because people have been asking me what to do to make a ROM compatible with the Nexus S 4G modem and RIL, so I made a flashable zip so you can use the modem and RIL on any CM7 based ROM (like MIUI or JoyOS or whatever you fancy).

    Note: If using a ROM not on this list, use the closest cm patch corresponding to the os and then download the phone and settings apks from the nexus s 4g Roms and either put them in the zip or push them. That way, roaming and update prl and profile will work.

    I included the KL2 modem in each AIO zip. If you do not like it, or would like to try other modem files, try the flashable zips here: http://xdaforums.com/showthread.php?t=1077168

    CM7
    just flash the zip below (made by nashdogg and I)
    http://d-h.st/dGR
    I added the nexus audio drivers in kernel and lib, and I also added voodoo color, voodoo sound, and Battery Life Extender.

    CM9 (Roaming Fixed) Instructions:
    Just flash this in CWM. Custom kernels are available in the 2nd post. http://d-h.st/U1L

    AOKP ICS (by Nashdogg)
    http://d-h.st/vVP

    Jellybean patches thanks to dropple, nashdogg, andy_nu, and didhiy ( newest patch as of 12/5/12 with nitest didhiy 1124 kernel voodoo color)

    PA 2.54 AIO ns4g modem patch- http://d-h.st/CQm

    CM10 AIO ns4g modem patch- http://d-h.st/96W

    AOKP-JB Build-4 AIO ns4g modem patch- http://d-h.st/t4n


    CM10.1 http://d-h.st/i9s

    Universal

    http://goo.im/devs/effsi/misc
    these should allow you to switch back and forth between the epic modem and nexus modem.

    what it does :
    installs blobs related to the modem
    edits build.prop lines to match the modem
    -should- work with all current versions (2.3 through 4.2.2)
    -should- work with all roms that support switching modems (aokp, cm, pa, pac, baked, hellybean, etc...)

    what it doesn't do :
    it does not install or change the actual modem itself.
    it does not install or change the kernel.
    it does not backup anything.
    it does not replace any apks.
    it does not perform any tweaks or extras of that sort.
    it does not fix issues in the system ie if 4g isn't working in the kernel this installer won't magically fix it or inversely break it if it works.

    so that means you will need to install the modem itself (through zip or the MORE RECOMMENDED METHOD OF ODIN)
    and that you will need to make sure you are on a proper kernel that supports your modem of choice.

    Ex... on stock aokp4.2.2 (which is epic modem by default) to switch to the nexus modem you would flash kernel of choice for nexus modem (didhiy/mine), then modem with recovery or odin, then flash swap2nexusmdm.zip
    Ex2... on ck10.1 (which is nexus modem by default) to switch to the epic modem you would flash modem of choice with Odin or recovery, then any kernel that supports epic modem and then flash swap2epicmdm.zip


    Note: These instructions are a bit different than effsi's as the order of flashing does matter when on an epic modem ROM and kernel as the modem flash is dependent on kernel drivers that are not present in epic modem kernels.

    Any Nexus S 4G modem can be used but the one included is supposedly best. Try any other one and let me know if it works better

    My kernel sources are at https://github.com/xboxfanj/android_kernel_samsung_victory in the gingerbread branch so if you want to make a kernel based on that or cherrypick the patches in my kernel into another kernel, you are welcome to.
    Use my commits and bbelos' commits at https://github.com/nexussense4g/android_device_samsung_epicmtd in the crespo-modem branch to get GPS and modem working on any ROM.

    Thank you to didhiy for adapting the patches that bbelos and I made. For support for Update PRL and Profile, you need to copy some of the overlays from the Nexus S 4G device sources.

    Thank you to bbelos, coolya, the CM SGS team, CM Nexus S team, AOSP, Samsung, Google, and me for making this patch.
    15
    Custom CM9 Kernels (note these are not all in one zips, so if you choose to flash these, you must also flash the AIO if you haven't already, and each time you upgrade builds, you'll need to flash the aio and the custom kernel if you still want it):

    Nyan:
    http://marcusant.com/android/epic/nyan_CM9-CrpMdm.zip

    Shadow: http://marcusant.com/android/epic/Shadow_CM9-CrpMdm.zip

    Anyone is welcome to include this patch in their rom, just as long as you give all the contributors credit.

    And also, if someone wants to make this for cm9, that'd be awesome. Use bbelos's crespo-modem branch in his device repo and use his crespo-modem branch in his vendor repo.

    Then use my kernel patches at my github and make a full cm9 build and if it works, release that build and release a patch like mine with kernel, and ril bins, libs, and etc files, and build.prop and everything outside system like the mtd scripts and modify updaterscript so it works, or just use my metain folder

    Sent from my SPH-D700 using Tapatalk 2
    10
    First! Sweet, I always wanted to do that. :- )

    And thank you so much xboxfanj for continuing to make this the phone that might never die! You and all the other great devs are definitely making it easy to
    wait to upgrade to a new phone. Keep up the good work, and thanks again.

    No problem. Glad you enjoy it. If there's ever anything you would like for me to port or do, PM me and I will do whatever I can to make it happen.

    Sent from my SPH-D700 using Tapatalk 2
    10
    I updated a patched stock kernel for cm10 nightly 0918 & after on nitest kernel thread.
    9
    Re: NS4G modem patch on CM7/9/10 based roms, nightlies and previews- 1/12/13

    NS4G Modem Patch for 4.2.2

    http://db.tt/E9i3nrqh

    NS4G Reverter for 4.2.2

    http://db.tt/Y0BVB4MQ

    Thank You all :)

    Nashdogg, hope your daughter get well soon, so you can provide the patch again :)

    Sent from my SPH-D700 using xda premium