forked from yifengyou/d3588-kernel-5.10.198
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd3588.sh
More file actions
executable file
·48 lines (37 loc) · 1.15 KB
/
d3588.sh
File metadata and controls
executable file
·48 lines (37 loc) · 1.15 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
#!/bin/bash
set -ex
JOB=`sed -n "N;/processor/p" /proc/cpuinfo|wc -l`
ARCH=`uname -m`
export KERNEL_TARGET=d3588
if [ X"${ARCH}" == X"aarch64" ] ; then
GCC=""
CROSS_COMPILE_ARM64=""
elif [ X"${ARCH}" == X"x86_64" ] ; then
GCC=`realpath ../gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu`
CROSS_COMPILE_ARM64=${GCC}/bin/aarch64-none-linux-gnu-
echo "using gcc: [${CROSS_COMPILE_ARM64}]"
else
echo "${ARCH} is not supported now!"
exit 1
fi
# clean
# make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE_ARM64 mrproper
# kernel
if [ -f .config ] ; then
cp -a .config .config-bak
fi
make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE_ARM64 ${KERNEL_TARGET}_defconfig
diff .config .config-bak
if [ $? -eq 0 ] ; then
cp -a .config-bak .config
fi
make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE_ARM64 -j$JOB
# make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE_ARM64 dtbs -j$JOB
# make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE_ARM64 ${KERNEL_TARGET}.img
mkdir -p ../tools/
cp arch/arm64/boot/Image ../tools/
mkdir -p ../rockdev/modules
find . -name "*.ko" |xargs -i /bin/cp -a {} ../rockdev/modules/
ls -alh ../rockdev/modules/
md5sum ../rockdev/modules/*.ko
echo "All done! [$?]"