野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7007|回复: 5

编译debian系统 字符驱动失败

[复制链接]
发表于 2020-5-4 11:30:03 | 显示全部楼层 |阅读模式
  1. 根据 https://tutorial.linux.doc.embedfire.com/zh_CN/latest/building_image/building_debian.html 下载内核代码并编译通过:
  1. git clone https://gitee.com/wildfireteam/ebf-buster-linux.git
  2. sudo ./make_deb.sh
复制代码
2. 然后根据 https://gitee.com/wildfireteam/embed_linux_tutorial/tree/master/base_code/linux_driver/EmbedCharDev 里面的编译字符启动代码, 出现如下错误:
  1. root@x61_ubuntu:/home/share/embed_linux_tutorial/base_code/linux_driver/EmbedCharDev# make
  2. make -C /home/share/fire/ebf-buster-linux/ M=/home/share/embed_linux_tutorial/base_code/linux_driver/EmbedCharDev modules
  3. make[1]: Entering directory '/home/share/fire/ebf-buster-linux'
  4. Makefile:590: include/config/auto.conf: No such file or directory

  5.   ERROR: Kernel configuration is invalid.
  6.          include/generated/autoconf.h or include/config/auto.conf are missing.
  7.          Run 'make oldconfig && make prepare' on kernel src to fix it.

  8. Makefile:641: recipe for target 'include/config/auto.conf' failed
  9. make[1]: *** [include/config/auto.conf] Error 1
  10. make[1]: Leaving directory '/home/share/fire/ebf-buster-linux'
  11. Makefile:6: recipe for target 'all' failed
  12. make: *** [all] Error 2
复制代码

3. 是否我还得到内核目录下 make menuconfig重新生成配置?我的疑问是 “make_deb.sh”这个脚本不是做了生成配置的工作了吗?4. 我的主机编译系统:
  1. root@x61_ubuntu:/home/share/embed_linux_tutorial/base_code/linux_driver/EmbedCharDev# lsb_release -a
  2. No LSB modules are available.
  3. Distributor ID: Ubuntu
  4. Description:    Ubuntu 18.04.4 LTS
  5. Release:        18.04
  6. Codename:       bionic
  7. root@x61_ubuntu:/home/share/embed_linux_tutorial/base_code/linux_driver/EmbedCharDev# arm-linux-gnueabihf-gcc --versionarm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0Copyright (C) 2017 Free Software Foundation, Inc.This is free software; see the source for copying conditions.  There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
复制代码








回复

使用道具 举报

发表于 2020-5-5 08:44:29 | 显示全部楼层
make_deb.sh编译了内核,但是他输出的那些文件都放到/home/pi中,你字符设备驱动的Makefile写的内核路径实际上还是新的,没编译过的。手动编译一次内核吧
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-5-5 11:33:17 | 显示全部楼层
Grit 发表于 2020-5-5 08:44
make_deb.sh编译了内核,但是他输出的那些文件都放到/home/pi中,你字符设备驱动的Makefile写的内核路径实 ...

我也是觉得我应该重新使用make来编译一次内核,但我有另外一个疑问:使用make_deb.sh编译了内核烧录到板子上, 然后再手动编译内核来提供给字符驱动, 到时候insmod 驱动, 内核会认吗?毕竟我可能内核的选项啥的和make_deb.sh的配置不一样。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-5-5 15:50:13 | 显示全部楼层
然后我手动来编译的时候:
make ARCH=arm imx_v7_ebf_defconfig
发现imx_v7_ebf_defconfig 文件不存在, 只有一个imx_v7_defconfig, 查看一下当前分支:
  1. root@x61_ubuntu:/home/share/fire/ebf-buster-linux# git branch -a
  2. * master
  3.   remotes/origin/HEAD -> origin/master
  4.   remotes/origin/master
复制代码

似乎也没有其他分支。
于是我决定使用一下imx_v7_defconfig来进行编译:
  1. make ARCH=arm imx_v7_defconfig
  2. make ARCH=arm -j4 CROSS_COMPILE=arm-linux-gnueabihf-
复制代码

得到如下错误:
  1. root@x61_ubuntu:/home/share/fire/ebf-buster-linux# make ARCH=arm -j4 CROSS_COMPILE=arm-linux-gnueabihf-
  2. scripts/kconfig/conf  --syncconfig Kconfig
  3.   CALL    scripts/checksyscalls.sh
  4.   CHK     include/generated/compile.h
  5.   GZIP    kernel/config_data.gz
  6.   GEN     .version
  7.   CHK     include/generated/compile.h
  8.   UPD     include/generated/compile.h
  9.   CC      init/version.o
  10.   AR      init/built-in.a
  11.   AR      built-in.a
  12.   LD      vmlinux.o
  13. sound/soc/codecs/cs42xx8-i2c.o:(.rodata+0x0): multiple definition of `cs42xx8_of_match'
  14. sound/soc/codecs/cs42xx8.o:cs42xx8.c:(.rodata+0x35c): first defined here
  15. Makefile:1026: recipe for target 'vmlinux' failed
  16. make: *** [vmlinux] Error 1
复制代码


哪位兄弟能提示一下如何着手吗?
回复 支持 反对

使用道具 举报

发表于 2020-5-5 16:31:16 | 显示全部楼层
zaijzhgh 发表于 2020-5-5 15:50
然后我手动来编译的时候:
make ARCH=arm imx_v7_ebf_defconfig
发现imx_v7_ebf_defconfig 文件不存在, 只 ...

配置文件用npi_v7_defconfig
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-5-6 08:25:35 | 显示全部楼层
Grit 发表于 2020-5-5 16:31
配置文件用npi_v7_defconfig

非常感谢, 问题得到解决了.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-4-30 00:00 , Processed in 0.040809 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表