简体   繁体   English

文件从initramfs“消失”

[英]Files “disappearing” from initramfs

On an embedded platform running Linux 2.6.36, I occasionally run into a problem where files do not appear in the root file system that ARE present in our initramfs cpio file. 在运行Linux 2.6.36的嵌入式平台,我偶尔会碰上其中的文件不会出现在存在于我们的initramfs的cpio文件的根文件系统的问题。

I am building the initramfs from a cpio listing file (see gen_init_cpio.c ), but also ran into the problem before when just using a full directory. 我正在从cpio列表文件(请参阅gen_init_cpio.c )构建initramfs,但是在仅使用完整目录时也会遇到问题。

When I say I know the files are present in the cpio file, I mean if I extract usr/initrmafs_data.cpio.gz the files are there. 当我说我知道cpio文件中存在文件时,我的意思是如果我解压缩usr/initrmafs_data.cpio.gz则文件在那里。

It seems to be loosely related to the amount of content in the initramfs, but I haven't found the magic number of files and/or total storage size that causes files to start disappearing. 它似乎与initramfs中的内容数量松散相关,但是我还没有发现导致文件开始消失的不可思议的文件数量和/或总存储大小。

Is there an option in make menuconfig I'm missing that would fix this? 我缺少的make menuconfig是否有一个选项可以解决此问题? A boot argument? 启动参数? Something else? 还有吗

Any suggestions? 有什么建议么?

Update : To clarify, this is with a built-in ramdisk using CONFIG_INITRAMFS_SOURCE and it's compressed with gzip via setting CONFIG_INITRAMFS_COMPRESSION_GZIP . 更新 :为了明确起见,这是使用CONFIG_INITRAMFS_SOURCE内置的ramdisk,并通过设置CONFIG_INITRAMFS_COMPRESSION_GZIP用gzip压缩的。 Also, this is for a mipsel-linux platform. 另外,这是针对mipsel-linux平台的。

Update #2 : I've added a printk to init/initramfs.c:clean_path and mysteriously, the previously "disappearing" files are now all there. 更新#2 :我已经在init/initramfs.c:clean_path添加了一个printk,并且神秘地,以前“消失的”文件现在都在那里。 I think this sorta seems to point to a kernel bug if attempting to log the behavior altered the behavior. 我认为,如果尝试记录该行为更改了行为,则这种排序似乎指向内核错误。 I'll compare initramfs.c against a newer kernel tomorrow to see if that sheds any light on the matter. 明天,我将initramfs.c与更新的内核进行比较,以了解是否有任何问题。

Probably your image size is bigger than default ramdisk size (4MB afaik). 您的映像大小可能大于默认的ramdisk大小(4MB afaik)。 Check if adding ramdisk_size=valuebiggerthanyourimagesize as a kernel parameter (before root=... parameter) solves your problem. 检查是否将ramdisk_size=valuebiggerthanyourimagesize添加为内核参数(在root=...参数之前)可以解决您的问题。 You can also try to change kernel config value CONFIG_BLK_DEV_RAM_SIZE . 您也可以尝试更改内核配置值CONFIG_BLK_DEV_RAM_SIZE

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

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