This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
forked from map220v/MU-sm8150pkg-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_uefi.sh
executable file
·83 lines (66 loc) · 2.21 KB
/
build_uefi.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
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
#!/bin/bash
cd "$(dirname "$0")"
#TARGET_DEVICE=${1}
#TARGET_RAM_SIZE=${2}
while getopts ":d:s:m:r:u:b:" opt; do
case ${opt} in
d) TARGET_DEVICE=${OPTARG};;
s) TARGET_RAM_SIZE=${OPTARG};;
m) Model=${OPTARG};;
r) RetailModel=${OPTARG};;
u) RetailSku=${OPTARG};;
b) BoardModel=${OPTARG};;
esac
done
# Check arguments.
if [ -z ${TARGET_DEVICE} ]; then
echo "Usage: build_uefi.sh -d <target_device> -s <ram_size>"
echo "Optional: -m <Model> -r <RetailModel> -u <RetailSku> -b <BoardModel>"
echo ""
echo "Available devices:"
for i in $(ls Platforms/SurfaceDuo1Pkg/Device); do
# skip if the directory is empty
if [ -z "$(ls Platforms/SurfaceDuo1Pkg/Device/${i})" ]; then
continue
fi
echo " $(basename ${i})"
done
echo ""
exit 1
fi
if [ -z ${TARGET_RAM_SIZE} ]; then
echo -e "\e[1;36mMissing ram size, default 6GB\e[0m"
TARGET_RAM_SIZE=6
fi
if [ -z ${Model} ]; then
Model=${TARGET_DEVICE}
echo -e "\e[1;36mMissing Model. Default ${Model}\e[0m"
fi
if [ -z ${RetailModel} ]; then
RetailModel=${Model}
echo -e "\e[1;36mMissing RetailModel. Default ${RetailModel}\e[0m"
fi
if [ -z ${RetailSku} ]; then
RetailSku=${Model}
echo -e "\e[1;36mMissing RetailSku. Default ${RetailSku}\e[0m"
fi
if [ -z ${BoardModel} ]; then
BoardModel=${Model}
echo -e "\e[1;36mMissing BoardModel. Default ${BoardModel}\e[0m"
fi
sleep 2
# Boot Boot shim.
bash ./build_boot_shim.sh
# Start the actual build:
if [ ${TARGET_DEVICE} = 'all' ]; then
for i in $(ls Platforms/SurfaceDuo1Pkg/Device); do
# skip if the directory is empty
if [ -z "$(ls Platforms/SurfaceDuo1Pkg/Device/${i})" ]; then
continue
fi
TARGET_DEVICE=$(basename ${i})
stuart_build -c Platforms/SurfaceDuo1Pkg/PlatformBuild.py TOOL_CHAIN_TAG=CLANG38 "TARGET_DEVICE=${TARGET_DEVICE}" "TARGET_RAM_SIZE=${TARGET_RAM_SIZE}"
done
else
stuart_build -c Platforms/SurfaceDuo1Pkg/PlatformBuild.py TOOL_CHAIN_TAG=CLANG38 "TARGET_DEVICE=${TARGET_DEVICE}" "TARGET_RAM_SIZE=${TARGET_RAM_SIZE}" "BOARDMODEL=${BoardModel}" "MODEL=${Model}" "RETAILSKU=${RetailSku}" "RETAILMODEL=${BoardModel}"
fi