File tree 10 files changed +80
-45
lines changed
10 files changed +80
-45
lines changed Original file line number Diff line number Diff line change 1
- Makefile.ubuntu14
1
+ Makefile.header_from_apt
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -4,14 +4,26 @@ set -eu
4
4
SRC_DIR=$( cd $( dirname ${BASH_SOURCE:- $0 } ) /../; pwd)
5
5
6
6
if [ -e /usr/src/linux ]; then
7
- # Raspbian/Raspberry Pi OS
8
- $SRC_DIR /utils/build_install.raspbian.bash && exit 0
7
+ # build with linux headers installed from source
8
+ if grep -q " Raspberry Pi 4" /proc/cpuinfo; then
9
+ echo build_install_header_from_source_raspi4.bash
10
+ $SRC_DIR /utils/build_install_header_from_source_raspi4.bash
11
+ exit 0
12
+ else
13
+ echo build_install_header_from_source_raspi2.bash
14
+ $SRC_DIR /utils/build_install_header_from_source_raspi2.bash
15
+ exit 0
16
+ fi
9
17
elif [ " $( ls /usr/src/linux-* 2> /dev/null) " != ' ' ]; then
10
- # Ubuntu
18
+ # build with linux headers installed with apt
11
19
if grep -q " Raspberry Pi 4" /proc/cpuinfo; then
12
- $SRC_DIR /utils/build_install.raspi4ubuntu.bash && exit 0
20
+ echo build_install_header_from_apt_raspi4.bash
21
+ $SRC_DIR /utils/build_install_header_from_apt_raspi4.bash
22
+ exit 0
13
23
else
14
- $SRC_DIR /utils/build_install.ubuntu14.bash && exit 0
24
+ echo build_install_header_from_apt_raspi2.bash
25
+ $SRC_DIR /utils/build_install_header_from_apt_raspi2.bash
26
+ exit 0
15
27
fi
16
28
else
17
29
# Error
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ build_install_header_from_source_raspi2.bash
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ build_install_header_from_apt_raspi2.bash
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -eu
2
+
3
+ SRC_DIR=$( cd $( dirname ${BASH_SOURCE:- $0 } ) /../; pwd)
4
+
5
+ # check kernel headers
6
+ [ ! -e /usr/src/linux-headers-$( uname -r) ] && { bash -e $SRC_DIR /utils/print_env.bash " No kernel header files found." ; exit 1; }
7
+
8
+ # build and install the driver
9
+ cd $SRC_DIR /src/drivers/
10
+ rm Makefile
11
+ ln -s Makefile.header_from_apt Makefile
12
+ make clean
13
+ make
14
+ sudo insmod rtmouse.ko
15
+
16
+ # initialize the driver
17
+ sleep 1
18
+ sudo chmod 666 /dev/rt*
19
+ echo 0 > /dev/rtmotoren0
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../; pwd)
8
8
# build and install the driver
9
9
cd $SRC_DIR /src/drivers/
10
10
rm Makefile
11
- ln -s Makefile.ubuntu14 Makefile
11
+ ln -s Makefile.header_from_apt Makefile
12
12
make clean
13
13
# Update for Raspberry Pi 4
14
14
sed -i -e " s/#define RASPBERRYPI 2/#define RASPBERRYPI 4/g" rtmouse.c
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -eu
2
+
3
+ SRC_DIR=$( cd $( dirname ${BASH_SOURCE:- $0 } ) /../; pwd)
4
+
5
+ # check kernel headers
6
+ [ ! -e /usr/src/linux ] && { bash -e $SRC_DIR /utils/print_env.bash " No kernel header files found." ; exit 1; }
7
+
8
+ # build and install the driver
9
+ cd $SRC_DIR /src/drivers/
10
+ rm Makefile
11
+ ln -s Makefile.header_from_source Makefile
12
+ make clean
13
+ make
14
+ sudo insmod rtmouse.ko
15
+
16
+ # initialize the driver
17
+ sleep 1
18
+ sudo chmod 666 /dev/rt*
19
+ echo 0 > /dev/rtmotoren0
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -eu
2
+
3
+ SRC_DIR=$( cd $( dirname ${BASH_SOURCE:- $0 } ) /../; pwd)
4
+
5
+ # check kernel headers
6
+ [ ! -e /usr/src/linux ] && { bash -e $SRC_DIR /utils/print_env.bash " No kernel header files found." ; exit 1; }
7
+
8
+ # build and install the driver
9
+ cd $SRC_DIR /src/drivers/
10
+ rm Makefile
11
+ ln -s Makefile.header_from_source Makefile
12
+ make clean
13
+ # Update for Raspberry Pi 4
14
+ sed -i -e " s/#define RASPBERRYPI 2/#define RASPBERRYPI 4/g" rtmouse.c
15
+ make
16
+ sudo insmod rtmouse.ko
17
+
18
+ # initialize the driver
19
+ sleep 1
20
+ sudo chmod 666 /dev/rt*
21
+ echo 0 > /dev/rtmotoren0
You can’t perform that action at this time.
0 commit comments