How to backup your modem.

Search This thread

dapaua

Senior Member
Dec 27, 2006
360
247
Barcelona
There is a modem for the optimus G here:
http://downloads.codefi.re/houstonn/lgog/modem/E975_E977_E976
but it is from firmware 10b. You may want to try if it works better than your firmware. In this case, it is better if you make a backup of your current modem firmware, so you can go back to your version. Here I will write instructions to backup your modem, so you can restore it if you need.

Probably some of you know this already and feel like these are old news, but maybe we can build a modem firmware library.

You need root and a way to make an adb connection to your phone. If you cannot use adb, you can always use a terminal emulator on your phone, but this makes it a bit harder to type the commands. Also, this is for people who understand what they are doing. If after reading the tutorial you don't understand what the commands do, please don't try it. Or at least don't make me responsible if your phone bricks. Here we go.

NON NEEDED STEPS: This steps are here to show why this works.
1-Connect to your phone by adb.
2- On the terminal type :
Code:
mount
You'll see the following (amongst other things):
Code:
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,context=u:object_r:radio_efs_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0

This means that the partition containing the firmware is /dev/block/platform/msm_sdcc.1/by-name/modem and it is mounted at /firmware.

NEEDED STEPS
1- Connect by adb
2- On the terminal type
Code:
su
Check if confirmation is needed on the phone screen. If needed, accept.
3-
On the terminal type:
Code:
dd if=/dev/block/platform/msm_sdcc.1/by-name/modem of=/sdcard/modem.img
4-You will receive the following after some seconds:
Code:
131072+0 records in
131072+0 records out
67108864 bytes transferred in 29.959 secs (2240023 bytes/sec)
5-Type
Code:
exit
exit
adb pull /sdcard/modem.img

6-Now you have your backup.

HOW TO PACK THIS BACKUP FOR FLASH:
1-Download the file: cwm-lgog_e975-europe-10b_modem.zip from http://downloads.codefi.re/houstonn/lgog/modem/E975_E977_E976
2-Open the zip file and replace the existing modem.img with your file
3-Rename the file to something meaningful, like cwm-lgog_e975-europe-10f_modem.zip


After these steps, you should be able to flash any modem, knowing that you can go back to your old version.
You can upload the packed files here, so we can have a library. I will upload the modem from european 10f version here. I tested it and it works correctly, but I won't take any responsibility for what you do with this file.
Good luck.

All this info is obtained from examining the houstonn LGOG modem flasher from team codefire, so all thanks go to them. Thanks.
 
Last edited:

kimitza

Senior Member
Feb 27, 2010
2,012
731
43
Buzau
Nice,i'll add this to the Freaking Annoying Questions.

Sent from Asylum via LG E975/smart phones,dumb people.
 

sonty

Member
Dec 7, 2010
47
46
could you please do the same thing for the misc partition and upload it somewhere?
I saw that freegee is touching this one so please mention if your phone was opened with freegee.
 

dapaua

Senior Member
Dec 27, 2006
360
247
Barcelona
could you please do the same thing for the misc partition and upload it somewhere?
I saw that freegee is touching this one so please mention if your phone was opened with freegee.

I am sorry, I am not going to upload my misc partition, as this partition contains my IMEI.
I can, however, tell you how to backup it:
Code:
dd if=/dev/block/platform/msm_sdcc.1/by-name/misc of=/sdcard/misc.img

Can I ask why you need that?
 

sonty

Member
Dec 7, 2010
47
46
I am sorry, I am not going to upload my misc partition, as this partition contains my IMEI.
Can I ask why you need that?
I had no idea the IMEI is also there. I asked for it because the baseband version is also stored there and it's kind of odd to know I'm flashing the modem from EU-10f and the displayed version is TW-10a. I'm still hoping to solve that issue.
 

dapaua

Senior Member
Dec 27, 2006
360
247
Barcelona
Ah, OK. Tomorrow I'll check if the misc partition can be mounted, this would make editing it much easier.
 

jumper8

New member
Sep 26, 2013
3
2
Ah, OK. Tomorrow I'll check if the misc partition can be mounted, this would make editing it much easier.

I think it is not possible to mount the misc partition.

“In any case, the misc partition isn't a "filesystem" partition as you are familiar with. It is actually just a simple data structure. In fact, only the system, cache, and userdata partitions are actually filesystem partitions, and the cache partition is only a filesystem partition part of the time -- during radio and spl updates, it also is used as a simple data structure with a header field and a payload field...”

http://xdaforums.com/showpost.php?p=7254425&postcount=3

I was trying to find some additional info about this structure but without success so far.

On may F180K the misc partition has 16 777 216 Bytes. Some interesting offset:
0x8000 – 0x800E IMEI (15Bytes)
0x8800 – 0x8824 Baseband version (37Bytes)
0x9000 – 0x9024 Baseband version (37Bytes)

CyanogenMod display the last one data on the Settings->About phone->Baseband version
 
  • Like
Reactions: dapaua

dapaua

Senior Member
Dec 27, 2006
360
247
Barcelona
I think it is not possible to mount the misc partition.

“In any case, the misc partition isn't a "filesystem" partition as you are familiar with. It is actually just a simple data structure. In fact, only the system, cache, and userdata partitions are actually filesystem partitions, and the cache partition is only a filesystem partition part of the time -- during radio and spl updates, it also is used as a simple data structure with a header field and a payload field...”

http://xdaforums.com/showpost.php?p=7254425&postcount=3

I was trying to find some additional info about this structure but without success so far.

On may F180K the misc partition has 16 777 216 Bytes. Some interesting offset:
0x8000 – 0x800E IMEI (15Bytes)
0x8800 – 0x8824 Baseband version (37Bytes)
0x9000 – 0x9024 Baseband version (37Bytes)

CyanogenMod display the last one data on the Settings->About phone->Baseband version

Thanks.

You are totally right, this partition is not a filesystem. And it is mostly empty, it's all zeros except for some bytes. Most of it are text strings, but there are some small binary parts.
I think the 0x8800 - 0x8824 part is the original firmware version.

I wouldn't touch that partition, seems too dangerous :) .
 

sonty

Member
Dec 7, 2010
47
46
I wouldn't touch that partition, seems too dangerous :) .
freegee touches it. I see it made a backup and the difference is that it changed some bytes to 0 (offsets 0x40-0x52), then wrote ANDROID-BOOT at offset 0x4000. the rest is the same. it seems there's nothing like a crc so basically I could write whatever I want in that version field. the bad part is that as an user you'll never know what modem version you have since its version is not stored on the modem partition. I wonder who came up with this system and what was he thinking.
thanks for the clarification. offtopic over :).
 

jumper8

New member
Sep 26, 2013
3
2
I had no idea the IMEI is also there. I asked for it because the baseband version is also stored there and it's kind of odd to know I'm flashing the modem from EU-10f and the displayed version is TW-10a. I'm still hoping to solve that issue.

Some time ago I had the same issue. I solved it by modifying binary data on the misc partition. I was done this only on CM10.1 (F180K). I don’t know if it will work on other custom rom especially stock one.
Today I’ve done this one more time for preparation the following procedure. Maybe some one will use it on the future.

STEPS:

0. Backup the misc partition with your recovery. I was used CWM Advance Edition PhilZ Touch 5:

Backup and Restore-> Custom Backup and Restore->Custom Backup Job->Backup misc (*)

I’m not sure if all CWMs version support misc partition backup. TWRP not support it right now.

1. Dump the misc partition to /sdcard.

Code:
adb wait-for-device
adb root
adb shell "dd if=/dev/block/platform/msm_sdcc.1/by-name/misc of=/sdcard/misc_orig.img"
OUTPUT:
32768+0 records in
32768+0 records out
16777216 bytes transferred in 6.539 secs (2565715 bytes/sec)

2. Pull the image to your PC
Code:
adb pull /sdcard/misc_orig.img misc_orig.img

3. Edit downloaded image file by your favorite hex editor (e.g. Notepad++ with Hex-Editor plugin)

Find both baseband name strings (mine were on offset 0x8800 and 0x9000) and change them (CM10.1 use the last one to set gsm.version.baseband in file /system/bin/fetch-swv).

REMEMBER:
- Do not use regular text editor (like Notepad or vi) – they can add some extra characters to the file.
- If possible try to modify only bytes responsible for original baseband name. If the new name is shorter, simply put spaces char (0x20) to clear unwanted chars. If you need to put the longer name, be careful. I don’t know the max size for this string. There are dozens of zeros behind the baseband name on my image file. So, for testing I added extra 20 Bytes text. The new baseband name was shown without problem.

4. Push the modified image file to your phone

Code:
 adb push misc_orig.img /sdcard/misc_mod.img

Check if size of the original and modified files are equal.

5. Write the modified image to the misc partition

Code:
adb shell "dd if=/sdcard/misc_mod.img  of=/dev/block/platform/msm_sdcc.1/by-name/misc "
OUTPUT:
32768+0 records in
32768+0 records out
16777216 bytes transferred in 4.183 secs (4010809 bytes/sec)

6. Reboot your phone
DONE.
 
Last edited:

hash.86

Senior Member
ok as a newbie i cant figure out how to back up modem using adb... but after reading stuff what i did :
downloaded "Android Terminal Emulator" from playstore
open emulator in phone wrote as u mentioned :

su
dd if=/dev/block/platform/msm_sdcc.1/by-name/modem of=/sdcard/modem.img

after some seconds this came out :

131072+0 records in
131072+0 records out
67108864 bytes transferred in 15.229 secs

then :

exit
exit

after that i checked sdcard but there was no img file...
then i open file manager from the phone and there it was my precious :laugh:
size = 64mb... is it normal?
anyway .. made a new folder "modem" copied the img file into modem folder (using file manger) again connected the phone to pc copied the modem folder on my desktop...
hope it will help new guys here like me :good:
 
Last edited:

pedro5148

Senior Member
Mar 28, 2014
258
54
Goiânia
after installing the European kitkat I lost my LGOG E977 modem, anyone have some backup there to help me?

how to fix this?

:crying::crying::crying::crying::crying::crying::crying::crying::crying:
 

pedro5148

Senior Member
Mar 28, 2014
258
54
Goiânia
Back to JB I recovered the IMEI, but I have no carrier signal.
So do the root with towelroot, unlock custom recovery with FreeGee, do I back up EFS, and when I restart the machine it loses the IMEI.

So I install the modem and E97710b.kdz for E97710b model recover EFS and nothing happens, still no sign of the operator ...

---------- Post added at 02:22 PM ---------- Previous post was at 02:22 PM ----------

Get back to JB and wait for your midel update

even going back to JB, I continued without the modem
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    There is a modem for the optimus G here:
    http://downloads.codefi.re/houstonn/lgog/modem/E975_E977_E976
    but it is from firmware 10b. You may want to try if it works better than your firmware. In this case, it is better if you make a backup of your current modem firmware, so you can go back to your version. Here I will write instructions to backup your modem, so you can restore it if you need.

    Probably some of you know this already and feel like these are old news, but maybe we can build a modem firmware library.

    You need root and a way to make an adb connection to your phone. If you cannot use adb, you can always use a terminal emulator on your phone, but this makes it a bit harder to type the commands. Also, this is for people who understand what they are doing. If after reading the tutorial you don't understand what the commands do, please don't try it. Or at least don't make me responsible if your phone bricks. Here we go.

    NON NEEDED STEPS: This steps are here to show why this works.
    1-Connect to your phone by adb.
    2- On the terminal type :
    Code:
    mount
    You'll see the following (amongst other things):
    Code:
    /dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,context=u:object_r:radio_efs_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0

    This means that the partition containing the firmware is /dev/block/platform/msm_sdcc.1/by-name/modem and it is mounted at /firmware.

    NEEDED STEPS
    1- Connect by adb
    2- On the terminal type
    Code:
    su
    Check if confirmation is needed on the phone screen. If needed, accept.
    3-
    On the terminal type:
    Code:
    dd if=/dev/block/platform/msm_sdcc.1/by-name/modem of=/sdcard/modem.img
    4-You will receive the following after some seconds:
    Code:
    131072+0 records in
    131072+0 records out
    67108864 bytes transferred in 29.959 secs (2240023 bytes/sec)
    5-Type
    Code:
    exit
    exit
    adb pull /sdcard/modem.img

    6-Now you have your backup.

    HOW TO PACK THIS BACKUP FOR FLASH:
    1-Download the file: cwm-lgog_e975-europe-10b_modem.zip from http://downloads.codefi.re/houstonn/lgog/modem/E975_E977_E976
    2-Open the zip file and replace the existing modem.img with your file
    3-Rename the file to something meaningful, like cwm-lgog_e975-europe-10f_modem.zip


    After these steps, you should be able to flash any modem, knowing that you can go back to your old version.
    You can upload the packed files here, so we can have a library. I will upload the modem from european 10f version here. I tested it and it works correctly, but I won't take any responsibility for what you do with this file.
    Good luck.

    All this info is obtained from examining the houstonn LGOG modem flasher from team codefire, so all thanks go to them. Thanks.
    4
    Hi all,

    I just create a .zip to backup your modem / baseband / radio with your recovery (CWM / TWRP...)
    1
    Ah, OK. Tomorrow I'll check if the misc partition can be mounted, this would make editing it much easier.

    I think it is not possible to mount the misc partition.

    “In any case, the misc partition isn't a "filesystem" partition as you are familiar with. It is actually just a simple data structure. In fact, only the system, cache, and userdata partitions are actually filesystem partitions, and the cache partition is only a filesystem partition part of the time -- during radio and spl updates, it also is used as a simple data structure with a header field and a payload field...”

    http://xdaforums.com/showpost.php?p=7254425&postcount=3

    I was trying to find some additional info about this structure but without success so far.

    On may F180K the misc partition has 16 777 216 Bytes. Some interesting offset:
    0x8000 – 0x800E IMEI (15Bytes)
    0x8800 – 0x8824 Baseband version (37Bytes)
    0x9000 – 0x9024 Baseband version (37Bytes)

    CyanogenMod display the last one data on the Settings->About phone->Baseband version