File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
package/root/usr/local/sbin Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -e
4+
5+ if [ " $( id -u) " -ne " 0" ]; then
6+ echo " This script requires root."
7+ exit 1
8+ fi
9+
10+ DEVICE=" ${1:-/ dev/ mmcblk0} "
11+
12+ if [ ! -b " $DEVICE " ]; then
13+ echo " Block device ${DEVICE} not found."
14+ exit 2
15+ fi
16+
17+ local boot0_position=8 # KiB
18+ local boot0_size=64 # KiB
19+ local uboot_position=19096 # KiB
20+ local uboot_size=1384 # KiB
21+
22+ echo " Flashing boot0 ..."
23+ dd if=" /boot/pine64/boot0-pine64-$( cat /etc/pine64_model) .bin" conv=notrunc bs=1k seek=$boot0_position oflag=sync of=" ${DEVICE} "
24+
25+ echo " Flashing U-Boot ..."
26+ dd if=" /boot/pine64/u-boot-pine64-$( cat /etc/pine64_model) .bin" conv=notrunc bs=1k seek=$uboot_position oflag=sync of=" ${DEVICE} "
27+
28+ sync
29+ echo " Done - you should reboot now."
You can’t perform that action at this time.
0 commit comments