-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathmk-kernel.sh
executable file
·44 lines (34 loc) · 926 Bytes
/
mk-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
43
44
#!/bin/bash -e
LOCALPATH=$(pwd)
OUT=${LOCALPATH}/out
EXTLINUXPATH=${LOCALPATH}/build/extlinux
BOARD=$1
finish() {
echo -e "\e[31m MAKE KERNEL IMAGE FAILED.\e[0m"
exit -1
}
trap finish ERR
if [ $# != 1 ] ; then
BOARD=rk3288-evb
fi
[ ! -d ${OUT} ] && mkdir ${OUT}
[ ! -d ${OUT}/kernel ] && mkdir ${OUT}/kernel
source $LOCALPATH/build/board_configs.sh $BOARD
if [ $? -ne 0 ]; then
exit
fi
echo Building kernel for ${BOARD} board!
echo Using ${DEFCONFIG}
cd ${LOCALPATH}/kernel
make ${DEFCONFIG}
make -j8
if [ "${ARCH}" == "arm" ] ; then
cp ${LOCALPATH}/kernel/arch/arm/boot/zImage ${OUT}/kernel/
cp ${LOCALPATH}/kernel/arch/arm/boot/dts/${DTB} ${OUT}/kernel/
else
cp ${LOCALPATH}/kernel/arch/arm64/boot/Image ${OUT}/kernel/
cp ${LOCALPATH}/kernel/arch/arm64/boot/dts/rockchip/${DTB} ${OUT}/kernel/
fi
# Change extlinux.conf according board
sed -e "s,fdt .*,fdt /$DTB,g" \
-i ${EXTLINUXPATH}/${CHIP}.conf