-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathisp.sh
More file actions
executable file
·117 lines (109 loc) · 2.54 KB
/
isp.sh
File metadata and controls
executable file
·117 lines (109 loc) · 2.54 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
TOP=../
export PATH=$PATH:$TOP/build/tools/isp/
X=xboot.img
U=u-boot.img
K=uImage
ROOTFS=rootfs.img
D=dtb
N=a926.img
# Partition name = file name
cp $X xboot0
cp $U uboot0
cp $X xboot1
cp $U uboot1
cp $U uboot2
cp $K kernel
if [ -f $N ]; then
cp $N nonos
fi
if [ "$1" != "SDCARD" ]; then
cp $ROOTFS rootfs
fi
cp $D DTB
# Note:
# If partitions' sizes listed before "kernel" are changed,
# please make sure U-Boot settings of CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, CONFIG_SRCADDR_KERNEL and CONFIG_SRCADDR_DTB
# are changed accordingly.
echo 'Unit in sector (512 bytes):'
for ADDR in "CONFIG_ENV_OFFSET" "CONFIG_ENV_SIZE" "CONFIG_SRCADDR_DTB" "CONFIG_SRCADDR_KERNEL"
do
cat ${TOP}boot/uboot/.config | grep --color -e ${ADDR}
done
if [ "$1" = "SDCARD" ]; then
isp pack_image ISPBOOOT.BIN \
xboot0 uboot0 \
xboot1 0x100000 \
uboot1 0x100000 \
uboot2 0x100000 \
env 0x80000 \
env_redund 0x80000 \
nonos 0x100000 \
dtb 0x40000 \
kernel 0x2000000
elif [ "$1" = "EMMC" ]; then
isp pack_image ISPBOOOT.BIN \
xboot0 uboot0 \
xboot1 0x100000 \
uboot1 0x100000 \
uboot2 0x100000 \
env 0x80000 \
env_redund 0x80000 \
nonos 0x100000 \
dtb 0x40000 \
kernel 0x2000000 \
rootfs 0x1e0000000
elif [ "$1" = "NAND" ]; then
isp pack_image ISPBOOOT.BIN \
xboot0 uboot0 \
xboot1 0x100000 \
uboot1 0x100000 \
uboot2 0x100000 \
env 0x80000 \
env_redund 0x80000 \
nonos 0x100000 \
dtb 0x40000 \
kernel 0x1900000 \
rootfs 0xe000000
elif [ "$1" = "USB" ]; then
isp pack_image ISPBOOOT.BIN \
xboot0 uboot0 \
xboot1 0x100000 \
uboot1 0x100000 \
nonos 0x100000 \
dtb 0x40000 \
kernel 0xd80000
fi
rm -rf xboot0
rm -rf uboot0
rm -rf xboot1
rm -rf uboot1
rm -rf uboot2
rm -rf kernel
rm -rf DTB
rm -rf env
rm -rf env_redund
rm -rf rootfs
rm -rf nonos
# Create image for booting from SD card or USB storage.
if [ "$1" = "SDCARD" ]; then
mkdir -p boot2linux_SDcard
cp -rf $U $K $N ./boot2linux_SDcard
dd if=ISPBOOOT.BIN of=boot2linux_SDcard/ISPBOOOT.BIN bs=1024 skip=0 count=64
rm -f ISPBOOOT.BIN
fi
if [ "$1" = "USB" ]; then
mkdir -p boot2linux_usb
isp extract4boot2linux_usbboot ISPBOOOT.BIN boot2linux_usb/ISPBOOOT.BIN
rm -f ISPBOOOT.BIN
fi
# Create image for partial update:
# isp extract4update ISPBOOOT.BIN ISP_UPDT.BIN [list of partitions ...]
# Example:
# isp extract4update ISPBOOOT.BIN ISP_UPDT.BIN uboot2
# isp extract4update ISPBOOOT.BIN ISP_UPDT.BIN kernel dtb
# isp extract4update ISPBOOOT.BIN ISP_UPDT.BIN uboot2 kernel dtb
#
# Execute update in U-Boot:
# run update_usb
# run update_sdcard
#