编译内核出现:
arch/arm/mm/tlb-v4wbi.S: Assembler messages:
arch/arm/mm/tlb-v4wbi.S:64: Error: too many positional arguments
scripts/Makefile.build:343: recipe for target ‘arch/arm/mm/tlb-v4wbi.o’ failed
make[1]: *** [arch/arm/mm/tlb-v4wbi.o] Error 1
Makefile:945: recipe for target ‘arch/arm/mm’ failed
make: *** [arch/arm/mm] Error 2
原因:交叉编译工具链太老,安装新的交叉编译工具
启动内核时,开发板上出现:
Verifying Checksum … Bad Data CRC
原因:烧进开发板的内核大于内核分区,部分代码丢失,校验失败
解决:修改分区大小
修改之后有2种方法使得修改生效:
手动:在开发板命令行输入:mtdparts default
自动:在uboot下,进入vim lib_arm/board.c
run_command(“mtdparts default”, 0); //添加此处代码
for (;? {
main_loop();
}
启动内核时:
Uncompressing Linux… done, booting the kernel 后面一堆乱码
解决:set bootargs ‘console=ttySAC0,115200’
接着出现:
VFS: Cannot open root device “(null)” or unknown-block(0,0): error -6
Please append a correct “root=” boot option; here are the available partitions:
1f00 256 mtdblock0 (driver?)
1f01 128 mtdblock1 (driver?)
1f02 8192 mtdblock2 (driver?)
1f03 253568 mtdblock3 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Backtrace:
原因:内核默认不支持yaffs2文件系统,而我挂接的是yaffs2文件系统
解决:使用yaffs2源码给内核打补丁,配置内核支持yaffs2
File systems —>
Miscellaneous filesystems --->
<*> YAFFS2 file system support
[*] Autoselect yaffs2 format
编译busybox出错:
/usr/local/arm/4.3.2/bin/…/arm-none-linux-gnueabi/libc/usr/include/linux/netfilter.h:44: error: field ‘in’ has incomplete type
/usr/local/arm/4.3.2/bin/…/arm-none-linux-gnueabi/libc/usr/include/linux/netfilter.h:45: error: field ‘in6’ has incomplete type
ipsvd/tcpudp.c: In function ‘tcpudpsvd_main’:
ipsvd/tcpudp.c:314: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
scripts/Makefile.build:192: recipe for target ‘ipsvd/tcpudp.o’ failed
make[1]: *** [ipsvd/tcpudp.o] Error 1
Makefile:701: recipe for target ‘ipsvd’ failed
make: *** [ipsvd] Error 2
解决办法:
usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/linux/netfilter.h 头文件的开头,添加缺少的头文件: #include <netinet/in.h>
编译内核出现的问题: error while loading shared libraries: libz.so.1: wrong ELF class: ELFCLASS
原因:Ubuntu16 64位使用32位交叉编译工具链时需要一些 32 位库
解决:apt-get install lib32ncurses5
apt-get install lib32z1
如出现无法定位软件包的情况:
sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0:i386 lib32stdc++6
编译busybox:
Makefile:405: *** mixed implicit and normal rules: deprecated syntax
Makefile:1242: *** mixed implicit and normal rules: deprecated syntax
make: *** No rule to make target ‘menuconfig’。 停止。
解决:修改Makefile的405行和1242行
编译busybox:
/work/make_system/busybox-1.20.0/scripts/gcc-version.sh: 行 11: arm-linux-gcc: 未找到命令
CC applets/applets.o
/bin/sh: 1: arm-linux-gcc: not found
scripts/Makefile.build:197: recipe for target ‘applets/applets.o’ failed
make[1]: *** [applets/applets.o] Error 127
Makefile:371: recipe for target ‘applets_dir’ failed
make: *** [applets_dir] Error 2
解决:打开顶层Makefile:
添加CROSS_COMPILE ?=/work/tools/opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-
编译busybox前:
Linux System Utilities—>nsenter,去掉该选项
Coreutils—>sync选项去掉
启动linux系统:
—[ end Kernel panic - not syncing: Requested init /linuxrc failed (error -2).
random: nonblocking pool is initialized
原因:可能是内核版本、编译器、busybox版本不匹配
编译内核:
Can’t use ‘defined(@array)’ (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
/work/trans_system/linux-3.4.2/kernel/Makefile:129: recipe for target ‘kernel/timeconst.h’ failed
make[1]: *** [kernel/timeconst.h] Error 255
Makefile:945: recipe for target ‘kernel’ failed
make: *** [kernel] Error 2
解决:if (!defined(@val)) {
@val = compute_values(KaTeX parse error: Expected 'EOF', got '}' at position 10: hz); }̲ 改为 if (…hz);
}
安装busybox:
/usr/local/arm/4.3.2/bin/arm-linux-gcc: 第 3 行: exec: arm-none-linux-gnueabi-gcc-4.3.2: 未找到
CC applets/applets.o
/usr/local/arm/4.3.2/bin/arm-linux-gcc: 第 3 行: exec: arm-none-linux-gnueabi-gcc-4.3.2: 未找到
scripts/Makefile.build:197: recipe for target ‘applets/applets.o’ failed
make[1]: *** [applets/applets.o] Error 127
Makefile:371: recipe for target ‘applets_dir’ failed
make: *** [applets_dir] Error 2
解决:
修改/usr/local/arm/4.3.2/bin/arm-linux-gcc:
#!/bin/bash
exec arm-none-linux-gnueabi-gcc -march=armv4t $*
改为
#!/bin/bash
exec /usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-gcc-4.3.2 -march=armv4t $*
启动内核:
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
没有选中 EABI选项
解决:
Kernel Features —>
[*] Use the ARM EABI to compile the kernel