Jan Kundrát | 4932c57 | 2018-01-15 19:05:14 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -ex |
| 4 | |
Jan Kundrát | 5fae0e6 | 2018-08-22 17:05:08 +0200 | [diff] [blame^] | 5 | # reset the LEDs |
| 6 | i2cset -y 1 0x6b 0xa5 0x5a || true |
| 7 | # configure for fast blinking |
| 8 | i2cset -y 1 0x60 0x00 0x01 || true |
| 9 | i2cset -y 1 0x60 0x01 0x20 || true |
| 10 | i2cset -y 1 0x60 0x12 0x40 || true |
| 11 | i2cset -y 1 0x60 0x13 0x04 || true |
| 12 | i2cset -y 1 0x60 0x0a 0xff || true |
| 13 | i2cset -y 1 0x60 0x0b 0xff || true |
| 14 | i2cset -y 1 0x60 0x0c 0xff || true |
| 15 | # yellow blinking |
| 16 | i2cset -y 1 0x60 0x16 0x0f || true |
| 17 | |
Jan Kundrát | 4932c57 | 2018-01-15 19:05:14 +0100 | [diff] [blame] | 18 | mkdir /tmp/sdcard.image |
| 19 | mount /mnt/sdcard.img.squashfs /tmp/sdcard.image/ |
| 20 | blkdiscard /dev/mmcblk0 |
| 21 | ddrescue --force /tmp/sdcard.image/sdcard.img /dev/mmcblk0 |
Jan Kundrát | 54e2d8b | 2018-08-22 17:04:07 +0200 | [diff] [blame] | 22 | |
| 23 | echo 0 > /sys/block/mmcblk0boot0/force_ro |
| 24 | echo 0 > /sys/block/mmcblk0boot1/force_ro |
| 25 | |
| 26 | ddrescue --force /mnt/u-boot-spl.kwb /dev/mmcblk0boot0 |
| 27 | ddrescue --force /mnt/u-boot-spl.kwb /dev/mmcblk0boot1 |
| 28 | |
Jan Kundrát | 5fae0e6 | 2018-08-22 17:05:08 +0200 | [diff] [blame^] | 29 | # solid yellow |
| 30 | i2cset -y 1 0x60 0x16 0x05 || true |
| 31 | |
Jan Kundrát | a805002 | 2018-01-15 19:52:09 +0100 | [diff] [blame] | 32 | fsck -y /dev/mmcblk0p1 || true |
| 33 | fsck -y /dev/mmcblk0p2 || true |
| 34 | fsck -y /dev/mmcblk0p3 || true |
| 35 | fsck -y /dev/mmcblk0p4 || true |
Jan Kundrát | 54e2d8b | 2018-08-22 17:04:07 +0200 | [diff] [blame] | 36 | |
Jan Kundrát | 4932c57 | 2018-01-15 19:05:14 +0100 | [diff] [blame] | 37 | sync |
Jan Kundrát | 54e2d8b | 2018-08-22 17:04:07 +0200 | [diff] [blame] | 38 | echo 1 > /sys/block/mmcblk0boot1/force_ro |
| 39 | echo 1 > /sys/block/mmcblk0boot0/force_ro |
| 40 | |
Jan Kundrát | 5fae0e6 | 2018-08-22 17:05:08 +0200 | [diff] [blame^] | 41 | # solid white |
| 42 | i2cset -y 1 0x60 0x16 0x15 || true |
| 43 | |
Jan Kundrát | 4932c57 | 2018-01-15 19:05:14 +0100 | [diff] [blame] | 44 | echo b > /proc/sysrq-trigger |