blob: 5bc4b81129561616952e98ae4293cb9b80eebbb9 (
plain)
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
|
#!/bin/bash
LOCAL_PATH=`pwd`
BASE_PATH=$(cd "$(dirname $0)"; pwd)
export ARCH=arm
if [ ${ARCH} = arm ]
then
KERNEL_CONFIG=meson64_a32_defconfig
export KERNEL_A32_SUPPORT=true
export CROSS_COMPILE=arm-linux-gnueabihf-
else
KERNEL_CONFIG=meson64_a64_defconfig
export CROSS_COMPILE=aarch64-linux-gnu-
fi
if [ "${KERNEL_SRC_DIR}" = "" ]
then
KERNEL_SRC_DIR=${BASE_PATH}/../../../../../common/
fi
if [ "${KERNEL_OUT_DIR}" = "" ]
then
KERNEL_OUT_DIR=${BASE_PATH}/../../../../../common/
fi
show_help()
{
echo "*** Please export KERNEL_SRC_DIR and KERNEL_OUT_DIR before building."
echo "e.g."
echo " export KERNEL_SRC_DIR=/mnt/fileroot/peifu/kernel"
echo " export KERNEL_OUT_DIR=/mnt/fileroot/peifu/kernel/out"
echo " ./build_gx.sh"
}
show_path()
{
echo "*** KERNEL_SRC_DIR=$KERNEL_SRC_DIR"
echo "*** KERNEL_OUT_DIR=$KERNEL_OUT_DIR"
}
do_build()
{
if [ ! -d $KERNEL_SRC_DIR ]; then
echo "*** $KERNEL_SRC_DIR: No such directory!"
show_help;
exit;
fi
if [ ! -d $KERNEL_OUT_DIR ]; then
echo "*** $KERNEL_OUT_DIR not exist, create now\n"
mkdir -p $KERNEL_OUT_DIR
fi
if [ ! -e $KERNEL_OUT_DIR/include/generated/autoconf.h ]; then
make -C $KERNEL_SRC_DIR O=$KERNEL_OUT_DIR $KERNEL_CONFIG
make -C $KERNEL_SRC_DIR O=$KERNEL_OUT_DIR modules_prepare
fi
make -C $KERNEL_SRC_DIR O=$KERNEL_OUT_DIR M=$LOCAL_PATH modules
}
do_clean()
{
if [ ! -d $KERNEL_SRC_DIR ]; then
echo "*** $KERNEL_SRC_DIR: No such directory!\n"
show_help;
exit;
fi
make -C $KERNEL_SRC_DIR O=$KERNEL_OUT_DIR M=$LOCAL_PATH clean
}
if [ "$1" = "help" ]; then
show_help;
exit;
elif [ "$1" = "clean" ]; then
do_clean;
exit;
else
show_path;
do_build;
fi
|