【error】scripts/basic/fixdep: Syntax error: "(" unexpected

前言

第一次安装PCIE驱动的时候容易出现各种问题,总结一下下。。

原因分析

一般情况下,直接make的时候会出现问题.

scripts/basic/fixdep: 1: scripts/basic/fixdep: Syntax error: "(" unexpected
scripts/Makefile.build:261: recipe for target '/opt/pcie_v4l2_mono-master/app/uisee-sensor.o' failed
make[3]: *** [/opt/pcie_v4l2_mono-master/app/uisee-sensor.o] Error 2
Makefile:1414: recipe for target '_module_/opt/pcie_v4l2_mono-master/app' failed
make[2]: *** [_module_/opt/pcie_v4l2_mono-master/app] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.4.38-tegra'
Makefile:16: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/opt/pcie_v4l2_mono-master/app'
Makefile:42: recipe for target 'all' failed
make: *** [all] Error 2

 原因一:

没有在/etc/rc.local文件中加载pcie驱动;

        echo "PCIE card exist, start pcie video driver"
        modprobe videodev
        modprobe videobuf2-core
        modprobe videobuf2-vmalloc
        modprobe videobuf2-dma-contig
        modprobe v4l2-common

等等。。。

原因二:

系统ext配置文件不完整;

解决方法:

在/boot/extconf,修改extconf文件,增加coherent_pool=16M,加在APPEND最后;

nvidia@tegra-ubuntu:/boot/extlinux$ sudo vi extlinux.conf 
 
TIMEOUT 30
DEFAULT primary

MENU TITLE p2771-0000 eMMC boot options

LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 coherent_pool=16M

原因三:

内核需要重新编译;

cd /lib/modules/4.4.38-tegra/
cd build
cd scripts/
sudo make scripts

scripts目录出错:

make: *** No rule to make target 'scripts'.  Stop.

注意,也可能是在build而不是scripts目录下进行编译;

build目录编译成功:

nvidia@tegra-ubuntu:/lib/modules/4.4.38-tegra/build$ sudo make scripts
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/bin2c
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --silentoldconfig Kconfig
#
# configuration written to .config
#
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  GEN     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/pnmtologo
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/sortextable

 

原因四:
驱动文件的权限问题;

sudo chown nvidia:nvidia pcie_v4l2_mono-master/ -R

原因五:

编译驱动;

cd /opt/pcie_***
sudo make clean
make #( no sudo)
sudo make insert

参考

1.编译驱动内核;

转载于:https://www.cnblogs.com/happyamyhope/p/9430225.html

你可能感兴趣的:(【error】scripts/basic/fixdep: Syntax error: "(" unexpected)