您尚未登录。

楼主 #1 2020-10-27 20:46:07

hacker
会员
注册时间: 2020-10-27
已发帖子: 4
积分: 3.5

根文件系统通过网络NFS挂载不成功,求助

用的是Orange Pi Win Plus,全志A64  开发环境为Ubuntu16.04  现在想通过tftp 下载内核和dtb,通过NFS挂载根文件系统。目前完成前半部分,但NFS挂载根文件系统一直不成功。。
    uboot启动log

U-Boot SPL 2020.10 (Oct 24 2020 - 18:25:06 +0800)
DRAM: 2048 MiB
Trying to boot from MMC1
NOTICE:  BL31: v2.3(debug):v2.3-842-gbd260fc
NOTICE:  BL31: Built : 18:21:47, Oct 24 2020
NOTICE:  BL31: Detected Allwinner A64/H64/R18 SoC (1689)
NOTICE:  BL31: Found U-Boot DTB at 0x4094690, model: OrangePi Win/Win Plus
INFO:    ARM GICv2 driver initialized
INFO:    Configuring SPC Controller
INFO:    PMIC: Probing AXP803 on RSB
INFO:    PMIC: dcdc1 voltage: 3.300V
INFO:    PMIC: dcdc5 voltage: 1.500V
INFO:    PMIC: dcdc6 voltage: 1.100V
INFO:    PMIC: dldo1 voltage: 3.300V
INFO:    PMIC: dldo2 voltage: 3.300V
INFO:    PMIC: dldo3 voltage: 3.300V
INFO:    PMIC: dldo4 voltage: 3.300V
INFO:    PMIC: fldo1 voltage: 1.200V
INFO:    PMIC: Enabling DC SW
INFO:    BL31: Platform setup done
INFO:    BL31: Initializing runtime services
INFO:    BL31: cortex_a53: CPU workaround for 843419 was applied
INFO:    BL31: cortex_a53: CPU workaround for 855873 was applied
WARNING: BL31: cortex_a53: CPU workaround for 1530924 was missing!
NOTICE:  PSCI: System suspend is unavailable
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x4a000000
INFO:    SPSR = 0x3c9
alloc space exhausted


U-Boot 2020.10 (Oct 24 2020 - 18:25:06 +0800) Allwinner Technology

CPU:   Allwinner A64 (SUN50I)
Model: OrangePi Win/Win Plus
DRAM:  2 GiB
MMC:   mmc@1c0f000: 0, mmc@1c10000: 1
Loading Environment from FAT... OK
In:    serial
Out:   serial
Err:   serial
Net:   phy interface7
eth0: ethernet@1c30000
starting USB...
Bus usb@1c1a000: USB EHCI 1.00
Bus usb@1c1a400: USB OHCI 1.0
Bus usb@1c1b000: USB EHCI 1.00
Bus usb@1c1b400: USB OHCI 1.0
scanning bus usb@1c1a000 for devices... 1 USB Device(s) found
scanning bus usb@1c1a400 for devices... 1 USB Device(s) found
scanning bus usb@1c1b000 for devices... 1 USB Device(s) found
scanning bus usb@1c1b400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
=>

    uboot版本是2020.10,烧录在SD卡中,在uboot命令行下可以ping通服务器,uboot命令行printenv log如下

=> printenv
arch=arm
autoload=no
baudrate=115200
board=sunxi
board_name=sunxi
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=fel mmc0 usb0 pxe dhcp
bootargs=console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.1.110:/work/nfs_root ip=192.168.1.105:192.168.1.110:192.168.1.253:255.255.255.0::eth0:off
bootcmd=tftp 0x40080000 Image; tftp 0x4FA00000 sun50i-a64-orangepi-win.dtb; booti 0x40080000 - 0x4FA00000
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_fel=if test -n ${fel_booted} && test -n ${fel_scriptaddr}; then echo '(FEL boot)'; source ${fel_scriptaddr}; fi
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_usb0=devnum=0; run usb_boot
bootdelay=2
bootfile=boot.scr.uimg
bootfstype=fat
bootm_size=0xa000000
console=ttyS0,115200
cpu=armv8
dfu_alt_info_ram=kernel ram 0x40080000 0x1000000;fdt ram 0x4FA00000 0x100000;ramdisk ram 0x4FE00000 0x4000000
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
dnsip=202.120.127.220
efi_dtb_prefixes=/ /dtb/ /dtb/current/
ethact=ethernet@1c30000
ethaddr=02:ba:35:13:ea:da
fdt_addr_r=0x4FA00000
fdtcontroladdr=b9f38fb0
fdtfile=allwinner/sun50i-a64-orangepi-win.dtb
fileaddr=41000000
filesize=2198
gatewayip=192.168.1.253
ipaddr=192.168.1.105
kernel_addr_r=0x40080000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
mmc_bootdev=0
netmask=255.255.255.0
partitions=name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};name=loader2,size=984k,uuid=${uuid_gpt_loader2};name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};name=system,size=-,uuid=${uuid_gpt_system};
preboot=usb start
pxefile_addr_r=0x4FD00000
ramdisk_addr_r=0x4FE00000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x4FC00000
serial#=92c001ba3513eada
serverip=192.168.1.110
soc=sunxi
stderr=serial,vidconsole
stdin=serial,usbkbd
stdout=serial,vidconsole
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
uuid_gpt_esp=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
uuid_gpt_system=b921b045-1df0-41c3-af44-4c6f280d3fae

Environment size: 4696/131068 bytes

在uboot中通过nfs命令可以下载文件

=> nfs 0x41000000 192.168.1.110:/work/nfs_root/test
Using ethernet@1c30000 device
File transfer via NFS from server 192.168.1.110; our IP address is 192.168.1.105
Filename '/work/nfs_root/test'.
Load address: 0x41000000
Loading: ##
done
Bytes transferred = 8600 (2198 hex)

在另一台虚拟机中可以成功挂载我服务器中的共享文件夹的内容,服务器中共享文件夹的内容如下

root@book-virtual-machine:/work/nfs_root# ls
bin  boot  dev  etc  home  lib  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  test  tmp  usr  var

这样足以说明我内核中nfs配置和 服务器中NFS的搭建没问题吧。。
这是设置bootargs的命令:setenv bootargs 'console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.1.110:/work/nfs_root ip=192.168.1.105:192.168.1.110:192.168.1.253:255.255.255.0::eth0:off' 
启动后log如下:

=> boot
Using ethernet@1c30000 device
TFTP from server 192.168.1.110; our IP address is 192.168.1.105
Filename 'Image'.
Load address: 0x40080000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###T ##############################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #############################
         755.9 KiB/s
done
Bytes transferred = 15683592 (ef5008 hex)
Using ethernet@1c30000 device
TFTP from server 192.168.1.110; our IP address is 192.168.1.105
Filename 'sun50i-a64-orangepi-win.dtb'.
Load address: 0x4fa00000
Loading: ###
         1023.4 KiB/s
done
Bytes transferred = 36702 (8f5e hex)
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
EHCI failed to shut down host controller.
   Loading Device Tree to 0000000049ff4000, end 0000000049ffff5d ... OK

Starting kernel ...

[  111.584802] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[  111.593062] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.3.13+ #11
[  111.599144] Hardware name: OrangePi Win/Win Plus (DT)
[  111.604186] Call trace:
[  111.606640]  dump_backtrace+0x0/0x150
[  111.610301]  show_stack+0x14/0x20
[  111.613613]  dump_stack+0xb4/0xdc
[  111.616927]  panic+0x150/0x32c
[  111.619979]  mount_block_root+0x1a0/0x290
[  111.623983]  mount_root+0x144/0x178
[  111.627468]  prepare_namespace+0x13c/0x184
[  111.631559]  kernel_init_freeable+0x250/0x278
[  111.635913]  kernel_init+0x10/0x108
[  111.639398]  ret_from_fork+0x10/0x18
[  111.642972] SMP: stopping secondary CPUs
[  111.646890] Kernel Offset: disabled
[  111.650374] CPU features: 0x0002,24002004
[  111.654374] Memory Limit: none
[  111.657430] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0) ]---

根文件系统是armbian SDK中的,另外我也尝试挂之前自己做的根文件系统两者都挂不上去。。我也尝试了这个帖子的方法https://whycan.com/t_1766.html
希望晕哥和各位大神帮帮小弟。。

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn