forked from ev3dev/ev3dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_kernel
executable file
·89 lines (62 loc) · 2.01 KB
/
build_kernel
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
80
81
82
83
84
85
86
87
#!/bin/sh
#******************************************************************************************************************
# COMPILE KERNEL
#******************************************************************************************************************
# as normal user on linux pc terminal:
echo
echo -------------------------------------------------------------------------------
echo BUILDING KERNEL
echo -------------------------------------------------------------------------------
echo
sleep 1
project=`pwd`
echo ${project}
. ./env_setup
echo ${AM1808_COMPILER}
PATH=${AM1808_COMPILER}:$PATH
# PATH=${AM1808_UBOOT_DIR}/tools:$PATH
echo ${PATH}
cd ${AM1808_KERNEL}
echo "Now we're in $(pwd)"
# arm-none-eabi-gcc -v
if [ "$1" = "clean" ]
then
make distclean ARCH=arm CROSS_COMPILE=${AM1808_ABI}
cp -v ${project}/ev3dev.config ${AM1808_KERNEL}/.config
exit 0
fi
if [ "$1" = "modules" ]
then
make modules ARCH=arm CROSS_COMPILE=${AM1808_ABI}
exit 0
fi
if [ "$1" = "oldconfig" ]
then
make oldconfig ARCH=arm CROSS_COMPILE=${AM1808_ABI}
exit 0
fi
if [ "$1" = "menuconfig" ]
then
make menuconfig ARCH=arm CROSS_COMPILE=${AM1808_ABI}
if [ ${AM1808_KERNEL}/.config -nt ${project}/ev3dev.config ]; then
printf 'Updating local config..\n'
cp -v ${AM1808_KERNEL}/.config ${project}/ev3dev.config
fi
exit 0
fi
if [ "$1" = "modules_install" ]
then
make modules_install ARCH=arm CROSS_COMPILE=${AM1808_ABI} INSTALL_MOD_PATH=${project}/modules
rm ${project}/modules/lib/modules/3.3.0+/build
rm ${project}/modules/lib/modules/3.3.0+/source
# mkdir -p ${project}/modules/lib/modules/3.3.0
# cp --parents `find . -name "*.ko"` ${project}/modules/lib/modules/3.3.0
exit 0
fi
cp ${project}/ev3dev.config ${AM1808_KERNEL}/.config
echo "CROSS COMPILING KERNEL"
make ARCH=arm CROSS_COMPILE=${AM1808_ABI}
echo "BUILDING BOOTABLE IMAGE"
make -j4 uImage ARCH=arm CROSS_COMPILE=${AM1808_ABI}
echo "COPYING BOOTABLE IMAGE TO LOCAL DIRECTORY"
cp ${AM1808_KERNEL}/arch/arm/boot/uImage ${project}/uImage