简体   繁体   English

内核和Rootfs通过tftp引导

[英]Kernel and Rootfs booting through tftp

Task: to load kernel and rootfs image and execute into the ram without storing onto the spi flash 任务:加载内核和rootfs映像并执行到ram中,而不存储到spi闪存中

I loaded flashable image (zimage at 0x200000) and flashable rootfs (jffs2 at 0x200000+offset) 我加载了可刷新图像(zimage位于0x200000)和可刷新rootfs(jffs2位于0x200000 + offset)

tftp zimage 0x200000 tftp jffs2 0x200000+offset bootm 0x200000 0x200000+offset tftp zimage 0x200000 tftp jffs2 0x200000+offset bootm 0x200000 0x200000+offset

It is giving me this error: 它给了我这个错误:

Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "ram0" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00        256 mtdblock0 (driver?)
1f01        256 mtdblock1 (driver?)
1f02       2048 mtdblock2 (driver?)
1f03      13824 mtdblock3 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

And sometimes : Bad Magic Number 有时:错误的魔术数

Any help will be appreciated 任何帮助将不胜感激

@sawdust, you were right. @锯末,你是对的。 jffs2 cannot be used in RAM as if it were an initrd or initramfs. jffs2不能像initrd或initramfs一样在RAM中使用。

i successfully loaded both images onto the ram and executed onto the ram itself based on EXT2 filesystem. 我成功地将两个图像都加载到ram上,并基于EXT2文件系统执行到ram本身上。

Bootargs: setenv bootargs root=/dev/ram0 console=ttyMCS mem=64M@0x0 init=/bin/sh Bootargs: setenv bootargs root=/dev/ram0 console=ttyMCS mem=64M@0x0 init=/bin/sh

As per your bootargs provided in comment use 根据您在评论使用中提供的bootargs

root=/dev/ram0 rootfstype=jffs2 rw initrd=0x200000+offset,16M console=ttyMCS mem=64M@0x0

here XM is the size of initrd, if it is 8 MB give 8M 这里的XM是initrd的大小,如果是8 MB,则给出8M

You haven't provided the offset of initrd in boot command, because of that kernel couldn't find the ramdisk image and gives not syncing: VFS: . 您尚未在启动命令中提供initrd的偏移量,因为该内核找不到ramdisk映像,并且not syncing: VFS: Just add initrd=0x200000+offset,16M as above. 只需添加initrd=0x200000+offset,16M

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM