Biktorgj / quectel_eg25_recovery

Stock firmware recovery packages for Quectel EG25-G
81 stars 16 forks source link

Some notes about firmware versions #6

Closed Zapeth closed 3 years ago

Zapeth commented 3 years ago

I was curious about all the different firmware versions that were available online, so I compiled a list of my findings:

fw-version modem-timestamp modem-sha1 (NON-HLOS.ubi) source
EG25GGBR07A07M2G_01.001.02 2019-04-15 10:15:59 4DA6394867589A35D6EE2393AF08F28E1EE8F6F6 ftp link
EG25GGBR07A07M2G_01.002.07 2019-08-21 19:47:17 A39571B80023CD77249E8D4756B43D227D22A855 master branch
EG25GGBR07A07M2G_OCPU_01.001.04 2020-03-13 12:05:52 043634312E8D3C093F513E0CD7E2E697037CE42F A07M2G_OCPU_01.001.01.001 branch
EG25GGBR07A08M2G_01.001.10 2019-12-03 18:17:59 09353AF136AC401CABDFB572FDD3B0A4E4B320D7** stock firmware on Pinephone (pmOS CE, dont know about current Beta Edition)
EG25GGBR07A08M2G_01.002.07 2020-06-13 09:32:06 6913F5F2B3A6F3820935DC4E21E713E7CE396747 A08M2G_01.002.07 branch*
EG25GGBR07A08M2G_01.003.04 2020-11-09 18:15:59 1E03160F229451FC09DAC079F7027B9BDAFC9A7A ~quectel sharepoint~
EG25GGBR07A08_30.003.30.003*** - - -
EG25GGBR07A08M2G_30.004.01 2021-09-24 11:13:11 F38318C5D63AFCB16A9E71D02860C0CD9710C1FF ~quectel sharepoint~
EG25GGBR07A08_30.005.30.005*** - - -
EG25GGBR07A08M2G_30.006.02 2022-01-07 13:06:17 3970E4F87D77E1A9B2B74D7EAE39FDD934934C31 A08M2G_30.006.30.006 branch
EG25GGBR07A08M2G_30.007.01 2022-05-18 22:05:53 - A08M2G_30.007.30.007 branch
EG25GGBR07A08M2G_30.200.02 2022-12-08 20:46:48 - A08M2G_30.200.30.200 branch
EG25GGBR07A08M2G_30.201.01 2023-03-14 16:55:44 2B597FD3D718501824750540E67DC78DD736A9BD hub.digi.com link
EG25GGBR07A08M2G_30.202.01 2023-06-14 15:26:59 - A08M2G_30.202.30.202 branch
EG25GGBR07A08M2G_30.203.02 2023-12-12 18:22:56 - A08M2G_30.203.30.203 branch

* ... binary identical to A08M2G_01.002.01.002 branch (except this one also includes the pdfs about the release changes) ** ... hash of dumped modem partition (due to lack of official flashable files) *** ... mentioned in release notes of later firmware version, no publicly available files found

The fw-version information was taken from the /usr/bin/quectel_daemon file in the rootfs partition, the modem-timestamp from the /Ver_Info.txt file in the modem partition.

I couldn't find any flashable files for the stock version online, so I tried dumping them from my phone. However I was only able to get the ubifs volumes for rootfs and modem, I'm not sure how boot and recovery partitions can be dumped (if at all). And even those dumped ubifs volumes seem to include unallocated data, so I'm not sure if those are safe for flashing.

Though any hints about properly dumping them would be appreciated (first time working with this kind of stuff).

Biktorgj commented 3 years ago

You can do it from EDL mode. You will be missing some partition information you can later retrieve from any of the other firmware update packages, but at least you'll be able to dump all of the partitions. The stock kernel is hacked to prevent you from dumping some of the partitions.

Check out EDL tools from here: https://github.com/bkerler/edl And run: ./edl.py rl dumps --skip=userdata --genxml while in EDL mode in the modem

Zapeth commented 3 years ago

Check out EDL tools from here: https://github.com/bkerler/edl And run: ./edl.py rl dumps --skip=userdata --genxml while in EDL mode in the modem

You mean this should be executed from the rootfs partition or from phone userspace (emmc/sd)?

In case of the former, whats the best/cleanest way to install the necessary requirements for edl.py? (python3, pip and dependencies).

In case of the latter, I'm guessing the installation instructions are still applicable for the pinephone (distro differences notwithstanding)?

Biktorgj commented 3 years ago

You need to run this from the Pinephone, it wouldn't fit in the modem :). Simply follow the installation instructions for linux and you're set If running stock firmware, you can run adb reboot edl to force reboot into EDL mode, then run the command. It should take a while to download everything as EDL is relatively slow

Zapeth commented 3 years ago

Thanks, I managed to dump the partitions now (which is basically all data that is listed here).

It would be even better if the firmware files that were used for flashing the stock version were available, but I guess this should suffice (assuming its safe to use them for re-flashing?)

Also here's the sha-1 of my dumped modem.bin, maybe this can still be matched between different devices? -> 09353AF136AC401CABDFB572FDD3B0A4E4B320D7

Biktorgj commented 3 years ago

If it has never been mounted rw maybe, but don't think so since you're probably also dumping the empty space at the end of the partition. If you want to do that you're better just doing shasum's of the files themselves.

Since that firmware version is not available at my repo, can you share it with me so I can make a flashable package? I would need all files except usr_data, misc and efs partitions

AndreySV commented 3 years ago

As @Zapeth I've dumped stock PinePhone modem firmware (pmOS edition). It certainly would be useful to have flashable package of it, just in case. Here is archive with my backup files: https://skv.freedombox.rocks/export/mobian/EG25GGBR07A08M2G_01.001.01.001.tar.xz

Will ./edl.py wf dump.bin restore modem to original state if full backup was made before using ./edl.py rf flash.bin?

'The stock kernel is hacked to prevent you from dumping some of the partitions.' Making backup using EDL will not have this limitation?

Biktorgj commented 3 years ago

When you dump via EDL you bypass any limitation inserted by Quectel, so yes, you read everything, as you should being the owner of your device :)

Don't try (at least at this point with edl tools) to flash it back with EDL. I broke (without remedy) a modem this way when something went south and marked some sectors in the partition table as badblocks

Tomorrow will download your file and make a flashable package. Thanks!

Zapeth commented 3 years ago

Thanks @AndreySV for providing your files, I haven't gotten around to find a suitable file host for uploading mine yet.

However comparing the dumped files, almost all partitions are identical anyway, so I guess the empty partition space didn't end up being an issue afterall (in regards to reproducibility).

Biktorgj commented 3 years ago

Okay, pushed! I have only diverted from the default branch for the kernel, recovery, modem and system partition, as all the rest should be identical or almost identical, and I wouldn't want to mess around with bootloaders without reasons as this is first a recovery repo and second a firmware archive (don't want anyone bricking because they selected the wrong branch)

I also added some other firmware versions I had but hadn't published (in case you're curious) https://github.com/Biktorgj/quectel_eg25_recovery/branches/all