forked from fukiame/kernel_builder
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathenv
More file actions
executable file
·47 lines (36 loc) · 1.64 KB
/
Copy pathenv
File metadata and controls
executable file
·47 lines (36 loc) · 1.64 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
#!/bin/bash
#
# config and common vars
export maindir="$(pwd)"
export outside="${maindir}/.."
#
export ARCH="arm64"
export SUBARCH="arm64"
export KBUILD_BUILD_USER="revive-selene"
export KBUILD_BUILD_HOST="github-actions"
export defconfig="selene_defconfig"
if [[ -z "$zipper_repo" ]]; then
export zipper_repo="https://github.com/Revive-Selene/AnyKernel3"
fi
if [[ -z "$zipper_branch" ]]; then
export zipper_branch=selene
fi
export out_image="${maindir}/out/arch/${ARCH}/boot/Image.gz-dtb"
export out_dtb="${maindir}/out/arch/${ARCH}/boot/dts/mediatek/mt6768.dtb"
#export out_dtbo="${maindir}/out/arch/${ARCH}/boot/dtbo.img"
export zipper="${outside}/zipper"
#
export defconfig_file="${maindir}/arch/${ARCH}/configs/${defconfig}"
export kernel_head="$(git log --pretty=format:'%h' -1)"
# Read version directly from Makefile to avoid 'grep: .config: No such file' warnings
# that occur when 'make kernelversion' is called before compilation
export kernel_ver="$(grep -m1 '^VERSION' Makefile | cut -d= -f2 | tr -d ' ').$(grep -m1 '^PATCHLEVEL' Makefile | cut -d= -f2 | tr -d ' ').$(grep -m1 '^SUBLEVEL' Makefile | cut -d= -f2 | tr -d ' ')"
# kernel_name: read from CONFIG_LOCALVERSION in defconfig (empty if not set)
export kernel_name_raw=$(grep 'CONFIG_LOCALVERSION=' "${defconfig_file}" 2>/dev/null | sed 's/CONFIG_LOCALVERSION=//g' | sed 's/"//g')
if [[ "$kernel_name_raw" == *"#"* ]]; then
export kernel_name="(HASTAG)$(echo "$kernel_name_raw" | sed 's/^[-#]*//')"
else
export kernel_name="$(echo "$kernel_name_raw" | sed 's/^[-#]*//')"
fi
export TIME=$(date +"%y%m%d-%H%M")
export zip_name="${maindir}/${kernel_name}${SUFFIX}-${TIME}-${kernel_head}.zip"