想要tftp下载内核,nfs挂载根文件系统的内核配置

想要tftp下载内核,nfs挂载根文件系统

1.配置内核

make x210ii_qt_defconfig

2.修改适合16.04的版本

到kernel/kernel/timeconst.pl中的371行将if (!defined(@val)) 改为if (!(@val))

3.配置menuconfig以支持tftp、nfs挂载

1、配置网络部分,主要是使能CONFIG_IP_PNP以在2中能够看到
Root file system on NFS选项
Networking support 
    Networking options 
        TCP/IP networking
                IP: kernel level autoconfiguration
                    [*] IP: DHCP support
                    [*] IP: BOOTP support

2、配置开启nfs服务
File systems  --->  
    Network File Systems  --->
        <*> NFS client support 
        [*] NFS client support for NFS version3                                 
        [*] NFS client support for the NFSv3 ACL protocol extension 
        [*] NFS client support for NFS version 4 (EXPERIMENTAL) 
        [*] NFS client support for NFSv4.1 (DEVELOPER ONLY) 
        [*] Root file system on NFS

4、编译内核

make -j4

5、修改uboot的bootargs和bootcmd

setenv bootargs root=/dev/nfs nfsroot=192.168.0.109:/home/aston/rootfs/rootfs ip=192.168.0.20:192.168.0.109:192.168.0.1:255.255.255.0::eth0:off  init=/linuxrc console=ttySAC2,115200 

set bootcmd 'tftp 0x30008000 zImage; bootm 0x30008000' 
gatewayip=192.168.0.1
serverip=192.168.0.109
netmask=255.255.255.0
ipaddr=192.168.0.20
bootargs=root=/dev/nfs nfsroot=192.168.0.109:/home/aston/rootfs/rootfs ip=192.168.0.20:192.168.0.109:192.168.0.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC2,115200
bootcmd=tftp 0x30008000 zImage; bootm 0x30008000

6、讲zImage复制到tftp下载,制作好rootfs启动即可

猜你喜欢

转载自blog.csdn.net/m0_37182543/article/details/80096164