forked from xin3liang/home-bin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-kernel.sh
executable file
·42 lines (32 loc) · 1.2 KB
/
build-kernel.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
#!/bin/bash
OUT=~/work/kernel/out
KERNEL_BOOT_DIR=arch/arm64/boot
CP=cp
DEST=~/tftp
CROSS_TOOLCHAIN=aarch64-linux-gnu-
COFNIG_FILE=~/config-4.16.0-estuary.5.aarch64
export LOCALVERSION="-liuxl-test-`date +%F`"
export KBUILD_DEBARCH=arm64
# targets: bindeb-pkg binrpm-pkg INSTALL_MOD_STRIP=1 Image modules INSTALL_MOD_PATH=${OUT} modules_install"
BUILD_TARGETS="Image modules"
#BUILD_TARGETS="binrpm-pkg INSTALL_MOD_STRIP=1"
CP_TARGETS="${KERNEL_BOOT_DIR}/Image"
set -x
## kernel .config compile
#cp ${COFNIG_FILE} ${OUT}/.config
# CONFIG: oldconfig defconfig estuary_defconfig
CONFIG="estuary_defconfig"
make ARCH=arm64 O=${OUT} ${CONFIG}
# ./scripts/kconfig/merge_config.sh -m ${COFNIG_FILE1} \
# ${COFNIG_FILE2} ${COFNIG_FILE3}\
# mv -f .config ${OUT}/.merged.config &&
# make ARCH=arm64 O=${OUT} KCONFIG_ALLCONFIG=${OUT}/.merged.config \
# alldefconfig
## kernel compile
if [ $? -eq 0 ]; then
make ARCH=arm64 CROSS_COMPILE=$CROSS_TOOLCHAIN O=${OUT} ${FLAGS} \
${BUILD_TARGETS} -j80 &&
cd ${OUT} &&
${CP} -r ${CP_TARGETS} ${DEST}
fi
set +x