uboot 设置bootargs配置内核网络挂载根文件系统
uboot设置bootargs
env set bootargs "mem=256M console=ttyAMA0,115200 root=/dev/nfs init=/linuxrc nfsroot=nfs主机地址:nfs路径/busybox/rootfs_glibc_arm64,proto=tcp rw nfsvers=3 rootwait ip=板子地址:nfs主机地址:网关:255.255.255.0::eth0:off"
saveenv
内核配置:
遇到问题如下:
问题一: bootargs 没有ip这里写错了
问题二: 不是nfs路径cat /etc/exports 修改该路径重启nfs:sudo /etc/init.d/nfs-kernel-server restartxxxx/rootfs_glibc_arm64 *(rw,sync,no_root_squash,no_subtree_check) 问题三: 内核没有使能nfs
问题四:当前ubuntu系统nfs版本和板子nfs挂载的不支持 1. 修改 NFS 配置文件:2. sudo vim /etc/default/nfs-kernel-server3. 末尾增加: RPCNFSDOPTS="--nfs-version 2,3,4 --debug --syslog"4. sudo /etc/init.d/nfs-kernel-server restart[ 101.800373] VFS: Unable to mount root fs via NFS, trying floppy.
[ 101.807335] VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6
[ 101.814718] Please append a correct "root=" boot option; here are the available partitions:
[ 101.823160] 0100 65536 ram0 (driver?)
[ 101.827880] 0101 65536 ram1 (driver?)
[ 101.832573] 0102 65536 ram2 (driver?)
[ 101.837347] 0103 65536 ram3 (driver?)
[ 101.841988] 0104 65536 ram4 (driver?)
[ 101.846695] 0105 65536 ram5 (driver?)
[ 101.851335] 0106 65536 ram6 (driver?)
[ 101.856027] 0107 65536 ram7 (driver?)
[ 101.860667] 0108 65536 ram8 (driver?)
[ 101.865333] 0109 65536 ram9 (driver?)
[ 101.869974] 010a 65536 ram10 (driver?)
[ 101.874720] 010b 65536 ram11 (driver?)
[ 101.879446] 010c 65536 ram12 (driver?)
[ 101.884194] 010d 65536 ram13 (driver?)
[ 101.888922] 010e 65536 ram14 (driver?)
[ 101.893669] 010f 65536 ram15 (driver?)
[ 101.898410] b300 15273984 mmcblk0 driver: mmcblk
[ 101.903768] b301 15269888 mmcblk0p1 9be55837-01
[ 101.909104] b308 7634944 mmcblk1 driver: mmcblk
[ 101.914503] b309 131072 mmcblk1p1 5edd22ea-01
[ 101.919862] b30a 7493632 mmcblk1p2 5edd22ea-02
[ 101.925247] b320 512 mmcblk1rpmb (driver?)
[ 101.930494] b318 4096 mmcblk1boot1 (driver?)
[ 101.935857] b310 4096 mmcblk1boot0 (driver?)
[ 101.941192] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[ 101.949470] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[ 112.942790] random: nonblocking pool is initialized
最终成功: