[WIP][CM7][UNOFFICIAL][MTD][SGH-T959V] 2.3.7 7.2.0-rc1 [04/21/2012]

Status
Not open for further replies.
Search This thread

bhundven

Inactive Recognized Developer
READ EVERYTHING.

COME BACK AND RE-READ THE WHOLE OP ON EVERY UPDATE.

IF YOU ARE OUT OF DATE, RE-READ THE WHOLE OP.


I hope the instructions get easier over time... ;)

Credits:
  • TeamAcid - For helping with early bml stuff!
  • m4xm4n - For rild many other helpful fixes! (now a part of TeamAcid)
  • hamsterblade - For incoming ringtone fix
  • EpicCM - The boards on our phones are both different then aries, so it was helpful to understand your device repo layout.
  • windxixi - For some of the fixes in his device tree for sk4g. Our phones are somewhat similar and somewhat different.
  • Krylon360 - For the original device repo and help along the way.
  • drhonk - Tiny Preempt RCU.
  • noobnl and Kaik541 on #cmsgs for helping me out, even if they couldn't answer my questions. Helpful to bounce problems off others. :)
  • People in #teamnerd for the support
  • Those that donated so I can have coffee and beer!
CyanogenMod is a free, community built, aftermarket firmware distribution of Android 2.3 (Gingerbread), which is designed to increase performance and reliability over stock Android for your device.

Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
* This mod is only for the Samsung Galaxy S 4G (SGH-T959V) or VibrantPlus.
* This mod will not work on Vibrant or any other phone that is not the SGS4G.
*/
CyanogenMod is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. CyanogenMod does still include various hardware-specific code, which is also slowly being open-sourced anyway.

The OTA package is now posted in the Third Post. The Rom/Kernel seems pretty stable and could use some user testing. I'm able to use this as my phone. There are some problems... so...

**Things that work and features (not in any particular order)**
  • MTD and YAFFS2.
  • reset-v0.4.1-mtd kernel. (newly reverted to stock and updated manually... see here)
  • Tiny Preempt RCU in the kernel for lower memory allocation overhead.
  • CWM 5.0.2.8 (stock).
  • 2d and 3d Graphics. Seems smooth.
  • Brightness control - thanks m4xm4n!
  • USB Storage in recovery works... in android it is broken.
  • Modem/RIL works. Get GSM/3g/4g! - I have some issues with rild. Mine seems to stay in "GSM" more then "HSPA"...
  • SMS works (when rild works)
  • Wifi now works! - Seems pretty stable for me.
  • BLN! (Use the pro app!)
  • Ringtones work!

**Known Issues**
  • Bluetooth does not work.
  • GPS does not work.
  • Rebooting to recovery or download mode is broken. If you know how to fix it, pm me!
  • hampsterblade has noticed some issues with call volume handling.
  • Again... USB storage in android is broken. Someone told me that it was upstream, but I can't find a bug on it in gerrit. So it must be a local problem.
  • If you find more issues, please check with CM7 gerrit before you think it's a problem with something I've done. ;)

Get the build from the thrid post. Make sure you read all the instructions before trying anything!
INSTRUCTIONS:
- First time flashing CM 7 to your Galaxy S 4G (or coming from another ROM)?
  1. INSTALL THE LATEST VERSION OF HEIMDALL
  2. Reboot to download mode.
  3. Heimdall my sms-kj6-v0.1.x with CWM 5.0.2.7.
    Code:
    bryan@bh-t410:~$ heimdall flash --kernel zImage
  4. Reboot to recovery.
  5. Do a full Nandroid backup!
  6. Go to 'mounts and storage'
  7. format /cache, /data, and /system
  8. Backup the /efs partition to the sdcard using 'adb shell' (you may or may not have to 'mkdir /efs' and 'mkdir /sdcard')
    Code:
    bryan@bh-t410:~$ adb shell
    * daemon not running. starting it now on port 5037 *
    * daemon started successfully *
    # mount -t vfat /dev/block/stl3 /efs
    # mount -t vfat /dev/block/mmcblk0p1 /sdcard
    # cd /efs
    # tar cf /sdcard/efs-backup.tar *
    # md5sum /sdcard/efs-backup.tar > /sdcard/efs-backup.tar.md5
  9. Copy the efs-backup.tar.gz and efs-backup.tar.gz.md5 to your computer!
  10. Advanced -> reboot to download mode
  11. Heimdall the boot.img from the out directory to the kernel partition.
    Code:
    bryan@bh-t410:~$ heimdall flash --kernel boot.img
  12. Boot to recovery (hold vol+ and vol-. Hold power until you see the Galaxy S screen. Then let go of power but keep holding vol+&vol- till you see recovery.)
  13. Use 'adb shell' to restore the /efs partition (again, you may or may not have to 'mkdir /efs' and/or 'mkdir /sdcard')
    Code:
    bryan@bh-t410:~$ adb shell
    erase_image efs
    mount /efs
    mount /sdcard
    cd /efs
    md5sum -c /sdcard/efs-backup.tar.md5 && tar xf /sdcard/efs-backup.tar
    Note: This does not erase the old bml efs partition. So when you go back to bml, you will be using the efs partition that you backed up from. The mtd partition you restored to will then be gone.
  14. Go to 'mounts and storage'
  15. 'mount USB storage', mount the device on your computer, copy over update.zip in the out directory, type 'sync' if you're on linux or mac (sync the filesystem buffers to disk) and unmount the storage on the computer. Then unmount the sdcard on the phone.
  16. format /boot, /cache, /data, and /system
  17. Go to the main menu: 'wipe data/factory reset'
  18. 'install zip from sdcard' install update.zip
  19. Optionally install the Google Apps (located at the bottom of the page).
  20. Reboot


- If you already have cm7 mtd installed, Just do the following:
  1. boot to recovery
  2. copy the zip to your sdcard
  3. install the new zip from sdcard
  4. advanced -> fix permissions
  5. Reboot

- To go back to Stock/BML, you must get into download mode and heimdall one-click back to kj6 with sms-cwm. Flash bootloaders!. I usually then cwm install the sms-kj6-v0.1.1-rc2, before I install a new rom or nandroid restore.

To make an Unoffical galaxys4gmtd build of CM7, go to the fourth post.
 
Last edited:

bhundven

Inactive Recognized Developer
Last edited:

Fluidification

Senior Member
Feb 26, 2011
2,280
1,460
Wow, looks like it booted up for you huh?

Also,
does themes already work?
Cyanbread??

---------- Post added at 04:27 PM ---------- Previous post was at 04:22 PM ----------

by the way, you are amazing bh!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 

hechoen

Senior Member
May 7, 2011
2,686
1,391
Bryan

Merry Christmas to you to buddy. Thanks for sticking around. Might not be getting this without your help.
 

thomas.raines

Recognized Developer
Jun 23, 2011
2,200
3,914
Hutto
With the efs issue, will this erase the current efs if someone were to flash it for testing purposes? And would one be able to restore their efs with a cwm backup?

Sent from my BAMF SGH-T959V!
 

bigtom624

Senior Member
Jun 23, 2010
1,600
815
Philadelphia Pa.
Awesome Bryan. I've had CM7 on my Vibrant for about a year now and I love it. It will be really great to have on my SGS4G. Thanks for all the time and work you put into bringing it to this phone.
 

bhundven

Inactive Recognized Developer
With the efs issue, will this erase the current efs if someone were to flash it for testing purposes? And would one be able to restore their efs with a cwm backup?

As per the current partition layout, the efs is untouched. In all my work, bricks, messup's partition wipeouts, my efs has stayed in tact. I'm thinking about taking a little space from userdata for an mtd efs partition (that wouldn't wipe the old efs partition) and enable /sd-ext (mmcblk0p2) for some more user data space stored on the sdcard.

I'm still not sure though. I'm going to research some of the other galaxys phones and see what they did.
 

g4ry12

Senior Member
Oct 17, 2011
97
35
First of all, thank you Bryan for all your work.

Also, I look through commits at GitHub sometimes, and while I'm no good in kernel programming, I guess this change in cyanogen_galaxys4gmtd_defconfig:

Code:
-CONFIG_TUN=m
+CONFIG_TUN=y

...means the TUN module is enabled by default. This is great for those who use a VPN, thank you once more for that.
 
Last edited:

bhundven

Inactive Recognized Developer
First of all, thank you very much for your work.

Also, I look through commits at GitHub sometimes, and while I'm no good in kernel programming, I guess this change in cyanogen_galaxys4gmtd_defconfig:

Code:
-CONFIG_TUN=m
+CONFIG_TUN=y
...means the TUN module is enabled by default. This is great for those who use a VPN, thank you once more for that.

Yup. Many things are now compiled in. Still have to insmod dhd.ko and bthid.ko, but I'm still looking for ways to get them compiled in. Less modules to load manually, means less for me to forget :D
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 55
    READ EVERYTHING.

    COME BACK AND RE-READ THE WHOLE OP ON EVERY UPDATE.

    IF YOU ARE OUT OF DATE, RE-READ THE WHOLE OP.


    I hope the instructions get easier over time... ;)

    Credits:
    • TeamAcid - For helping with early bml stuff!
    • m4xm4n - For rild many other helpful fixes! (now a part of TeamAcid)
    • hamsterblade - For incoming ringtone fix
    • EpicCM - The boards on our phones are both different then aries, so it was helpful to understand your device repo layout.
    • windxixi - For some of the fixes in his device tree for sk4g. Our phones are somewhat similar and somewhat different.
    • Krylon360 - For the original device repo and help along the way.
    • drhonk - Tiny Preempt RCU.
    • noobnl and Kaik541 on #cmsgs for helping me out, even if they couldn't answer my questions. Helpful to bounce problems off others. :)
    • People in #teamnerd for the support
    • Those that donated so I can have coffee and beer!
    CyanogenMod is a free, community built, aftermarket firmware distribution of Android 2.3 (Gingerbread), which is designed to increase performance and reliability over stock Android for your device.

    Code:
    #include <std_disclaimer.h>
    /*
    * Your warranty is now void.
    *
    * I am not responsible for bricked devices, dead SD cards,
    * thermonuclear war, or you getting fired because the alarm app failed. Please
    * do some research if you have any concerns about features included in this ROM
    * before flashing it! YOU are choosing to make these modifications, and if
    * you point the finger at me for messing up your device, I will laugh at you.
    * This mod is only for the Samsung Galaxy S 4G (SGH-T959V) or VibrantPlus.
    * This mod will not work on Vibrant or any other phone that is not the SGS4G.
    */
    CyanogenMod is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. CyanogenMod does still include various hardware-specific code, which is also slowly being open-sourced anyway.

    The OTA package is now posted in the Third Post. The Rom/Kernel seems pretty stable and could use some user testing. I'm able to use this as my phone. There are some problems... so...

    **Things that work and features (not in any particular order)**
    • MTD and YAFFS2.
    • reset-v0.4.1-mtd kernel. (newly reverted to stock and updated manually... see here)
    • Tiny Preempt RCU in the kernel for lower memory allocation overhead.
    • CWM 5.0.2.8 (stock).
    • 2d and 3d Graphics. Seems smooth.
    • Brightness control - thanks m4xm4n!
    • USB Storage in recovery works... in android it is broken.
    • Modem/RIL works. Get GSM/3g/4g! - I have some issues with rild. Mine seems to stay in "GSM" more then "HSPA"...
    • SMS works (when rild works)
    • Wifi now works! - Seems pretty stable for me.
    • BLN! (Use the pro app!)
    • Ringtones work!

    **Known Issues**
    • Bluetooth does not work.
    • GPS does not work.
    • Rebooting to recovery or download mode is broken. If you know how to fix it, pm me!
    • hampsterblade has noticed some issues with call volume handling.
    • Again... USB storage in android is broken. Someone told me that it was upstream, but I can't find a bug on it in gerrit. So it must be a local problem.
    • If you find more issues, please check with CM7 gerrit before you think it's a problem with something I've done. ;)

    Get the build from the thrid post. Make sure you read all the instructions before trying anything!
    INSTRUCTIONS:
    - First time flashing CM 7 to your Galaxy S 4G (or coming from another ROM)?
    1. INSTALL THE LATEST VERSION OF HEIMDALL
    2. Reboot to download mode.
    3. Heimdall my sms-kj6-v0.1.x with CWM 5.0.2.7.
      Code:
      bryan@bh-t410:~$ heimdall flash --kernel zImage
    4. Reboot to recovery.
    5. Do a full Nandroid backup!
    6. Go to 'mounts and storage'
    7. format /cache, /data, and /system
    8. Backup the /efs partition to the sdcard using 'adb shell' (you may or may not have to 'mkdir /efs' and 'mkdir /sdcard')
      Code:
      bryan@bh-t410:~$ adb shell
      * daemon not running. starting it now on port 5037 *
      * daemon started successfully *
      # mount -t vfat /dev/block/stl3 /efs
      # mount -t vfat /dev/block/mmcblk0p1 /sdcard
      # cd /efs
      # tar cf /sdcard/efs-backup.tar *
      # md5sum /sdcard/efs-backup.tar > /sdcard/efs-backup.tar.md5
    9. Copy the efs-backup.tar.gz and efs-backup.tar.gz.md5 to your computer!
    10. Advanced -> reboot to download mode
    11. Heimdall the boot.img from the out directory to the kernel partition.
      Code:
      bryan@bh-t410:~$ heimdall flash --kernel boot.img
    12. Boot to recovery (hold vol+ and vol-. Hold power until you see the Galaxy S screen. Then let go of power but keep holding vol+&vol- till you see recovery.)
    13. Use 'adb shell' to restore the /efs partition (again, you may or may not have to 'mkdir /efs' and/or 'mkdir /sdcard')
      Code:
      bryan@bh-t410:~$ adb shell
      erase_image efs
      mount /efs
      mount /sdcard
      cd /efs
      md5sum -c /sdcard/efs-backup.tar.md5 && tar xf /sdcard/efs-backup.tar
      Note: This does not erase the old bml efs partition. So when you go back to bml, you will be using the efs partition that you backed up from. The mtd partition you restored to will then be gone.
    14. Go to 'mounts and storage'
    15. 'mount USB storage', mount the device on your computer, copy over update.zip in the out directory, type 'sync' if you're on linux or mac (sync the filesystem buffers to disk) and unmount the storage on the computer. Then unmount the sdcard on the phone.
    16. format /boot, /cache, /data, and /system
    17. Go to the main menu: 'wipe data/factory reset'
    18. 'install zip from sdcard' install update.zip
    19. Optionally install the Google Apps (located at the bottom of the page).
    20. Reboot


    - If you already have cm7 mtd installed, Just do the following:
    1. boot to recovery
    2. copy the zip to your sdcard
    3. install the new zip from sdcard
    4. advanced -> fix permissions
    5. Reboot

    - To go back to Stock/BML, you must get into download mode and heimdall one-click back to kj6 with sms-cwm. Flash bootloaders!. I usually then cwm install the sms-kj6-v0.1.1-rc2, before I install a new rom or nandroid restore.

    To make an Unoffical galaxys4gmtd build of CM7, go to the fourth post.
    32
    Seventh (1st Reset) Release - 04/21/2012 (01:41:41AM PST):
    boot.img
    update.zip

    Sixth Release - 04/19/2012 (6:47PM PST):
    boot.img
    update.zip

    Fifth Release - 04/18/2012 (2:13PM PST):
    boot.img
    update.zip

    Forth Release - 04/09/2012 (10:17PM PST):
    boot.img
    update.zip

    Third Release - 04/09/2012 (2:15PM PST):
    boot.img
    update.zip

    Second Release - 04/08/2012 (12:15PM PST):
    boot.img
    update.zip

    First Release - 04/05/2012 (8:12PM PST):
    boot.img
    update.zip
    26
    You can find our current changes by browsing over to github:

    http://github.com/teamacid/
    24
    Building CM7 from source

    The build is now on the teamacid repository.
    Please follow the updated build instructions on the wiki:

    http://xdaforums.com/wiki/Samsung_Galaxy_S/SGH-T959V/Building_From_Source
    16
    Okay, finally got around to making the CWM zips for making the installs easier on the users.
    INSTRUCTIONS
    1. Download both zip files, plus the latest update.zip and boot.img from the downloads post on this thread
    2. Transfer all 3 zips to your phone
    3. Reboot to recovery (RED CWM)
    4. Do a nandroid backup of your current ROM
    5. Flash cm7-efs-backup.zip
    6. Put your phone into download mode
    7. Flash the latest boot.img from bryan's OP using HEIMDALL
    8. You should now be in the BLUE CWM menu
    9. Do a factory reset (Main Menu > wipe data/factory reset, you might get a format volume error. It's normal, continue)
    10. Format and mount /system (Main Menu > format /system & mount /system)
    11. Flash cm7-efs-restore.zip
    12. Flash the cm7 rom zip you downloaded, and the gapps zip if you want
    13. Reboot and enjoy CM7.

    DOWNLOADS
    cm7-efs-backup.zip
    cm7-efs-restore.zip

    EXPLANATION
    The problem was that the phone won't like it if you flash the kernel via CWM, so you have to do it via heimdall or it won't work for you.
    For the curious ones. I just made a few scripts that get run through CWM that do a lot of the steps in Bryan's OP for you. It'll do all the efs backup and restore for you, which will make flashing CM7 a little more trivial