loongarch ethercat

目录

部署

交叉编译路径和linux源码路径

export KERNEL_DIR=/path/to/loongarch/kernel/source
export CROSS_COMPILE=loongarch64-linux-gnu-

生成 configure

./bootstrap

配置configure

./configure \
    --enable-8139too=no \
    --enable-generic=yes \      
    --enable-sii-assign=yes \
    --host=loongarch64-linux-gnu \
    --with-linux-dir=$KERNEL_DIR \
    --prefix=/home/fanbao/etherlab

这里先用 --enable-generic=yes ,先用通用的,因为不知道loongarch是否支持igb的原生驱动

make 和 make modules

sudo make
sudo make -C "/home/fanbao/workspace-hvisor/hvisor-la64-linux/linux-6.11.6/" \
     M="$PWD" \
     ARCH=loongarch \
     CROSS_COMPILE=loongarch64-unknown-linux-gnu- \
     INSTALL_MOD_DIR="ethercat" \
     modules

make install 和 make modules_install

make install
make DESTDIR=/home/fanbao/hvisor-la64-linux/target/root/ modules_install 

注意,这里可能需要进行一些交叉编译,比如 make ... CROSS_COMPILE 等等,因为我后来查看 file ethercat 这个可执行文件,显示架构还是 x86的

这里 make install 将安装 ethercat header,init script,sysconfig file 和 userspace tool 到 prefix path
这里 make DESTDIR=/home/fanbao/hvisor-la64-linux/target/root/ modules_install,是因为可能是要找到目标loongarch的rootfs的lib/modules目录,而我感觉就是 /home/fanbao/hvisor-la64-linux/target/root/lib/modules 这个目录

posted @ 2026-02-02 21:28  爱吃鸡魔人zf  阅读(3)  评论(0)    收藏  举报