Extracting original firmware from S905 Box using uboot md?

  • Hi, I just recently got UART access on my S905 Android Box. I have looked into ways to dump original firmware before I try LE and other distros. I could only find the method that uses uboot, as mentioned in this video by Matt Brown. The method uses bdinfo to see the memory start address (flashstart) and the size (flashsize). Unfortunately, uboot on my box doesn't have this. Here's a list of commands that I have access to, on uboot:-

    I soon found a Reddit thread with the same issue, but no proper resolution to it. But, when I do run printenv, I find some lines that seem interesting to me, as a noob:-

    Just to test if uboot md would work for the dump, I took bootup_offset as start and bootup_size as size to run md using Matt Brown's video. But, even after running for 30 minutes, all I get is 0s.

    My questions

    1. Am I on the right track? Can I use any values from the printenv output to actually dump the firmware? If yes, can you point me to the right ones?

    2. If you are wondering why I don't just download the stock firmware online, I don't get a perfect match for my box. Checking HW Info app, I get that my box is a p201. The closest stock firmware that I see is Android/p201/p201:5.1.1/LMY47V/20160118:userdebug/test-keys (available on Chinagadgetreview). But, the original one on the box has a different date and says user instead of userdebug, probably cause it was meant to be strictly for production.

    3. Can I install the stock firmware linked in question 2 above from Chinagadgetreview using my SD Card and the stock UPDATE&BACKUP app?

  • Have a read of this https://github.com/LibreELEC/amlogic-boot-fip/pull/27 - and please note that this forum really isn't interested in dealing with Android backup/recovery issues (not our OS, not our problem).

    Also note that LE does not support install of the OS to the internal storage and while booting LE from an SD card changes the boot process slightly it's not harmful to the Android install - modern upstream kernels cannot see/mount any of the partitions created by the vendor boot firmware due to Amlogic's proprietary partition scheme - so we're not going to mess Android up.

    NB: You can easily dump the full content of eMMC storage from inside LE using "dd" although this is a raw image and you will not be able to use it as recovery media in the event of eMMC issues as the u-boot in the dump is for eMMC boot only; magic headers are located at the wrong offset for SD/USB boot due to S905 requiring different offsets.

  • Have a read of this https://github.com/LibreELEC/amlogic-boot-fip/pull/27 - and please note that this forum really isn't interested in dealing with Android backup/recovery issues (not our OS, not our problem).

    Also note that LE does not support install of the OS to the internal storage and while booting LE from an SD card changes the boot process slightly it's not harmful to the Android install - modern upstream kernels cannot see/mount any of the partitions created by the vendor boot firmware due to Amlogic's proprietary partition scheme - so we're not going to mess Android up.

    NB: You can easily dump the full content of eMMC storage from inside LE using "dd" although this is a raw image and you will not be able to use it as recovery media in the event of eMMC issues as the u-boot in the dump is for eMMC boot only; magic headers are located at the wrong offset for SD/USB boot due to S905 requiring different offsets.

    Thank you for the comment. Pardon me for posting this here. I posted it here, since many members seem to have found the help for these problems on LE forum. Again, pardon me for that. I will definitely go through the link you posted. Any help counts. Thanks. Kindly close the thread if you feel this is offtopic.

  • UPDATE - COuldn't figure out a way to use uboot. Was able to finally get TWRP running. Backed it up. It cannot be used with Amlogic's USB Burning Tool, but, as long as the box has a recovery to boot to, I guess, I am relatively safe.