1

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.

2
  • 1
    Vote-to-close people: Since when does issues involving compiling the kernel go on superuser.com? I'm currently adding printk statements and hacking up "init/*.c" files to get to the bottom of this..... Jul 20, 2015 at 21:31
  • This is the kind of integration issue that's on-topic but borderline here, is utterly offside for Super User, borderline on Unix & Linux, and would probably do best on its own site. Jul 20, 2015 at 22:29

1 Answer 1

0

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.

2
  • Good suggestion, but no luck with either. :(. CONFIG_BLK_DEV_RAM_SIZE is already significantly larger than the initramfs image post-decompression. Jul 20, 2015 at 20:05
  • Well, looks I confused old-style initrd with initramfs, so this parameter really shouldn't matter. Do the files also disappear if you do not built initramfs into the kernel, but load it as initrd (if your bootloader could do that ofc)?
    – nsilent22
    Jul 20, 2015 at 20:47

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.