From 760a7527cb78b36fada0f4a342261f009f6c7839 Mon Sep 17 00:00:00 2001 From: Daisuke Sato Date: Wed, 6 Oct 2021 16:07:38 +0900 Subject: [PATCH 1/3] Update file name to match the current situation --- src/drivers/Makefile | 2 +- ...file.ubuntu14 => Makefile.header_from_apt} | 0 ...e.raspbian => Makefile.header_from_source} | 0 utils/build_install.bash | 14 ++++++++----- ...build_install_header_from_apt_raspi2.bash} | 2 +- ...build_install_header_from_apt_raspi4.bash} | 2 +- ...ld_install_header_from_source_raspi2.bash} | 2 +- ...ild_install_header_from_source_raspi4.bash | 21 +++++++++++++++++++ 8 files changed, 34 insertions(+), 9 deletions(-) rename src/drivers/{Makefile.ubuntu14 => Makefile.header_from_apt} (100%) rename src/drivers/{Makefile.raspbian => Makefile.header_from_source} (100%) rename utils/{build_install.ubuntu14.bash => build_install_header_from_apt_raspi2.bash} (91%) rename utils/{build_install.raspi4ubuntu.bash => build_install_header_from_apt_raspi4.bash} (92%) rename utils/{build_install.raspbian.bash => build_install_header_from_source_raspi2.bash} (90%) create mode 100755 utils/build_install_header_from_source_raspi4.bash 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..2376f19 100755 --- a/utils/build_install.bash +++ b/utils/build_install.bash @@ -4,14 +4,18 @@ 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 + $SRC_DIR/utils/build_install_header_from_source_raspi4.bash && exit 0 + else + $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 + $SRC_DIR/utils/build_install_header_from_apt_raspi4.bash && exit 0 else - $SRC_DIR/utils/build_install.ubuntu14.bash && exit 0 + $SRC_DIR/utils/build_install_header_from_apt_raspi2.bash && exit 0 fi else # Error diff --git a/utils/build_install.ubuntu14.bash b/utils/build_install_header_from_apt_raspi2.bash similarity index 91% rename from utils/build_install.ubuntu14.bash rename to utils/build_install_header_from_apt_raspi2.bash index 9087335..0826cd3 100755 --- a/utils/build_install.ubuntu14.bash +++ b/utils/build_install_header_from_apt_raspi2.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 make sudo insmod rtmouse.ko 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.raspbian.bash b/utils/build_install_header_from_source_raspi2.bash similarity index 90% rename from utils/build_install.raspbian.bash rename to utils/build_install_header_from_source_raspi2.bash index 19e4c99..1bf52ba 100755 --- a/utils/build_install.raspbian.bash +++ b/utils/build_install_header_from_source_raspi2.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.raspbian Makefile +ln -s Makefile.header_from_source Makefile make clean make sudo insmod rtmouse.ko 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 From 90b1553bf83ec41c5ff99ea8fa3d427fd4ef1fc1 Mon Sep 17 00:00:00 2001 From: Daisuke Sato Date: Wed, 6 Oct 2021 16:14:05 +0900 Subject: [PATCH 2/3] Add symbolic link for backward compatibility --- utils/build_install.raspbian.bash | 1 + utils/build_install.ubuntu14.bash | 1 + 2 files changed, 2 insertions(+) create mode 120000 utils/build_install.raspbian.bash create mode 120000 utils/build_install.ubuntu14.bash 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 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 From 0274f45c5eeddf630db91e498e4a2a662f411426 Mon Sep 17 00:00:00 2001 From: Daisuke Sato Date: Fri, 22 Oct 2021 19:23:42 +0900 Subject: [PATCH 3/3] Add debug output --- utils/build_install.bash | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/utils/build_install.bash b/utils/build_install.bash index 2376f19..d3e587c 100755 --- a/utils/build_install.bash +++ b/utils/build_install.bash @@ -6,16 +6,24 @@ SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../; pwd) if [ -e /usr/src/linux ]; then # build with linux headers installed from source if grep -q "Raspberry Pi 4" /proc/cpuinfo; then - $SRC_DIR/utils/build_install_header_from_source_raspi4.bash && exit 0 + echo build_install_header_from_source_raspi4.bash + $SRC_DIR/utils/build_install_header_from_source_raspi4.bash + exit 0 else - $SRC_DIR/utils/build_install_header_from_source_raspi2.bash && exit 0 + 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 # build with linux headers installed with apt if grep -q "Raspberry Pi 4" /proc/cpuinfo; then - $SRC_DIR/utils/build_install_header_from_apt_raspi4.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_header_from_apt_raspi2.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 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

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:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy