B2G-flash-tool icon indicating copy to clipboard operation
B2G-flash-tool copied to clipboard

[shallow_flash] "keep_profile" should be the default behavior

Open julienw opened this issue 9 years ago • 3 comments

Currently, the default behavior is deleting all user data, and only if the user set --keep_profile the data is recovered.

I think the default should be the opposite, and we should have a parameter --clean-user-data to delete the user data.

A good path could be to add this parameter first, then change all scripts that use shallow_flash, and then in ~1 month change the default.

julienw avatar Mar 25 '15 16:03 julienw

The problem is that we can not guarantee the backup/restore always works fine. [1] Because the backup/restore functions use adb pull/push to get/put user data, which are not provided by B2G. That's why the backup/restore tool is BETA version.

As far as I know, there are some bugs[2] for backup/restore user data. But no one is working on it now.

[1] #272 and #288 [2] Bug 1026531 and Bug 1078710

askeing avatar Mar 31 '15 16:03 askeing

Because the backup/restore functions use adb pull/push to get/put user data, which are not provided by B2G.

I don't understand the sentence.

I also don't understand why we need to backup/restore. Why can't we just not "rm -rf" the files in https://github.com/Mozilla-TWQA/B2G-flash-tool/blob/4a235dcf90b76dd7a27c1838424464ff8a7fdb4b/shallow_flash.sh#L142-L150 ?

And same in the full flash, why can't we skip flashing the "userdata" partition by default?

This way we don't need backup/restore.

Of course this doesn't work if the user downgrades his phone. But even like this his data are not lost because he can just flash a newer version again. But we could still add a warning so that the user knows about this.

julienw avatar Mar 31 '15 17:03 julienw

I don't understand the sentence.

The backup_restore_profile is a workaround, it will call adb to pull or push files. It is not the B2G feature. The backup/restore by B2G is still not implemented.

I also don't understand why we need to backup/restore. Why can't we just not "rm -rf" the files in https://github.com/Mozilla-TWQA/B2G-flash-tool/blob/4a235dcf90b76dd7a27c1838424464ff8a7fdb4b/shallow_flash.sh#L142-L150 ?

In the beginning, due to B2G do not have any way to flash gaia.zip and b2g-xx-arm.tar.gz (gecko) into devices, we develop these tools for helping engineers' daily work. And we will change builds between different version very often. ex: v2.0 -> v2.2 -> master -> v2.0. So, we have to clean the profile before flash new gaia.zip.

And same in the full flash, why can't we skip flashing the "userdata" partition by default?

We do not have the answer, because the flash.sh (full-flash) is under B2G project. You can start a mail thread for this suggestion.

askeing avatar Jun 02 '15 09:06 askeing