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