我按照看云这篇文章 ZeroSpiNorFlash启动系统制作指南
使用MX25L128启动系统,想用JFFS2作为根文件系统
启动参数也是照链接上的要求做:
vi include/configs/sun8i.h
#define CONFIG_BOOTCOMMAND "sf probe 0; " \
"sf read 0x41800000 0x100000 0x10000; " \
"sf read 0x41000000 0x110000 0x400000; " \
"bootz 0x41000000 - 0x41800000"#define CONFIG_BOOTARGS "console=ttyS0,115200 earlyprintk panic=5 rootwait " \
"mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,-(rootfs) root=31:03 rw rootfstype=jffs2"
但是启动后是酱紫:
[ 1.478000] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[ 1.487663] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 00:00:14 UTC (14)
[ 1.495901] vcc5v0: disabling
[ 1.498954] ALSA device list:
[ 1.501926] #0: V3s Audio Codec
[ 1.506041] VFS: Cannot open root device "31:03" or unknown-block(31,3): error -2
[ 1.513623] Please append a correct "root=" boot option; here are the available partitions:
[ 1.522004] 1f00 1024 mtdblock0
[ 1.522008] (driver?)
[ 1.528563] 1f01 64 mtdblock1
[ 1.528566] (driver?)
[ 1.535098] 1f02 6144 mtdblock2
[ 1.535100] (driver?)
[ 1.541650] 1f03 25536 mtdblock3
[ 1.541653] (driver?)
[ 1.548213] b300 1949184 mmcblk0
[ 1.548217] driver: mmcblk
[ 1.555009] b301 1949118 mmcblk0p1 00000000-01
[ 1.555011]
[ 1.561818] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,3)
[ 1.570163] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.13.0-licheepi-zero+ #10
[ 1.577458] Hardware name: Allwinner sun8i Family
[ 1.582194] [<c010e22c>] (unwind_backtrace) from [<c010af9c>] (show_stack+0x10/0x14)
[ 1.589940] [<c010af9c>] (show_stack) from [<c0667710>] (dump_stack+0x90/0xa4)
[ 1.597164] [<c0667710>] (dump_stack) from [<c011b0dc>] (panic+0xf0/0x268)
[ 1.604041] [<c011b0dc>] (panic) from [<c090116c>] (mount_block_root+0x19c/0x26c)
[ 1.611520] [<c090116c>] (mount_block_root) from [<c0901358>] (mount_root+0x11c/0x124)
[ 1.619430] [<c0901358>] (mount_root) from [<c09014b8>] (prepare_namespace+0x158/0x1a0)
[ 1.627428] [<c09014b8>] (prepare_namespace) from [<c0900e2c>] (kernel_init_freeable+0x1d0/0x1e0)
[ 1.636292] [<c0900e2c>] (kernel_init_freeable) from [<c067971c>] (kernel_init+0x8/0x110)
[ 1.644464] [<c067971c>] (kernel_init) from [<c0107358>] (ret_from_fork+0x14/0x3c)
[ 1.652033] Rebooting in 5 seconds..
离线
改成这样试一试:
#define CONFIG_BOOTARGS "console=ttyS0,115200 earlyprintk panic=5 rootwait " \
"mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,-(rootfs) root=/dev/mtdblock3 rw rootfstype=jffs2"
离线
貌似没用, 仍然报一样的错误。
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 15883
[ 0.000000] Kernel command line: console=ttyS0,115200 earlyprintk panic=5 rootwait mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,6M(kernel)ro,-(rootfs) root=/dev/mtdblock3 rw rootfstype=jffs2
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
离线
我搜了一下, Booting Linux with rootfs on a JFFS2 File System
看是不是因为这样:
Step through the following procedure to enable a JFFS2 root filesystem in the sample networking configuration:
Modify the Linux kernel configuration to not include the rootfs into the uImage. For this, run make kmenuconfig in the project directory and uncheck (disable) the Initial RAM filesystem... option:
General setup --->
[ ] Initial RAM filesystem and RAM disk (initramfs/initrd) support
你是不是勾上了 initramfs/initrd 这个根文件系统?
离线
搞定,谢谢,终于把这个坑填上了
离线
我搜了一下, Booting Linux with rootfs on a JFFS2 File System
看是不是因为这样:
Step through the following procedure to enable a JFFS2 root filesystem in the sample networking configuration:
Modify the Linux kernel configuration to not include the rootfs into the uImage. For this, run make kmenuconfig in the project directory and uncheck (disable) the Initial RAM filesystem... option:
General setup --->
[ ] Initial RAM filesystem and RAM disk (initramfs/initrd) support你是不是勾上了 initramfs/initrd 这个根文件系统?
这个地方是不要勾选吗 我的内核突然就出现了和这个问题一样的 我这里是勾选了的
离线
搞定,谢谢,终于把这个坑填上了
、
请问你是怎么解决的哦哦
离线
我按照这个操作成功了,应该是没找到设备树
https://whycan.com/t_4119.html
离线