forked from ev3dev/ev3dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_modules
executable file
·51 lines (38 loc) · 1.58 KB
/
build_modules
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
#!/bin/sh
#******************************************************************************************************************
# COMPILE KERNEL
#******************************************************************************************************************
# as normal user on linux pc terminal:
echo
echo -------------------------------------------------------------------------------
echo BUILDING MODULES
echo -------------------------------------------------------------------------------
echo
sleep 1
project=`pwd`
echo ${project}
. ./env_setup
echo ${AM1808_COMPILER}
echo ${AM1808_KERNEL}
PATH=${AM1808_COMPILER}:$PATH
echo ${PATH}
if [ ! -f ${AM1808_KERNEL}/include/config/kernel.release ]; then
echo "Kernel not compiled?"
exit 1
fi
AM1808_KERNEL_RELEASE="$(cat ${AM1808_KERNEL}/include/config/kernel.release)"
if [ ! -e ./modules/lib/modules/${AM1808_KERNEL_RELEASE}/updates ]; then
mkdir -p ./modules/lib/modules/${AM1808_KERNEL_RELEASE}/updates
fi
for module in "ev3dev" "ui" "pwm" # "sound" => EV3 own sound module deprecated probably! (David Lechner's driver).
# for module in "ev3dev" "ui"
# for module in "pwm"
do
cd ../ev3dev-modules/lms2012/d_${module}/Linuxmod_AM1808
echo "Now we're in $(pwd)"
make -C ${AM1808_KERNEL} M=`pwd` MOD=${module} ARCH=arm CROSS_COMPILE=${AM1808_ABI} modules
cd ${project}
cp ../ev3dev-modules/lms2012/d_${module}/Linuxmod_AM1808/*.ko ./modules/lib/modules/${AM1808_KERNEL_RELEASE}/updates/
done
# make -C ${AM1808_KERNEL} MOD=${module} M=`pwd` ARCH=arm CROSS_COMPILE=${AM1808_ABI} modules
# cp $1.ko $AM1808_MODULES/$1.ko