csky linux 编译内核,arm linux kernel编译问题总结-Go语言中文社区

1 make menuconfig报错

guang@guang-kylin:~/Develop/linux-stable$ make menuconfig

HOSTCC scripts/basic/fixdep

* Unable to find the ncurses libraries or the

* required header files.

* ‘make menuconfig’ requires the ncurses libraries.

* Install ncurses (ncurses-devel or libncurses-dev

* depending on your distribution) and try again.

scripts/kconfig/Makefile:219: recipe for target ‘scripts/kconfig/dochecklxdialog’ failed

make[1]: * [scripts/kconfig/dochecklxdialog] Error 1

Makefile:528: recipe for target ‘menuconfig’ failed

make: * [menuconfig] Error 2

guang@guang-kylin:~/Develop/linux-stable$

解决,安装ncurses:

sudo apt install ncurses-dev

3 busybox执行 make menuconfig报错

guang@guang-ubuntu:~/Develop/busybox$ make menuconfig

HOSTCC scripts/basic/fixdep

HOSTCC scripts/basic/split-include

scripts/basic/split-include.c: In function ‘main’:

scripts/basic/split-include.c:134:6: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]

fgets(old_line, buffer_size, fp_target);

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

HOSTCC scripts/basic/docproc

HOSTCC scripts/kconfig/conf.o

scripts/kconfig/conf.c: In function ‘conf_askvalue’:

scripts/kconfig/conf.c:145:3: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]

fgets(line, 128, stdin);

^~~~~~~~~~~~~~~~~~~

scripts/kconfig/conf.c: In function ‘conf_choice’:

scripts/kconfig/conf.c:393:4: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]

fgets(line, 128, stdin);

^~~~~~~~~~~~~~~~~~~

HOSTCC scripts/kconfig/kxgettext.o

HOSTCC scripts/kconfig/mconf.o

scripts/kconfig/mconf.c: In function ‘show_textbox’:

scripts/kconfig/mconf.c:847:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]

write(fd, text, strlen(text));

^~~~~~~~~~~~~~~~~~~~~~~~~

scripts/kconfig/mconf.c: In function ‘exec_conf’:

scripts/kconfig/mconf.c:481:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]

pipe(pipefd);

^~~~~~~~

HOSTCC scripts/kconfig/zconf.tab.o

HOSTLD scripts/kconfig/mconf

HOSTCC scripts/kconfig/lxdialog/checklist.o

:0:12: fatal error: curses.h: No such file or directory

compilation terminated.

scripts/Makefile.host:120: recipe for target ‘scripts/kconfig/lxdialog/checklist.o’ failed

make[2]: * [scripts/kconfig/lxdialog/checklist.o] Error 1

/home/guang/Develop/busybox/scripts/kconfig/Makefile:14: recipe for target ‘menuconfig’ failed

make[1]: * [menuconfig] Error 2

Makefile:443: recipe for target ‘menuconfig’ failed

make: * [menuconfig] Error 2

解决:

sudo apt-get install libncurses5-dev libncursesw5-dev

make menuconfig执行效果如下

2d28e741499226023876ded2aa997714.png

4 开发板启动过程中报:can’t run ‘/etc/init.d/rcS’: Permission denied

7ecaba4267f913f125df06167eb85b99.png

解决:增加rcS可执行权限

guang@arm-vexpress:/ # cd etc/init.d/

guang@arm-vexpress:/etc/init.d # ls

rcS

guang@arm-vexpress:/etc/init.d # ls -al

total 3

drwxr-xr-x 2 0 0 1024 Jun 11 18:26 .

drwxr-xr-x 3 0 0 1024 Jun 11 18:26 ..

-rw-r–r– 1 0 0 328 Jun 11 18:26 rcS

guang@arm-vexpress:/etc/init.d # chmod -R 777 rcS

guang@arm-vexpress:/etc/init.d # ls -al

total 3

drwxr-xr-x 2 0 0 1024 Jun 11 18:26 .

drwxr-xr-x 3 0 0 1024 Jun 11 18:26 ..

-rwxrwxrwx 1 0 0 328 Jun 11 18:26 rcS

5 无法重启开发板,报

guang@arm-vexpress:/etc/init.d # reboot

reboot: can’t open ‘/proc’: No such file or directory

VFS: Mounted root (ext3 filesystem) on device 179:0.

Freeing unused kernel memory: 1024K

random: crng init done

mount: mounting proc on /proc failed: No such file or directory

mount: mounting tmpfs on /tmp failed: No such file or directory

mount: mounting sysfs on /sys failed: No such file or directory

mdev: /sys/dev: No such file or directory

Welcome to arm vexpress-a9 board

can’t open /dev/console: No such file or directory

can’t open /dev/console: No such file or directory

can’t open /dev/console: No such file or directory

can’t open /dev/console: No such file or directory

can’t open /dev/console: No such file or directory

can’t open /dev/console: No such file or directory

解决:排查了一下,是制作完善rootfs的时候,创建了etc目录,而根目录下对应的proc、mnt、tmp、sys等文件夹忘记创建了,创建了就OK,新增如下文件

5eb189fcebb2271dbe1657532245813c.png

效果如下

136e6149edf6518e88eac00b28217067.png

6 make编译ko文件报错

guang@guang-ubuntu:~/Develop/trainning/ko_file/20180611$ make

make -C /home/guang/Develop/linux-stable M=/home/guang/Develop/trainning/ko_file/20180611 modules

make[1]: Entering directory ‘/home/guang/Develop/linux-stable’

Building modules, stage 2.

MODPOST 1 modules

/bin/sh: 1: scripts/mod/modpost: not found

scripts/Makefile.modpost:92: recipe for target ‘__modpost’ failed

make[2]: * [__modpost] Error 127

Makefile:1576: recipe for target ‘modules’ failed

make[1]: * [modules] Error 2

make[1]: Leaving directory ‘/home/guang/Develop/linux-stable’

Makefile:17: recipe for target ‘default’ failed

make: * [default] Error 2

解决:如下的库可以解决上面类似的大多数问题

sudo apt-get install bison

sudo apt-get install flex

7 make menuconfig报错:

guang@guang-kylin:~/Develop/linux-stable$ make clear

HOSTCC scripts/basic/fixdep

HOSTCC scripts/kconfig/conf.o

YACC scripts/kconfig/zconf.tab.c

/bin/sh: 1: bison: not found

scripts/Makefile.lib:196: recipe for target ‘scripts/kconfig/zconf.tab.c’ failed

make[2]: * [scripts/kconfig/zconf.tab.c] Error 127

Makefile:528: recipe for target ‘syncconfig’ failed

make[1]: * [syncconfig] Error 2

make: * No rule to make target ‘clear’. Stop.

guang@guang-kylin:~/Develop/linux-stable$

解决:

sudo apt-get install bison

sudo apt-get install flex

8 刚下载完成的linux kernel,make clear失败,make clean成功了,还没来得及分析,记录一下:

guang@guang-kylin:~/Develop/linux-stable$ make clear

LEX scripts/kconfig/zconf.lex.c

HOSTCC scripts/kconfig/zconf.tab.o

HOSTLD scripts/kconfig/conf

scripts/kconfig/conf –syncconfig Kconfig

* Configuration file “.config” not found!

* Please run some configurator (e.g. “make oldconfig” or

* “make menuconfig” or “make xconfig”).

scripts/kconfig/Makefile:40: recipe for target ‘syncconfig’ failed

make[2]: * [syncconfig] Error 1

Makefile:528: recipe for target ‘syncconfig’ failed

make[1]: * [syncconfig] Error 2

make: * No rule to make target ‘clear’. Stop.

guang@guang-kylin:~/Develop/linux-stable$ make clean

guang@guang-kylin:~/Develop/linux-stable$ ls

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值