作者
QQ群:852283276
微信:arm80x86
微信公众号:青儿创客基地
B站:主页 https://space.bilibili.com/208826118
参考
ln: target ‘libcublas’ is not a directory
i.MX6Q kernel compilation for camera/video (gstreamer)
解析 Linux 内核可装载模块的版本检查机制
version magic '3.10.0_hifone SMP mod_unload ARMv7 p2v8 ’ should be '3.10.0_s40 SMP mod_unload ARMv7
error: macro “TIME” might prevent reproducible builds [-Werror=date-time]
编译内核时指定输出目录
$ make O=dir/to/store/output/files
# or
$ export KBUILD_OUTPUT=dir/to/store/output/files/
$ make
error: macro “DATE” might prevent reproducible builds [-Werror=date-time]
ccflags-y += -Wno-error=date-time -Wno-date-time
** 108 printk messages dropped **
这是Xilinx Zynq的默认配置,都改成17。
(14) Kernel log buffer size (16 => 64KB, 17 => 128KB)
(12) CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)
多个c文件编译驱动
obj-m:=pcie_chipset.o
pcie_chipset-objs := pcie_ep.o intc/xilinx_intc.o xaxienet/xilinx_axienet_main.o xaxienet/xilinx_axienet_mdio.o
Invalid module format
银河麒麟4.0,在目标机上编译驱动,此时不是交叉编译,/lib/modules
下面有几个文件夹,内核路径使用uname -r
,否则报上述问题。
loading out-of-tree module taints kernel.
模块依据代码编写与编译时的位置可分:内部模块和外部模块,即 in-tree module 和 out-of-tree module,在内核树外部编写并构建的模块就是外部模块。
version magic '4.13.16 SMP mod_unload ’ should be '4.13.0-36-generic SMP mod_unload ’
修改,
include/generated/utsrelease.h
#define UTS_RELEASE "4.13.16"
#define UTS_RELEASE "4.13.0-36-generic"
include/config/kernel.release
4.13.16
4.13.0-36-generic
或内核源代码的makefile
VERSION = 4
PATCHLEVEL = 13
SUBLEVEL = 16
EXTRAVERSION =
VERSION = 4
PATCHLEVEL = 13
SUBLEVEL = 0
EXTRAVERSION = -36-generic
make modules报错ln: target ‘/source’ is not a directory
sudo -E env "PATH=$PATH" make INSTALL_MOD_PATH=~/Apalis-iMX6-LXDE-Image_2.8.4/rootfs/ modules_install
现象,
zc@ubuntu:~/project$ make modules_install
ln: target '/source' is not a directory
Makefile:1232: recipe for target '_modinst_' failed
make: *** [_modinst_] Error 1
调试Makefile发现,
ln -s /program/zynqmp/linux-xlnx-v2018.2 /project/zynqmp_rootfs/lib/modules/4.14.0-fdk-1.0.0-20181120.1856 /source
版本号后面多加了个空格,导致语法错误,哎。
网卡驱动无法卸载
驱动pcie_chipset
Used参数为1,无法卸载,执行ifconfig enp3s0 down
之后可以卸载。
$ lsmod
Module Size Used by
pcie_chipset 45502 1
xphy 2568 0
uio 14551 1 pcie_chipset
$ sudo ifconfig enp3s0 down
$ lsmod
Module Size Used by
pcie_chipset 45502 0
xphy 2568 0
uio 14551 1 pcie_chipset
替换系统驱动文件之后仍加载老驱动
需要更新ramfs,
$ sudo update-initramfs -u