I have a vmlinux file with no source code, header files or any other peripherals.

What's the easiest way to convert it into a bootable zImage?


Technically, a vmlinuz (or zImage) is a packed version of the kernel (e.g. gzip or bzip2) + an extractor. If you have a extractor from a "sufficient similar kernel" (same architecture and not too different kernel version) you can try to compress the vmlinux and glue the extractor in front of it. Some more information can be found e.g. under http://jeffbastian.blogspot.com/2012/11/extract-vmlinux-with-power-of-command.html .

  • What about loading and running the code/text section of the ELF file? Does extracting sufficient? And, Wikipedia says the zImage contains also objects like "setup" and "boot header" – Reflection Mar 6 '16 at 21:44
  • Yeah, the extractor does both do initial boot (incl. header for multiboot), extract and start the kernel. I didn't try it myself yet, but using the extractor from a similar kernel could worl. – mifritscher Mar 7 '16 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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