-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.sh
35 lines (27 loc) · 876 Bytes
/
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
export KBUILD_BUILD_USER=baddar90
export ARCH=arm64
export CROSS_COMPILE=$HOME/arm64-gcc-10/bin/aarch64-linux-gnu-
export CROSS_COMPILE_ARM32=$HOME/arm32-gcc-9.1/bin/arm-eabi-
BUILD="/home/baddar/build"
OUT="/home/baddar/out"
#NPR=`expr $(nproc) + 1`
echo "cleaning build..."
if [ -d "$BUILD" ]; then
rm -rf "$BUILD"
fi
if [ -d "$OUT" ]; then
rm -rf "$OUT"
fi
echo "setting up build..."
mkdir "$BUILD"
make O="$BUILD" lineageos_axon7_defconfig
echo "building kernel..."
make O="$BUILD" -j30
echo "building modules..."
make O="$BUILD" INSTALL_MOD_PATH="." INSTALL_MOD_STRIP=1 modules_install
rm $BUILD/lib/modules/*/build
rm $BUILD/lib/modules/*/source
mkdir -p $OUT/modules
mv "$BUILD/arch/arm64/boot/Image.gz-dtb" "$OUT/Image.gz-dtb"
find "$BUILD/lib/modules/" -name *.ko | xargs -n 1 -I '{}' mv {} "$OUT/modules"
echo "Image.gz-dtb & modules can be found in $BUILD"