forked from SherlockChiang/kali-nethunter-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig
More file actions
executable file
·152 lines (113 loc) · 4.23 KB
/
config
File metadata and controls
executable file
·152 lines (113 loc) · 4.23 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/bin/bash
##############################################
# Toolchains
##############################################
# Toolchain root directory
TD=~/android/toolchains
# Preferred editor
EDIT=vi
# Architecture
export ARCH=arm64
export SUBARCH=arm64
# Enable ccache to speed up compilation
CCACHE=false
# Clang
export CLANG_ROOT=${TD}/clang-10.0
export CLANG_PATH=${CLANG_ROOT}/bin
export PATH=${CLANG_PATH}:${PATH}
export LD_LIBRARY_PATH=${CLANG_ROOT}/lib64:$LD_LIBRARY_PATH
export CLANG_TRIPLE=aarch64-linux-gnu-
# "CC=clang" cannot be exported - we'll pass it to make in the function make_kernel if "CC" is set to "clang"
CC=clang
# Source repository
CLANG_SRC="https://kali.download/nethunter-images/toolchains/google_clang-10.0.4.tar.xz"
CLANG_SRC_TYPE="wget"
# GCC 64bit
# arm64 cross compiler directory
CCD64="${TD}/aarch64-4.9"
export CROSS_COMPILE=${CCD64}/bin/aarch64-linux-android-
# Source repository
CROSS_COMPILE_SRC="https://kali.download/nethunter-images/toolchains/google_aarch64-4.9.tar.xz"
CROSS_COMPILE_SRC_TYPE="wget"
# GCC 32bit
# armhf cross compiler directory
CCD32="${TD}/armhf-4.9"
export CROSS_COMPILE_ARM32=${CCD32}/bin/arm-linux-androideabi-
# Source repository
CROSS_COMPILE_ARM32_SRC="https://kali.download/nethunter-images/toolchains/google_armhf-4.9.tar.xz"
CROSS_COMPILE_ARM32_TYPE="wget"
# Kernel local name
export LOCALVERSION=-NetHunter
##############################################
# Environment
##############################################
# Kernel source directory
KDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )"
# build config
CONFIG=nethunter_defconfig
# Copy "SRC_VERSION" to "TARGET_VERSION" if kernel makefile expects it
SRC_VERSION=
TARGET_VERSION=
# Directory structure on the target device that will contain the modules directory
MODULE_DIRTREE="modules/system_root/"
# CPU threads
# All Available cores (Used for normal compilation)
THREADS="$(grep -c ^processor /proc/cpuinfo)"
# NetHunter kernel zip name
NH_ARCHIVE="nethunter-kernel$LOCALVERSION.zip"
# AnyKernel zip name
ANY_ARCHIVE="anykernel$LOCALVERSION.zip"
# Image Type (Only ONE of the following (lz4/gz) can be enabled!)
# GZ Image (Uncomment to Enable)
IMAGE_NAME=Image.gz-dtb
# lz4 image (Uncomment to Enable)
#IMAGE_NAME=Image.lz4-dtb
# Set to "true" to enable dtbo
DO_DTBO=false
# Set to "true" to enable dtb
DO_DTB=false
# DTB Version
DTB_VER=2
# Space separated list of dtb file to generate in brackets
DTB_FILES=
# Path to compiled kernel image
KERNEL_IMAGE=$BUILD_DIR/out/arch/arm64/boot/$IMAGE_NAME
# NetHunter kernel zip directory
NHKERNEL_DIR=$BUILD_DIR/nethunter
# AnyKernel zip directory
ANYKERNEL_DIR=$BUILD_DIR/anykernel3
# DTBTool
DTBTOOL=$BUILD_DIR/tools/dtbToolCM
# Name of the dtb output image
# Must be dtb.img when used with NetHunter's installer (boot-patcher)
# https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-installer/-/tree/main/boot-patcher
DTB_IMG=dtb.img
# Input DTB path
DTB_IN=$BUILD_DIR/out/arch/arm64/boot/dts
# Path to compiled dtbo image
DTBO_IMAGE=$BUILD_DIR/out/arch/arm64/boot/dtbo.img
# Location to build the kernel
KERNEL_OUT="$BUILD_DIR/out"
# Destination patch for the changelog
CHANGELOG=$ANYKERNEL_DIR/Changelog.txt
# Destination path for compiled modules
MODULES_OUT=$BUILD_DIR/modules_out
# Source path for module tree to be copied to into NetHunter zip
MODULES_IN=$BUILD_DIR/modules_out/lib
# Destination Path for uploading kernel zip
UPLOAD_DIR=$BUILD_DIR/output/
# Directory containing the kernel patches
PATCH_DIR="$BUILD_DIR/patches"
# Package dependencies
DEBIAN_DEPEND="axel bc binutils-aarch64-linux-gnu build-essential ccache curl device-tree-compiler pandoc libncurses5-dev lynx lz4 fakeroot xz-utils whiptail"
SUSE_DEPEND="axel bc ccache curl dtc pandoc libncurses6 lynx lz4 make ncurses-devel newt patch python-base fakeroot xz zip"
# Preferred target for make [menu|n]config - "menuconfig" is default but "nconfig" can be used if keymappings are off
CONFIG_TOOL=menuconfig
# Additional compiler arguments
MAKE_ARGS=""
####################################################################
# Overwrite any of the above settings with this local config file: #
LOCAL_CONFIG=local.config
if [ -f ${BUILD_DIR}/$LOCAL_CONFIG ]; then
source ${BUILD_DIR}/$LOCAL_CONFIG
fi