Xavier开发者平台Docker中安装PCAN

PCAN又叫做PCAN-USB,也叫作CAN卡,是一个CAN转USB接口,可以将CAN网络上的报文通过USB接口传输到PC上,通过相关的软件来查看CAN报文。

1、PCAN依赖的环境

    linux-headers-`uname -r`
    libpopt-dev
    g++

2、ARM64架构宿主机上安装PCAN

sudo apt install libpopt-dev -y
tar -xzvf peak-linux-driver-8.10.2.tar.gz
cd peak-linux-driver-8.10.2
sudo make all NET=NO PCI=NO ISA=NO DNG=NO PCC=NO
sudo make  install
sudo modprobe pcan

3、ARM64架构Docker中安装PCAN
1)、add之前宿主机make产生的文件到对应的docker目录上
2)、在docker中加载pcan
具体内容如下

ADD file/linux-headers-4.9.140-tegra /usr/src/linux-headers-4.9.140-tegra/
ADD file/pcanlib/etc/modules.conf.local /etc/
ADD file/pcanlib/lib/modules/4.9.140-tegra /lib/modules/4.9.140-tegra/
ADD file/pcanlib/usr/include /usr/include/
ADD file/pcanlib/usr/lib /usr/lib/
ADD file/pcanlib/usr/local/bin /usr/local/bin/
ADD file/tegra /usr/lib/aarch64-linux-gnu/tegra/
RUN echo "/usr/lib/aarch64-linux-gnu/tegra" >> /etc/ld.so.conf.d/aarch64-linux-gnu.conf \
    && ldconfig
    && modprobe pcan \