forked from rehosting/linux_builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·60 lines (53 loc) · 1.45 KB
/
build.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
#!/bin/bash
set -eu
help() {
cat >&2 <<EOF
USAGE ./build.sh [--help] [--config-only] [--versions VERSIONS] [--targets TARGETS]
--config-only
Only update the defconfigs instead of building the kernel
--versions VERSIONS
Build only the specified kernel versions. By default, all versions are built.
--targets TARGETS
Build only for the specified targets. By default, all targets are built.
EXAMPLES
./build.sh --config-only --versions "4.10 6.7" --targets "armel mipseb mipsel mips64eb"
./build.sh --versions 4.10
./build.sh --targets armel
./build.sh
EOF
}
# Default options
CONFIG_ONLY=false
#VERSIONS="4.10 6.7"
VERSIONS="4.10"
TARGETS="armeb armel arm64 mipseb mipsel mips64eb mips64el"
# Parse command-line arguments
while [[ $# -gt 0 ]]; do
case "$1" in
--help)
help
exit
;;
--config-only)
CONFIG_ONLY=true
shift # past argument
;;
--versions)
VERSIONS="$2"
shift # past argument
shift # past value
;;
--targets)
TARGETS="$2"
shift # past argument
shift # past value
;;
*)
help
exit 1
;;
esac
done
docker build -t pandare/kernel_builder .
mkdir -p cache
docker run --rm -v $PWD/cache:/tmp/build -v $PWD:/app pandare/kernel_builder bash /app/_in_container_build.sh "$CONFIG_ONLY" "$VERSIONS" "$TARGETS"