dipcore / mstar-bin-tool

Scripts to manipulate Mstar firmware binaries (e.g. MstarUpgrade.bin, LetvUpgrade.bin etc)
274 stars 130 forks source link

[question] setenv on partition? #4

Closed bs135 closed 5 years ago

bs135 commented 5 years ago

I unpacked a BIN file. Some partition sessions have setenv command. How do I modify config file for it?

# File Partition: recovery
filepartload 0x20200000 $(UpgradeImage) 0x1c8000 0xe44250
mmc erase.p misc
mmc erase.p recovery
mmc write.p 0x20200000 recovery 0xE44250 1
filepartload 0x20200000 $(UpgradeImage) 0x100d000 0x220
store_secure_info recoverySign 0x20200000
setenv recoverycmd mmc read.p 0x24D00000 recovery 0x00F00000\; authenticateAN 0x24D00000\; bootm 0x24D00000
saveenv
dipcore commented 5 years ago

Just copy all setenv and saveenv commands from your original header script to "Suffix:" section. These commands just set some environment variables and they can be located anywhere in the header script. So it is not a problem to have all of them together in one Suffix section.

Take a look on this config as an example https://github.com/dipcore/mstar-bin-tool/blob/master/configs/letv-x355pro-recovery.ini

dipcore commented 5 years ago

BTW If you are trying to pack recovery partition only then you need to copy setenv commands related to recovery only. No need to copy all setenv commands. Just look on the example I mention above.

bs135 commented 5 years ago

I tried and it work fine. Thank you.