-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·64 lines (50 loc) · 1.46 KB
/
build.sh
File metadata and controls
executable file
·64 lines (50 loc) · 1.46 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
#!/usr/bin/env bash
# shellcheck disable=SC1091
#
# Personal ESK Kernel build script
#
set -Eeuo pipefail
# Workspace
WORKSPACE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$WORKSPACE/config.sh"
source "$WORKSPACE/build/utils.sh"
source "$WORKSPACE/build/telegram.sh"
source "$WORKSPACE/build/github.sh"
source "$WORKSPACE/build/steps.sh"
# Error handling
trap 'error "Build failed at line $LINENO: $BASH_COMMAND"' ERR
################################################################################
# Main
################################################################################
main() {
SECONDS=0
init_build
init_logging
validate_env
send_start_msg
prepare_dirs
fetch_sources
setup_toolchain
prepare_build
build_kernel
# Build package name
VARIANT="$(is_true "$KSU" && echo "KSU" || echo "VNL")"
is_true "$SUSFS" && VARIANT+="-SUSFS"
is_true "$LXC" && VARIANT+="-LXC"
PACKAGE_NAME="$KERNEL_NAME-$KERNEL_VERSION-$VARIANT"
# Build flashable package
package_anykernel "$PACKAGE_NAME"
package_bootimg "$PACKAGE_NAME"
# Github Actions metadata
write_metadata "$PACKAGE_NAME"
local build_time="$SECONDS"
step 13 "Finalize build"
if is_true "$TG_NOTIFY"; then
telegram_notify "$build_time" "$PACKAGE_NAME"
else
local min=$((build_time / 60))
local sec=$((build_time % 60))
success "Build success in ${min}m ${sec}s"
fi
}
main "$@"