荔枝派Zero(全志V3S) tftp下载 kernel 和 nfs 挂载文件系统

news2024/11/24 6:44:05

文章目录

  • 前言
  • 一、U-Boot 适配 Ethernet
    • 1、配置 U-Boot
    • 2、修改 dts 文件
    • 3、编译
    • 4、烧写到 SD 卡
    • 5、测试
      • <1>、查看启动打印信息
      • <2>、ping 测试
  • 二、Kernel 适配 Ethernet
    • 1、配置 kernel
    • 2、修改 dts 文件
    • 3、编译
    • 4、拷贝到 SD 卡
    • 5、测试
      • <1>、启动网络接口,并查看网络信息
      • <2>、ping 测试
  • 三、通过 tftp下载 zImage 和 dts,通过 nfs 挂载文件系统
    • 1、设置 bootcmd
    • 2、设置 bootargs
    • 3、保存
  • 四、挂载效果
    • 1、从 tftp 下载 kernel 及通过 nfs 挂载 rootfs
    • 2、直接从 SD 卡加载 kernel 和 rootfs


前言

传输文件每次都插拔 SD 卡太麻烦了,还是使用网线传输文件比较快,借此机会讲述一下 通过 tftp下载 kernel 和 nfs 挂载文件系统


一、U-Boot 适配 Ethernet

我使用的 uboot 是 2017.01 版本的,U-Boot 2017 已经支持了 sun8i-emac 的驱动,只需要在编译时选上并且修改 dts 就行。

1、配置 U-Boot

①、进入u-boot源码目录,执行

 make menuconfig

②、Device Drivers -> Network device support 按照下图进行配置
在这里插入图片描述

2、修改 dts 文件

①、修改 sun8i-v3s-licheepi-zero.dts

find ./ -name sun8i-v3s-licheepi-zero.dts
vi ./arch/arm/dts/sun8i-v3s-licheepi-zero.dts

在这里插入图片描述
这里说明一下:下面的是 git 的对比功能,+ 就是表示比原来增加的部分,也就是我们需要编写的部分。(可以根据 + 前面和后面的部分准确的定位)

sun8i-v3s-licheepi-zero.dts:

diff --git a/arch/arm/dts/sun8i-v3s-licheepi-zero.dts b/arch/arm/dts/sun8i-v3s-licheepi-zero.dts
index 3d9168c..b8b9fc3 100644
--- a/arch/arm/dts/sun8i-v3s-licheepi-zero.dts
+++ b/arch/arm/dts/sun8i-v3s-licheepi-zero.dts
@@ -49,6 +49,7 @@
        compatible = "licheepi,licheepi-zero", "allwinner,sun8i-v3s";
 
        aliases {
+               ethernet0 = &emac;
                serial0 = &uart0;
        };
 
@@ -81,3 +82,14 @@
        usb0_id_det-gpio = <&pio 5 6 GPIO_ACTIVE_HIGH>;
        status = "okay";
 };
+
+&emac {
+       phy = <&phy0>;
+       phy-mode = "mii";
+       allwinner,use-internal-phy;
+       allwinner,leds-active-low;
+       status = "okay";
+       phy0: ethernet-phy@0 {
+               reg = <1>;
+       };
+};

②、修改 sun8i-v3s.dtsi

find ./ -name sun8i-v3s.dtsi
vi ./arch/arm/dts/sun8i-v3s.dtsi

在这里插入图片描述
sun8i-v3s.dtsi:

diff --git a/arch/arm/dts/sun8i-v3s.dtsi b/arch/arm/dts/sun8i-v3s.dtsi
index ebefc0f..cb81dd5 100644
--- a/arch/arm/dts/sun8i-v3s.dtsi
+++ b/arch/arm/dts/sun8i-v3s.dtsi
@@ -96,6 +96,11 @@
                #size-cells = <1>;
                ranges;
 
+               syscon: syscon@01c00000 {
+                       compatible = "allwinner,sun8i-h3-syscon","syscon";
+                       reg = <0x01c00000 0x34>;
+               };
+
                mmc0: mmc@01c0f000 {
                        compatible = "allwinner,sun7i-a20-mmc";
                        reg = <0x01c0f000 0x1000>;
@@ -208,6 +213,17 @@
                        interrupt-controller;
                        #interrupt-cells = <3>;
 
+                       emac_rgmii_pins: emac0@0 {
+                               allwinner,pins = "PD0", "PD1", "PD2", "PD3",
+                                               "PD4", "PD5", "PD7",
+                                               "PD8", "PD9", "PD10",
+                                               "PD12", "PD13", "PD15",
+                                               "PD16", "PD17";
+                               allwinner,function = "emac";
+                               allwinner,drive = <SUN4I_PINCTRL_40_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
                        uart0_pins_a: uart0@0 {
                                pins = "PB8", "PB9";
                                function = "uart0";
@@ -270,6 +286,20 @@
                        status = "disabled";
                };
 
+               emac: ethernet@1c30000 {
+                       compatible = "allwinner,sun8i-h3-emac";
+                       reg = <0x01c30000 0x104>, <0x01c00030 0x4>;
+                       reg-names = "emac", "syscon";
+                       interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
+                       resets = <&ccu RST_BUS_EMAC>, <&ccu RST_BUS_EPHY>;
+                       reset-names = "ahb", "ephy";
+                       clocks = <&ccu CLK_BUS_EMAC>, <&ccu CLK_BUS_EPHY>;
+                       clock-names = "ahb", "ephy";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
                gic: interrupt-controller@01c81000 {
                        compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
                        reg = <0x01c81000 0x1000>,

3、编译

time make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- 2>&1 | tee build.log
ls

在这里插入图片描述

4、烧写到 SD 卡

sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8

在这里插入图片描述

5、测试

<1>、查看启动打印信息

有下面红框的部分说明配置成功。
在这里插入图片描述

<2>、ping 测试

在ping网络之前我们需要先设置 ip
①、设置主机端(ubuntu)网络信息

可以参考之前写的一个文章在 ubuntu 配置两个网卡,一个用来上外网,一个用来连接板子 i.mx287学习笔记-ubuntu虚拟机网络配置同时连接WIFI上外网和连接以太网与i.mx287开发板通信

在这里插入图片描述
②、设置开发板端网络信息

setenv ipaddr 192.168.25.20
setenv gatewayip 192.168.25.1
setenv netmask 255.255.255.0
setenv serverip 192.168.25.25
saveenv

③、在单板端 ping 主机

ping 192.168.25.25

在这里插入图片描述
失败了,看到当前电脑防火墙都处于开启状态,应该是这个原因,关闭电脑端防火墙再次测试
在这里插入图片描述
在这里插入图片描述
成功了

二、Kernel 适配 Ethernet

我使用的 kernel 是 5.2.0 版本

1、配置 kernel

<1>、配置以太网网络
在 linux 根目录下

make menuconfig

Device Drivers -> Network device support -> Ethernet driver support
按照如下配置:
在这里插入图片描述
在这里插入图片描述
因为我们后面还需要通过nfs挂载文件系统,所以我们还需要继续配置

<2>、配置NFS文件系统相关网络
Networking support -> Networking options
按照如下配置:
在这里插入图片描述
<3>、配置 NFS 文件系统
File systems -> Network File Systems
按照如下配置:
在这里插入图片描述

2、修改 dts 文件

5.2 版本的 dock 版本的设备树中已经添加了。

3、编译

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4

得到 zImage 和 sun8i-v3s-licheepi-zero-dock.dtb
在这里插入图片描述

4、拷贝到 SD 卡

sudo cp ./arch/arm/boot/zImage ./arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dtb /media/Gnep/KERNEL/

在这里插入图片描述

5、测试

<1>、启动网络接口,并查看网络信息

ifconfig eth0 up
ifconfig

在这里插入图片描述

<2>、ping 测试

①、在单板端 ping 主机

ifconfig eth0 192.168.25.20
ping 192.168.25.25

在这里插入图片描述
②、在主机端 ping 单板

ping 192.168.25.20

在这里插入图片描述
可以看到,互 ping 成功

三、通过 tftp下载 zImage 和 dts,通过 nfs 挂载文件系统

搭建 NFS 服务器以及 TFTP 服务器的方法可以参考这个:SSH 服务器、NFS 服务器、TFTP 服务器详解及测试
首先确保 sun8i-v3s-licheepi-zero-dock.dtb 和 zImage拷贝到了 /tftpboot 目录下,/nfsroot 下为 rootfs.tar 解压缩后的文件
在这里插入图片描述

1、设置 bootcmd

setenv  bootcmd 'setenv bootm_boot_mode sec;setenv ipaddr 192.168.25.20;setenv serverip 192.168.25.25;tftp 41000000 zImage;tftp 41800000 sun8i-v3s-licheepi-zero-dock.dtb;bootz 0x41000000 - 0x41800000'

2、设置 bootargs

setenv bootargs root=/dev/nfs nfsroot=192.168.25.25:/nfsroot,nfsvers=4 rw ip=192.168.25.20:192.168.25.25:192.168.25.1:255.255.255.0::eth0:off init=/linuxrc console=ttyS0,115200

3、保存

saveenv

四、挂载效果

1、从 tftp 下载 kernel 及通过 nfs 挂载 rootfs

一个启动的完整打印信息

U-Boot SPL 2017.01-rc2-00057-g32ab1804cd-dirty (Apr 29 2023 - 10:11:46)
DRAM: 64 MiB
Trying to boot from MMC1

U-Boot 2017.01-rc2-00057-g32ab1804cd-dirty (Apr 29 2023 - 10:11:46 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000


U-Boot 2017.01-rc2-00057-g32ab1804cd-dirty (Apr 29 2023 - 10:11:46 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In:    serial@01c28000
Out:   serial@01c28000 Err: serial@01c28000 Net: phy interface0 eth0: ethernet@1c30000 starting USB... No controllers found Hit any key to stop autoboot: 0 Using ethernet@1c30000 device TFTP from server 192.168.25.25; our IP address is 192.168.25.20
Filename 'zImage'.
Load address: 0x41000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #####################################################
         654.3 KiB/s
done
Bytes transferred = 4580840 (45e5e8 hex)
Using ethernet@1c30000 device
TFTP from server 192.168.25.25; our IP address is 192.168.25.20
Filename 'sun8i-v3s-licheepi-zero-dock.dtb'.
Load address: 0x41800000
Loading: #
         1.4 MiB/s
done
Bytes transferred = 12100 (2f44 hex)
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Device Tree to 42dfa000, end 42dfff43 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.2.0-licheepi-zero+ (Gnep@lpvm) (gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05)) #2 SMP Fri Apr 28 18:59:07 CST 2023
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Lichee Pi Zero with Dock
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] percpu: Embedded 16 pages/cpu s34508 r8192 d22836 u65536
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 15883
[    0.000000] Kernel command line: root=/dev/nfs rw nfsroot=192.168.25.25:/nfsroot ip=192.168.25.20:192.168.25.25:192.168.0.1:255.255.255.0::eth0:off init=/linuxrc console=ttyS0,115200
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 52500K/64036K available (7168K kernel code, 308K rwdata, 1824K rodata, 1024K init, 265K bss, 11536K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x300/0x48c with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000009] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000022] Switching to timer-based delay loop, resolution 41ns
[    0.000212] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000461] Console: colour dummy device 80x30
[    0.000520] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000537] pid_max: default: 32768 minimum: 301
[    0.000702] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000720] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001557] CPU: Testing write buffer coherency: ok
[    0.002103] /cpus/cpu@0 missing clock-frequency property
[    0.002130] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002909] Setting up static identity map for 0x40100000 - 0x40100060
[    0.003123] rcu: Hierarchical SRCU implementation.
[    0.003661] smp: Bringing up secondary CPUs ...
[    0.003680] smp: Brought up 1 node, 1 CPU
[    0.003691] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.003699] CPU: All CPU(s) started in SVC mode.
[    0.004769] devtmpfs: initialized
[    0.008308] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.008649] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.008682] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.008938] pinctrl core: initialized pinctrl subsystem
[    0.010084] NET: Registered protocol family 16
[    0.010633] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.011923] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.011942] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.037193] SCSI subsystem initialized
[    0.037489] usbcore: registered new interface driver usbfs
[    0.037548] usbcore: registered new interface driver hub
[    0.037653] usbcore: registered new device driver usb
[    0.037892] mc: Linux media interface: v0.10
[    0.037937] videodev: Linux video capture interface: v2.00
[    0.038161] Advanced Linux Sound Architecture Driver Initialized.
[    0.039524] clocksource: Switched to clocksource arch_sys_counter
[    0.052538] NET: Registered protocol family 2
[    0.053376] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.053419] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.053443] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.053466] TCP: Hash tables configured (established 1024 bind 1024)
[    0.053627] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.053680] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.053982] NET: Registered protocol family 1
[    0.054958] RPC: Registered named UNIX socket transport module.
[    0.054982] RPC: Registered udp transport module.
[    0.054989] RPC: Registered tcp transport module.
[    0.054994] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.056788] Initialise system trusted keyrings
[    0.057239] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.065782] NFS: Registering the id_resolver key type
[    0.065846] Key type id_resolver registered
[    0.065854] Key type id_legacy registered
[    0.065875] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.095649] Key type asymmetric registered
[    0.095670] Asymmetric key parser 'x509' registered
[    0.095778] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.095791] io scheduler mq-deadline registered
[    0.095798] io scheduler kyber registered
[    0.096744] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[    0.100714] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.173113] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.175639] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[    0.176811] printk: console [ttyS0] disabled
[    0.197122] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 36, base_baud = 1500000) is a U6_16550A
[    0.752469] printk: console [ttyS0] enabled
[    0.781975] libphy: Fixed MDIO Bus: probed
[    0.786651] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[    0.792553] dwmac-sun8i 1c30000.ethernet: No regulator found
[    0.798765] dwmac-sun8i 1c30000.ethernet: Current syscon value is not the default 148000 (expect 58000)
[    0.808256] dwmac-sun8i 1c30000.ethernet: No HW DMA feature register supported
[    0.815498] dwmac-sun8i 1c30000.ethernet: RX Checksum Offload Engine supported
[    0.822727] dwmac-sun8i 1c30000.ethernet: COE Type 2
[    0.827686] dwmac-sun8i 1c30000.ethernet: TX Checksum insertion supported
[    0.834477] dwmac-sun8i 1c30000.ethernet: Normal descriptors
[    0.840139] dwmac-sun8i 1c30000.ethernet: Chain mode enabled
[    0.846038] libphy: stmmac: probed
[    0.850227] dwmac-sun8i 1c30000.ethernet: Found internal PHY node
[    0.856507] libphy: mdio_mux: probed
[    0.860194] dwmac-sun8i 1c30000.ethernet: Switch mux to internal PHY
[    0.866551] dwmac-sun8i 1c30000.ethernet: Powering internal PHY
[    0.873692] libphy: mdio_mux: probed
[    0.877618] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.884264] ehci-platform: EHCI generic platform driver
[    0.889864] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.895482] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.903473] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[    0.939522] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    0.946731] hub 1-0:1.0: USB hub found
[    0.950688] hub 1-0:1.0: 1 port detected
[    0.955319] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.961673] ohci-platform: OHCI generic platform driver
[    0.967232] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    0.973983] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    0.981968] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[    1.054635] hub 2-0:1.0: USB hub found
[    1.058476] hub 2-0:1.0: 1 port detected
[    1.065805] usbcore: registered new interface driver usb-storage
[    1.073126] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input0
[    1.082466] sun6i-rtc 1c20400.rtc: registered as rtc0
[    1.087531] sun6i-rtc 1c20400.rtc: RTC enabled
[    1.092257] i2c /dev entries driver
[    1.097240] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input1
[    1.107098] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.115841] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    1.152381] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.159694] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[    1.194701] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB
[    1.202863] usbcore: registered new interface driver usbhid
[    1.208440] usbhid: USB HID core driver
[    1.214579] sun4i-codec 1c22c00.codec: ASoC: codec-analog@01c23000 not registered
[    1.222222] sun4i-codec 1c22c00.codec: Failed to register our card
[    1.229758] Initializing XFRM netlink socket
[    1.234073] NET: Registered protocol family 17
[    1.239133] Key type dns_resolver registered
[    1.243720] Registering SWP/SWPB emulation handler
[    1.249908] Loading compiled-in X.509 certificates
[    1.260419] simple-framebuffer 43e89000.framebuffer: framebuffer at 0x43e89000, 0x177000 bytes, mapped to 0x(ptrval)
[    1.271064] simple-framebuffer 43e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[    1.287363] Console: switching to colour frame buffer device 100x30
[    1.299918] simple-framebuffer 43e89000.framebuffer: fb0: simplefb registered!
[    1.308771] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.320289] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.326056] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    1.335557] hub 3-0:1.0: USB hub found
[    1.339632] hub 3-0:1.0: 1 port detected
[    1.343629] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.354261] debugfs: Directory '1c22c00.codec' with parent 'V3s Audio Codec' already present!
[    1.362947] sun4i-codec 1c22c00.codec: ASoC: Failed to create component debugfs directory: -17
[    1.373146] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[    1.380873] mmc0: new high speed SDHC card at address 1234
[    1.388193] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T06:46:28 UTC (24388)
[    1.398686] mmcblk0: mmc0:1234 SA08G 7.21 GiB 
[    1.404611] dwmac-sun8i 1c30000.ethernet eth0: PHY [0.1:01] driver [Generic PHY]
[    1.413624] dwmac-sun8i 1c30000.ethernet eth0: No Safety Features support found
[    1.421018] dwmac-sun8i 1c30000.ethernet eth0: No MAC Management Counters available
[    1.428671] dwmac-sun8i 1c30000.ethernet eth0: PTP not supported by HW
[    1.435250] dwmac-sun8i 1c30000.ethernet eth0: configuring for phy/mii link mode
[    1.444023]  mmcblk0: p1 p2
[    5.609819] dwmac-sun8i 1c30000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[    5.669538] IP-Config: Complete:
[    5.672778]      device=eth0, hwaddr=02:00:f4:0d:32:47, ipaddr=192.168.25.20, mask=255.255.255.0, gw=192.168.0.1
[    5.682972]      host=192.168.25.20, domain=, nis-domain=(none)
[    5.688886]      bootserver=192.168.25.25, rootserver=192.168.25.25, rootpath=
[    5.696337] IP-Config: Gateway not on directly connected network
[    5.702515] vcc5v0: disabling
[    5.705487] ALSA device list:
[    5.708453]   #0: V3s Audio Codec
[    9.166191] random: fast init done
[  103.536444] VFS: Unable to mount root fs via NFS, trying floppy.
[  103.543316] VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6
[  103.550663] Please append a correct "root=" boot option; here are the available partitions:
[  103.559021] b300         7563264 mmcblk0 
[  103.559025]  driver: mmcblk
[  103.565852]   b301           32768 mmcblk0p1 49bfda8b-01
[  103.565854] 
[  103.572664]   b302         7529472 mmcblk0p2 49bfda8b-02
[  103.572665] 
[  103.579470] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[  103.587729] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.2.0-licheepi-zero+ #2
[  103.594852] Hardware name: Allwinner sun8i Family
[  103.599588] [<c010ed14>] (unwind_backtrace) from [<c010b72c>] (show_stack+0x10/0x14)
[  103.607329] [<c010b72c>] (show_stack) from [<c07374f0>] (dump_stack+0x84/0x98)
[  103.614550] [<c07374f0>] (dump_stack) from [<c011dddc>] (panic+0x110/0x2fc)
[  103.621512] [<c011dddc>] (panic) from [<c0a0136c>] (mount_block_root+0x1a0/0x288)
[  103.628991] [<c0a0136c>] (mount_block_root) from [<c0a01598>] (mount_root+0x144/0x160)
[  103.636902] [<c0a01598>] (mount_root) from [<c0a01704>] (prepare_namespace+0x150/0x194)
[  103.644903] [<c0a01704>] (prepare_namespace) from [<c074f944>] (kernel_init+0x8/0x10c)
[  103.652815] [<c074f944>] (kernel_init) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[  103.660373] Exception stack(0xc3833fb0 to 0xc3833ff8)
[  103.665420] 3fa0:                                     00000000 00000000 00000000 00000000
[  103.673588] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  103.681754] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[  103.688376] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0) ]---

可以看到 tftp 下载没有问题,但是在 nfs 挂载的时候却可以出现了报错

[ 103.536444] VFS: Unable to mount root fs via NFS, trying floppy.
[ 103.543316] VFS: Cannot open root device “nfs” or unknown-block(2,0):

于是上网找了很多方法尝试,发现这个问题遇到的人还真不少,但是我尝试了很多种方法都没有解决,我所使用的 ubuntu 版本是 22.04,这里罗列一下我所参考的几篇文章
https://blog.csdn.net/hannibaychty/article/details/126984843
https://blog.csdn.net/seeyouwlx/article/details/128428709
https://blog.csdn.net/register_k/article/details/120113228
https://blog.csdn.net/lengyuefeng212/article/details/121217025

这个问题耗费了我一天的精力,等有时间再继续排查吧。

2、直接从 SD 卡加载 kernel 和 rootfs

启动到系统下,执行下列命令

ifconfig eth0 up
ifconfig eth0 192.168.25.20
ping 192.168.25.25
mount -t nfs 192.168.25.25:/nfsroot /mnt -o nolock

在这里插入图片描述
上述挂载成功,和下述 nfs 服务器中的文件一致
在这里插入图片描述
从这里可以说明 kernel 中有关 nfs 的配置没问题,因此 “VFS: Unable to mount root fs via NFS, trying floppy.” 这个报错并不是 nfs 配置导致的问题,具体问题后面有时间再继续排查。


我的qq:2442391036,欢迎交流!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/477201.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【嵌入式环境下linux内核及驱动学习笔记-(7-内核 I/O)-多路复用】

目录 2、多路复用2.1 函数select相关2.1.1 应用层select()2.1.2 FD_ZERO2.1.3 FD_SET2.1.4 FD_ISSET 2.2 函数poll相关2.2.1 poll函数 2.3 驱动层 函数2.4 实例 接上篇&#xff0c;继续内核 I/O的五种模式的解读。 2、多路复用 select&#xff0c;poll&#xff0c;epoll都是IO…

常见的接口优化技巧思路

一、背景 针对老项目&#xff0c;去年做了许多降本增效的事情&#xff0c;其中发现最多的就是接口耗时过长的问题&#xff0c;就集中搞了一次接口性能优化。本文将给小伙伴们分享一下接口优化的通用方案。 二、接口优化方案总结 1.批处理 批量思想&#xff1a;批量操作数据…

windows如何确认服务器上程序端口是否正常

方式1&#xff1a;ping命令 ping命令说明 ping命令是个使用频率极高的网络诊断工具&#xff0c;在Windows、Unix和Linux系统下均适用。它是TCP/IP协议的一部分&#xff0c;用于确定本地主机是否能与另一台主机交换数据报。根据返回的信息&#xff0c;我们可以推断TCP/IP参数设…

类和对象 -上(C++)

目录 认识面向过程和面向对象 类的引入 类的定义 语法&#xff1a; 类的两种定义方式&#xff1a; 成员变量命名规则建议 类的访问限定符及封装 访问限定符 C 中 class 和 struct 的区别&#xff1f; 封装 类的作用域 类的实例化 类对象模型 如何计算类对象的大小 结构体的内存…

想保护你的网站?用Python来生成验证码图片

前言 随着互联网的发展&#xff0c;我们越来越多地依赖于网站和应用程序&#xff0c;而这些网站和应用程序也面临着各种各样的安全威胁&#xff0c;其中之一就是用户可能会通过脚本攻击你的网站。为了缓解这些安全风险&#xff0c;一个常见的做法是在用户进行操作时&#xff0…

关于电信设备进网许可制度若干改革举措的通告

Q&#xff1a;3月1日后&#xff0c;不再实行进网许可管理的11种电信设备是否还需要继续申请和使用标志&#xff1f; A&#xff1a;3月1日起&#xff0c;对不再实行进网许可管理的11种电信设备停止核发进网许可标志&#xff0c;已申请的标志可在证书有效期内继续使用。 Q&#…

应用启动时aerospike客户端查询rt高原因

在应用刚起步时&#xff0c;发到预发测试或者生产小部分流量进来时&#xff0c;发现aerospike的rt特别高&#xff0c;在流量稍微大点时&#xff0c;rt恢复正常。基本可以断定客户端存在预热问题。 应用没有设置连接池配置&#xff0c;因此check下默认配置 可以看到&#xff0…

c++类 笔记(陆续更新该文档)

派生类 #include <iostream> using namespace std; class Box{private://类私有&#xff0c;只有成员可以调用 也就是说你不可以通过box1.a来调用 ,这些变量其实你默认不用写private 这个变量&#xff0c;只要放在最上面他默认就是 私有int a1;protected://protected&am…

AlgoC++:课程总结

目录 课程总结前言1. 未讲解内容2. 复习2.1 矩阵求导2.2 优化方法2.3 具体的算法 3. 未来怎么学C(必看&#xff01;&#xff01;&#xff01;) 课程总结 前言 手写AI推出的全新面向AI算法的C课程 Algo C&#xff0c;链接。记录下个人学习笔记&#xff0c;仅供自己参考。 本次课…

【嵌入式环境下linux内核及驱动学习笔记-(8-内核 I/O)-信号驱动】

目录 3 信号驱动的异步通知3.1 linux异步通知编程3.1.1 什么是信号3.1.2 信号的工作流程: 3.2. 应用层3.2.1 信号接收 signal函数3.2.2 应用层 fcntl 函数3.2.3 应用层信号驱动机制步骤 3.3 驱动层3.3.1 驱动层模板3.3.2 驱动层 实现fasync函数3.3.3 fasync_helper3.3.4 struct…

Golang-常见数据结构Slice

Slice slice 翻译成中文就是切片&#xff0c;它和数组&#xff08;array&#xff09;很类似&#xff0c;可以用下标的方式进行访问&#xff0c;如果越界&#xff0c;就会产生 panic。但是它比数组更灵活&#xff0c;可以自动地进行扩容。 了解 slice 的本质, 最简单的方法就是…

MySQL 一条SQL语句是如何执行的?

总览 ​ 所以今天我们把MySQL拆解一下&#xff0c;看看里边有哪些零件。下边是MySQL的基本架构示意图。 大体来说&#xff0c;MySQL分为Server层和存储引擎两部分。 Server 层包括连接器、查询缓存、分析器、优化器、执行器等&#xff0c;涵盖 MySQL 的大多数核心服务功能&am…

小白也能懂的可转债配债价格计算

可转债配债如何计算 先给理论公式&#xff1a; 配债10张/1手所需的钱数 配债所需股数 * 当前的股价 这个公式应该很好理解&#xff0c;不需要做过多的解释。 那&#xff0c; 为什么如此简单的公式&#xff0c;还是很多人不会算&#xff0c;是因为&#xff1a; 配债所需的股数跟…

类与对象之构造函数

文章目录 导读类的6个默认构造函数构造函数概念特性 析构函数概念特性 拷贝构造函数概念特性 赋值运算符重载运算符重载赋值运算符重载前置和后置重载 导读 本文是md导入的可能格式有点乱&#xff0c;希望各位理解一下 类的6个默认构造函数 默认成员函数&#xff1a;用户没有…

五一堵车 | AI“高速”车辆检测轻而易举监测大家安全

点击蓝字关注我们 关注并星标 从此不迷路 计算机视觉研究院 学习群&#xff5c;扫码在主页获取加入方式 计算机视觉研究院专栏 作者&#xff1a;Edison_G 五一节不管是离开小城镇还是进入大城市&#xff0c;每个高速路口都是堵车&#xff0c;现在人工智能愈来愈发达&#xff0c…

git fetch时,FETCH_HEAD和.git\refs\remotes\origin会有哪些变化

目录 github远程仓库状态clone 到本地对新clone的仓库直接 fetchgit fetchgit fetch origingit fetch origin test1git fetch origin test2:test22 结论 github远程仓库状态 clone 到本地 git fetchgit fetch origingit fetch origin test3git fetch origin test2:test22 git f…

Photon AI Translator 和做产品的一些思考

近 4 个月内我一直在做 Apple 平台的产品&#xff0c;虽然从使用量来说「简体中文」用户是占多数&#xff0c;但我一直有做多语言的支持&#xff1a;英语、简体中文和繁体中文。习惯上 Google 翻译的我&#xff0c;基本上在使用 Xcode 过程中也会一直在浏览器开着 Google Trans…

复古决战快速施法穿墙秒怪分析流程及安全防护

《决战》是一款非常古老的RPG游戏&#xff0c;作为热血传奇同期的热门游戏也深受7080后的喜爱。 在十几年前玩这个游戏时&#xff0c;我也使用过瞬移穿墙&#xff0c;快速施法秒怪等功能的辅助。 下面我们就用一个自己架设的单机版来回顾一下当年辅助开发的流程&#xff0c;并…

【三十天精通Vue 3】 第二十二天 Vue 3的UI框架详解

✅创作者&#xff1a;陈书予 &#x1f389;个人主页&#xff1a;陈书予的个人主页 &#x1f341;陈书予的个人社区&#xff0c;欢迎你的加入: 陈书予的社区 &#x1f31f;专栏地址: 三十天精通 Vue 3 文章目录 引言一、常用的Vue 3 UI框架概览1. 常用的Vue 3 UI框架有哪些&…

不同主题增删改查系统【控制台+MySQL】(Java课设)

有很多顾客都是只要实现各种各样的增删改查系统即可&#xff0c;只是主题和数据库表不一样&#xff0c;功能都是增删改查这四个功能&#xff0c;做出来的效果和下面的截图是一样的&#xff0c;后续这样的增删改查系统的运行效果请参考下面的截图&#xff0c;我就不一一演示了&a…