diff --git a/src/drivers/Makefile b/src/drivers/Makefile index 1086ef4..c45a429 120000 --- a/src/drivers/Makefile +++ b/src/drivers/Makefile @@ -1 +1 @@ -Makefile.ubuntu14 \ No newline at end of file +Makefile.header_from_apt \ No newline at end of file diff --git a/src/drivers/Makefile.ubuntu14 b/src/drivers/Makefile.header_from_apt similarity index 100% rename from src/drivers/Makefile.ubuntu14 rename to src/drivers/Makefile.header_from_apt diff --git a/src/drivers/Makefile.raspbian b/src/drivers/Makefile.header_from_source similarity index 100% rename from src/drivers/Makefile.raspbian rename to src/drivers/Makefile.header_from_source diff --git a/utils/build_install.bash b/utils/build_install.bash index 03225cb..d3e587c 100755 --- a/utils/build_install.bash +++ b/utils/build_install.bash @@ -4,14 +4,26 @@ set -eu SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../; pwd) if [ -e /usr/src/linux ]; then - # Raspbian/Raspberry Pi OS - $SRC_DIR/utils/build_install.raspbian.bash && exit 0 + # build with linux headers installed from source + if grep -q "Raspberry Pi 4" /proc/cpuinfo; then + echo build_install_header_from_source_raspi4.bash + $SRC_DIR/utils/build_install_header_from_source_raspi4.bash + exit 0 + else + echo build_install_header_from_source_raspi2.bash + $SRC_DIR/utils/build_install_header_from_source_raspi2.bash + exit 0 + fi elif [ "$(ls /usr/src/linux-* 2> /dev/null)" != '' ]; then - # Ubuntu + # build with linux headers installed with apt if grep -q "Raspberry Pi 4" /proc/cpuinfo; then - $SRC_DIR/utils/build_install.raspi4ubuntu.bash && exit 0 + echo build_install_header_from_apt_raspi4.bash + $SRC_DIR/utils/build_install_header_from_apt_raspi4.bash + exit 0 else - $SRC_DIR/utils/build_install.ubuntu14.bash && exit 0 + echo build_install_header_from_apt_raspi2.bash + $SRC_DIR/utils/build_install_header_from_apt_raspi2.bash + exit 0 fi else # Error diff --git a/utils/build_install.raspbian.bash b/utils/build_install.raspbian.bash deleted file mode 100755 index 19e4c99..0000000 --- a/utils/build_install.raspbian.bash +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -eu - -SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../; pwd) - -# check kernel headers -[ ! -e /usr/src/linux ] && { bash -e $SRC_DIR/utils/print_env.bash "No kernel header files found."; exit 1; } - -# build and install the driver -cd $SRC_DIR/src/drivers/ -rm Makefile -ln -s Makefile.raspbian Makefile -make clean -make -sudo insmod rtmouse.ko - -# initialize the driver -sleep 1 -sudo chmod 666 /dev/rt* -echo 0 > /dev/rtmotoren0 diff --git a/utils/build_install.raspbian.bash b/utils/build_install.raspbian.bash new file mode 120000 index 0000000..0cd0e79 --- /dev/null +++ b/utils/build_install.raspbian.bash @@ -0,0 +1 @@ +build_install_header_from_source_raspi2.bash \ No newline at end of file diff --git a/utils/build_install.ubuntu14.bash b/utils/build_install.ubuntu14.bash deleted file mode 100755 index 9087335..0000000 --- a/utils/build_install.ubuntu14.bash +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -eu - -SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../; pwd) - -# check kernel headers -[ ! -e /usr/src/linux-headers-$(uname -r) ] && { bash -e $SRC_DIR/utils/print_env.bash "No kernel header files found."; exit 1; } - -# build and install the driver -cd $SRC_DIR/src/drivers/ -rm Makefile -ln -s Makefile.ubuntu14 Makefile -make clean -make -sudo insmod rtmouse.ko - -# initialize the driver -sleep 1 -sudo chmod 666 /dev/rt* -echo 0 > /dev/rtmotoren0 diff --git a/utils/build_install.ubuntu14.bash b/utils/build_install.ubuntu14.bash new file mode 120000 index 0000000..4121f3a --- /dev/null +++ b/utils/build_install.ubuntu14.bash @@ -0,0 +1 @@ +build_install_header_from_apt_raspi2.bash \ No newline at end of file diff --git a/utils/build_install_header_from_apt_raspi2.bash b/utils/build_install_header_from_apt_raspi2.bash new file mode 100755 index 0000000..0826cd3 --- /dev/null +++ b/utils/build_install_header_from_apt_raspi2.bash @@ -0,0 +1,19 @@ +#!/bin/bash -eu + +SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../; pwd) + +# check kernel headers +[ ! -e /usr/src/linux-headers-$(uname -r) ] && { bash -e $SRC_DIR/utils/print_env.bash "No kernel header files found."; exit 1; } + +# build and install the driver +cd $SRC_DIR/src/drivers/ +rm Makefile +ln -s Makefile.header_from_apt Makefile +make clean +make +sudo insmod rtmouse.ko + +# initialize the driver +sleep 1 +sudo chmod 666 /dev/rt* +echo 0 > /dev/rtmotoren0 diff --git a/utils/build_install.raspi4ubuntu.bash b/utils/build_install_header_from_apt_raspi4.bash similarity index 92% rename from utils/build_install.raspi4ubuntu.bash rename to utils/build_install_header_from_apt_raspi4.bash index 0f52a9e..482d675 100755 --- a/utils/build_install.raspi4ubuntu.bash +++ b/utils/build_install_header_from_apt_raspi4.bash @@ -8,7 +8,7 @@ SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../; pwd) # build and install the driver cd $SRC_DIR/src/drivers/ rm Makefile -ln -s Makefile.ubuntu14 Makefile +ln -s Makefile.header_from_apt Makefile make clean # Update for Raspberry Pi 4 sed -i -e "s/#define RASPBERRYPI 2/#define RASPBERRYPI 4/g" rtmouse.c diff --git a/utils/build_install_header_from_source_raspi2.bash b/utils/build_install_header_from_source_raspi2.bash new file mode 100755 index 0000000..1bf52ba --- /dev/null +++ b/utils/build_install_header_from_source_raspi2.bash @@ -0,0 +1,19 @@ +#!/bin/bash -eu + +SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../; pwd) + +# check kernel headers +[ ! -e /usr/src/linux ] && { bash -e $SRC_DIR/utils/print_env.bash "No kernel header files found."; exit 1; } + +# build and install the driver +cd $SRC_DIR/src/drivers/ +rm Makefile +ln -s Makefile.header_from_source Makefile +make clean +make +sudo insmod rtmouse.ko + +# initialize the driver +sleep 1 +sudo chmod 666 /dev/rt* +echo 0 > /dev/rtmotoren0 diff --git a/utils/build_install_header_from_source_raspi4.bash b/utils/build_install_header_from_source_raspi4.bash new file mode 100755 index 0000000..a09aabb --- /dev/null +++ b/utils/build_install_header_from_source_raspi4.bash @@ -0,0 +1,21 @@ +#!/bin/bash -eu + +SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../; pwd) + +# check kernel headers +[ ! -e /usr/src/linux ] && { bash -e $SRC_DIR/utils/print_env.bash "No kernel header files found."; exit 1; } + +# build and install the driver +cd $SRC_DIR/src/drivers/ +rm Makefile +ln -s Makefile.header_from_source Makefile +make clean +# Update for Raspberry Pi 4 +sed -i -e "s/#define RASPBERRYPI 2/#define RASPBERRYPI 4/g" rtmouse.c +make +sudo insmod rtmouse.ko + +# initialize the driver +sleep 1 +sudo chmod 666 /dev/rt* +echo 0 > /dev/rtmotoren0
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: