Skip to content

Commit 6f79ae1

Browse files
committed
Add pine64_install_uboot.sh script
1 parent dd62647 commit 6f79ae1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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."

0 commit comments

Comments
 (0)