[Replicant] EFS backup methods

doak doak+list at posteo.net
Mon Jan 20 10:27:57 UTC 2020


Hi there,

Regarding EFS backup and cat-pull-method [1]:
> At some point or under some condition, this stopped working and the backup were corrupted.

My first guess was that stdout *and* stderr are captured, because the command
     adb shell 'echo STDOUT; echo STDERR >&2' >/dev/null
does filter both, although I would expect to see "STDERR". IIRC 'adb' did separation of these,
perhaps the current version is buggy.

But than I was wondering bei these two commands dump the same but wrong data ...
   adb shell 'dd if=/dev/block/mmcblk0p3 bs=1k' >TEST ; sha1sum TEST
   adb shell 'cat /dev/block/mmcblk0p3' >TEST ; sha1sum TEST
... and realised that 'adb' returns Windows fileending encoding (CR+LF), which seems to
go into the dump as well: (see also attached screenshot)
     -00000430: 8a6a 255e 0200 0a00 53ef 0100 0200 0000  .j%^....S.......
     +00000430: 8a6a 255e 0200 0d0a 0053 ef01 0002 0000  .j%^.....S......

Don't know if this is intended. Perhaps that changed at some time which is the reason it stopped
to work. Perhaps 'adb' (either on target or my machine) is built the wrong way.
I stumbled over this trying to archieve a generic adb-pull-device method [2]:
   part="`adb shell "ls /dev/block/platform/*/by-name/EFS" | head --bytes=-2`"
   adb pull "$part" ./EFS.img
The variable '$part' will be "corrupt" without stripping '0x0d' away.

Tested on i9305, recovery of replicant 6.0 0003, using 'adb' from Debian.

Comments are welcome ;)


[1] https://redmine.replicant.us/projects/replicant/wiki/BackupsResearch#adb-shell-cat-pipe
[2] https://redmine.replicant.us/projects/replicant/wiki/BackupsResearch#adb-pull-the-block-device


Regards,
doak
-------------- next part --------------
A non-text attachment was scrubbed...
Name: adb-encoding-issue.png
Type: image/png
Size: 142912 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/replicant/attachments/20200120/f1a6593e/attachment-0001.png>


More information about the Replicant mailing list