-
Notifications
You must be signed in to change notification settings - Fork 13
/
system.sh
executable file
·57 lines (47 loc) · 1.18 KB
/
system.sh
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
#!/bin/bash
ROOTFS_NAME="rootfs-alpine.tar.gz"
DEVICE_NAME="pico-mini-b"
while getopts ":f:d:" opt; do
case ${opt} in
f) ROOTFS_NAME="${OPTARG}" ;;
d) DEVICE_NAME="${OPTARG}" ;;
?)
echo "Invalid option: -${OPTARG}."
exit 1
;;
esac
done
DEVICE_ID="6"
case $DEVICE_NAME in
pico-mini-b) DEVICE_ID="6" ;;
pico-plus) DEVICE_ID="7" ;;
pico-pro-max) DEVICE_ID="8" ;;
*)
echo "Invalid device: ${DEVICE_NAME}."
exit 1
;;
esac
rm -rf sdk/sysdrv/custom_rootfs/
mkdir -p sdk/sysdrv/custom_rootfs/
cp "$ROOTFS_NAME" sdk/sysdrv/custom_rootfs/
pushd sdk || exit
pushd tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/ || exit
source env_install_toolchain.sh
popd || exit
rm -rf .BoardConfig.mk
echo "$DEVICE_ID" | ./build.sh lunch
echo "export RK_CUSTOM_ROOTFS=../sysdrv/custom_rootfs/$ROOTFS_NAME" >> .BoardConfig.mk
echo "export RK_BOOTARGS_CMA_SIZE=\"1M\"" >> .BoardConfig.mk
# build sysdrv - rootfs
./build.sh uboot
./build.sh kernel
./build.sh driver
./build.sh env
#./build.sh app
# package firmware
./build.sh firmware
./build.sh save
popd || exit
rm -rf output
mkdir -p output
cp sdk/output/image/update.img "output/$DEVICE_NAME-sysupgrade.img"