From e7709d134d19f5aff8d08417cf4d501e8fc10143 Mon Sep 17 00:00:00 2001 From: Sven Date: Mon, 7 Apr 2025 18:26:04 +0200 Subject: [PATCH] line endings from CRLF to LF; prepare for MOK signing --- installSocketCAN.sh | 137 ++++++++++++++++++++++---------------------- 1 file changed, 70 insertions(+), 67 deletions(-) diff --git a/installSocketCAN.sh b/installSocketCAN.sh index 517a38c..6358914 100755 --- a/installSocketCAN.sh +++ b/installSocketCAN.sh @@ -1,67 +1,70 @@ -#!/bin/bash - -cd $HOME - -sudo apt install -y linux-headers-generic build-essential gcc git dkms cmake libusb-1.0-0-dev libpcap-dev can-utils - -rm -rf intrepid-socketcan-kernel-module -git clone https://github.com/intrepidcs/intrepid-socketcan-kernel-module.git -cd intrepid-socketcan-kernel-module -make -sudo make install -grep -F -q 'can' /etc/modules | echo 'can' | sudo tee -a /etc/modules -grep -F -q 'can-raw' /etc/modules | echo 'can-raw' | sudo tee -a /etc/modules -grep -F -q 'can-dev' /etc/modules | echo 'can-dev' | sudo tee -a /etc/modules -sudo modprobe can -sudo modprobe can-raw -sudo modprobe can-dev -sudo insmod intrepid.ko - - -cd .. -rm -rf icsscand -git clone --recursive https://github.com/intrepidcs/icsscand.git -cd icsscand -mkdir -p build && cd build -cmake -DCMAKE_BUILD_TYPE=Release .. -make - -sudo cp libicsneo-socketcan-daemon /usr/sbin/ - -echo << EOF > icsscand.service -[Unit] -Description=Intrepid Device Scanner - -[Service] -ExecStart=/usr/sbin/libicsneo-socketcan-daemon - -[Install] -WantedBy=multi-user.target -EOF - -sudo cp icsscand.service /etc/systemd/system/ - -sudo systemctl enable icsscand.service -sudo systemctl start icsscand.service - -sleep 10 - -cd ../.. -sudo ip link set can0 up -sudo ip link set can1 up -sudo ip link set can2 up -sudo ip link set can3 up - -rm -rf libicsneo -git clone https://github.com/intrepidcs/libicsneo -cd libicsneo -cmake -S . -B build -cmake --build build -sudo cp build/*.so /usr/lib/ -sudo cp 99-intrepidcs.rules /etc/udev/rules.d/ -sudo cp -r include/* /usr/include -sudo udevadm control --reload -sudo udevadm trigger - -cd .. - +#!/bin/bash + +cd $HOME + +sudo apt install -y linux-headers-generic build-essential gcc git dkms cmake libusb-1.0-0-dev libpcap-dev can-utils + +rm -rf intrepid-socketcan-kernel-module +git clone https://github.com/intrepidcs/intrepid-socketcan-kernel-module.git +cd intrepid-socketcan-kernel-module +make + +# check for MOK signing the module... + +sudo make install +grep -F -q 'can' /etc/modules | echo 'can' | sudo tee -a /etc/modules +grep -F -q 'can-raw' /etc/modules | echo 'can-raw' | sudo tee -a /etc/modules +grep -F -q 'can-dev' /etc/modules | echo 'can-dev' | sudo tee -a /etc/modules +sudo modprobe can +sudo modprobe can-raw +sudo modprobe can-dev +sudo insmod intrepid.ko + + +cd .. +rm -rf icsscand +git clone --recursive https://github.com/intrepidcs/icsscand.git +cd icsscand +mkdir -p build && cd build +cmake -DCMAKE_BUILD_TYPE=Release .. +make + +sudo cp libicsneo-socketcan-daemon /usr/sbin/ + +echo << EOF > icsscand.service +[Unit] +Description=Intrepid Device Scanner + +[Service] +ExecStart=/usr/sbin/libicsneo-socketcan-daemon + +[Install] +WantedBy=multi-user.target +EOF + +sudo cp icsscand.service /etc/systemd/system/ + +sudo systemctl enable icsscand.service +sudo systemctl start icsscand.service + +sleep 10 + +cd ../.. +sudo ip link set can0 up +sudo ip link set can1 up +sudo ip link set can2 up +sudo ip link set can3 up + +rm -rf libicsneo +git clone https://github.com/intrepidcs/libicsneo +cd libicsneo +cmake -S . -B build +cmake --build build +sudo cp build/*.so /usr/lib/ +sudo cp 99-intrepidcs.rules /etc/udev/rules.d/ +sudo cp -r include/* /usr/include +sudo udevadm control --reload +sudo udevadm trigger + +cd .. +