Jan Kundrát | 4932c57 | 2018-01-15 19:05:14 +0100 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -ex |
| 4 | |
| 5 | mkdir /tmp/sdcard.image |
| 6 | mount /mnt/sdcard.img.squashfs /tmp/sdcard.image/ |
| 7 | blkdiscard /dev/mmcblk0 |
| 8 | ddrescue --force /tmp/sdcard.image/sdcard.img /dev/mmcblk0 |
| 9 | echo 0 > /sys/block/mmcblk0boot0/force_ro |
| 10 | ddrescue --force /mnt/u-boot-spl.kwb /dev/mmcblk0boot0 |
| 11 | echo 1 > /sys/block/mmcblk0boot0/force_ro |
| 12 | echo 0 > /sys/block/mmcblk0boot1/force_ro |
| 13 | ddrescue --force /mnt/u-boot-spl.kwb /dev/mmcblk0boot1 |
| 14 | echo 1 > /sys/block/mmcblk0boot1/force_ro |
| 15 | sync |
| 16 | echo b > /proc/sysrq-trigger |