arm_linux_yaffs2文件系统移植到内核GUN编译错误问题处理
linuxarm内核编译流程
linuxarm内核编译流程Linux ARM内核编译流程是将Linux操作系统内核的源代码编译成二进制可执行代码的过程。
下面是一个详细的流程说明:3. 配置编译选项:在进行内核编译之前,需要对内核进行一些配置。
可以使用make menuconfig, make xconfig或make config等命令来配置内核选项。
这些配置选项包括了硬件平台、设备驱动、文件系统支持、网络协议等。
4. 生成.config文件:在完成配置后,会生成一个.config文件,该文件描述了内核的配置选项。
可以使用make oldconfig,make silentoldconfig或make defconfig等命令生成.config文件。
5. 编译内核:使用make命令开始编译内核。
可以指定编译的目标类型(如Image、vmlinux、zImage等),也可以同时编译内核模块。
6. 生成二进制镜像文件:根据编译的目标类型,可以得到对应的二进制镜像文件。
如:使用make zImage编译生成一个压缩的内核镜像文件(zImage),使用make uImage可以将zImage转换为u-boot可启动的格式。
7. 安装内核:将生成的二进制镜像文件安装到目标设备中。
可以使用工具如Fastboot或者将镜像文件拷贝到设备的存储介质上。
8. 启动内核:重启目标设备,通过引导引导加载器(如U-Boot)加载并启动刚刚安装的内核。
9.测试和调试:启动后,可以使用命令行工具或者调试器等工具对内核进行测试和调试。
可以通过串口或网络连接来获取内核的控制台输出。
10. 更新和维护:根据需求和情况,可以更新和维护内核。
可以从Linux官方网站获取新版本的内核源代码,并重复上述流程进行更新和编译。
总结:Linux ARM内核编译流程包括获取内核源代码、配置编译工具链、配置编译选项、生成.config文件、编译内核、生成二进制镜像文件、安装内核、启动内核、测试和调试、更新和维护等步骤。
Yaffs2 文件系统移植
Yaffs2 文件系统移植/blog/static/1247505732009916437175/一.准备工作1、yaffs2源代码获取进入/cgi-bin/viewcvs.cgi/,点击“Download GNU tarball”,下载后出现cvs-ro ot.tar.gz压缩包。
2、busybox-1.13.3从/downloads/下载busybox,这里下载的是busy busybox-1.13.3.tar.gz。
3、根文件系统制作工具从/ 网站下载根文件系统制作工具mkyaffs2image.tgz。
4、友善之臂的根文件系统在制作根文件系统时,需要用到链接库,为保证链接库能用直接用友善之臂的根文件系统root_qtopia 中的链接库lib,到友善之臂网站/ 下载root_qtopia.tgz。
5、给内核打yaffs2文件系统的补丁cd /opt/stdudyarm/sourcetar –zxvf cvs-root.tar.gz –C /opt/studyarmcd /opt/stdudyarm/cvs/yaffs2/./patch-ker.sh c /opt/studyarm/linux-2.6.29.1/上面命令完成下面三件事情:(1) 修改内核fs/Kconfig增加一行:source "fs/yaffs2/Kconfig"(2) 修改内核fs/Kconfig增加一行:ojb-$(CONFIG_YAFFS_FS) +=yaffs2/(3) 在内核fs/目录下创建yaffs2目录将yaffs2源码目录下面的Makefile.kernel文件复制为内核fs/yaffs2/Makefie;将yaffs2 源码目录的Kconfig文件复制到内核fs/yaffs2目录下;将yaffs2源码目录下的*.c *.h文件复制到内核fs/yaffs2目录下.6 配置Linux内核选择支持yaffs2文件系统Filesystem--->Miscellaneous filesystems---><*>YAFFS2 file system support[*] Lets Yaffs do its own ECCNative language support<*> Codepage 437 (United States,Canada)<*>Simplified Chinese charset(GB2312)<*>Traditional Chinese charset(Big5)<*>NLS ISO 8859-1(Latin1:Western European Languages)<*>NLS UTF-8编译内核make zImage二.制作根文件系统2.1嵌入式Linux中都需要构建根文件系统,构建根文件系统的规则在FHS(Filesystem Hierarchy Standard)文档中,下面是根文件系统顶层目录。
YAFFS2启动坏块问题
启动的时候出现一大串:block 2 is badblock 3 is badblock 4 is badblock 5 is badblock 6 is badblock 7 is badblock 8 is badblock 9 is bad...VFS: Mounted root (yaffs filesystem).Freeing init memory: 120KWarning: unable to open an initial console.Failed to execute /linuxrc. Attempting defaults...Kernel panic - not syncing: No init found. Try passing init= option to kernel.或者block 2 is bad没有出现,直接显示VFS: Mounted root (yaffs filesystem).Freeing init memory: 120KWarning: unable to open an initial console.Failed to execute /linuxrc. Attempting defaults...Kernel panic - not syncing: No init found. Try passing init= option to kernel.其实都是MTD没有正确地读取到root, 可以在u-boot 中执行nand bad, 查看bad block 的信息, 如果从0x200000 - 0x1200000 之间有很多bad block说明nand write.yaffs 这个命令还有问题, OOB 的信息没有正确地写入在NANDFLASH, 只写入了data, 而OOB 没有写进去.下面说说如果解决这个问题:在NANDFLASH 的写入过程中, 其中会调用nand_do_write_ops, 在这个函数中,if (unlikely(oob))oob = nand_fill_oob(chip, oob, ops);这两行要注意, 在这两行之前OOB buf一直都是正解的,但这两行之后, OOB 的数据就变成了0xFF了,在靠前的一些block OOB 都是0xFF,但是到了后面OOB的数据就变得杂乱无章了,所以就会出现一大串的bad flash,为什么会变成没有规律,原因还没有找到,将这两行MASK,改为memcpy(chip->oob_poi, oob, ops->ooblen);问题就解决了,或者在nand_write_opts 函数中将oob_ops.mode = MTD_OOB_AUTO;改为oob_ops.mode = MTD_OOB_RAW;问题同样可以解决.。
Linux系统编译安装常见错误处理方法
5.Configure: error: libjpeg.(a|so) not found
# yum install libjpeg libjpeg-devel
6.Configure: error: libpng.(also) not found.
# yum install libpng libpng-devel
13.Configure: error: Cannot find ldap.h
# yum install openldap-devel
本篇文章来源于 Linux公社网站() 原文链接:/Linux/2011-04/34622.htm
再php:~/:./configure …… --with-gd=/usr/local/gd2 ……
1) Configure: error: xml2-config not found. Please check your libxml2 installation.
Solutions :
Solutions :
Quote: # yum install unixODBC-devel
12) Configure: error: Cannot find pspell
Solutions :
Quote: # yum install pspell-devel
13) configure: error: mcrypt.h not found. Please reinstall libmcrypt.
7) Configure: error: freetype.h not found.
Solutions :
Quote: #yum install freetype-devel
移植yaffs到linux
移植yaffs到linux移植yaffs到linux9月3日今天开始移植yaffs到linux2.61)首先选择的突破口是为u-boot增加nand write.yaffs命令,按照《嵌入式Linux应用开发完全手册(韦东山)》上的教程完成对u-boot的修改,编译后,write.yaffs指令报错,无奈,放弃。
2)给2.6.26内核添加yaffs2驱动,发现没有编译进内核,用里面的Makefile.kernel替换Makefile,编译内核时发生错误。
网上指出新版的内核与yaffs2文件有冲突,有patch,未找到,暂缓,放弃。
3)转换到2.6.14.1内核,编译yaffs驱动,顺利通过。
因为前天移植了u-boot-1.3.1,放弃了u-boot旧式的nand_legacy,采用linux mtd 的标准ecc算法,因此现在 2.6.14.1内核也可以打开NAND_ECC_SOFT。
启动信息:yaffs Sep 3 2008 19:54:24 Installing.yaffs: dev is 32505858 name is "mtdblock2"yaffs: Attempting MTD mount on 31.2, "mtdblock2"VFS: Mounted root (yaffs filesystem) readonly.mount_devfs_fs(): unable to mount devfs, err: -2Freeing init memory: 112KWarning: unable to open an initial console.Failed to execute /linuxrc. Attempting defaults...Kernel panic - not syncing: No init found. Try passing init= option to kernel.当然有错误,因为还没有烧入yaffs文件系统。
浅谈更新linux-3.2.5(7) 让内核支持yaffs2
浅谈更新linux-3.2.5(7)让内核支持yaffs2
一开始我用的是一个较旧的版本的yaffs2.tar.gz,结果显示如下
然后我就去上去找最新的驱动。
当然,我还没找到,我一个朋友就给我发来一份他用的yaffs2的驱动。
然后接下来我来讲讲过程
首先建立一个文件夹mkdir /file/fl
然后把linux-3.2.5的景象放到/file/fl下解压 tar xvf linux-3.2.5.tar.bz2
然后把yaffs2_20111027官方git.tar.bz2放到/file/fl下解压,然后进入cd /file/fl/yaffs2
然后ls
看到如图
接下来运行口令./patch-ker.sh c /file/fl/linux-3.2.5
给内核打上yaffs2的补丁。
但是这里遇到了问题,如图
什么意思?
您需要选择使用m 或者s。
在命令中加入m就可以了。
然后输入口令./patch-ker.sh c m /file/fl/linux-3.2.5然后如图所示,成功了
OK 。
显示如下就算是成功了
Updating /file/fl/linux-3.2.5/fs/Kconfig Updating /file/fl/linux-3.2.5/fs/Makefile。
LINUX-2.6内核移植过程中常见问题及解决方法
LINUX-2.6内核移植过程中常见问题及解决方法1、内核启动后,出现如下提示后停住UNCOMPRESSING LINUX........................................................... DONE, BOOTING THE KERNEL一般情况下,这个时候内核已经启动了,只不过在控制台CONSOLE中没有打印信息而已。
所以问题主要锁定在串口这一块。
首先确定你的板子包括硬件都是没有问题的。
可以分以下几种情况,最常见的原因是在内核启动命令行这块CMDLINE,一般情况下LINUX-2.4内核中,CONSOLE=TTYS0,而LINUX-2.6内核则用CONSOLE=TTYSAC0。
还有一个原因,不多见,我当时用的是S3C2410的板子,BOOTLOADER用的是U-BOOT-1.0.0,内核移植的是LINUX-2.6.16,结果出现这个问题,在网上查了很多资料,最后找出来问题。
U-BOOT把S3C2410的时钟设置为202MHZ,而内核启动时使用的是200MHZ,修改U-BOOT中的MPLLCON:CLK_POWER->MPLLCON MPLLCON = 0X0005C040;//MPLL=200MHZ2、内核编译成功后,启动后出现如下提示后就停住了。
FREEING INIT MEMORY: 72KWARNING: UNABLE TO OPEN AN INITIAL CONSOLE.这个也是控制台CONSOLE的问题,LINUX-2.6.13以后的内核都支持DEVFS,而之后版本的内核就把DEVFS这块去掉了,虽然还能在内核源码中找到对应的源码,你也可以把它加进内核,但是也不是太好用。
2.6.13 后的版本改为支持UDEV了,UDEV这块我也没太弄懂,正在研究。
因此如果你是LINUX-2.6.13版本一下的内核,编译的时候在PSEUDO FILESYSTEMS添加DEV FILESYSTEM SURPPORT选项,也就是添加DEVFS的支持,如果LINUX-2.6.13之后的版本,你就看看你的ROOTFS下有没有/DEV/CONSOLE这个文件,没有的话,自己做一个就可以#MKNOD CONSOLE C 5 13、内核启动后,打印出一大堆提示信息UNABLE TO HANDLE KERNEL XXXX POINTER DEREFERENCE AT VIRTUAL ADDRESS XXXXXX ……R10: 00000000 R9 : 00000000 R8 : 00500001R7 : 00000001 R6 : C011AB50 R5 : C3726C00 R4 : C013E024R3 : 00000000 R2 : 00000000 R1 : 00000000 R0 : C3726C00….<0>KERNEL PANIC - NOT SYNCING: ATTEMPTED TO KILL INIT!这个提示是内核启动加载驱动时出错,那就只有找到出错的驱动,不加载它,如果必须要用这个驱动,只有自己修改源代码,一般问题都在对硬件的地址操作有问题。
嵌入式linux内核编译错误的一些解决办法
make[2]:***[drivers/video/console2] error 2
make[1]:***[drivers/video1] error 2
make:***[drivers] error 2
解决方法:
在make menuconfig 时选哪个设备驱动的选项进去在选Graphics support ->
scripts/basic/docproc.c: 在函数‘parse_file’中:
scripts/basic/docproc.c:296: 警告: 对指针赋值时目标与指针符号不一致
SHIPPED scripts/kconfig/zconf.tab.h
HOSTCC scripts/kconfig/conf.o
四:
make zImage和make xipImage
Kernel configured for XIP (CONFIG_XIP_KERNEL=y)
Only the xipImage target is available in this case
make[1]: *** [arch/arm/boot/zImage] Error 1
make: *** [.tmp_vmlinux1] 错误 1
ld链接时产生错误
对应行:
/home/kevin/ARMSystem/linux-2.6.12/arch/arm/kernel/vmlinux.lds
/* those must never be empty */
ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
Linux内核模块编译出错:ER...
Linux内核模块编译出错:ER...嵌⼊式Linux简单内核模块的编程:将以下hello.c和Makefile⽂件放在同⼀⽬录,然后make⼀下⽣成hello.ko⽂件hello.c的内容:#include "linux/module.h"#include "linux/init.h"static int __init hellomodule_init(void) //模块初始化函数{printk("Hello_init! Are you ok ? oLHHo \n");return 0;}static void __exit hellomodule_exit(void) //模块退出函数{printk("Hello_exit! Oh_Yes!");return 0;}module_init(hellomodule_init);module_exit(hellomodule_exit);MODULE_LICENSE("GPL");⼀个简单的内核模块主要由4个部分组成:包含头⽂件、实现内核模块初始化函数和模块退出函数、使⽤module_init 和module_exit 宏指定模块初始化函数和模块退出函数、声明模块license为"GPL",这4个部分是⼀个模块必需的,也就构成了内核模块的框架。
Makefile的内容:ifneq ($(KERNELRELEASE),)obj-m := hello.oelseKDIR :=/home/olhho/opt/linux-2.6.30.9 #⾃⼰编译的内核的存放路径all:make -C $(KDIR) M=$(PWD) modules ARCH=arm CROSS_COMPILE=arm-linux-clean:rm -f *.ko *.o *.mod.o *.mod.c *.symvers modul*endifobj-m:为内核顶层⽬录Makefile⽂件中使⽤的变量,表⽰要编译成模块的⽬标⽂件。
编译Linux内核的错误汇总
四: make zImage 和 make xipImage Kernel configured for XIP (CONFIG_XIP_KERNEL=y) Only the xipImage target is available in this case make[1]: *** [arch/arm/boot/zImage] Error 1 make: *** [zImage] Error 2
下面是编译时产生的一些信息
1' cross compile
# CROSS_COMPILE specify the prefix used for all executables used
# during compilation. Only gcc and related bin- utils executables
解决方法:修改 arch/arm/kernel/vmlinux.lds [arm@localhost linux2.6.14]$ vi arch/arm/kernel/vmlinux.lds 将文件尾 2 条的 ASSERT 注释掉(1439 行) /* ASSERT((__proc_info_end __ proc_info_begin), "missing CPU support") */ /* ASSERT((__arch_info_end __ arch_info_begin), "no machine record defined") */ 然后重新 make zImage 即可
b
/usr/local/arm/bin/arm- linux- ld:arch/arm/kernel/vmlinux.lds:782: parse error make: *** [.tmp_vmlinux1] 错误 1 ld 链接时产生错误 对应行:
2440启动串口输出乱码问题
2440 移植2.6.30 (转)解压缩内核压缩文件后进入到目录中,然后修改Makefile,找到ARCH ?=CROSS_COMPILE ?=这两项,不修改这两项的话将会默认使用x86的配置,这里修改为ARCH ?= armCROSS_COMPILE ?= arm-linux-arm-linux- 是交叉编译器~ 这里我使用的交叉编译器为友善送的arm-linux-gcc-4.3.2.tgz,带EABI然后执行make menuconfig,然后进入System Type中看看是否为ARM体系~第一行为ARM system type 说明没错~ 然后在ARM system type中选择SamSung“S3C2410...”随后在下面出现的S3C2440 Machines中选择SMDK2440退出保存~ 执行make zImage出现ERRORdrivers/video/console/vgacon.c:510:error “PCIMEM_BASE undeclared”是在vgacon_startup中,vgacon是啥?~ 不认识~ 应该是不必要的东西~ 去掉它~vim drivers/video/console/Makefile在里面看见了这句obj-$(CONFIG_VGA_CONSOLE) += vgacon.o然后执行find ./ -name “Kconfig” | xargs grep “VGA_CONSOLE”看见config VGA_CONSOLE 在driver/video/console/Kconfig中也就是说在驱动->视频->终端中,执行make menuconfig在Device Drivers->Graphics Support->Console display driver support中发现了VGA text console去掉它,保存设置后再编译编译完成后将在arch/arm/boot中得到zImage文件使用SuperVivi的USB加载功能启动这个内核文件~ 得到下列输出zImage magic = 0x016f2818Setup linux parameters at 0x30000100linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0" MACH_TYPE = 1999NOW, Booting Linux......Uncompressing Linux........................................................................................................ done, booting the kernel.失败信息不够丰富~ 根据kasim大大的指点,在配置中进入Kernel hacking打开Kernel debugging和Kernel low-level debugging functions 还有Kernel low-level debugging messages via S3C UART保存后再编译运行zImage后得下列输出zImage magic = 0x016f2818Setup linux parameters at 0x30000100linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0" MACH_TYPE = 1999NOW, Booting Linux......Uncompressing Linux........................................................................................................ done, booting the kernel.Error: unrecognized/unsupported machine ID (r1 = 0x000007cf).Available machine support:ID (hex) NAME0000016a SMDK2440Please check your kernel config and/or bootloader.失败原来是machine的ID和Supervivi传递进来的ID不匹配~关于machine ID,可以参考一下这篇文章<2.6.18-2内核中对S3C2440的引导启动分析>虽然版本老了点,但是核心思想还是没有变vim arch/arm/mach-s3c2440/mach-smdk2440.c在最后一段有这句MACHINE_START(S3C2440 , ”SMDK2440”)这里S3C2440就是machine ID的代号~ 呢具体值是多少呢?~在arch/arm/tools/mach-types中s3c2440 ARCH_S3C2440 S3C2440 362原来我们的machine ID是362~呢bootloader传递进来的值是多少呢?~Error: unrecognized/unsupported machine ID (r1 = 0x000007cf).注意到没有?~ 0x7CF转换成10进制也就是1999修改mach-types中的对应项s3c2440 ARCH_S3C2440 S3C2440 1999虽然这样就和下面MINI2440的1999冲突了,但是只要不加入MINI2440的配置就没事修改后编译,再执行zImage后得下列输出zImage magic = 0x016f2818Setup linux parameters at 0x30000100linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0" MACH_TYPE = 1999NOW, Booting Linux......Uncompressing Linux........................................................................................................ done, booting the kernel.失败咦?~ 啥都没有?~ 最起码也应该有个乱码吧这时候我的第一反应是会不会没有跳入到start_kernel中所以马上编辑init/main.c,在start_kernel的前部加上printk(KERN_INFO “in start_kernel \n”);但是这个时候内核还没有初始化,所以printk是没有作用的~继续得到kasim大大的指点,编辑kernel/printk.c中的printk函数{va_list args;int r;#ifdef CONFIG_DEBUG_LLextern void printascii(const char *);char buff[256];#endifva_start(args, fmt);r = vprintk(fmt, args);#ifdef CONFIG_DEBUG_LLvsprintf(buff, fmt, args);#endifva_end(args);#ifdef CONFIG_DEBUG_LLprintascii(buff);#endifreturn r;}编译后执行zImage,得下列输出zImage magic = 0x016f2818Setup linux parameters at 0x30000100linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0" MACH_TYPE = 1999NOW, Booting Linux......Uncompressing Linux........................................................................................................ done, booting the kernel.<6>in start_kernel<6>Initializing cgroup subsys cpuset<6>Initializing cgroup subsys cpu<5>Linux version 2.6.30.3 (wolf@ubuntu) (gcc version 4.3.2 (Sourcery G++ Lite2008q3-72) ) #4 Wed Aug 5 16:54:49 CST 2009 ..................................................失败虽然正常输出了~ 有进入start_kernel~ 但是为什么之前每输出呢?~ 会不会是没有找到输出设备在输出中看到这行<5>Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0 console=ttySAC0 会不会是没有ttySAC0这个设备呢~ 在内核中搜索ttySAC 在driver/serial/samsung.c中得到对应项目这时候我猜想会不会没有加载samsung.c , 经过一轮Makefile和Kconfig的查询, 发现对应选项在Device Drivers->Character devices->Serial drivers中一看,原来根本就没有加载Samsung SoC serial support , 选成静态编译之后又出现了Support for console on Samsung SoC serial port ,就是它了,选上, 退出的时候顺便把Kernel low-level debugging functions给取消了否则我们设置的printk会自行输出,就不知道ttySAC有没有加载成功了编译后执行,得下列输出zImage magic = 0x016f2818Setup linux parameters at 0x30000100linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0" MACH_TYPE = 1999NOW, Booting Linux......Uncompressing Linux......................................................................................................... done, booting the kernel.w# DpñGpGp´ó70ÇC¼ØûÛ»›3ó•ó¸Û0ƒw#DpñGpGp´ó•tØ›•p¸›7¿³ó•\@û7¼¿[£¼Û3•¼ó;£¸ÀÛ;[7û;D°•D@GoGpGpíó•t›7•{ð#ßóÄ;›•770ÄÄ3Çß;GoDh}û7wœ´{…[ó7ûÛ›30°ôܸ‡#_sÄ;›•770Øijœ¼DG@ÁôÛ•ûÄ;•sÄ›£Ø›•DŽ³ÃÛ70ÄGpÁ4ßœ»ôGã›30³D˜ßF[s˜£ÀÛû70ÛD8ßÄ4G8ôGv£°ÇÃGpÍ´0ƒ†# DpñGš´;óC…[4¸F¸ÄÛtÜàGp}4GGÇ4tD@Ä38ÀGpGß ôØ Û›ŸÄÛD\Cûƒ£¸ƒ;7v›Ã30Ü›4Û´£ô¼;C3[;7ù³û770‡¸°[•4tD@Ä38ÀGpGß ´´p‡ƒ•ô¼Û7ŸtÛG»4œØ…Çpíƒw# .......................................失败但这说明ttySAC加载成功了~ 不过为什么是乱码呢?~这时候就需要对比友善的配置和我们的配置有什么不同了~打开友善送的linux-2.6.29,观察arch/arm/mach-s3c2440/mach-mini2440.c和我们的2.6.30.4下面的arch/arm/mach-s3c2440/mach-smdk2440.c有什么不同由于乱码主要是时钟问题,所以我们重点观察UART的设置和基本设置,其它什么NAND LCD 的就不看先修改smdk2440_uartcfgs[][2] = {.ulcon = 0x03,}修改s3c24xx_init_clocks(12000000);然后编译再运行,输出为zImage magic = 0x016f2818Setup linux parameters at 0x30000100linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0" MACH_TYPE = 1999NOW, Booting Linux......Uncompressing Linux......................................................................................................... done, booting the kernel.[ 0.000000] in start_kernel[ 0.000000] Initializing cgroup subsys cpuset[ 0.000000] Initializing cgroup subsys cpu ...........................最后为Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)失败终于可以正常输出了,但是根文件系统挂载失败因为板子上的根文件系统为yaffs2 这时候内核还没有这个文件系统的支持,需要我们加上去拷贝友善的送的2.6.29下的fs/yaffs2目录到我们的fs目录下然后修改观察一下友善的送的2.6.29下的fs/Kconfig 和fs/Makefile和我们的有什么不同在我们的Kconfig中的source “fs/jffs2/Kconfig” 上面加上source “fs/yaffs2/Kconfig”在Makefile中的obj-$(CONFIG_FAT_FS) += fat/ 上面加上obj-$(CONFIG_YAFFS_FS) += yaffs2/然后在配置的File systems->Miscellaneous filesystems 中选上“YAFFS2 file system support” “Autoselect yaffs2 format” “Cache short names in RAM”然后编译运行,输出如下......................Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)失败还是不行,往上看几行VFS: Cannot open root device "mtdblock2" or unknown-block(0,0)Please append a correct "root=" boot option; here are the available partitions:Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)原来是没有可用的分区这个时候就要更正我们的NAND配置了还是对照友善送的linux-2.6.29,观察arch/arm/plat-s3c24xx/common-friendly-smdk.c来修改我们的arch/arm/plat-s3c24xx/common-smdk.c主要修改smdk_default_nand_part[]{[0] = {.name = “supervivi”,.size = 0x00060000,.offset = 0,},[1] = {.name = “Kernel”,.offset = 0x00060000,.size = 0x00200000,},[2] = {.name = “root”,.offset = 0x00260000,.size = 1024*1024*1024,},[3] = {.name = “nand”,.offset = 0x00000000,.size = 1024*1024*1024,}};编译后运行,输出VFS: Cannot open root device "mtdblock2" or unknown-block(0,0)Please append a correct "root=" boot option; here are the available partitions:Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)失败还是不行,连最起码的分区都没有看见,会不会是MTD没有加载呢?~打开配置进入Device DriversMemory Technology Device ......... 前面是个M~ 说明这个模块是动态加载的,而我们编译的zImage里面只有静态模块将MTD选为静态加载,然后进入MTD配置中看看还有什么需要选的NAND Device Support 这个也是动态,选为静态加载进入NAND Device Support原来连NAND Flash support for S3C2410/S3C2440 SoC都没选,马上选为静态加载保存配置后编译运行,再运行输出如下:NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit) Scanning device for bad blocksCreating 4 MTD partitions on "NAND 128MiB 3,3V 8-bit":0x000000000000-0x000000060000 : "supervivi"0x000000060000-0x000000260000 : "Kernel"0x000000260000-0x000040260000 : "root"mtd: partition "root" extends beyond the end of device "NAND 128MiB 3,3V 8-bit" -- size truncated to 0x7da00000x000000000000-0x000040000000 : "nand"mtd: partition "nand" extends beyond the end of device "NAND 128MiB 3,3V 8-bit" -- size truncated to 0x8000000 ...............................VFS: Cannot open root device "mtdblock2" or unknown-block(0,0)Please append a correct "root=" boot option; here are the available partitions:Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)失败还是没有可用分区,虽然成功分辨了分区,但是没有加载成功,估计还是在MTD的模块选择上这时候需要对照友善的配置,经过对比,发现在友善的配置中静态编译了MTD中的下面3个模块Direct char device access to MTD devicesCommon interface to block layer for MTD …translation layers‟Caching block device access to MTD devices我们也选为静态编译保存配置后编译运行,输出如下List of all partitions:1f00 384 mtdblock0 (driver?)1f01 2048 mtdblock1 (driver?)1f02 128640 mtdblock2 (driver?)1f03 131072 mtdblock3 (driver?)No filesystem could mount root, tried: cramfsKernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)分区加载成功了,但是文件系统却不能识别,我们之前不是已经加入了yaffs2么?~回到配置中再看,原来是动态编译,并没有真正进入到内核之中,选为静态编译~保存配置后编译,输出为yaffs: dev is 32505858 name is "mtdblock2"yaffs: passed flags ""yaffs: Attempting MTD mount on 31.2, "mtdblock2"yaffs: auto selecting yaffs2yaffs_read_super: isCheckpointed 0VFS: Mounted root (yaffs filesystem) on device 31:2.Freeing init memory: 128KKernel panic - not syncing: Attempted to kill init!失败依然错误,这个时候懵了,哪里错呢~ 没办法,只能对照着友善的配置一个个大模块对着来改当改到Kernel Features的时候错误消失了,原来需要选上Use the ARM EABI to compile the kernelAllow old ABI binaries to run with thie Kernel为什么呢?~ Google了一下,原来友善的根文件系统在编译的时候也启用了EABI特性,内核和文件系统需要对上文件系统用了EABI 内核也要用EABI 内核不用EABI 也只能读取不用EABI的文件系统选上这两项之后再编译,运行,输出如下yaffs: dev is 32505858 name is "mtdblock2"yaffs: passed flags ""yaffs: Attempting MTD mount on 31.2, "mtdblock2"yaffs: auto selecting yaffs2yaffs_read_super: isCheckpointed 0VFS: Mounted root (yaffs filesystem) on device 31:2.Freeing init memory: 128Kmount: mounting none on /proc/bus/usb failed: No such file or directoryhwclock: can't open '/dev/misc/rtc': No such file or directory[01/Jan/1970:00:00:13 +0000] boa: server version Boa/0.94.13[01/Jan/1970:00:00:13 +0000] boa: server built Mar 26 2009 at 15:28:42.[01/Jan/1970:00:00:13 +0000] boa: starting server pid=845, port 80open device leds: No such file or directoryTry to bring eth0 interface up......ifconfig: SIOCGIFFLAGS: No such deviceifconfig: SIOCSIFHWADDR: No such deviceifconfig: SIOCSIFADDR: No such deviceroute: SIOCADDRT: No such processDoneifconfig: SIOCSIFADDR: No such devicePlease press Enter to activate this console.[root@FriendlyARM /]#成功了,ls后输出如下bin home lost+found proc sys vardev lib mini2440 root tmp wwwetc linuxrc opt sbin usr不过ifconfig命令没有成功,继续来配置网卡对比友善的mach-mini2440.c文件,发现我们的mach-smdk2440.c中的smdk2440_devices[]数组并没有&s3c_device_dm9k这个结构,加上,追踪发现该数据结构在arch/arm/plat-s3c24xx/devs.c中,我们的devs.c中没有该数据结构的定义,加上#include <linux/dm9000.h>static struct resource s3c_dm9k_resource[] = {[0] = {.start = S3C2410_CS4,.end = S3C2410_CS4 + 3,.flags = IORESOURCE_MEM,},[1] = {.start = S3C2410_CS4 + 4,.end = S3C2410_CS4 + 4 + 3,.flags = IORESOURCE_MEM,},[2] = {.start = IRQ_EINT7,.end = IRQ_EINT7,.flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,},};static struct dm9000_plat_data s3c_dm9k_platdata = {.flags = DM9000_PLATF_16BITONLY,};struct platform_device s3c_device_dm9k = {.name = “dm9000”,.id = 0;.num_resources = ARRAY_SIZE(s3c_dm9k_resource),.resource = s3c_dm9k_resource,.dev = {.platform_data = &s3c_dm9k_platdata,}};EXPORT_SYMBOL(s3c_device_dm9k);编译,出错,error : s3c_device_dm9k undeclared here找不到结构?~ 打开mach-smdk2440.c看看有什么头文件比较显眼的就是<plat/s3c2410.h><plat/s3c2440.h><plat/devs.h>,我们刚才编辑的文件是devs.c呢么devs.h的可能性较高,通过搜索,这个devs.h在/arch/arm/plat-s3c/include/plat/中,打开,BINGO,里面都是devs.c的数据定义加上我们的s3c_device_dm9kextern struct platform_device s3c_device_dm9k;再编译,通过了,不过这个时候先别急,我们只添加了设备,驱动有没有静态加载呢?~ 打开配置Device Drivers->Networks device support->Ethernet(10 or 100Mbit)DM9000 support没选上,马上选为静态编译保存配置,编译后运行,输出如下Try to bring eth0 interface up......说明DM9000配置成功使用ping命令进行测试,发现丢包率高达78%是不是驱动没设置好呢?~ 比较了一下友善的driver/net/dm9000.c和2.6.30.4的dm9000.c,发现明显不同直接拷贝友善的dm9000.c和dm9000.h过来编译后运行,顺利进入终端,然后运行PING丢包改善,基本无丢包我对这次内核移植的总结是:一步步来~ 先做好终端输出再挂载好根文件系统最后才考虑其它驱动的配置到此移植就基本结束了= 3=)/ 感谢阅读。
linux移植问题汇总(一)
linux移植问题汇总(⼀)linux移植问题汇总(⼀)在此记录移植linux过程中出现的问题以及解决⽅法。
项⽬GitHub地址1、移植linux kernel碰到的问题①、kernel配置好后启动时发现卡在“Starting kernel ...”,最后发现是linux的bug,由于u-boot2014.04串⼝配置默认开启FIFO,linux内核在早期串⼝打印时也⽤到了FIFO,但是却有两个变量fifo_mask、fifo_max没被赋值,导致死在了⼀个while循环⾥⾯(arch/arm/plat-samsung/include/plat/uncompress.h -> static void putc(int ch))。
解决⽅法:⼀:修改linux内核,给未初始化的变量赋值:arch/arm/mach-s5pv210/include/mach/uncompress.h arch_detect_cpu()static void arch_detect_cpu(void){/* we do not need to do any cpu detection here at the moment. */fifo_mask = S5PV210_UFSTAT_TXMASK; //add by Nickfifo_max = 255 << S5PV210_UFSTAT_TXSHIFT; //add by Nick.}⼆:修改uboot,关闭串⼝FIFO。
②、linux3.3.5增加tiny210板级⽂件⽀持是碰到的问题,很奇怪我仅仅是重命名了⼀下函数的名字,就出现编译错误,能确定命名是没有错误的。
错误如下:CALL scripts/checksyscalls.shCHK include/generated/compile.hCC [M] drivers/scsi/scsi_wait_scan.oKSYM .tmp_kallsyms1.SAS .tmp_kallsyms1.oLD .tmp_vmlinux2KSYM .tmp_kallsyms2.SAS .tmp_kallsyms2.oLD vmlinuxSYSMAP System.mapSYSMAP .tmp_System.mapInconsistent kallsyms dataThis is a bug - please report about itTry make KALLSYMS_EXTRA_PASS=1 as a workaroundmake: *** [vmlinux] Error 1⽤下⾯提⽰的做法make KALLSYMS_EXTRA_PASS=1编译可以通过,⽣成的镜像⽂件也可以正常运⾏,但不知道为什么会报这个错误,仅仅只是重命名了函数名,很奇怪,貌似是bug,为了避免我更换了⼀个版本linux3.0.80,⽤这个版本没有任何问题,以后也先⽤这个版本移植。
linux系统下uboot、kernel、android文件系统编译错误整理及解决办法
linux系统下uboot、kernel、android文件系统编译错误整理及解决办法Ver1.0作成者:雷鹏作成年月:2012/09/251、linux下编译应用程序时出现如下错误: /usr/bin/ld: cannot find -lxxx。
原因分析:编译过程找不到对应库文件。
其中,-lxxx表示链接库文件 libxxx.so。
由于库文件是编译过程临时生成的,如果前面编译过程出错也会导致出现这种情况,下面针对本机系统环境缺失而引起的错误进行分析。
一般出现这种错误有以下几种原因:⑴.系统缺乏对应的库文件;⑵.版本不对应;⑶.库文件的链接错误;⑷.库文件路径设置问题。
解决方法:对应第一第二种情况,可以通过下载安装lib来解决,ubuntu系统可以直接通过apt-get来安装:apt-get install libxxx-dev如果还是不能解决问题,那么,引起错误的原因不是链接错误就是库文件路径问题。
通过find或者locate指令定位到链接文件,查看链接文件是否正确的指向了编译需要的lib,如果不是,用下列指令修改它。
ln -sf */libxxx.so.x */libxxx.so如果是库文件路径引发的问题,可以到/etc/ld.so.conf.d目录下,修改其中任意一份conf文件,(可以自建conf,以方便识别)将lib所在目录写进去,然后在终端输入 ldconfig 更新缓存。
2、编译时出现错误提示:include/asm is a directory but a symlink was expected原因分析:linux/include/asm 文件夹是内核编译过程中创建的,创建结果就是一个指向文件夹asm-arm 的链接,表明该系统的平台是arm架构的,而编译系统内核之前,是没有asm这个链接的,所以,在编译过程中,创建该链接时文件名字与asm文件夹的名字发生冲突,于是系统报错了。
linux arm的编译命令
linux arm的编译命令摘要:1.Linux ARM 编译命令简介2.常用编译命令详解3.编译过程中可能遇到的问题及解决方法4.实践案例:编译一个简单的Linux 内核模块正文:随着ARM 架构在服务器、嵌入式设备和移动设备等领域的广泛应用,掌握Linux ARM 的编译命令变得尤为重要。
本文将介绍Linux ARM 编译的基本知识,常用编译命令的使用,编译过程中可能遇到的问题及解决方法,并通过一个实践案例帮助大家更好地掌握Linux ARM 编译。
1.Linux ARM 编译命令简介在Linux ARM 系统中,编译命令主要分为两类:一类是针对源代码的编译,另一类是针对编译器的配置。
针对源代码的编译命令主要有:- 清空编译缓存:`make clean`- 构建编译工具链:`make toolchain`- 编译内核源代码:`make`- 编译内核模块:`make modules`- 编译用户空间程序:`make`针对编译器的配置命令主要有:- 初始化编译器配置:`make menuconfig`- 生成编译规则:`make rules`- 编译器配置:`make defconfig`2.常用编译命令详解(1)清空编译缓存:`make clean`该命令用于清除之前的编译过程中产生的中间文件,避免重复编译。
在编译大型项目时,这一步尤为重要,可以提高编译效率。
(2)构建编译工具链:`make toolchain`该命令用于构建一个适用于ARM 架构的编译工具链,包括编译器、汇编器等。
在使用之前,需要确保已正确安装编译器和工具链相关的软件包。
(3)编译内核源代码:`make`该命令用于编译Linux 内核源代码。
在编译过程中,可能需要根据实际情况调整编译选项,例如:- 指定内核版本:`make ARCH=armv8-linux-gnueabihf_defconfig` - 编译特定架构的支持:`make ARCH=armv8-linux-gnueabihf MACHINE=tegra124`(4)编译内核模块:`make modules`该命令用于编译内核模块。
嵌入式linux内核编译错误的一...
嵌入式linux内核编译错误的一些解决办法(Some solutions to compile errors in embedded Linux kernel)一:无效的选项` ABI = AAPCS Linux的选项错误脚本/ Kconfig /会议/手臂/ Kconfig的弓CHK include/linux/H版。
链接包括/ ASM臂/弓->包含/手臂/ arch-s3c2410 ASM使[ 1 ]:包含/ ASM臂/马赫类型。
检查包括/ Linux / utsrelease。
Hcc拱/臂/内核/ ASM偏移。
CC1:错误:无效的选项` ABI = Linux的特点使[ 1 ]:*** [ ARM /内核/ ASM偏移量]错误1制作:* * * [ prepare0 ]错误2解决方法:你建立一个OABI编译器的一个是核心。
你可以关掉你的配置文件是期权(核心功能->使用EABI),或者,你可以使用一个是工具如臂/ GNU Linux从<http:/ / www.codesourcery。
COM / gnu_toolchains /手臂/下载。
HTML >。
我推荐后者,因为你能跑的Arjan的新形象。
上述的关掉是选项可以通过测试二:司机/视频/游戏/ vgacon啊:987:警告:比较是真的由于数据类型范围的限制使[ 3 ]:*** [司机/视频/游戏/ vgacon O ]错误1。
使[ 2 ]:*** [司机/视频/ console2 ]错误2使[ 1 ]:*** [司机/ VIDEO1 ]错误2制造:*** [驾驶员]错误2解决方法:在menuconfig时选哪个设备驱动的选项进去在选图形支持->控制台显示驱动程序支持>文本控制台(不选这个)再编译就行了!三:` rtc_lock”未定义错误(未完全解决)方法:司机/内置。
O(文本+ 0x281e4):司机/焦炭/ NVRAM。
linux编译安装时常见错误解决办法
linux编译安装时常见错误解决办法configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution复制代码代码如下:yum -y install libxslt-develconfigure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.复制代码代码如下:yum -y install net-snmp-develconfigure: error: Please reinstall readline - I cannot find readline.h复制代码代码如下:yum -y install readline-develconfigure: error: Cannot find pspell复制代码代码如下:yum -y install aspell-develchecking for unixODBC support... configure: error: ODBC header file '/usr/include/sqlext.h' not found!复制代码代码如下:yum -y install unixODBC-develconfigure: error: Unable to detect ICU prefix or /usr/bin/icu-config failed. Please verify ICU install prefix and make sure icu-config works.复制代码代码如下:yum -y install libicu-develconfigure: error: utf8mime2text() has new signature, but U8TCANONICAL is missing. This should not happen. Check config.log for additional information.复制代码代码如下:yum -y install libc-client-develconfigure: error: freetype.h not found.复制代码代码如下:yum -y install freetype-develconfigure: error: xpm.h not found.复制代码代码如下:yum -y install libXpm-develconfigure: error: png.h not found.复制代码代码如下:yum -y install libpng-develconfigure: error: vpx_codec.h not found.复制代码代码如下:yum -y install libvpx-develconfigure: error: Cannot find enchant复制代码代码如下:yum -y install enchant-develconfigure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/复制代码代码如下:yum -y install libcurl-develLAOGAO added 20140907:configure: error: mcrypt.h not found. Please reinstall libmcrypt.复制代码代码如下:wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gztar zxf libmcrypt-2.5.7.tar.gzcd libmcrypt-2.5.7./configuremake && make installadded 20141003:Cannot find imap复制代码代码如下:ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.soconfigure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing.复制代码代码如下:yum -y install libc-client-develCannot find ldap.h复制代码代码如下:yum -y install openldapyum -y install openldap-develconfigure: error: Cannot find ldap libraries in /usr/lib复制代码代码如下:cp -frp /usr/lib64/libldap* /usr/lib/configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path复制代码代码如下:yum -y install postgresql-develconfigure: error: Please reinstall the lib curl distribution复制代码代码如下:yum -y install curl-develconfigure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.复制代码代码如下:yum -y install net-snmp-develconfigure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution复制代码代码如下:yum -y install libxslt-develchecking for BZip2 support… yes checking for BZip2 in default path… not found configure: error: Please reinstall the BZip2 distribution Fix:复制代码代码如下:yum -y install bzip2-develchecking for cURL support… yes checking if we should use cURL for url streams… no checking for cURL in default path… not found configure: error: Please reinstall the libcurl distribution – easy.h should be in/include/curl/Fix:复制代码代码如下:yum -y install curl-develchecking for curl_multi_strerror in -lcurl… yes checking for QDBM support… no checking for GDBM support… no checking for NDBM support… no configure: error: DBA: Could not find necessary header file(s).Fix:复制代码代码如下:yum -y install db4-develchecking for fabsf… yes checking for floorf… yes configure: error: jpeglib.h not found.Fix:复制代码代码如下:yum -y install libjpeg-develchecking for fabsf… yes checking for floorf… yes checking for jpeg_read_header in -ljpeg… yes configure: error: png.h not found. Fix:复制代码代码如下:yum -y install libpng-develchecking for png_write_image in -lpng… yes If configure fails try –with-xpm-dir=configure: error: freetype.h not found.Fix:复制代码代码如下:Reconfigure your PHP with the following option. --with-xpm-dir=/usrchecking for png_write_image in -lpng… yes configure: error: libXpm.(a|so) not found.Fix:复制代码代码如下:yum -y install libXpm-develchecking for bind_textdomain_codeset in -lc… yes checking for GNU MP support… yes configure: error: Unable to locate gmp.hFix:复制代码代码如下:yum -y install gmp-develchecking for utf8_mime2text signature… new checking for U8T_DECOMPOSE… configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.Fix:复制代码代码如下:yum -y install libc-client-develchecking for LDAP support… yes, shared checking for LDAP Cyrus SASL support… yes configure: error: Cannot find ldap.hFix:复制代码代码如下:yum -y install openldap-develchecking for mysql_set_character_set in -lmysqlclient… yes checking for mysql_stmt_next_result in -lmysqlclient… no checking for Oracle Database OCI8 support… no checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h' not found!Fix:复制代码代码如下:yum -y install unixODBC-develchecking for PostgreSQL support for PDO… yes, shared checking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation pathFix:复制代码代码如下:yum -y install postgresql-develchecking for sqlite 3 support for PDO… yes, shared checking for PDO includes… (cached) /usr/local/src/php-5.3.7/ext checking for sqlite3 files in default path… not found configure: error: Please reinstall the sqlite3 distributionFix:复制代码代码如下:yum -y install sqlite-develchecking for utsname.domainname… yes checking for PSPELL support… yes configure: error: Cannot find pspellFix:复制代码代码如下:yum -y install aspell-develchecking whether to enable UCD SNMP hack… yes checking for default_store.h… nochecking for kstat_read in -lkstat… no checking for snmp_parse_oid in -lsnmp… no checking for init_snmp in -lsnmp… no configure: error: SNMP sanity check failed. Please check config.log for more information.Fix:复制代码代码如下:yum -y install net-snmp-develchecking whether to enable XMLWriter support… yes, shared checking for xml2-config path… (cached) /usr/bin/xml2-config checking whether libxml build works… (cached) yes checking for XSL support… yes, shared configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distributionFix:复制代码代码如下:yum -y install libxslt-develconfigure: error: xml2-config not found. Please check your libxml2 installation.Fix:复制代码代码如下:yum -y install libxml2-develchecking for PCRE headers location… configure: error: Could not find pcre.h in /usrFix:复制代码代码如下:yum -y install pcre-develconfigure: error: Cannot find MySQL header files under yes. Note that the MySQL client library is not bundled anymore!Fix:复制代码代码如下:yum -y install mysql-develchecking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h' not found!Fix:复制代码代码如下:yum -y install unixODBC-develchecking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path Fix:复制代码代码如下:yum -y install postgresql-develconfigure: error: Cannot find pspellFix:复制代码代码如下:yum -y install pspell-develconfigure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.Fix:复制代码代码如下:yum -y install net-snmp-develconfigure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distributionFix:复制代码代码如下:yum -y install libxslt-develconfigure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution复制代码代码如下:yum -y install libxslt-develconfigure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.复制代码代码如下:yum -y install net-snmp-develconfigure: error: Please reinstall readline - I cannot find readline.h复制代码代码如下:yum -y install readline-develconfigure: error: Cannot find pspell复制代码代码如下:yum -y install aspell-develchecking for unixODBC support... configure: error: ODBC header file '/usr/include/sqlext.h' not found!复制代码代码如下:yum -y install unixODBC-develconfigure: error: Unable to detect ICU prefix or /usr/bin/icu-config failed. Please verify ICU install prefix and make sure icu-config works.复制代码代码如下:yum -y install libicu-develconfigure: error: utf8mime2text() has new signature, but U8TCANONICAL is missing. This should not happen. Check config.log for additional information.复制代码代码如下:yum -y install libc-client-develconfigure: error: freetype.h not found.复制代码代码如下:yum -y install freetype-develconfigure: error: xpm.h not found.复制代码代码如下:yum -y install libXpm-develconfigure: error: png.h not found.复制代码代码如下:yum -y install libpng-develconfigure: error: vpx_codec.h not found.复制代码代码如下:yum -y install libvpx-develconfigure: error: Cannot find enchant复制代码代码如下:yum -y install enchant-develconfigure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/复制代码代码如下:yum -y install libcurl-develLAOGAO added 20140907:configure: error: mcrypt.h not found. Please reinstall libmcrypt.复制代码代码如下:wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gztar zxf libmcrypt-2.5.7.tar.gzcd libmcrypt-2.5.7./configuremake && make installadded 20141003:Cannot find imap复制代码代码如下:ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.soconfigure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing.复制代码代码如下:yum -y install libc-client-develCannot find ldap.h复制代码代码如下:yum -y install openldapyum -y install openldap-develconfigure: error: Cannot find ldap libraries in /usr/lib复制代码代码如下:cp -frp /usr/lib64/libldap* /usr/lib/configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path复制代码代码如下:configure: error: Please reinstall the lib curl distribution复制代码代码如下:yum -y install curl-develconfigure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.复制代码代码如下:yum -y install net-snmp-develconfigure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution复制代码代码如下:yum -y install libxslt-develchecking for BZip2 support… yes checking for BZip2 in default path… not found configure: error: Please reinstall the BZip2 distribution Fix:复制代码代码如下:yum -y install bzip2-develchecking for cURL support… yes checking if we should use cURL for url streams… no checking for cURL in default path… not found configure: error: Please reinstall the libcurl distribution – easy.h should be in/include/curl/Fix:复制代码代码如下:yum -y install curl-develchecking for curl_multi_strerror in -lcurl… yes checking for QDBM support… no checking for GDBM support… no checking for NDBM support… no configure: error: DBA: Could not find necessary header file(s).Fix:复制代码代码如下:yum -y install db4-develchecking for fabsf… yes checking for floorf… yes configure: error: jpeglib.h not found.Fix:复制代码代码如下:yum -y install libjpeg-develchecking for fabsf… yes checking for floorf… yes checking for jpeg_read_header in -ljpeg… yes configure: error: png.h not found.Fix:复制代码代码如下:yum -y install libpng-develchecking for png_write_image in -lpng… yes If configure fails try –with-xpm-dir=configure: error: freetype.h not found.Fix:复制代码代码如下:Reconfigure your PHP with the following option. --with-xpm-dir=/usrchecking for png_write_image in -lpng… yes configure: error: libXpm.(a|so) not found.Fix:复制代码代码如下:yum -y install libXpm-develchecking for bind_textdomain_codeset in -lc… yes checking for GNU MP support… yes configure: error: Unable to locate gmp.hFix:复制代码代码如下:yum -y install gmp-develchecking for utf8_mime2text signature… new checking for U8T_DECOMPOSE… configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.Fix:复制代码代码如下:checking for LDAP support… yes, shared checking for LDAP Cyrus SASL support… yes configure: error: Cannot find ldap.hFix:复制代码代码如下:yum -y install openldap-develchecking for mysql_set_character_set in -lmysqlclient… yes checking for mysql_stmt_next_result in -lmysqlclient… no checking for Oracle Database OCI8 support… no checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h' not found!Fix:复制代码代码如下:yum -y install unixODBC-develchecking for PostgreSQL support for PDO… yes, shared checking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation pathFix:复制代码代码如下:yum -y install postgresql-develchecking for sqlite 3 support for PDO… yes, shared checking for PDO includes… (cached) /usr/local/src/php-5.3.7/ext checking for sqlite3 files in default path… not found configure: error: Please reinstall the sqlite3 distributionFix:复制代码代码如下:yum -y install sqlite-develchecking for utsname.domainname… yes checking for PSPELL support… yes configure: error: Cannot find pspellFix:复制代码代码如下:yum -y install aspell-develchecking whether to enable UCD SNMP hack… yes checking for default_store.h… nochecking for kstat_read in -lkstat… no checking for snmp_parse_oid in -lsnmp… no checking for init_snmp in -lsnmp… no configure: error: SNMP sanity check failed. Please check config.log for more information.Fix:复制代码代码如下:yum -y install net-snmp-develchecking whether to enable XMLWriter support… yes, shared checking for xml2-config path… (cached) /usr/bin/xml2-config checking whether libxml build works… (cached) yes checking for XSL support… yes, shared configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distributionFix:复制代码代码如下:yum -y install libxslt-develconfigure: error: xml2-config not found. Please check your libxml2 installation.Fix:复制代码代码如下:yum -y install libxml2-develchecking for PCRE headers location… configure: error: Could not find pcre.h in /usrFix:复制代码代码如下:yum -y install pcre-develconfigure: error: Cannot find MySQL header files under yes. Note that the MySQL client library is not bundled anymore!Fix:复制代码代码如下:yum -y install mysql-develchecking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h' not found!Fix:复制代码代码如下:yum -y install unixODBC-develchecking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path Fix:复制代码代码如下:yum -y install postgresql-develconfigure: error: Cannot find pspellFix:复制代码代码如下:yum -y install pspell-develconfigure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.Fix:复制代码代码如下:yum -y install net-snmp-develconfigure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distributionFix:复制代码代码如下:yum -y install libxslt-devel。
arm内核编译流程
arm内核编译流程1.引言1.1 概述概述部分的内容可以包括对于arm内核编译流程的简要介绍。
概述部分:ARM内核编译流程是指将ARM架构的操作系统内核代码转化为可执行的二进制文件的过程。
ARM架构作为一种广泛应用于手机、嵌入式设备等领域的处理器架构,其内核编译流程对于软件开发人员来说是非常重要的。
在ARM内核编译流程中,软件开发人员需要根据具体的需求和目标,进行一系列的编译、链接和优化等操作,以生成适用于目标平台的可执行代码。
通过这些操作,可以实现对ARM内核的定制化、优化和适配,从而为不同种类的应用提供更好的性能和可靠性。
ARM内核编译流程的关键步骤包括代码预处理、编译、链接和优化。
在代码预处理阶段,编译器会处理源代码中的宏定义、条件编译等指令,生成预处理后的源代码。
在编译阶段,编译器将预处理后的源代码转化为汇编代码。
在链接阶段,编译器会将汇编代码和库文件等合并,生成可执行的二进制文件。
在优化阶段,编译器会对生成的二进制文件进行优化,以提高代码的执行效率和性能。
ARM内核编译流程的重要性不言而喻。
通过对ARM内核的编译,可以实现对操作系统内核的灵活定制和优化,从而满足各种应用场景的需求。
同时,掌握ARM内核编译流程也有助于开发人员深入理解ARM架构的底层实现原理,加深对软件系统的认识和理解。
本篇文章将详细介绍ARM内核编译流程的概述和详细步骤,旨在帮助读者全面了解ARM内核编译的过程和原理,并展望未来ARM内核编译流程的发展趋势。
1.2文章结构1.2 文章结构本文将按照以下结构来呈现关于ARM内核编译流程的内容:1. 引言1.1 概述:介绍ARM内核编译流程的背景和基本概念。
1.2 文章结构:说明本文的组织结构和每个部分的内容。
1.3 目的:明确本文旨在讨论ARM内核编译流程的目标和意义。
2. 正文2.1 ARM内核编译流程的概述:简要介绍ARM内核编译流程的整体过程和关键步骤。
2.2 ARM内核编译流程的详细步骤:详细说明ARM内核编译流程中的每个具体步骤和相关工具的使用方法。
LINUX内核STARTINGKERNEL...串口无输出问题归纳
下面两篇文章是ARM9论坛上的讲解ramdisk文件系统的很不错的文章今天做了个试验,让Linux2.6.29.4从ramdisk根文件系统启动成功,总结一下。
其中涉及的内容较多,很多东西不再详述,如需深入研究请查阅相关资料(百度或谷歌一下一大堆)。
开发环境:Fedora 9交叉编译工具链:arm-linux-gcc 4.3.2 with EABI嵌入式Linux内核版本:2.6.29.4-FriendlyARM。
昨天写贴子的时候具体记不清了,今天起来启动开发板用uname -r查一下,就是叫做2.6.29.4-FriendlyARM,帖子已经改好了。
本文就是友善之臂的2.6.29.4-FriendlyARM的那个版本的内核的基础上改的。
其它版本的应该也类似,仅供参考。
开发板:mini2440-128M Nand FlashBootloader:u-boot-2009.11具体步骤如下:1.解压内核源码树解压linux-2.6.29-mini2440-20090708.tgz到自己的工作目录,会生成一个友善之臂修改过的并且有几个mini2440默认配置文件的内核源码目录linux-2.6.29。
具体步骤参照友善之臂mini2440开发板用户手册,具体不详述了。
2.修改内核配置选项进入内核源码目录linux-2.6.29目录#cp config_mini2440_t35 .config#make menuconfig ARCH=arm打开配置菜单,修改两个配置项,分别是:a):General setup-->选择Initial RAM filesystem and RAM disk...... 项b):Device Drivers-->Block devices-->选择RAM block device support 项并检查Optimize for size是否被选中,如果没有则选中,此项优化内核大小,根据需要进行配置。
Linux内核编译及常见错误实验报告
***学生实验报告一、实验目的(1)学习重新编译Linux内核的方法(2)理解Linux标准内核和发行版本内核的区别。
二、实验内容在Linux系统中下载同一发行版本的版本号较高的内核,编译之后运行自己编译的内核,并使用uname-r命令查看是否运行成功。
由于不同版本的内核在编译过程中可能出现不同的问题,本书推荐的内核版本为4.16.10。
从第7章开始的进阶实验篇,都可以选用该版本的内核。
三、实验设备Vmware上运行的linux ubuntu 5.11.0-43-generic实验成功:linux ubuntu 4.18.0-generic(Ubuntu18.04均可)实验成功的方法在最后四、实验过程和原理分析一、实验(一)准备工作:在这里我建议用一个全新的虚拟机,避免编译错误对原来常使用的虚拟机造成不可逆的影响,安装好后就先安装gcc、make等工具首先下载好Linux***内核文件解压至/usr/src 目录下,如下:确认安装好gcc、make等工具,后可直接运行命令sudo make menuconfig进行查看内核功能是否需要编译,如果遇到如下错误可以运行命令sudo apt bison 或sudo apt-get install fiex bison命令解决错误:解决:(不建议)(强烈建议)除此之外还可以直接运行,上一条命令解决不了就用下面这个:sudo apt-get install --reinstall bison libbison-dev flex libfl-dev解决上述错误(强烈建议)运行完上述命令后再次输入sudo make menuconfig便正常进入如下:见到这个界面后无需任何多余操作,使用键盘方向键选择<Save>回车再回车即可此时.config文件生成成功.config文件是隐藏文件记得加参数-a此外还有一个方法就是用cp 命令从原有系统的内核复制.config文件过来也可以命令:sudo cp /boot/config- 5.11.0-43-generic ./.config(二)编译内核为了避免多线程编译时同时出现过多错误,我们这里一开始只使用单线程编译在这里除了用make编译还可以用make-kpkg等工具,个人比较喜欢用make-kpkg但课本用make所以我接下来的实验也先用make完成。
arm_linux_yaffs2文件系统移植到内核GUN编译错误问题处理
yaffs2更新的比较慢,跟不上内核的更新速度.所以只能自己做些修改first step刚开始从官网下载下来的直接打补丁后会出现一系列的错误.如下:**fs/yaffs2/yaffs_vfs.c: In function 'yaffs_readpage_nolock':fs/yaffs2/yaffs_vfs.c:286:34: error: 'struct file' has no member named 'f_dentry'obj = yaffs_dentry_to_obj(f->f_dentry);^fs/yaffs2/yaffs_vfs.c: In function 'yaffs_hold_space':fs/yaffs2/yaffs_vfs.c:484:34: error: 'struct file' has no member named 'f_dentry'obj = yaffs_dentry_to_obj(f->f_dentry);^fs/yaffs2/yaffs_vfs.c: In function 'yaffs_release_space':fs/yaffs2/yaffs_vfs.c:502:34: error: 'struct file' has no member named 'f_dentry'obj = yaffs_dentry_to_obj(f->f_dentry);^fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_write':fs/yaffs2/yaffs_vfs.c:594:34: error: 'struct file' has no member named 'f_dentry'obj = yaffs_dentry_to_obj(f->f_dentry);^fs/yaffs2/yaffs_vfs.c:606:11: error: 'struct file' has no member named 'f_dentry'inode = f->f_dentry->d_inode;^fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_flush':fs/yaffs2/yaffs_vfs.c:730:55: error: 'struct file' has no member named 'f_dentry'struct yaffs_obj *obj = yaffs_dentry_to_obj(file->f_dentry);^fs/yaffs2/yaffs_vfs.c: At top level:fs/yaffs2/yaffs_vfs.c:780:10: error: 'new_sync_read' undeclared here (not in a function).read = new_sync_read,^fs/yaffs2/yaffs_vfs.c:781:11: error: 'new_sync_write' undeclared here (not in a function).write = new_sync_write,^fs/yaffs2/yaffs_vfs.c: In function 'yaffs_follow_link':fs/yaffs2/yaffs_vfs.c:1078:2: error: implicit declaration of function 'nd_set_link' [-Werror=implicit-function-declaration]nd_set_link(nd, alias);^fs/yaffs2/yaffs_vfs.c: At top level:fs/yaffs2/yaffs_vfs.c:1118:17: warning: initialization from incompatible pointer type.follow_link = yaffs_follow_link,^fs/yaffs2/yaffs_vfs.c:1118:17: warning: (near initialization for'yaffs_symlink_inode_operations.follow_link')fs/yaffs2/yaffs_vfs.c:1120:14: warning: initialization from incompatible pointer type.put_link = yaffs_put_link,^fs/yaffs2/yaffs_vfs.c:1120:14: warning: (near initialization for'yaffs_symlink_inode_operations.put_link')fs/yaffs2/yaffs_vfs.c: In function 'yaffs_iterate':fs/yaffs2/yaffs_vfs.c:1730:34: error: 'struct file' has no member named 'f_dentry'obj = yaffs_dentry_to_obj(f->f_dentry);^cc1: some warnings being treated as errorsmake[4]: *** [fs/yaffs2/yaffs_vfs.o] Error 1make[3]: *** [fs/yaffs2] Error 2make[2]: *** [fs] Error 2make[2]: *** Waiting for unfinished jobs....make[1]: ***[/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16 /.stamp_built] Error 2make: *** [_all] Error 2**上面有三个问题要解决∙1: error: ‘struct file’ has no member named ‘f_dentry’∙2: error: ‘new_sync_read/write’ undeclared here∙3: error: implicit declaration of function ‘nd_set_link’1 ‘struct file’ has no member named‘f_dentry’第一个是由于新内核的file结构体发生了变化,把dentry这个成员放到了path 结构体里,这里只要更改下就行.struct file {union {struct llist_node fu_llist;struct rcu_head fu_rcuhead;} f_u;struct path f_path;struct path {struct vfsmount *mnt;struct dentry *dentry;};直接在yaffs_vfs.c里加上下列定义就行,或者全部替换#define f_dentry f_path.dentry#define f_vfsmnt f_path.mnt2 ‘new_sync_read/write’ undeclared here对于第2个问题是由于新内核没有”new_sync_read/write”这两个导出函数了,改成.read = __vfs_read,//new_sync_read.write = __vfs_write, //new_sync_write3 error: implicit declaration of function‘nd_set_link’到linux官网查询发现4.4.16内核里已经不用nd_set_link这个函数了,因此要修改用到这个函数的地方.主要就是yaffs_follow_link这个函数啦,yaffs_follow_link的定义主要参考你的include/Linux/fs.h里的struct inode_operations.follow_link来定义.以前的alias是保存在 nd->saved_names里,现在这个成员已经被删除了,直接通过函数返回值返回,并且保存在*cookie中@@ -1053,7 +1062,11 @@}#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)+#else+static const char *yaffs_follow_link(struct dentry *dentry,void**cookie)+#endif{void *ret;#else@@ -1075,7 +1088,11 @@goto out;}#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)nd_set_link(nd, alias);+#else+ *cookie = alias;+#endifret = alias;out:if (ret_int)@@ -1107,10 +1124,17 @@#endif#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)void yaffs_put_link(struct dentry *dentry, struct nameidata *nd, void *alias){kfree(alias);}+#else+void yaffs_put_link(struct inode *inode,void *alias)+{+ kfree(alias);+}+#endif#endifstatic const struct inode_operations yaffs_symlink_inode_operations = {second step以上修改完后在编译时还会出现下列的错误:In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:21:21: warning: 'struct yaffs_dev' declared inside parameter listint nval_del(struct yaffs_dev *dev, char *xb, int xb_size, const YCHAR * name);^fs/yaffs2/yaffs_nameval.h:21:21: warning: its scope is only this definition or declaration, which is probably not what you wantfs/yaffs2/yaffs_nameval.h:24:7: warning: 'struct yaffs_dev' declared inside parameter listint bsize, int flags);^fs/yaffs2/yaffs_nameval.h:27:7: warning: 'struct yaffs_dev' declared inside parameter listint bsize);^fs/yaffs2/yaffs_nameval.h:29:8: warning: 'struct yaffs_dev' declared inside parameter listconst char *xb, int xb_size, char *buf, int bsize);^fs/yaffs2/yaffs_nameval.h:30:27: warning: 'struct yaffs_dev' declared inside parameter listint nval_hasvalues(struct yaffs_dev *dev, const char *xb, int xb_size); ^fs/yaffs2/yaffs_nameval.c:82:5: error: conflicting types for 'nval_del' int nval_del(struct yaffs_dev *dev, char *xb, int xb_size, const YCHAR *name)^In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:21:5: note: previous declaration of'nval_del' was hereint nval_del(struct yaffs_dev *dev, char *xb, int xb_size, const YCHAR * name);^fs/yaffs2/yaffs_nameval.c:100:5: error: conflicting types for'nval_set'int nval_set(struct yaffs_dev *dev,^In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:22:5: note: previous declaration of'nval_set' was hereint nval_set(struct yaffs_dev *dev,^fs/yaffs2/yaffs_nameval.c:145:5: error: conflicting types for'nval_get'int nval_get(struct yaffs_dev *dev,^In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:25:5: note: previous declaration of'nval_get' was hereint nval_get(struct yaffs_dev *dev,^fs/yaffs2/yaffs_nameval.c:185:5: error: conflicting types for'nval_list'int nval_list(struct yaffs_dev *dev, const char *xb, int xb_size, char *buf, int bsize)^In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:28:5: note: previous declaration of'nval_list' was hereint nval_list(struct yaffs_dev *dev,^fs/yaffs2/yaffs_nameval.c:227:5: error: conflicting types for'nval_hasvalues'int nval_hasvalues(struct yaffs_dev *dev, const char *xb, int xb_size) ^In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:30:5: note: previous declaration of'nval_hasvalues' was hereint nval_hasvalues(struct yaffs_dev *dev, const char *xb, int xb_size); ^make[4]: *** [fs/yaffs2/yaffs_nameval.o] Error 1make[3]: *** [fs/yaffs2] Error 2make[2]: *** [fs] Error 2make[2]: *** Waiting for unfinished jobs....make[1]: ***[/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16 /.stamp_built] Error 2make: *** [_all] Error 2解释:error: conflicting types for ‘nval_del’,查看nval_del几个函数,这里我看不出有什么类型冲突错误,网上搜了下主要是第一个WARNING那里引起的.在yaffs_nameval.h中,结构体struct yaffs_dev的定义出现在参数列表中,而在此之前没有定义,这样会导致函数不识别这个结构体引发上面的错误,查询了下struct yaffs_dev在”yaffs_guts.h”中被定义,因此在yaffs_nameval.h 文件中include下”yaffs_guts.h”就OK了third step通过上两个修改后可能还会遇到下面的两个错误:error: unknown type name ‘Y_LOFF_T’In file included from fs/yaffs2/yaffs_guts.c:18:0:fs/yaffs2/yaffs_endian.h:32:86: error: unknown type name 'Y_LOFF_T' static inline Y_LOFF_T swap_loff_t(Y_LOFF_T lval)^fs/yaffs2/yaffs_endian.h:32:107: error: unknown type name 'Y_LOFF_T' static inline Y_LOFF_T swap_loff_t(Y_LOFF_T lval)^make[4]: *** [fs/yaffs2/yaffs_guts.o] Error 1make[3]: *** [fs/yaffs2] Error 2make[2]: *** [fs] Error 2make[2]: *** Waiting for unfinished jobs....make[1]: ***[/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16 /.stamp_built] Error 2make: *** [_all] Error 2这个好解决,在yaffs_endian.h中加上如下定义:#ifndef Y_LOFF_T#define Y_LOFF_T loff_t#endifyaffs_guts.c:line: undefined reference to functionfs/built-in.o: In function `yaffs_check_obj_details_loaded':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:3254: undefined reference to`yaffs_do_endian_oh'fs/built-in.o: In function `yaffs_oh_size_load':fs/yaffs2/yaffs_guts.c:5165: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5166: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs_update_oh':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:3401: undefined reference to`yaffs_do_endian_oh'fs/built-in.o: In function `yaffs_guts_initialise':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:4912: undefined reference to`yaffs_endian_config'fs/built-in.o: In function `yaffs_oh_size_load':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5165: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5166: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs_oh_to_size':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5181: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5182: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5190: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs_pack_tags2_tags_only':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_packedtags2.c:111: undefined reference to`yaffs_do_endian_packed_tags2'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_packedtags2.c:111: undefined reference to`yaffs_do_endian_packed_tags2'fs/built-in.o: In function `yaffs_unpack_tags2_tags_only':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_packedtags2.c:137: undefined reference to`yaffs_do_endian_packed_tags2'fs/built-in.o: In function `yaffs_load_tags_to_spare':fs/yaffs2/yaffs_tagscompat.c:92: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_tagscompat.c:93: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs_get_tags_from_spare':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_tagscompat.c:122: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_tagscompat.c:123: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `nval_used':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_nameval.c:69: undefined reference to`yaffs_do_endian_s32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_nameval.c:75: undefined reference to`yaffs_do_endian_s32'fs/built-in.o: In function `nval_find':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_nameval.c:41: undefined reference to`yaffs_do_endian_s32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_nameval.c:53: undefined reference to`yaffs_do_endian_s32'fs/built-in.o: In function `nval_del':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_nameval.c:93: undefined reference to`yaffs_do_endian_s32'fs/built-in.o:/home/anzyelay/Downloads/buildroot-2016.05/output/build /linux-4.4.16/fs/yaffs2/yaffs_nameval.c:136: more undefined references to `yaffs_do_endian_s32' followfs/built-in.o: In function `yaffs2_checkpt_tnode_worker':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:599: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs2_wr_checkpt_sum':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:811: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs2_rd_checkpt_tnodes':fs/yaffs2/yaffs_yaffs2.c:647: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:671: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs2_rd_checkpt_sum':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:835: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs2_scan_chunk':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:1302: undefined reference to`yaffs_do_endian_oh'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:1302: undefined reference to`yaffs_do_endian_oh'make[2]: *** [vmlinux] Error 1make[1]: ***[/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16 /.stamp_built] Error 2make: *** [_all] Error 2anzyelay@ubuntu:buildroot-2016.05$这个看了下明明这些函数都有定义有实现怎么就是不识别呢??头文件这些也包函了,网上找了下说编译器没有编译到譔文件可有导致其它函数引用时无法识别,我看了下编译情况, 其它的.c文件都编译成.o了,然后打开Makefile一看果然没有加进来,yaffs真的不省心,在Makefile.kernel里增加如下 :yaffs-y += yaffs_endian.o这回万恶的错误都没了吧.编译后是OK的了,至于启动后有没有其它原因导致的错误就不得而知了.yaffs的补丁文件如下:diff -Nur yaffs2/Makefile.kernel yaffs2.anzyelay/Makefile.kernel--- yaffs2/Makefile.kernel 2016-07-29 14:01:01.778572877 +0800+++ yaffs2.anzyelay/Makefile.kernel 2016-08-03 10:29:07.361276458 +0800 @@ -15,4 +15,5 @@yaffs-y += yaffs_bitmap.oyaffs-y += yaffs_summary.oyaffs-y += yaffs_verify.o+yaffs-y += yaffs_endian.odiff -Nur yaffs2/yaffs_endian.h yaffs2.anzyelay/yaffs_endian.h--- yaffs2/yaffs_endian.h 2016-07-29 14:01:01.814572879 +0800+++ yaffs2.anzyelay/yaffs_endian.h 2016-08-03 11:18:12.633411085+0800@@ -29,6 +29,9 @@#define swap_s32(val) \(s32)(swap_u32((u32)(val)))+#ifndef Y_LOFF_T+#define Y_LOFF_T loff_t +#endifstatic inline Y_LOFF_T swap_loff_t(Y_LOFF_T lval){u32 vall = swap_u32((u32) (lval & 0xffffffff));diff -Nur yaffs2/yaffs_nameval.h yaffs2.anzyelay/yaffs_nameval.h--- yaffs2/yaffs_nameval.h 2016-07-29 14:01:01.818572879 +0800+++ yaffs2.anzyelay/yaffs_nameval.h 2016-08-03 11:22:07.409421602 +0800@@ -17,6 +17,7 @@#define __NAMEVAL_H__#include "yportenv.h"+#include "yaffs_guts.h"int nval_del(struct yaffs_dev *dev, char *xb, int xb_size, const YCHAR* name);int nval_set(struct yaffs_dev *dev,diff -Nur yaffs2/yaffs_vfs_multi.c yaffs2.anzyelay/yaffs_vfs_multi.c--- yaffs2/yaffs_vfs_multi.c 2016-07-29 14:01:01.818572879 +0800+++ yaffs2.anzyelay/yaffs_vfs_multi.c 2016-08-03 11:06:42.877379435+0800@@ -76,6 +76,10 @@#include <linux/slab.h>#include <linux/init.h>#include <linux/fs.h>+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 16))+#define f_dentry f_path.dentry+#define f_vfsmnt f_path.mnt+#endif#include <linux/proc_fs.h>#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39))#include <linux/smp_lock.h>@@ -777,8 +781,13 @@#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))static const struct file_operations yaffs_file_operations = {#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 16)//anzyelay+ .read = __vfs_read,+ .write = __vfs_write,+#else.read = new_sync_read,.write = new_sync_write,+#endif.read_iter = generic_file_read_iter,.write_iter = generic_file_write_iter,#else@@ -1053,7 +1062,11 @@}#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)+#else+static const char *yaffs_follow_link(struct dentry *dentry,void**cookie)+#endif{void *ret;#else@@ -1075,7 +1088,11 @@goto out;}#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)nd_set_link(nd, alias);+#else+ *cookie = alias;+#endifret = alias;out:if (ret_int)@@ -1107,10 +1124,17 @@#endif#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)void yaffs_put_link(struct dentry *dentry, struct nameidata *nd, void *alias){kfree(alias);}+#else+void yaffs_put_link(struct inode *inode,void *alias)+{+ kfree(alias);+}+#endif#endifstatic const struct inode_operations yaffs_symlink_inode_operations = {。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
yaffs2更新的比较慢,跟不上内核的更新速度.所以只能自己做些修改first step刚开始从官网下载下来的直接打补丁后会出现一系列的错误.如下:**fs/yaffs2/yaffs_vfs.c: In function 'yaffs_readpage_nolock':fs/yaffs2/yaffs_vfs.c:286:34: error: 'struct file' has no member named 'f_dentry'obj = yaffs_dentry_to_obj(f->f_dentry);^fs/yaffs2/yaffs_vfs.c: In function 'yaffs_hold_space':fs/yaffs2/yaffs_vfs.c:484:34: error: 'struct file' has no member named 'f_dentry'obj = yaffs_dentry_to_obj(f->f_dentry);^fs/yaffs2/yaffs_vfs.c: In function 'yaffs_release_space':fs/yaffs2/yaffs_vfs.c:502:34: error: 'struct file' has no member named 'f_dentry'obj = yaffs_dentry_to_obj(f->f_dentry);^fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_write':fs/yaffs2/yaffs_vfs.c:594:34: error: 'struct file' has no member named 'f_dentry'obj = yaffs_dentry_to_obj(f->f_dentry);^fs/yaffs2/yaffs_vfs.c:606:11: error: 'struct file' has no member named 'f_dentry'inode = f->f_dentry->d_inode;^fs/yaffs2/yaffs_vfs.c: In function 'yaffs_file_flush':fs/yaffs2/yaffs_vfs.c:730:55: error: 'struct file' has no member named 'f_dentry'struct yaffs_obj *obj = yaffs_dentry_to_obj(file->f_dentry);^fs/yaffs2/yaffs_vfs.c: At top level:fs/yaffs2/yaffs_vfs.c:780:10: error: 'new_sync_read' undeclared here (not in a function).read = new_sync_read,^fs/yaffs2/yaffs_vfs.c:781:11: error: 'new_sync_write' undeclared here (not in a function).write = new_sync_write,^fs/yaffs2/yaffs_vfs.c: In function 'yaffs_follow_link':fs/yaffs2/yaffs_vfs.c:1078:2: error: implicit declaration of function 'nd_set_link' [-Werror=implicit-function-declaration]nd_set_link(nd, alias);^fs/yaffs2/yaffs_vfs.c: At top level:fs/yaffs2/yaffs_vfs.c:1118:17: warning: initialization from incompatible pointer type.follow_link = yaffs_follow_link,^fs/yaffs2/yaffs_vfs.c:1118:17: warning: (near initialization for'yaffs_symlink_inode_operations.follow_link')fs/yaffs2/yaffs_vfs.c:1120:14: warning: initialization from incompatible pointer type.put_link = yaffs_put_link,^fs/yaffs2/yaffs_vfs.c:1120:14: warning: (near initialization for'yaffs_symlink_inode_operations.put_link')fs/yaffs2/yaffs_vfs.c: In function 'yaffs_iterate':fs/yaffs2/yaffs_vfs.c:1730:34: error: 'struct file' has no member named 'f_dentry'obj = yaffs_dentry_to_obj(f->f_dentry);^cc1: some warnings being treated as errorsmake[4]: *** [fs/yaffs2/yaffs_vfs.o] Error 1make[3]: *** [fs/yaffs2] Error 2make[2]: *** [fs] Error 2make[2]: *** Waiting for unfinished jobs....make[1]: ***[/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16 /.stamp_built] Error 2make: *** [_all] Error 2**上面有三个问题要解决∙1: error: ‘struct file’ has no member named ‘f_dentry’∙2: error: ‘new_sync_read/write’ undeclared here∙3: error: implicit declaration of function ‘nd_set_link’1 ‘struct file’ has no member named‘f_dentry’第一个是由于新内核的file结构体发生了变化,把dentry这个成员放到了path 结构体里,这里只要更改下就行.struct file {union {struct llist_node fu_llist;struct rcu_head fu_rcuhead;} f_u;struct path f_path;struct path {struct vfsmount *mnt;struct dentry *dentry;};直接在yaffs_vfs.c里加上下列定义就行,或者全部替换#define f_dentry f_path.dentry#define f_vfsmnt f_path.mnt2 ‘new_sync_read/write’ undeclared here对于第2个问题是由于新内核没有”new_sync_read/write”这两个导出函数了,改成.read = __vfs_read,//new_sync_read.write = __vfs_write, //new_sync_write3 error: implicit declaration of function‘nd_set_link’到linux官网查询发现4.4.16内核里已经不用nd_set_link这个函数了,因此要修改用到这个函数的地方.主要就是yaffs_follow_link这个函数啦,yaffs_follow_link的定义主要参考你的include/Linux/fs.h里的struct inode_operations.follow_link来定义.以前的alias是保存在 nd->saved_names里,现在这个成员已经被删除了,直接通过函数返回值返回,并且保存在*cookie中@@ -1053,7 +1062,11 @@}#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)+#else+static const char *yaffs_follow_link(struct dentry *dentry,void**cookie)+#endif{void *ret;#else@@ -1075,7 +1088,11 @@goto out;}#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)nd_set_link(nd, alias);+#else+ *cookie = alias;+#endifret = alias;out:if (ret_int)@@ -1107,10 +1124,17 @@#endif#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)void yaffs_put_link(struct dentry *dentry, struct nameidata *nd, void *alias){kfree(alias);}+#else+void yaffs_put_link(struct inode *inode,void *alias)+{+ kfree(alias);+}+#endif#endifstatic const struct inode_operations yaffs_symlink_inode_operations = {second step以上修改完后在编译时还会出现下列的错误:In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:21:21: warning: 'struct yaffs_dev' declared inside parameter listint nval_del(struct yaffs_dev *dev, char *xb, int xb_size, const YCHAR * name);^fs/yaffs2/yaffs_nameval.h:21:21: warning: its scope is only this definition or declaration, which is probably not what you wantfs/yaffs2/yaffs_nameval.h:24:7: warning: 'struct yaffs_dev' declared inside parameter listint bsize, int flags);^fs/yaffs2/yaffs_nameval.h:27:7: warning: 'struct yaffs_dev' declared inside parameter listint bsize);^fs/yaffs2/yaffs_nameval.h:29:8: warning: 'struct yaffs_dev' declared inside parameter listconst char *xb, int xb_size, char *buf, int bsize);^fs/yaffs2/yaffs_nameval.h:30:27: warning: 'struct yaffs_dev' declared inside parameter listint nval_hasvalues(struct yaffs_dev *dev, const char *xb, int xb_size); ^fs/yaffs2/yaffs_nameval.c:82:5: error: conflicting types for 'nval_del' int nval_del(struct yaffs_dev *dev, char *xb, int xb_size, const YCHAR *name)^In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:21:5: note: previous declaration of'nval_del' was hereint nval_del(struct yaffs_dev *dev, char *xb, int xb_size, const YCHAR * name);^fs/yaffs2/yaffs_nameval.c:100:5: error: conflicting types for'nval_set'int nval_set(struct yaffs_dev *dev,^In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:22:5: note: previous declaration of'nval_set' was hereint nval_set(struct yaffs_dev *dev,^fs/yaffs2/yaffs_nameval.c:145:5: error: conflicting types for'nval_get'int nval_get(struct yaffs_dev *dev,^In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:25:5: note: previous declaration of'nval_get' was hereint nval_get(struct yaffs_dev *dev,^fs/yaffs2/yaffs_nameval.c:185:5: error: conflicting types for'nval_list'int nval_list(struct yaffs_dev *dev, const char *xb, int xb_size, char *buf, int bsize)^In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:28:5: note: previous declaration of'nval_list' was hereint nval_list(struct yaffs_dev *dev,^fs/yaffs2/yaffs_nameval.c:227:5: error: conflicting types for'nval_hasvalues'int nval_hasvalues(struct yaffs_dev *dev, const char *xb, int xb_size) ^In file included from fs/yaffs2/yaffs_nameval.c:28:0:fs/yaffs2/yaffs_nameval.h:30:5: note: previous declaration of'nval_hasvalues' was hereint nval_hasvalues(struct yaffs_dev *dev, const char *xb, int xb_size); ^make[4]: *** [fs/yaffs2/yaffs_nameval.o] Error 1make[3]: *** [fs/yaffs2] Error 2make[2]: *** [fs] Error 2make[2]: *** Waiting for unfinished jobs....make[1]: ***[/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16 /.stamp_built] Error 2make: *** [_all] Error 2解释:error: conflicting types for ‘nval_del’,查看nval_del几个函数,这里我看不出有什么类型冲突错误,网上搜了下主要是第一个WARNING那里引起的.在yaffs_nameval.h中,结构体struct yaffs_dev的定义出现在参数列表中,而在此之前没有定义,这样会导致函数不识别这个结构体引发上面的错误,查询了下struct yaffs_dev在”yaffs_guts.h”中被定义,因此在yaffs_nameval.h 文件中include下”yaffs_guts.h”就OK了third step通过上两个修改后可能还会遇到下面的两个错误:error: unknown type name ‘Y_LOFF_T’In file included from fs/yaffs2/yaffs_guts.c:18:0:fs/yaffs2/yaffs_endian.h:32:86: error: unknown type name 'Y_LOFF_T' static inline Y_LOFF_T swap_loff_t(Y_LOFF_T lval)^fs/yaffs2/yaffs_endian.h:32:107: error: unknown type name 'Y_LOFF_T' static inline Y_LOFF_T swap_loff_t(Y_LOFF_T lval)^make[4]: *** [fs/yaffs2/yaffs_guts.o] Error 1make[3]: *** [fs/yaffs2] Error 2make[2]: *** [fs] Error 2make[2]: *** Waiting for unfinished jobs....make[1]: ***[/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16 /.stamp_built] Error 2make: *** [_all] Error 2这个好解决,在yaffs_endian.h中加上如下定义:#ifndef Y_LOFF_T#define Y_LOFF_T loff_t#endifyaffs_guts.c:line: undefined reference to functionfs/built-in.o: In function `yaffs_check_obj_details_loaded':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:3254: undefined reference to`yaffs_do_endian_oh'fs/built-in.o: In function `yaffs_oh_size_load':fs/yaffs2/yaffs_guts.c:5165: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5166: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs_update_oh':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:3401: undefined reference to`yaffs_do_endian_oh'fs/built-in.o: In function `yaffs_guts_initialise':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:4912: undefined reference to`yaffs_endian_config'fs/built-in.o: In function `yaffs_oh_size_load':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5165: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5166: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs_oh_to_size':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5181: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5182: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_guts.c:5190: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs_pack_tags2_tags_only':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_packedtags2.c:111: undefined reference to`yaffs_do_endian_packed_tags2'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_packedtags2.c:111: undefined reference to`yaffs_do_endian_packed_tags2'fs/built-in.o: In function `yaffs_unpack_tags2_tags_only':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_packedtags2.c:137: undefined reference to`yaffs_do_endian_packed_tags2'fs/built-in.o: In function `yaffs_load_tags_to_spare':fs/yaffs2/yaffs_tagscompat.c:92: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_tagscompat.c:93: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs_get_tags_from_spare':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_tagscompat.c:122: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_tagscompat.c:123: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `nval_used':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_nameval.c:69: undefined reference to`yaffs_do_endian_s32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_nameval.c:75: undefined reference to`yaffs_do_endian_s32'fs/built-in.o: In function `nval_find':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_nameval.c:41: undefined reference to`yaffs_do_endian_s32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_nameval.c:53: undefined reference to`yaffs_do_endian_s32'fs/built-in.o: In function `nval_del':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_nameval.c:93: undefined reference to`yaffs_do_endian_s32'fs/built-in.o:/home/anzyelay/Downloads/buildroot-2016.05/output/build /linux-4.4.16/fs/yaffs2/yaffs_nameval.c:136: more undefined references to `yaffs_do_endian_s32' followfs/built-in.o: In function `yaffs2_checkpt_tnode_worker':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:599: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs2_wr_checkpt_sum':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:811: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs2_rd_checkpt_tnodes':fs/yaffs2/yaffs_yaffs2.c:647: undefined reference to`yaffs_do_endian_u32'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:671: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs2_rd_checkpt_sum':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:835: undefined reference to`yaffs_do_endian_u32'fs/built-in.o: In function `yaffs2_scan_chunk':/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:1302: undefined reference to`yaffs_do_endian_oh'/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16/ fs/yaffs2/yaffs_yaffs2.c:1302: undefined reference to`yaffs_do_endian_oh'make[2]: *** [vmlinux] Error 1make[1]: ***[/home/anzyelay/Downloads/buildroot-2016.05/output/build/linux-4.4.16 /.stamp_built] Error 2make: *** [_all] Error 2anzyelay@ubuntu:buildroot-2016.05$这个看了下明明这些函数都有定义有实现怎么就是不识别呢??头文件这些也包函了,网上找了下说编译器没有编译到譔文件可有导致其它函数引用时无法识别,我看了下编译情况, 其它的.c文件都编译成.o了,然后打开Makefile一看果然没有加进来,yaffs真的不省心,在Makefile.kernel里增加如下 :yaffs-y += yaffs_endian.o这回万恶的错误都没了吧.编译后是OK的了,至于启动后有没有其它原因导致的错误就不得而知了.yaffs的补丁文件如下:diff -Nur yaffs2/Makefile.kernel yaffs2.anzyelay/Makefile.kernel--- yaffs2/Makefile.kernel 2016-07-29 14:01:01.778572877 +0800+++ yaffs2.anzyelay/Makefile.kernel 2016-08-03 10:29:07.361276458 +0800 @@ -15,4 +15,5 @@yaffs-y += yaffs_bitmap.oyaffs-y += yaffs_summary.oyaffs-y += yaffs_verify.o+yaffs-y += yaffs_endian.odiff -Nur yaffs2/yaffs_endian.h yaffs2.anzyelay/yaffs_endian.h--- yaffs2/yaffs_endian.h 2016-07-29 14:01:01.814572879 +0800+++ yaffs2.anzyelay/yaffs_endian.h 2016-08-03 11:18:12.633411085+0800@@ -29,6 +29,9 @@#define swap_s32(val) \(s32)(swap_u32((u32)(val)))+#ifndef Y_LOFF_T+#define Y_LOFF_T loff_t +#endifstatic inline Y_LOFF_T swap_loff_t(Y_LOFF_T lval){u32 vall = swap_u32((u32) (lval & 0xffffffff));diff -Nur yaffs2/yaffs_nameval.h yaffs2.anzyelay/yaffs_nameval.h--- yaffs2/yaffs_nameval.h 2016-07-29 14:01:01.818572879 +0800+++ yaffs2.anzyelay/yaffs_nameval.h 2016-08-03 11:22:07.409421602 +0800@@ -17,6 +17,7 @@#define __NAMEVAL_H__#include "yportenv.h"+#include "yaffs_guts.h"int nval_del(struct yaffs_dev *dev, char *xb, int xb_size, const YCHAR* name);int nval_set(struct yaffs_dev *dev,diff -Nur yaffs2/yaffs_vfs_multi.c yaffs2.anzyelay/yaffs_vfs_multi.c--- yaffs2/yaffs_vfs_multi.c 2016-07-29 14:01:01.818572879 +0800+++ yaffs2.anzyelay/yaffs_vfs_multi.c 2016-08-03 11:06:42.877379435+0800@@ -76,6 +76,10 @@#include <linux/slab.h>#include <linux/init.h>#include <linux/fs.h>+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 16))+#define f_dentry f_path.dentry+#define f_vfsmnt f_path.mnt+#endif#include <linux/proc_fs.h>#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39))#include <linux/smp_lock.h>@@ -777,8 +781,13 @@#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))static const struct file_operations yaffs_file_operations = {#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 16)//anzyelay+ .read = __vfs_read,+ .write = __vfs_write,+#else.read = new_sync_read,.write = new_sync_write,+#endif.read_iter = generic_file_read_iter,.write_iter = generic_file_write_iter,#else@@ -1053,7 +1062,11 @@}#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)+#else+static const char *yaffs_follow_link(struct dentry *dentry,void**cookie)+#endif{void *ret;#else@@ -1075,7 +1088,11 @@goto out;}#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)nd_set_link(nd, alias);+#else+ *cookie = alias;+#endifret = alias;out:if (ret_int)@@ -1107,10 +1124,17 @@#endif#if (YAFFS_NEW_FOLLOW_LINK == 1)+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 16)void yaffs_put_link(struct dentry *dentry, struct nameidata *nd, void *alias){kfree(alias);}+#else+void yaffs_put_link(struct inode *inode,void *alias)+{+ kfree(alias);+}+#endif#endifstatic const struct inode_operations yaffs_symlink_inode_operations = {。