-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdate_uboot_image
More file actions
executable file
·69 lines (55 loc) · 1.63 KB
/
update_uboot_image
File metadata and controls
executable file
·69 lines (55 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "Script must be run as root !"
exit 0
fi
echo ""
date
echo "********************************"
echo "Update u-boot in sdcard image "
echo "********************************"
echo ""
# =====================================================
# ==== P A R A M E T E R S ============================
# =====================================================
# *********************
# Set sdcard image name
# *********************
sdcardimg="jessie-minimal.img"
# *****************************************************
# Path to odroid u-boot files
# *****************************************************
BL1="uboot/bl1.bin.hardkernel"
UBOOT="uboot/u-boot.bin"
# ^^^^ P A R A M E T E R S ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
if [ ! -f $BL1 ]; then
echo "Error: $BL1 is not exist."
exit 0
fi
if [ ! -f $UBOOT ]; then
echo "Error: $UBOOT is not exist."
exit 0
fi
echo ""
echo "Updating u-boot in $sdcardimg ..."
dd if=$BL1 of=${sdcardimg} bs=1 count=442 conv=notrunc > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "ERROR installing u-boot."
exit 0
fi
dd if=$BL1 of=${sdcardimg} bs=512 skip=1 seek=1 conv=notrunc > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "ERROR installing u-boot."
exit 0
fi
dd if=$UBOOT of=${sdcardimg} bs=512 seek=64 conv=notrunc > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "ERROR installing u-boot."
exit 0
fi
sync
echo ""
echo "U-boot updated in $sdcardimg."
# -------------------------------------------------------------------
# -------------------------------------------------------------------