Llinux内核及文件系统 下载本文

内容发布更新时间 : 2024/5/5 10:11:36星期一 下面是文章的全部内容请认真阅读。

配置和编译uboot

1. 清理uboot

make distclean

2. 配置U-Boot

TQ210: make TQ210_config

Smart210: make smart210_config OK210: make forlinx_linux_config

OK6410: make forlinx_nand_ram256_config Tiny6410: make tiny6410_config TQ2440: make TQ2440_config Mini2440: make mini2440_config

3. 编译uboot

make 4. 下载uboot

配置和编译内核

1. 清理中间文件和配置文件

make distclean

2. 配置内核

make menuconfig ARCH=arm CROSS_COMPILE=arm-linux-

3. 编译内核镜像

make uImage ARCH=arm CROSS_COMPILE=arm-linux-

4. 下载与运行

TQ210: tftp 0xc0008000 uImage Smart210: tftp 0x20000000 uImage OK210: tftp 0xc0008000 uImage OK6410: tftp 0xc0008000 uImage Tiny6410: tftp 0xc0008000 uImage TQ2440: tftp 0x31000000 uImage Mini2440: tftp 0x31000000 uImage

Config文件出错

.config文件出错

vim打开.config文件找到CONFIG_INITRAMFS_SOURCE这一行,改为 CONFIG_INITRAMFS_SOURCE=\,也就是把这个路径清空。

这是老师电脑上的配置,你们先清空即可。

使用NFS

使用NFS

(1)内核配置 ---》取消initramfs ---》进入File System

---》根文件系统onNFS选上 (2)编译内核

内核支持NFS分区(即编译时在File system中选中[*] Root file system on NFS),

以及支持内核IP_PNP(即编译时在Networking中选中[*] IP: kernel level autoconfiguration) File systems --->

Network File Systems --->

<*> NFS client support ## 必选

[*] NFS client support for NFS version 3 ## 必选 [*] Root file system on NFS ## 必选 同时要保证NFS使用的网络协议要选上 Networking --->

[*] Networking support

Networking options --->

[*] IP: kernel level autoconfiguration ## 必选

需要打开IP:Kernel level autoconfiguration 以及下面所有的选项包括DHCP, BOOTP, RARP,而且NFS Client Support不能是模块,必须编译进内核

(3)设置UBOOT启动参数

setenv bootargs noinitrd (设置启动参数的固定格式)

console=ttySAC0,115200 init=/init (启动项信息,串口0,波特率) root=/dev/nfs rw (指明用nfs启动)

nfsroot=192.168.1.3:/home/S5-driver/lesson9/rootfs(根文件系统在主机的路径)

ip=192.168.1.6(开发板IP地址):192.168.1.3(主机IP):192.168.1.1(网关):255.255.255.0(掩码):(开发板主机名):eth0(启动之后IP地址赋值的对象):off(关闭动态IP)

setenv bootargs noinitrd console=ttySAC0,115200 init=/linuxrc root=/dev/nfs rw nfsroot=192.168.1.108:/NFS/rootfs ,proto=tcp,nfsvers=3,nolock ip=192.168.1.230:192.168.1.108:192.168.1.1:255.255.255.0:XiaoJunJun:eth0:off