Skip to content

Fix 'Cannot open initramfs' error while building kernel

sbrinkmann edited this page May 4, 2014 · 3 revisions

Marvin creates config files which point towards an initramfs file/directory which don't exist. This causes an error like the following when you start the build process.

CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h’ is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
/opt/src/Linux3188/scripts/gen_initramfs_list.sh: Cannot open ‘../initramfs/initramfs.cpio’
make[1]: *** [usr/initramfs_data.cpio.gz] Error 1
make: *** [usr] Error 2
make: *** Waiting for unfinished jobs….

You can fix this issue quickly by comment the initramfs config parameter in the main kernel configuration.

  • When you've choosen your Marvin configuration ./marvin config ...
  • Open the .config file in the root directory of the kernel with a text editor
  • Look for the parameter CONFIG_INITRAMFS_SOURCE and comment the line with a hash
    # CONFIG_INITRAMFS_SOURCE="../initramfs/initramfs-3.0.36+.cpio"
  • Save the changes and close the text editor
  • Call ./marvin build to compile the kernel
  • Acknowledge the question Initramfs source file(s) (INITRAMFS_SOURCE) [] (NEW) by hitting enter-key