第5章 开发板的第 1 个驱动实验 make all报错

book@100ask:~/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_100ask_imx6ull_src_bin$ make all
make -C /home/book/100ask_imx6ull_mini-sdk/Linux-4.9.88 M=`pwd` modules 
make[1]: Entering directory '/home/book/100ask_imx6ull_mini-sdk/Linux-4.9.88'
  CC [M]  /home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/leddrv.o
In file included from ./include/linux/kobject.h:21:0,
                 from ./include/linux/module.h:17,
                 from /home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/leddrv.c:1:
./include/linux/sysfs.h: In function ‘sysfs_get_dirent’:
./include/linux/sysfs.h:523:37: warning: pointer targets in passing argument 2 of ‘kernfs_find_and_get’ differ in signedness [-Wpointer-sign]
  return kernfs_find_and_get(parent, name);
                                     ^~~~
In file included from ./include/linux/sysfs.h:15:0,
                 from ./include/linux/kobject.h:21,
                 from ./include/linux/module.h:17,
                 from /home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/leddrv.c:1:
./include/linux/kernfs.h:452:1: note: expected ‘const char *’ but argument is of type ‘const unsigned char *kernfs_find_and_get(struct kernfs_node *kn, const char *name)
 ^~~~~~~~~~~~~~~~~~~
/home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/leddrv.c: In function ‘led_drv_write’:
/home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/leddrv.c:39:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
  int err;
      ^~~
/home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/leddrv.c: In function ‘led_init’:
/home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/leddrv.c:83:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
  int err;
      ^~~
/home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/leddrv.c: At top level:
/home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/leddrv.c:127:1: fatal error: opening dependency file /home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/.leddrv.o.d: Permission denied
 MODULE_LICENSE("GPL");
 ^~~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:293: recipe for target '/home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/leddrv.o' failed
make[2]: *** [/home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin/leddrv.o] Error 1
Makefile:1499: recipe for target '_module_/home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin' failed
make[1]: *** [_module_/home/book/01_all_series_quickstart/05_嵌入式Linux驱动开发基础知识/source/02_led_drv/02_led_drv_for_boards/100ask_imx6ull_src_bin] Error 2
make[1]: Leaving directory '/home/book/100ask_imx6ull_mini-sdk/Linux-4.9.88'
Makefile:14: recipe for target 'all' failed
make: *** [all] Error 2

驱动开发编译驱动程序,需要首先编译buildroot的linux内核。
详见手册第三篇中编译内核章节。

谢谢,已经解决了,重新下载了一遍内核,重新编译内核、模块之后好了