forked from tossp/redpill-tool-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
46 lines (39 loc) · 1.49 KB
/
entrypoint.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
#!/usr/bin/env bash
set -eu
BRP_DEBUG=${BRP_DEBUG:-0}
if [ "${BRP_DEBUG}" -eq 1 ]; then
env
fi
if [ $# -eq 0 ];then
git -C ${REDPILL_LKM_SRC} fetch
git -C ${REDPILL_LOAD_SRC} fetch
if [ "${LOCAL_RP_LKM_USE}" == "false" ]; then
REDPILL_LKM_BRANCH=$(git -C ${REDPILL_LKM_SRC} name-rev --name-only HEAD)
echo "Checking if redpill-lkm sources require pull."
if [ $(git -C ${REDPILL_LKM_SRC} rev-list HEAD...origin/${REDPILL_LKM_BRANCH} --count ) -eq 0 ];then
echo " Nothing to do."
else
git -C ${REDPILL_LKM_SRC} pull
echo "Pulled latest commits."
fi
else
echo "Redpill-lkm sources are mapped into the build container, skipping pull of latest sources."
fi
if [ "${LOCAL_RP_LOAD_USE}" == "false" ]; then
REDPILL_LOAD_BRANCH=$(git -C ${REDPILL_LOAD_SRC} name-rev --name-only HEAD)
echo "Check if redpill-load sources require pull."
if [ $(git -C ${REDPILL_LOAD_SRC} rev-list HEAD...origin/${REDPILL_LOAD_BRANCH} --count ) -eq 0 ];then
echo " Nothing to do."
else
git -C ${REDPILL_LOAD_SRC} pull
echo "Pulled latest commits."
fi
else
echo "Redpill-load sources are mapped into the build container, skipping pull of latest sources."
fi
echo "Lay back and enjoy the show: Magic is about to happen!"
make build_all
echo "The redpill bootloader is created, the container will be ended now."
exit 0
fi
exec "$@"