-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathbld_release.sh
More file actions
executable file
·107 lines (89 loc) · 2.5 KB
/
bld_release.sh
File metadata and controls
executable file
·107 lines (89 loc) · 2.5 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
#!/bin/sh
#
# This script is used to generate a new release
#
# Guy Turcotte, March 2021
# Update for idf.py, October 2024
#
if [ ! command -v idf.py >/dev/null 2>&1 ]; then
. ~/esp/esp-idf/export.sh
if [ ! command -v idf.py >/dev/null 2>&1 ]; then
echo "Unable to get esp-idf ready. Aborting." >&2
return 1
fi
fi
if [ "$3" = "" ]; then
echo "Usage: $0 version_nbr type extended_case [build_only]"
echo "type = 6, 10, 6plus, 6plusv2, 6flick"
echo "extended_case = 0, 1"
echo " 0 = no extended case"
echo " 1 = with extended case"
echo "build_only (optional) = 1, 2"
echo " 1 = clean build folder"
echo " 2 = keep build folder"
return 1
fi
if [ "$3" = "0" ]; then
folder="release-v$1-inkplate_$2"
environment="inkplate_$2_release"
case "$2" in
"6") device="INKPLATE_6" ;;
"10") device="INKPLATE_10" ;;
"6plus") device="INKPLATE_6PLUS" ;;
"6plusv2") device="INKPLATE_6PLUS_V2" ;;
"6flick") device="INKPLATE_6FLICK" ;;
*) echo "UNKNOWN DEVICE NAME. ABORTING!"
return 1
;;
esac
echo "Device is ${device}"
else
folder="release-v$1-inkplate_extended_case_$2"
environment="inkplate_$2_extended_case_release"
fi
if [ "$4" = "" ]; then
if [ -f "$folder.zip" ]; then
echo "File $folder.zip already exist!"
return 1
fi
fi
if [ ! "$4" = "2" ]; then
rm -rf build
fi
idf.py build -DDEVICE=$device -DAPP_VERSION=$1
if [ ! -f "build/EPub-InkPlate.bin" ]; then
echo "idf.py run error!"
return 1
fi
if [ ! "$4" = "" ]; then
echo "Compilation only... bld_release completed."
return 0
fi
rm bin/*.bin
mkdir "$folder"
cp build/bootloader/bootloader.bin bin
cp build/partition_table/partition-table.bin bin/partitions.bin
cp build/EPub-InkPlate.bin bin/firmware.bin
cp -r bin "$folder"
mkdir "$folder/SDCard"
mkdir "$folder/SDCard/fonts"
mkdir "$folder/SDCard/books"
cp SDCard/config_distrib.txt $folder/SDCard/config.txt
cp SDCard/fonts_list.xml $folder/SDCard/fonts_list.xml
cp SDCard/fonts_list_orig.xml $folder/SDCard/fonts_list_orig.xml
cp SDCard/fonts/* $folder/SDCard/fonts
cp SDCard/books/Austen*.epub $folder/SDCard/books
cp doc/timezones.csv $folder
if [ "$3" = "0" ]; then
case "$2" in
"6plus"|"6plusv2"|"6flick") cp "doc/USER GUIDE TOUCH.pdf" "$folder/USER GUIDE.pdf" ;;
*) cp "doc/USER GUIDE.pdf" "$folder" ;;
esac
else
cp "doc/USER GUIDE for Extended Case.pdf" "$folder/USER GUIDE.pdf"
fi
cp "doc/INSTALL.pdf" "$folder"
cp adjust_size.sh "$folder"
zip -r "$folder.zip" "$folder"
rm -rf "$folder"
echo "bld_release completed."