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.
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.
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.
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.
Is there an option in make menuconfig
I'm missing that would fix this? 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
. Also, this is for a mipsel-linux
platform.
Update #2 : I've added a printk to init/initramfs.c:clean_path
and mysteriously, the previously "disappearing" files are now all there. 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.
Probably your image size is bigger than default ramdisk size (4MB afaik). Check if adding ramdisk_size=valuebiggerthanyourimagesize
as a kernel parameter (before root=...
parameter) solves your problem. You can also try to change kernel config value CONFIG_BLK_DEV_RAM_SIZE
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.